Skip to content

Commit

Permalink
UI improvements (for localizations)
Browse files Browse the repository at this point in the history
  • Loading branch information
objective-see committed Feb 17, 2025
1 parent a3a0aef commit 08098cb
Show file tree
Hide file tree
Showing 5 changed files with 292 additions and 556 deletions.
41 changes: 6 additions & 35 deletions LuLu/App/Base.lproj/AlertWindow.xib
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@
</textFieldCell>
</textField>
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="xft-9d-bha">
<rect key="frame" x="18" y="67" width="220" height="18"/>
<rect key="frame" x="18" y="72" width="511" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Signing Authorities:" id="D1C-aK-AFU">
<font key="font" size="12" name="Menlo-Bold"/>
Expand All @@ -579,25 +579,16 @@
</textFieldCell>
</textField>
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="bdt-6r-ZQN">
<rect key="frame" x="18" y="107" width="62" height="18"/>
<rect key="frame" x="18" y="107" width="81" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Details:" id="b63-At-csb">
<font key="font" size="12" name="Menlo-Bold"/>
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="XYv-li-aE6">
<rect key="frame" x="18" y="87" width="131" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Signing ID:" id="2iW-bn-Rov">
<font key="font" size="12" name="Menlo-Bold"/>
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" setsMaxLayoutWidthAtFirstLayout="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="md4-Vv-ZQL" userLabel="messageLabel">
<rect key="frame" x="79" y="107" width="450" height="18"/>
<rect key="frame" x="103" y="93" width="426" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="left" id="m7h-3S-cCv">
<font key="font" size="12" name="Menlo-Regular"/>
Expand All @@ -606,25 +597,16 @@
</textFieldCell>
</textField>
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" tag="1" setsMaxLayoutWidthAtFirstLayout="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Dkp-Qw-TZb" userLabel="messageLabel">
<rect key="frame" x="18" y="48" width="511" height="18"/>
<rect key="frame" x="18" y="53" width="511" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" alignment="left" title=" -" id="Ki9-ld-5Xu">
<font key="font" size="12" name="Menlo-Regular"/>
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField hidden="YES" focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" setsMaxLayoutWidthAtFirstLayout="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="UdA-Tk-0fO" userLabel="messageLabel">
<rect key="frame" x="242" y="67" width="287" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" alignment="left" title="not applicable" id="9Yb-sJ-Kcj">
<font key="font" size="12" name="Menlo-Regular"/>
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" tag="2" setsMaxLayoutWidthAtFirstLayout="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="hWl-Gd-eYT" userLabel="messageLabel">
<rect key="frame" x="18" y="30" width="511" height="18"/>
<rect key="frame" x="18" y="35" width="511" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" alignment="left" title=" -" id="1zg-95-QM7">
<font key="font" size="12" name="Menlo-Regular"/>
Expand All @@ -633,23 +615,14 @@
</textFieldCell>
</textField>
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" tag="3" setsMaxLayoutWidthAtFirstLayout="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="jpF-Wn-qHJ" userLabel="messageLabel">
<rect key="frame" x="18" y="12" width="511" height="18"/>
<rect key="frame" x="18" y="17" width="511" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" alignment="left" title=" -" id="FLb-1c-otA">
<font key="font" size="12" name="Menlo-Regular"/>
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" setsMaxLayoutWidthAtFirstLayout="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="l6K-9G-Bcx" userLabel="messageLabel">
<rect key="frame" x="153" y="87" width="376" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" alignment="left" title="signing id" id="HBz-tK-Y6f">
<font key="font" size="12" name="Menlo-Regular"/>
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
<point key="canvasLocation" x="448.5" y="737"/>
</view>
Expand Down Expand Up @@ -715,8 +688,6 @@
<outlet property="details" destination="md4-Vv-ZQL" id="kwn-lQ-6O2"/>
<outlet property="icon" destination="JFu-zg-Xoc" id="eVd-8Z-dDB"/>
<outlet property="message" destination="jNc-sZ-Rpj" id="oJk-zm-87b"/>
<outlet property="noSigningAuths" destination="UdA-Tk-0fO" id="rU5-L6-Dkf"/>
<outlet property="signingID" destination="l6K-9G-Bcx" id="CGK-A9-GCM"/>
<outlet property="view" destination="rai-3Q-8AG" id="amJ-ge-paR"/>
</connections>
</viewController>
Expand Down
6 changes: 0 additions & 6 deletions LuLu/App/SigningInfoViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,4 @@
//details
@property (weak) IBOutlet NSTextField* details;

//signing id
@property (weak) IBOutlet NSTextField* signingID;

//no signing auths
@property (weak) IBOutlet NSTextField* noSigningAuths;

@end
56 changes: 21 additions & 35 deletions LuLu/App/SigningInfoViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ -(void)popoverWillShow:(NSNotification *)notification;
//summary
NSMutableString* summary = nil;

//signing ID
// default to blank
NSString* signingID = @"";

//alloc string for summary
summary = [NSMutableString string];

Expand All @@ -49,9 +53,6 @@ -(void)popoverWillShow:(NSNotification *)notification;
//details: n/a
self.details.stringValue = NSLocalizedString(@"not applicable", @"not applicable");

