Skip to content

Commit

Permalink
Add preferences
Browse files Browse the repository at this point in the history
- to change the save location
- to launch app on login

Also, added app icons as well.
  • Loading branch information
vishaltelangre committed Jun 25, 2017
1 parent 0a69a0b commit 3c7bca1
Show file tree
Hide file tree
Showing 23 changed files with 385 additions and 142 deletions.
54 changes: 48 additions & 6 deletions Kyapchar.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,69 @@
objects = {

/* Begin PBXBuildFile section */
08016E591EFD116A00409465 /* Preferences.xib in Resources */ = {isa = PBXBuildFile; fileRef = 08016E581EFD116A00409465 /* Preferences.xib */; };
0834CC341EFFEEE70037C1D2 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0834CC331EFFEEE70037C1D2 /* Assets.xcassets */; };
086724DC1DC86E07007033BB /* Recorder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 086724DB1DC86E07007033BB /* Recorder.swift */; };
088746CD1EFFC7A6007636BD /* LaunchAtLoginHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 088746CC1EFFC7A6007636BD /* LaunchAtLoginHelper.swift */; };
088746D01EFFC92E007636BD /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 088746CF1EFFC92E007636BD /* Foundation.framework */; };
089CD7551DC7B742005067DB /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 089CD7541DC7B742005067DB /* AppDelegate.swift */; };
089CD7571DC7B742005067DB /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 089CD7561DC7B742005067DB /* Assets.xcassets */; };
089CD75A1DC7B742005067DB /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 089CD7581DC7B742005067DB /* MainMenu.xib */; };
089CD7641DC85A3C005067DB /* MenuController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 089CD7631DC85A3C005067DB /* MenuController.swift */; };
08CCC4B51EFD203B00521354 /* Preferences.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08CCC4B41EFD203B00521354 /* Preferences.swift */; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
08CCC4D01EFD444900521354 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 12;
dstPath = Contents/Library/LoginItems;
dstSubfolderSpec = 1;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
08016E581EFD116A00409465 /* Preferences.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = Preferences.xib; sourceTree = "<group>"; };
0834CC331EFFEEE70037C1D2 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
086724DB1DC86E07007033BB /* Recorder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Recorder.swift; sourceTree = "<group>"; };
088746CC1EFFC7A6007636BD /* LaunchAtLoginHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LaunchAtLoginHelper.swift; sourceTree = "<group>"; };
088746CF1EFFC92E007636BD /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
089CD7511DC7B742005067DB /* Kyapchar.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Kyapchar.app; sourceTree = BUILT_PRODUCTS_DIR; };
089CD7541DC7B742005067DB /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
089CD7561DC7B742005067DB /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
089CD7591DC7B742005067DB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
089CD75B1DC7B742005067DB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
089CD7631DC85A3C005067DB /* MenuController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MenuController.swift; sourceTree = "<group>"; };
08CCC4B41EFD203B00521354 /* Preferences.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Preferences.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
089CD74E1DC7B742005067DB /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
088746D01EFFC92E007636BD /* Foundation.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
088746CE1EFFC92E007636BD /* Frameworks */ = {
isa = PBXGroup;
children = (
088746CF1EFFC92E007636BD /* Foundation.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
089CD7481DC7B742005067DB = {
isa = PBXGroup;
children = (
089CD7531DC7B742005067DB /* Kyapchar */,
089CD7521DC7B742005067DB /* Products */,
088746CE1EFFC92E007636BD /* Frameworks */,
);
sourceTree = "<group>";
};
Expand All @@ -54,12 +84,15 @@
089CD7531DC7B742005067DB /* Kyapchar */ = {
isa = PBXGroup;
children = (
088746CC1EFFC7A6007636BD /* LaunchAtLoginHelper.swift */,
08CCC4B41EFD203B00521354 /* Preferences.swift */,
089CD7631DC85A3C005067DB /* MenuController.swift */,
086724DB1DC86E07007033BB /* Recorder.swift */,
089CD7541DC7B742005067DB /* AppDelegate.swift */,
089CD7561DC7B742005067DB /* Assets.xcassets */,
089CD7581DC7B742005067DB /* MainMenu.xib */,
08016E581EFD116A00409465 /* Preferences.xib */,
089CD75B1DC7B742005067DB /* Info.plist */,
0834CC331EFFEEE70037C1D2 /* Assets.xcassets */,
);
path = Kyapchar;
sourceTree = "<group>";
Expand All @@ -74,6 +107,7 @@
089CD74D1DC7B742005067DB /* Sources */,
089CD74E1DC7B742005067DB /* Frameworks */,
089CD74F1DC7B742005067DB /* Resources */,
08CCC4D01EFD444900521354 /* CopyFiles */,
);
buildRules = (
);
Expand All @@ -90,13 +124,13 @@
089CD7491DC7B742005067DB /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0730;
LastSwiftUpdateCheck = 0830;
LastUpgradeCheck = 0820;
ORGANIZATIONNAME = "Vishal Telangre";
TargetAttributes = {
089CD7501DC7B742005067DB = {
CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 0820;
LastSwiftMigration = 0830;
};
};
};
Expand All @@ -123,7 +157,8 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
089CD7571DC7B742005067DB /* Assets.xcassets in Resources */,
08016E591EFD116A00409465 /* Preferences.xib in Resources */,
0834CC341EFFEEE70037C1D2 /* Assets.xcassets in Resources */,
089CD75A1DC7B742005067DB /* MainMenu.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -136,7 +171,9 @@
buildActionMask = 2147483647;
files = (
086724DC1DC86E07007033BB /* Recorder.swift in Sources */,
088746CD1EFFC7A6007636BD /* LaunchAtLoginHelper.swift in Sources */,
089CD7551DC7B742005067DB /* AppDelegate.swift in Sources */,
08CCC4B51EFD203B00521354 /* Preferences.swift in Sources */,
089CD7641DC85A3C005067DB /* MenuController.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -159,6 +196,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_APPICON_NAME = "";
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
Expand Down Expand Up @@ -206,6 +244,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_APPICON_NAME = "";
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
Expand Down Expand Up @@ -246,11 +285,13 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
COMBINE_HIDPI_IMAGES = YES;
INFOPLIST_FILE = Kyapchar/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.vishaltelangre.Kyapchar;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
};
name = Debug;
Expand All @@ -259,6 +300,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
COMBINE_HIDPI_IMAGES = YES;
INFOPLIST_FILE = Kyapchar/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
Expand Down

This file was deleted.

This file was deleted.

7 changes: 6 additions & 1 deletion Kyapchar/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ import Cocoa
class AppDelegate: NSObject, NSApplicationDelegate {

func applicationDidFinishLaunching(_ aNotification: Notification) {
// Insert code here to initialize your application
let configuredSaveLocation = UserDefaults.standard.url(forKey: "KyapcharSaveLocation")
let defaultSaveLocation = FileManager.default.urls(for: .moviesDirectory, in: .userDomainMask).first

if (configuredSaveLocation == nil) {
UserDefaults.standard.set(defaultSaveLocation, forKey: "KyapcharSaveLocation")
}
}

func applicationWillTerminate(_ aNotification: Notification) {
Expand Down
30 changes: 20 additions & 10 deletions Kyapchar/Assets.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
@@ -1,53 +1,63 @@
{
"images" : [
{
"idiom" : "mac",
"size" : "16x16",
"idiom" : "mac",
"filename" : "icon_16x16.png",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "16x16",
"idiom" : "mac",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"idiom" : "mac",
"size" : "32x32",
"idiom" : "mac",
"filename" : "icon_32x32.png",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "32x32",
"idiom" : "mac",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"idiom" : "mac",
"size" : "128x128",
"idiom" : "mac",
"filename" : "icon_128x128.png",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "128x128",
"idiom" : "mac",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"idiom" : "mac",
"size" : "256x256",
"idiom" : "mac",
"filename" : "icon_256x256.png",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "256x256",
"idiom" : "mac",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"idiom" : "mac",
"size" : "512x512",
"idiom" : "mac",
"filename" : "icon_512x512.png",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "512x512",
"idiom" : "mac",
"filename" : "[email protected]",
"scale" : "2x"
}
],
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 8 additions & 3 deletions Kyapchar/Base.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15G1004" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="12121" systemVersion="16F73" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="12121"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
Expand All @@ -29,6 +29,11 @@
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="3kM-PI-BsL"/>
<menuItem title="Preferences" keyEquivalent="," id="PUe-NB-Ofw">
<connections>
<action selector="onPreferencesItemClick:" target="p5r-VI-AXR" id="oX4-7Y-TaT"/>
</connections>
</menuItem>
<menuItem title="Quit" keyEquivalent="q" id="DBI-fV-KJ2">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
Expand Down
Loading

0 comments on commit 3c7bca1

Please sign in to comment.