Remember file importer metadata checkbox state.

This commit is contained in:
Damiano Galassi committed 2018-02-12 13:19:39 +01:00
1 parent 0003ff73b3
commit 181682c880
2 files changed
+6 -1

No files matched your search

+4 -1
View File
@@ -206,6 +206,7 @@ class FileImportController: NSWindowController, NSTableViewDataSource, NSTableVi
super.windowDidLoad() super.windowDidLoad()
self.importMetadataCheckbox.isEnabled = importMetadata self.importMetadataCheckbox.isEnabled = importMetadata
self.importMetadataCheckbox.state = UserDefaults.standard.bool(forKey: "SBFileImporterImportMetadata") ? .on : .off
} }
// MARK: Public properties // MARK: Public properties
@@ -359,7 +360,9 @@ class FileImportController: NSWindowController, NSTableViewDataSource, NSTableVi
// MARK: Actions // MARK: Actions
@IBAction func setImportMetadata(_ sender: NSButton) { @IBAction func setImportMetadata(_ sender: NSButton) {
importMetadata = sender.state == NSControl.StateValue.on let enabled = sender.state == NSControl.StateValue.on
importMetadata = enabled
UserDefaults.standard.set(enabled, forKey: "SBFileImporterImportMetadata")
} }
@IBAction func setCheck(_ sender: NSButton) { @IBAction func setCheck(_ sender: NSButton) {
+2
View File
@@ -56,6 +56,8 @@ import Cocoa
"SBMetadataTvShowResultMap": tvShowDefaultMap, "SBMetadataTvShowResultMap": tvShowDefaultMap,
"SBMetadataKeepEmptyAnnotations": false, "SBMetadataKeepEmptyAnnotations": false,
"SBFileImporterImportMetadata": true,
"SBForceHvc1": true] "SBForceHvc1": true]
defaults.register(defaults: settings) defaults.register(defaults: settings)