//signing id: n/a
self.signingID.stringValue = NSLocalizedString(@"not applicable", @"not applicable");

//bail
goto bail;
}
Expand All @@ -65,11 +66,18 @@ -(void)popoverWillShow:(NSNotification *)notification;
//append to summary
[summary appendFormat:NSLocalizedString(@" is validly signed", @" is validly signed")];

//set signing id
if(nil != signingInfo[KEY_CS_ID])
{
//set
signingID = signingInfo[KEY_CS_ID];
}

//item signed by apple
if(Apple == [signingInfo[KEY_CS_SIGNER] intValue])
{
//set details
self.details.stringValue = NSLocalizedString(@"signed by Apple proper", @"signed by Apple proper");
self.details.stringValue = [NSString stringWithFormat:NSLocalizedString(@"%@ signed by Apple proper", @"%@ signed by Apple proper"), signingID];
}
//item signed, third party/ad hoc, etc
else
Expand All @@ -78,20 +86,20 @@ -(void)popoverWillShow:(NSNotification *)notification;
if(AppStore == [signingInfo[KEY_CS_SIGNER] intValue])
{
//set details
self.details.stringValue = NSLocalizedString(@"signed by Mac App Store", @"signed by Mac App Store");
self.details.stringValue = [NSString stringWithFormat:NSLocalizedString(@"%@ signed by Mac App Store", @"%@ signed by Mac App Store"), signingID];
}
//developer id?
else if(DevID == [signingInfo[KEY_CS_SIGNER] intValue])
{
//set details
self.details.stringValue = NSLocalizedString(@"signed with an Apple Developer ID", @"signed with an Apple Developer ID");
self.details.stringValue = [NSString stringWithFormat:NSLocalizedString(@"%@ signed with an Apple Developer ID", @"%@ signed with an Apple Developer ID"), signingID];
}
//something else
// ad hoc? 3rd-party?
else if(AdHoc == [signingInfo[KEY_CS_SIGNER] intValue])
{
//set details
self.details.stringValue = NSLocalizedString(@" signed by 3rd-party/ad hoc", @" signed by 3rd-party/ad hoc");
self.details.stringValue = [NSString stringWithFormat:NSLocalizedString(@"%@ signed by 3rd-party/ad hoc", @"%@ signed by 3rd-party/ad hoc"), signingID];
}
else
{
Expand All @@ -104,10 +112,7 @@ -(void)popoverWillShow:(NSNotification *)notification;
// usually (always?) adhoc
if(0 == [signingInfo[KEY_CS_AUTHS] count])
{
//set details
self.details.stringValue = NSLocalizedString(@"signed, but no signing authorities (adhoc?)", @"signed, but no signing authorities (adhoc?)");

//set signing auth field
//set signing auths field to none
((NSTextField*)[self.view viewWithTag:SIGNING_AUTH_1]).stringValue = NSLocalizedString(@"› no signing authorities", @"› no signing authorities");
}

Expand All @@ -126,13 +131,6 @@ -(void)popoverWillShow:(NSNotification *)notification;
}
}

//set signing id
if(nil != signingInfo[KEY_CS_ID])
{
//set
self.signingID.stringValue = signingInfo[KEY_CS_ID];
}

break;

//unsigned
Expand All @@ -144,8 +142,8 @@ -(void)popoverWillShow:(NSNotification *)notification;
//details: n/a
self.details.stringValue = NSLocalizedString(@"not applicable", @"not applicable");

//signing id: n/a
self.signingID.stringValue = NSLocalizedString(@"not applicable", @"not applicable");
//set signing auths field to n/a
((NSTextField*)[self.view viewWithTag:SIGNING_AUTH_1]).stringValue = NSLocalizedString(@"not applicable", @"not applicable");

break;

Expand All @@ -157,28 +155,16 @@ -(void)popoverWillShow:(NSNotification *)notification;
[summary appendFormat:NSLocalizedString(@" has a signing issue", @" has a signing issue")];

//set details
self.details.stringValue = [NSMutableString stringWithFormat:NSLocalizedString(@"signing error: %#lx", @"signing error: %#lx"), (long)[signingInfo[KEY_CS_STATUS] integerValue]];
self.details.stringValue = [NSMutableString stringWithFormat:NSLocalizedString(@"%@ signing error: %#lx", @"%@ signing error: %#lx"), signingID, (long)[signingInfo[KEY_CS_STATUS] integerValue]];

//set signing id
if(nil != signingInfo[KEY_CS_ID])
{
//set
self.signingID.stringValue = signingInfo[KEY_CS_ID];
}
//set signing auths field to n/a
((NSTextField*)[self.view viewWithTag:SIGNING_AUTH_1]).stringValue = NSLocalizedString(@"not applicable", @"not applicable");

break;
}

bail:

//no (valid) signing auths?
// show 'not applicable' msg
if(0 == [((NSTextField*)[self.view viewWithTag:SIGNING_AUTH_1]).stringValue length])
{
//show
self.noSigningAuths.hidden = NO;
}

//assign summary to outlet
self.message.stringValue = summary;

Expand Down
Loading

0 comments on commit 08098cb

Please sign in to comment.