Skip to content

Commit 2c1d66c

Browse files
committed
1.0.1: Added preferences screen
Added auto increment build numbers
1 parent bd2f09c commit 2c1d66c

8 files changed

+211
-643
lines changed

guetzli-gui.png

-12.6 KB
Loading

guetzli-gui.xcodeproj/project.pbxproj

+49
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
8D0483E11E7C6A59009CF777 /* guetzli_guiTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D0483E01E7C6A59009CF777 /* guetzli_guiTests.swift */; };
1515
8D0483EC1E7C6A59009CF777 /* guetzli_guiUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D0483EB1E7C6A59009CF777 /* guetzli_guiUITests.swift */; };
1616
8D0483FA1E7C8644009CF777 /* Command.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D0483F91E7C8644009CF777 /* Command.swift */; };
17+
8D57F37A1E7CAC8300DDCD83 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 8D57F3791E7CAC8300DDCD83 /* Credits.rtf */; };
18+
8D57F3881E7CAF5800DDCD83 /* PreferencesWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D57F3861E7CAF5800DDCD83 /* PreferencesWindowController.swift */; };
19+
8D57F3891E7CAF5800DDCD83 /* PreferencesWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8D57F3871E7CAF5800DDCD83 /* PreferencesWindowController.xib */; };
1720
/* End PBXBuildFile section */
1821

1922
/* Begin PBXContainerItemProxy section */
@@ -47,6 +50,9 @@
4750
8D0483EB1E7C6A59009CF777 /* guetzli_guiUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = guetzli_guiUITests.swift; sourceTree = "<group>"; };
4851
8D0483ED1E7C6A59009CF777 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
4952
8D0483F91E7C8644009CF777 /* Command.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Command.swift; sourceTree = "<group>"; };
53+
8D57F3791E7CAC8300DDCD83 /* Credits.rtf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.rtf; name = Credits.rtf; path = "Supporting Files/Credits.rtf"; sourceTree = "<group>"; };
54+
8D57F3861E7CAF5800DDCD83 /* PreferencesWindowController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = PreferencesWindowController.swift; path = Preferences/PreferencesWindowController.swift; sourceTree = "<group>"; };
55+
8D57F3871E7CAF5800DDCD83 /* PreferencesWindowController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = PreferencesWindowController.xib; path = Preferences/PreferencesWindowController.xib; sourceTree = "<group>"; };
5056
/* End PBXFileReference section */
5157

5258
/* Begin PBXFrameworksBuildPhase section */
@@ -97,6 +103,8 @@
97103
8D0483CD1E7C6A59009CF777 /* guetzli-gui */ = {
98104
isa = PBXGroup;
99105
children = (
106+
8D57F3811E7CAF2E00DDCD83 /* Preferences */,
107+
8D57F3781E7CAC6E00DDCD83 /* Supporting Files */,
100108
8D0483CE1E7C6A59009CF777 /* AppDelegate.swift */,
101109
8D0483D01E7C6A59009CF777 /* ViewController.swift */,
102110
8D0483D21E7C6A59009CF777 /* Assets.xcassets */,
@@ -125,6 +133,23 @@
125133
path = "guetzli-guiUITests";
126134
sourceTree = "<group>";
127135
};
136+
8D57F3781E7CAC6E00DDCD83 /* Supporting Files */ = {
137+
isa = PBXGroup;
138+
children = (
139+
8D57F3791E7CAC8300DDCD83 /* Credits.rtf */,
140+
);
141+
name = "Supporting Files";
142+
sourceTree = "<group>";
143+
};
144+
8D57F3811E7CAF2E00DDCD83 /* Preferences */ = {
145+
isa = PBXGroup;
146+
children = (
147+
8D57F3861E7CAF5800DDCD83 /* PreferencesWindowController.swift */,
148+
8D57F3871E7CAF5800DDCD83 /* PreferencesWindowController.xib */,
149+
);
150+
name = Preferences;
151+
sourceTree = "<group>";
152+
};
128153
/* End PBXGroup section */
129154

130155
/* Begin PBXNativeTarget section */
@@ -135,6 +160,7 @@
135160
8D0483C71E7C6A59009CF777 /* Sources */,
136161
8D0483C81E7C6A59009CF777 /* Frameworks */,
137162
8D0483C91E7C6A59009CF777 /* Resources */,
163+
8D57620F1E7CCAEF009177C0 /* Increment Build Number */,
138164
);
139165
buildRules = (
140166
);
@@ -236,7 +262,9 @@
236262
buildActionMask = 2147483647;
237263
files = (
238264
8D0483D31E7C6A59009CF777 /* Assets.xcassets in Resources */,
265+
8D57F37A1E7CAC8300DDCD83 /* Credits.rtf in Resources */,
239266
8D0483D61E7C6A59009CF777 /* Main.storyboard in Resources */,
267+
8D57F3891E7CAF5800DDCD83 /* PreferencesWindowController.xib in Resources */,
240268
);
241269
runOnlyForDeploymentPostprocessing = 0;
242270
};
@@ -256,13 +284,31 @@
256284
};
257285
/* End PBXResourcesBuildPhase section */
258286

