-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add reset to defaults functionality #36
Conversation
Launcher/Classes/AppHandler.swift
Outdated
|
||
class AppHandler { | ||
func applicationRestart() { | ||
guard let resourcePath = Bundle.main.resourcePath else { exit(0) } // If we don't have a resourcePath, we can't do any restart logic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's fatalError()
here with a message (instead of the exit(0)
)
@@ -75,11 +75,16 @@ | |||
<modifierMask key="keyEquivalentModifierMask"/> | |||
<menu key="submenu" title="Settings" id="eMl-Tr-UV4"> | |||
<items> | |||
<menuItem title="Configure Settings" keyEquivalent="s" id="QJc-YU-Tln"> | |||
<menuItem title="Configure settings" keyEquivalent="s" id="QJc-YU-Tln"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep this uppercased as per the Human Interface Guidelines:
Use title-case for titles. Capitalize every word except articles, coordinating conjunctions, and prepositions of four or fewer letters.
Launcher/Classes/AppHandler.swift
Outdated
import Foundation | ||
|
||
class AppHandler { | ||
func applicationRestart() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about restartApplication()
? Reads a bit more natural.
Launcher/Classes/AppDelegate.swift
Outdated
@@ -19,6 +19,14 @@ class AppDelegate: NSObject, NSApplicationDelegate { | |||
} | |||
} | |||
|
|||
@IBAction func resetToDefaults(_ sender: Any) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resetUserDefaults(_:)
?
Launcher/Classes/AppDelegate.swift
Outdated
@@ -19,6 +19,14 @@ class AppDelegate: NSObject, NSApplicationDelegate { | |||
} | |||
} | |||
|
|||
@IBAction func resetToDefaults(_ sender: Any) { | |||
// Reset UserDefaults | |||
if let appDomain = Bundle.main.bundleIdentifier { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we error here if the bundleIdentifier is invalid?
Will help in testing + fixing possible user problems