Skip to content

Commit 69af33e

Browse files
Add standalone preferences window with additional settings
- Update minimum deployment target to 10.14 - Add Preferences storyboard to project - Add PreferencesViewController to project - Add FileLayoutPreferencesViewController to project - Add ContentsPreferencesViewController to project - Add SampleFileStructureGenerator to project - Add assets to support file structure preview - Add asset for Contents preference pane tab - Enable enclosing destination folder feature - Update AppDelegate to use preferences window controller - Exposes new user defaults for: - File structure - Destination folder name - Automatic saving of generated files - Number of lines between settings - Align setting values - Resolves #60, Resolves #62, Resolves #59, Resolves #57 - Resolves #56, Resolves #41
1 parent 8fdbbe5 commit 69af33e

20 files changed

+1141
-5
lines changed

BuildSettingExtractor.xcodeproj/project.pbxproj

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
5359360F24687FF800445F95 /* Preferences.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5359360D24687FF800445F95 /* Preferences.storyboard */; };
1011
53719E9319BF4C6D005D3DE0 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 53719E9219BF4C6D005D3DE0 /* Cocoa.framework */; };
1112
53719E9D19BF4C6D005D3DE0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 53719E9B19BF4C6D005D3DE0 /* InfoPlist.strings */; };
1213
53719E9F19BF4C6D005D3DE0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 53719E9E19BF4C6D005D3DE0 /* main.m */; };
@@ -19,7 +20,11 @@
1920
53719EBD19BF4C6D005D3DE0 /* BuildSettingExtractorTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 53719EBC19BF4C6D005D3DE0 /* BuildSettingExtractorTests.m */; };
2021
538196C51A851BB40033CB65 /* BuildSettingInfoSubpaths.plist in Resources */ = {isa = PBXBuildFile; fileRef = 538196C41A851BB40033CB65 /* BuildSettingInfoSubpaths.plist */; };
2122
539A0207234EFA4300193374 /* BuildSettingInfoSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 539A0206234EFA4300193374 /* BuildSettingInfoSource.m */; };
23+
53B3D7F023F6EB6F0039C5B0 /* PreferencesViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 53B3D7EE23F6EB6F0039C5B0 /* PreferencesViewController.m */; };
24+
53B3D7F623F6EDB70039C5B0 /* FileLayoutPreferencesViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 53B3D7F523F6EDB70039C5B0 /* FileLayoutPreferencesViewController.m */; };
25+
53B3D7FA23F6EDCD0039C5B0 /* ContentsPreferencesViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 53B3D7F823F6EDCD0039C5B0 /* ContentsPreferencesViewController.m */; };
2226
53BC11311A817447005E2FD2 /* BuildSettingCommentGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = 53BC11301A817447005E2FD2 /* BuildSettingCommentGenerator.m */; };
27+
53C7618223F85AE20024B432 /* SampleFileStructureGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = 53C7618123F85AE20024B432 /* SampleFileStructureGenerator.m */; };
2328
53F372ED1A7BC6A7006118CB /* DragFileView.m in Sources */ = {isa = PBXBuildFile; fileRef = 53F372EC1A7BC6A7006118CB /* DragFileView.m */; };
2429
53F372F01A7C042F006118CB /* BuildSettingExtractor.m in Sources */ = {isa = PBXBuildFile; fileRef = 53F372EF1A7C042F006118CB /* BuildSettingExtractor.m */; };
2530
53F372F41A7C0CBE006118CB /* ThreeBuildConfigs.plist in Resources */ = {isa = PBXBuildFile; fileRef = 53F372F31A7C0CBE006118CB /* ThreeBuildConfigs.plist */; };
@@ -44,6 +49,7 @@
4449

