Skip to content
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

Merged
merged 5 commits into from
Oct 23, 2017
Merged

Add reset to defaults functionality #36

merged 5 commits into from
Oct 23, 2017

Conversation

JoeSSS
Copy link
Contributor

@JoeSSS JoeSSS commented Oct 23, 2017

Will help in testing + fixing possible user problems


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
Copy link
Contributor

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">
Copy link
Contributor

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.

import Foundation

class AppHandler {
func applicationRestart() {
Copy link
Contributor

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.

@@ -19,6 +19,14 @@ class AppDelegate: NSObject, NSApplicationDelegate {
}
}

@IBAction func resetToDefaults(_ sender: Any) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resetUserDefaults(_:)?

@@ -19,6 +19,14 @@ class AppDelegate: NSObject, NSApplicationDelegate {
}
}

@IBAction func resetToDefaults(_ sender: Any) {
// Reset UserDefaults
if let appDomain = Bundle.main.bundleIdentifier {
Copy link
Contributor

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?

@JoeSSS JoeSSS merged commit eddbaa6 into master Oct 23, 2017
@JoeSSS JoeSSS deleted the reset_to_defaults branch October 23, 2017 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants