Skip to content

Commit

Permalink
Localizations (Spanish), Friends++, UI improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
objective-see committed Sep 23, 2024
1 parent 77ea0c5 commit 69b1b27
Show file tree
Hide file tree
Showing 39 changed files with 1,317 additions and 142 deletions.
19 changes: 19 additions & 0 deletions Application/Application.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
CD8641512CA161D500803551 /* Rules.xib in Resources */ = {isa = PBXBuildFile; fileRef = CD8641502CA161D500803551 /* Rules.xib */; };
CD8641552CA161DA00803551 /* StatusBarPopover.xib in Resources */ = {isa = PBXBuildFile; fileRef = CD8641542CA161DA00803551 /* StatusBarPopover.xib */; };
CD8641592CA161DF00803551 /* UpdateWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = CD8641582CA161DF00803551 /* UpdateWindow.xib */; };
CD8641702CA1B5F300803551 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = CD86416E2CA1B5F300803551 /* InfoPlist.strings */; };
CD8641802CA1F03E00803551 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = CD86417F2CA1F03E00803551 /* Localizable.xcstrings */; };
CD8FD5D623BAE2D200EFE0FB /* PrefsWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = CD8FD5D423BAE2D200EFE0FB /* PrefsWindowController.m */; };
CD8FD5F623C05AD900EFE0FB /* RuleRow.m in Sources */ = {isa = PBXBuildFile; fileRef = CD8FD5F023C05AD800EFE0FB /* RuleRow.m */; };
CD8FD5F723C05AD900EFE0FB /* RuleRowCell.m in Sources */ = {isa = PBXBuildFile; fileRef = CD8FD5F223C05AD800EFE0FB /* RuleRowCell.m */; };
Expand Down Expand Up @@ -85,6 +87,8 @@
CD8641562CA161DA00803551 /* mul */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; name = mul; path = mul.lproj/StatusBarPopover.xcstrings; sourceTree = "<group>"; };
CD8641572CA161DF00803551 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/UpdateWindow.xib; sourceTree = "<group>"; };
CD86415A2CA161DF00803551 /* mul */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; name = mul; path = mul.lproj/UpdateWindow.xcstrings; sourceTree = "<group>"; };
CD86416F2CA1B5F300803551 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/InfoPlist.strings; sourceTree = "<group>"; };
CD86417F2CA1F03E00803551 /* Localizable.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = Localizable.xcstrings; sourceTree = "<group>"; };
CD8FD5D223BAE2D100EFE0FB /* PrefsWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PrefsWindowController.h; sourceTree = "<group>"; };
CD8FD5D423BAE2D200EFE0FB /* PrefsWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PrefsWindowController.m; sourceTree = "<group>"; };
CD8FD5ED23C05AD800EFE0FB /* RuleRowCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RuleRowCell.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -137,6 +141,7 @@
7D7755DA1F02E05B00D0017D = {
isa = PBXGroup;
children = (
CD86417F2CA1F03E00803551 /* Localizable.xcstrings */,
CDE09AF12919829000561CFF /* Uninstaller */,
7D3B75201F13356900568828 /* Shared */,
7D7755E51F02E05B00D0017D /* Source */,
Expand Down Expand Up @@ -170,6 +175,7 @@
CDCBF0DC26499DFF001D9F9A /* Event.h */,
CDCBF0DD26499DFF001D9F9A /* Event.m */,
7D7755F11F02E05B00D0017D /* Info.plist */,
CD86416E2CA1B5F300803551 /* InfoPlist.strings */,
CDC6098C263CB7EB006D1332 /* LogMonitor.h */,
CDC6098D263CB7EB006D1332 /* LogMonitor.m */,
CD86414C2CA161CF00803551 /* MainMenu.xib */,
Expand Down Expand Up @@ -281,6 +287,7 @@
English,
en,
Base,
es,
);
mainGroup = 7D7755DA1F02E05B00D0017D;
productRefGroup = 7D7755E41F02E05B00D0017D /* Products */;
Expand All @@ -302,10 +309,12 @@
CD6836682391DB6F00CF19C1 /* security.plist in Resources */,
CD86413C2CA1617A00803551 /* AboutWindow.xib in Resources */,
CD8641592CA161DF00803551 /* UpdateWindow.xib in Resources */,
CD8641802CA1F03E00803551 /* Localizable.xcstrings in Resources */,
CD8641552CA161DA00803551 /* StatusBarPopover.xib in Resources */,
CD2F801724468A8C009C3D77 /* patrons.txt in Resources */,
CD8641512CA161D500803551 /* Rules.xib in Resources */,
CD86414D2CA161CF00803551 /* MainMenu.xib in Resources */,
CD8641702CA1B5F300803551 /* InfoPlist.strings in Resources */,
7DD25FF01F23B73C00277EC4 /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -402,6 +411,14 @@
name = UpdateWindow.xib;
sourceTree = "<group>";
};
CD86416E2CA1B5F300803551 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
CD86416F2CA1B5F300803551 /* es */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */

/* Begin XCBuildConfiguration section */
Expand Down Expand Up @@ -458,6 +475,7 @@
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = NO;
SDKROOT = macosx;
SWIFT_EMIT_LOC_STRINGS = YES;
};
name = Debug;
};
Expand Down Expand Up @@ -507,6 +525,7 @@
MACOSX_DEPLOYMENT_TARGET = 10.12;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_EMIT_LOC_STRINGS = YES;
};
name = Release;
};
Expand Down
57 changes: 44 additions & 13 deletions Application/Application/AVMonitor.m
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,9 @@ -(void)processAttributions:(NSMutableArray*)newAudioAttributions newCameraAttrib
return;
}

//TODO: refactor alerts
// delay showing them!

//register for audio changes
-(BOOL)watchAudioDevice:(AVCaptureDevice*)device
{
Expand Down Expand Up @@ -813,12 +816,18 @@ -(BOOL)watchAudioDevice:(AVCaptureDevice*)device
//dbg msg
os_log_debug(logHandle, "audio event: off");

//init event
// process (client) and device are nil
event = [[Event alloc] init:nil device:device deviceType:Device_Microphone state:NSControlStateValueOff];

//handle event
[self handleEvent:event];
//still wait
// cuz the on event is waiting...
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.5 * NSEC_PER_SEC), dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{

//init event
// process (client) and device are nil
event = [[Event alloc] init:nil device:device deviceType:Device_Microphone state:NSControlStateValueOff];

//handle event
[self handleEvent:event];

});
}

//audio on?
Expand Down Expand Up @@ -987,12 +996,18 @@ -(BOOL)watchVideoDevice:(AVCaptureDevice*)device
//dbg msg
os_log_debug(logHandle, "camera event: off");

//init event
// process (client) and device are nil
event = [[Event alloc] init:nil device:device deviceType:Device_Camera state:NSControlStateValueOff];

//handle event
[self handleEvent:event];
//still wait
// cuz the on event is waiting...
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.5 * NSEC_PER_SEC), dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{

//init event
// process (client) and device are nil
event = [[Event alloc] init:nil device:device deviceType:Device_Camera state:NSControlStateValueOff];

//handle event
[self handleEvent:event];

});
}

} //macOS 13.3
Expand Down Expand Up @@ -1435,7 +1450,7 @@ -(NSUInteger)shouldShowNotification:(Event*)event
result = NOTIFICATION_SPURIOUS;

//dbg msg
os_log_debug(logHandle, "ignoring event, as it happened <1.0s ago");
os_log_debug(logHandle, "ignoring event, as last event happened <1.0s ago");

//bail
goto bail;
Expand Down Expand Up @@ -1498,6 +1513,9 @@ -(void)handleEvent:(Event*)event
//result
NSInteger result = NOTIFICATION_ERROR;

//dbg msg
os_log_debug(logHandle, "handling event: %{public}@", event);

//should show?
@synchronized (self) {

Expand Down Expand Up @@ -1586,6 +1604,19 @@ -(void)showNotification:(Event*)event
//init request
request = [UNNotificationRequest requestWithIdentifier:NSUUID.UUID.UUIDString content:content trigger:NULL];

//log: on
if(NSControlStateValueOn == event.state)
{
//log
os_log(logHandle, "[Alert] On Event: %@ / Device: %@ / %@", content.title, content.subtitle, content.body);
}
//log: off
else
{
//log
os_log(logHandle, "[Alert] Off Event: %@ / Device: %@", content.title, content.subtitle);
}

//send notification
[UNUserNotificationCenter.currentNotificationCenter addNotificationRequest:request withCompletionHandler:^(NSError *_Nullable error)
{
Expand Down
7 changes: 2 additions & 5 deletions Application/Application/Base.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="3Oo-ON-R9s"/>
<menuItem title="Preferences..." id="yfe-lu-f3I">
<modifierMask key="keyEquivalentModifierMask"/>
<menuItem title="Settings..." keyEquivalent="," id="yfe-lu-f3I">
<connections>
<action selector="showPreferences:" target="Voe-Tx-rLC" id="0UK-iW-u9N"/>
</connections>
Expand Down Expand Up @@ -69,9 +68,7 @@
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
<menuItem isSeparatorItem="YES" id="Y5x-j1-ofU"/>
<menuItem title="Preferences..." tag="103" id="Zao-2v-WyJ">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
<menuItem title="Settings..." tag="103" keyEquivalent="," id="Zao-2v-WyJ"/>
<menuItem title="Allowed Items..." tag="104" id="i2A-ax-9ff">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
Expand Down
Loading

0 comments on commit 69b1b27

Please sign in to comment.