287+
/* Begin PBXShellScriptBuildPhase section */
288+
8D57620F1E7CCAEF009177C0 /* Increment Build Number */ = {
289+
isa = PBXShellScriptBuildPhase;
290+
buildActionMask = 2147483647;
291+
files = (
292+
);
293+
inputPaths = (
294+
);
295+
name = "Increment Build Number";
296+
outputPaths = (
297+
);
298+
runOnlyForDeploymentPostprocessing = 0;
299+
shellPath = /bin/sh;
300+
shellScript = "buildNumber=$(/usr/libexec/PlistBuddy -c \"Print CFBundleVersion\" \"${PROJECT_DIR}/${INFOPLIST_FILE}\")\nbuildNumber=$(($buildNumber + 1))\n/usr/libexec/PlistBuddy -c \"Set :CFBundleVersion $buildNumber\" \"${PROJECT_DIR}/${INFOPLIST_FILE}\"";
301+
};
302+
/* End PBXShellScriptBuildPhase section */
303+
259304
/* Begin PBXSourcesBuildPhase section */
260305
8D0483C71E7C6A59009CF777 /* Sources */ = {
261306
isa = PBXSourcesBuildPhase;
262307
buildActionMask = 2147483647;
263308
files = (
264309
8D0483D11E7C6A59009CF777 /* ViewController.swift in Sources */,
265310
8D0483CF1E7C6A59009CF777 /* AppDelegate.swift in Sources */,
311+
8D57F3881E7CAF5800DDCD83 /* PreferencesWindowController.swift in Sources */,
266312
8D0483FA1E7C8644009CF777 /* Command.swift in Sources */,
267313
);
268314
runOnlyForDeploymentPostprocessing = 0;
@@ -509,6 +555,7 @@
509555
8D0483F21E7C6A59009CF777 /* Release */,
510556
);
511557
defaultConfigurationIsVisible = 0;
558+
defaultConfigurationName = Release;
512559
};
513560
8D0483F31E7C6A59009CF777 /* Build configuration list for PBXNativeTarget "guetzli-guiTests" */ = {
514561
isa = XCConfigurationList;
@@ -517,6 +564,7 @@
517564
8D0483F51E7C6A59009CF777 /* Release */,
518565
);
519566
defaultConfigurationIsVisible = 0;
567+
defaultConfigurationName = Release;
520568
};
521569
8D0483F61E7C6A59009CF777 /* Build configuration list for PBXNativeTarget "guetzli-guiUITests" */ = {
522570
isa = XCConfigurationList;
@@ -525,6 +573,7 @@
525573
8D0483F81E7C6A59009CF777 /* Release */,
526574
);
527575
defaultConfigurationIsVisible = 0;
576+
defaultConfigurationName = Release;
528577
};
529578
/* End XCConfigurationList section */
530579
};

guetzli-gui/AppDelegate.swift

+5-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import Cocoa
1111
@NSApplicationMain
1212
class AppDelegate: NSObject, NSApplicationDelegate {
1313

14-
14+
var preferencesWindow : PreferencesWindowController!
1515

1616
func applicationDidFinishLaunching(_ aNotification: Notification) {
1717
// Insert code here to initialize your application
@@ -21,6 +21,9 @@ class AppDelegate: NSObject, NSApplicationDelegate {
2121
// Insert code here to tear down your application
2222
}
2323

24+
@IBAction func preferencesClicked(_ sender: NSMenuItem) {
25+
preferencesWindow = PreferencesWindowController(windowNibName: "PreferencesWindowController")
26+
preferencesWindow.showWindow(nil)
27+
}
2428

2529
}
26-

0 commit comments

Comments
 (0)