4550
/* Begin PBXFileReference section */
4651
532C57C7234BB32700FA0872 /* BSE-CodeSigning.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "BSE-CodeSigning.xcconfig"; sourceTree = "<group>"; };
52+
5359360E24687FF800445F95 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Preferences.storyboard; sourceTree = "<group>"; };
4753
536AA121235293B600A0FE29 /* BuildSettingExtractor.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = BuildSettingExtractor.entitlements; sourceTree = "<group>"; };
4854
53719E8F19BF4C6D005D3DE0 /* BuildSettingExtractor.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BuildSettingExtractor.app; sourceTree = BUILT_PRODUCTS_DIR; };
4955
53719E9219BF4C6D005D3DE0 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
@@ -66,8 +72,16 @@
6672
5395AF4D1A7C6BB60028BE88 /* ReadMe.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = ReadMe.md; sourceTree = "<group>"; };
6773
539A0205234EFA4300193374 /* BuildSettingInfoSource.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BuildSettingInfoSource.h; sourceTree = "<group>"; };
6874
539A0206234EFA4300193374 /* BuildSettingInfoSource.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BuildSettingInfoSource.m; sourceTree = "<group>"; };
75+
53B3D7EE23F6EB6F0039C5B0 /* PreferencesViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PreferencesViewController.m; sourceTree = "<group>"; };
76+
53B3D7EF23F6EB6F0039C5B0 /* PreferencesViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PreferencesViewController.h; sourceTree = "<group>"; };
77+
53B3D7F423F6EDB70039C5B0 /* FileLayoutPreferencesViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FileLayoutPreferencesViewController.h; sourceTree = "<group>"; };
78+
53B3D7F523F6EDB70039C5B0 /* FileLayoutPreferencesViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FileLayoutPreferencesViewController.m; sourceTree = "<group>"; };
79+
53B3D7F723F6EDCD0039C5B0 /* ContentsPreferencesViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ContentsPreferencesViewController.h; sourceTree = "<group>"; };
80+
53B3D7F823F6EDCD0039C5B0 /* ContentsPreferencesViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ContentsPreferencesViewController.m; sourceTree = "<group>"; };
6981
53BC112F1A817447005E2FD2 /* BuildSettingCommentGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BuildSettingCommentGenerator.h; sourceTree = "<group>"; };
7082
53BC11301A817447005E2FD2 /* BuildSettingCommentGenerator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BuildSettingCommentGenerator.m; sourceTree = "<group>"; };
83+
53C7618023F85AE20024B432 /* SampleFileStructureGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SampleFileStructureGenerator.h; sourceTree = "<group>"; };
84+
53C7618123F85AE20024B432 /* SampleFileStructureGenerator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SampleFileStructureGenerator.m; sourceTree = "<group>"; };
7185
53F372EB1A7BC6A7006118CB /* DragFileView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DragFileView.h; sourceTree = "<group>"; };
7286
53F372EC1A7BC6A7006118CB /* DragFileView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DragFileView.m; sourceTree = "<group>"; };
7387
53F372EE1A7C042F006118CB /* BuildSettingExtractor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BuildSettingExtractor.h; sourceTree = "<group>"; };
@@ -172,6 +186,7 @@
172186
53FA882723421B9900F51EC3 /* AppConstants+Categories.m */,
173187
53F372F91A7C5803006118CB /* Constants+Categories.h */,
174188
53F372FA1A7C5803006118CB /* Constants+Categories.m */,
189+
53B3D7EB23F6EB090039C5B0 /* Preferences */,
175190
53719EA719BF4C6D005D3DE0 /* MainMenu.xib */,
176191
53719EAA19BF4C6D005D3DE0 /* Assets.xcassets */,
177192
538196C41A851BB40033CB65 /* BuildSettingInfoSubpaths.plist */,
@@ -209,6 +224,22 @@
209224
name = "Supporting Files";
210225
sourceTree = "<group>";
211226
};
227+
53B3D7EB23F6EB090039C5B0 /* Preferences */ = {
228+
isa = PBXGroup;
229+
children = (
230+
53B3D7EF23F6EB6F0039C5B0 /* PreferencesViewController.h */,
231+
53B3D7EE23F6EB6F0039C5B0 /* PreferencesViewController.m */,
232+
53B3D7F423F6EDB70039C5B0 /* FileLayoutPreferencesViewController.h */,
233+
53B3D7F523F6EDB70039C5B0 /* FileLayoutPreferencesViewController.m */,
234+
53B3D7F723F6EDCD0039C5B0 /* ContentsPreferencesViewController.h */,
235+
53B3D7F823F6EDCD0039C5B0 /* ContentsPreferencesViewController.m */,
236+
53C7618023F85AE20024B432 /* SampleFileStructureGenerator.h */,
237+
53C7618123F85AE20024B432 /* SampleFileStructureGenerator.m */,
238+
5359360D24687FF800445F95 /* Preferences.storyboard */,
239+
);
240+
path = Preferences;
241+
sourceTree = "<group>";
242+
};
212243
53F372F61A7C3164006118CB /* TestFiles */ = {
213244
isa = PBXGroup;
214245
children = (
@@ -266,7 +297,7 @@
266297
53719E8719BF4C6D005D3DE0 /* Project object */ = {
267298
isa = PBXProject;
268299
attributes = {
269-
LastUpgradeCheck = 1110;
300+
LastUpgradeCheck = 1140;
270301
ORGANIZATIONNAME = "Tapas Software";
271302
TargetAttributes = {
272303
53719EAF19BF4C6D005D3DE0 = {
@@ -301,6 +332,7 @@
301332
53719E9D19BF4C6D005D3DE0 /* InfoPlist.strings in Resources */,
302333
538196C51A851BB40033CB65 /* BuildSettingInfoSubpaths.plist in Resources */,
303334
53719EAB19BF4C6D005D3DE0 /* Assets.xcassets in Resources */,
335+
5359360F24687FF800445F95 /* Preferences.storyboard in Resources */,
304336
53719EA919BF4C6D005D3DE0 /* MainMenu.xib in Resources */,
305337
);
306338
runOnlyForDeploymentPostprocessing = 0;
@@ -332,8 +364,12 @@
332364
53F372ED1A7BC6A7006118CB /* DragFileView.m in Sources */,
333365
53FA882823421B9900F51EC3 /* AppConstants+Categories.m in Sources */,
334366
53BC11311A817447005E2FD2 /* BuildSettingCommentGenerator.m in Sources */,
367+
53B3D7FA23F6EDCD0039C5B0 /* ContentsPreferencesViewController.m in Sources */,
368+
53C7618223F85AE20024B432 /* SampleFileStructureGenerator.m in Sources */,
369+
53B3D7F023F6EB6F0039C5B0 /* PreferencesViewController.m in Sources */,
335370
539A0207234EFA4300193374 /* BuildSettingInfoSource.m in Sources */,
336371
53719E9F19BF4C6D005D3DE0 /* main.m in Sources */,
372+
53B3D7F623F6EDB70039C5B0 /* FileLayoutPreferencesViewController.m in Sources */,
337373
);
338374
runOnlyForDeploymentPostprocessing = 0;
339375
};
@@ -356,6 +392,14 @@
356392
/* End PBXTargetDependency section */
357393

358394
/* Begin PBXVariantGroup section */
395+
5359360D24687FF800445F95 /* Preferences.storyboard */ = {
396+
isa = PBXVariantGroup;
397+
children = (
398+
5359360E24687FF800445F95 /* Base */,
399+
);
400+
name = Preferences.storyboard;
401+
sourceTree = "<group>";
402+
};
359403
53719E9B19BF4C6D005D3DE0 /* InfoPlist.strings */ = {
360404
isa = PBXVariantGroup;
361405
children = (
@@ -430,7 +474,7 @@
430474
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
431475
GCC_WARN_UNUSED_FUNCTION = YES;
432476
GCC_WARN_UNUSED_VARIABLE = YES;
433-
MACOSX_DEPLOYMENT_TARGET = 10.9;
477+
MACOSX_DEPLOYMENT_TARGET = 10.14;
434478
ONLY_ACTIVE_ARCH = YES;
435479
SDKROOT = macosx;
436480
};
@@ -477,7 +521,7 @@
477521
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
478522
GCC_WARN_UNUSED_FUNCTION = YES;
479523
GCC_WARN_UNUSED_VARIABLE = YES;
480-
MACOSX_DEPLOYMENT_TARGET = 10.9;
524+
MACOSX_DEPLOYMENT_TARGET = 10.14;
481525
SDKROOT = macosx;
482526
};
483527
name = Release;

BuildSettingExtractor/AppDelegate.m

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@
1616
#define OVERWRITE_CHECKING_DISABLED 0
1717

1818
// Temporary flag until the preference pane is updated
19-
#define ENCLOSING_DESTINATION_FOLDER_ENABLED 0
19+
#define ENCLOSING_DESTINATION_FOLDER_ENABLED 1
2020

2121
@interface AppDelegate () <NSOpenSavePanelDelegate>
2222

2323
@property (weak) IBOutlet NSWindow *window;
2424
@property (weak) IBOutlet DragFileView *dragFileView;
2525
@property (weak) IBOutlet NSWindow *preferencesWindow;
26+
@property NSWindowController *preferencesWindowController;
2627
@property (weak) IBOutlet NSTextField *dragFileLabel;
2728

2829
@end
@@ -233,7 +234,11 @@ - (void)performExtractionFromProject:(NSURL *)fileURL toDestination:(NSURL *)des
233234
}
234235

235236
- (IBAction)presentPreferencesWindow:(id)sender {
236-
[self.window beginSheet:self.preferencesWindow completionHandler:nil];
237+
if (!self.preferencesWindowController) {
238+
NSStoryboard *storyboard = [NSStoryboard storyboardWithName:@"Preferences" bundle:nil];
239+
self.preferencesWindowController = (NSWindowController *)[storyboard instantiateInitialController];
240+
}
241+
[self.preferencesWindowController showWindow:nil];
237242
}
238243

239244
- (IBAction)dismissPreferencesWindow:(id)sender {
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"filename" : "config_file.png",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"filename" : "[email protected]",
11+
"scale" : "2x"
12+
},
13+
{
14+
"idiom" : "universal",
15+
"scale" : "3x"
16+
}
17+
],
18+
"info" : {
19+
"version" : 1,
20+
"author" : "xcode"
21+
}
22+
}
1.13 KB
Loading
1.9 KB
Loading
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "contents_icon.png",
5+
"idiom" : "universal",
6+
"scale" : "1x"
7+
},
8+
{
9+
"filename" : "[email protected]",
10+
"idiom" : "universal",
11+
"scale" : "2x"
12+
},
13+
{
14+
"idiom" : "universal",
15+
"scale" : "3x"
16+
}
17+
],
18+
"info" : {
19+
"author" : "xcode",
20+
"version" : 1
21+
}
22+
}
1.33 KB
Loading
2.93 KB
Loading
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"filename" : "folder.png",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"filename" : "[email protected]",
11+
"scale" : "2x"
12+
},
13+
{
14+
"idiom" : "universal",
15+
"scale" : "3x"
16+
}
17+
],
18+
"info" : {
19+
"version" : 1,
20+
"author" : "xcode"
21+
}
22+
}
1.25 KB
Loading

0 commit comments

Comments
 (0)