Skip to content

Commit 121dd14

Browse files
Add Preference sheet
1 parent 2343d94 commit 121dd14

File tree

2 files changed

+77
-4
lines changed

2 files changed

+77
-4
lines changed

BuildSettingExtractor/AppDelegate.m

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616

1717
@interface AppDelegate () <NSOpenSavePanelDelegate>
1818

19-
@property (assign) IBOutlet NSWindow *window;
19+
@property (weak) IBOutlet NSWindow *window;
2020
@property (weak) IBOutlet DragFileView *dragFileView;
21+
@property (weak) IBOutlet NSWindow *preferencesWindow;
2122

2223
@property BOOL shouldOverwriteFiles;
2324

@@ -71,6 +72,14 @@ - (IBAction)handleDroppedFile:(DragFileView *)sender {
7172
}
7273
}
7374

75+
- (IBAction)presentPreferencesWindow:(id)sender {
76+
[self.window beginSheet:self.preferencesWindow completionHandler:nil];
77+
}
78+
79+
- (IBAction)dismissPreferencesWindow:(id)sender {
80+
[self.window endSheet:self.preferencesWindow];
81+
}
82+
7483
#pragma mark - NSOpenSavePanelDelegate
7584

7685
/* We want to protect against overwriting the contents of a folder that already has xcconfig files in it. So validate the contents of the selected folder.

BuildSettingExtractor/Base.lproj/MainMenu.xib

Lines changed: 67 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<customObject id="Voe-Tx-rLC" customClass="AppDelegate">
1616
<connections>
1717
<outlet property="dragFileView" destination="THh-eD-rRa" id="zXq-Cy-fLL"/>
18+
<outlet property="preferencesWindow" destination="fKt-mn-0WB" id="QZi-jp-8Bf"/>
1819
<outlet property="window" destination="QvC-M9-y7g" id="gIp-Ho-8D9"/>
1920
</connections>
2021
</customObject>
@@ -32,7 +33,11 @@
3233
</connections>
3334
</menuItem>
3435
<menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/>
35-
<menuItem title="Preferences…" keyEquivalent="," id="BOF-NM-1cW"/>
36+
<menuItem title="Preferences…" keyEquivalent="," id="BOF-NM-1cW">
37+
<connections>
38+
<action selector="presentPreferencesWindow:" target="-1" id="X0T-tK-MSL"/>
39+
</connections>
40+
</menuItem>
3641
<menuItem isSeparatorItem="YES" id="wFC-TO-SCJ"/>
3742
<menuItem title="Services" id="NMo-om-nkz">
3843
<modifierMask key="keyEquivalentModifierMask"/>
@@ -668,7 +673,7 @@
668673
</menuItem>
669674
</items>
670675
</menu>
671-
<window title="Build Setting Extractor" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g">
676+
<window title="Build Setting Extractor" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" frameAutosaveName="BuildSettingExtractor" animationBehavior="default" id="QvC-M9-y7g">
672677
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
673678
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
674679
<rect key="contentRect" x="335" y="390" width="436" height="210"/>
@@ -705,7 +710,66 @@
705710
<constraint firstItem="THh-eD-rRa" firstAttribute="top" secondItem="EiT-Mj-1SZ" secondAttribute="top" constant="20" symbolic="YES" id="yY4-bH-zCm"/>
706711
</constraints>
707712
</view>
708-
<point key="canvasLocation" x="451" y="300"/>
713+
<point key="canvasLocation" x="-298" y="59"/>
714+
</window>
715+
<userDefaultsController representsSharedInstance="YES" id="Czo-a1-luY"/>
716+
<window title="Preferences" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" frameAutosaveName="Preferences" animationBehavior="default" id="fKt-mn-0WB">
717+
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES"/>
718+
<rect key="contentRect" x="985" y="795" width="320" height="122"/>
719+
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1417"/>
720+
<value key="minSize" type="size" width="320" height="122"/>
721+
<value key="maxSize" type="size" width="320" height="122"/>
722+
<view key="contentView" id="1kK-jA-VrG">
723+
<rect key="frame" x="0.0" y="0.0" width="320" height="122"/>
724+
<autoresizingMask key="autoresizingMask"/>
725+
<subviews>
726+
<button translatesAutoresizingMaskIntoConstraints="NO" id="jJF-zo-xje">
727+
<rect key="frame" x="18" y="86" width="260" height="18"/>
728+
<buttonCell key="cell" type="check" title="Open destination folder when finished " bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="bOl-XK-mYp">
729+
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
730+
<font key="font" metaFont="system"/>
731+
</buttonCell>
732+
<connections>
733+
<binding destination="Czo-a1-luY" name="value" keyPath="values.TPSOpenDirectoryInFinder" id="tYf-ps-faC"/>
734+
</connections>
735+
</button>
736+
<button translatesAutoresizingMaskIntoConstraints="NO" id="PO3-kF-2C5">
737+
<rect key="frame" x="18" y="59" width="242" height="18"/>
738+
<buttonCell key="cell" type="check" title="Include build setting info comments" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="Miy-u0-wrI">
739+
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
740+
<font key="font" metaFont="system"/>
741+
</buttonCell>
742+
<connections>
743+
<binding destination="Czo-a1-luY" name="value" keyPath="values.TPSIncludeBuildSettingInfoComments" id="UHb-Q1-xEE"/>
744+
</connections>
745+
</button>
746+
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Hfn-iA-xua">
747+
<rect key="frame" x="224" y="13" width="82" height="32"/>
748+
<constraints>
749+
<constraint firstAttribute="width" constant="70" id="Mhi-36-XF6"/>
750+
</constraints>
751+
<buttonCell key="cell" type="push" title="Done" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="STv-vC-Etq">
752+
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
753+
<font key="font" metaFont="system"/>
754+
<string key="keyEquivalent" base64-UTF8="YES">
755+
DQ
756+
</string>
757+
</buttonCell>
758+
<connections>
759+
<action selector="dismissPreferencesWindow:" target="Voe-Tx-rLC" id="yFB-dd-ies"/>
760+
</connections>
761+
</button>
762+
</subviews>
763+
<constraints>
764+
<constraint firstAttribute="bottom" secondItem="Hfn-iA-xua" secondAttribute="bottom" constant="20" symbolic="YES" id="4qv-Vd-eta"/>
765+
<constraint firstItem="PO3-kF-2C5" firstAttribute="top" secondItem="jJF-zo-xje" secondAttribute="bottom" constant="13" id="SBZ-jh-KMn"/>
766+
<constraint firstItem="jJF-zo-xje" firstAttribute="leading" secondItem="PO3-kF-2C5" secondAttribute="leading" id="Tk0-KE-6NX"/>
767+
<constraint firstAttribute="trailing" secondItem="Hfn-iA-xua" secondAttribute="trailing" constant="20" symbolic="YES" id="lga-uZ-nGU"/>
768+
<constraint firstItem="jJF-zo-xje" firstAttribute="top" secondItem="1kK-jA-VrG" secondAttribute="top" constant="20" symbolic="YES" id="tW5-wZ-DRa"/>
769+
<constraint firstItem="jJF-zo-xje" firstAttribute="leading" secondItem="1kK-jA-VrG" secondAttribute="leading" constant="20" symbolic="YES" id="tlz-a7-foM"/>
770+
</constraints>
771+
</view>
772+
<point key="canvasLocation" x="196" y="42"/>
709773
</window>
710774
</objects>
711775
</document>

0 commit comments

Comments
 (0)