Rename the 'Last used' save position to 'Automatic'
It's not always the last used position
This commit is contained in:
4 files changed
+7
-11
No files matched your search
@@ -231,12 +231,12 @@
|
|||||||
</textField>
|
</textField>
|
||||||
<popUpButton verticalHuggingPriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="saveLocationPopUp">
|
<popUpButton verticalHuggingPriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="saveLocationPopUp">
|
||||||
<rect key="frame" x="136" y="242" width="180" height="24"/>
|
<rect key="frame" x="136" y="242" width="180" height="24"/>
|
||||||
<popUpButtonCell key="cell" type="push" title="Last Used Folder" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="saveLocationLastUsed" id="saveLocationCell">
|
<popUpButtonCell key="cell" type="push" title="Automatic" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="saveLocationLastUsed" id="saveLocationCell">
|
||||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||||
<font key="font" metaFont="message"/>
|
<font key="font" metaFont="message"/>
|
||||||
<menu key="menu" id="saveLocationMenu">
|
<menu key="menu" id="saveLocationMenu">
|
||||||
<items>
|
<items>
|
||||||
<menuItem title="Last Used Folder" state="on" id="saveLocationLastUsed">
|
<menuItem title="Automatic" state="on" id="saveLocationLastUsed">
|
||||||
<connections>
|
<connections>
|
||||||
<action selector="setSaveLocation:" target="-2" id="saveLocationLastUsedAction"/>
|
<action selector="setSaveLocation:" target="-2" id="saveLocationLastUsedAction"/>
|
||||||
</connections>
|
</connections>
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ class GeneralPrefsViewController: NSViewController {
|
|||||||
let location = Prefs.saveAsLocation
|
let location = Prefs.saveAsLocation
|
||||||
|
|
||||||
if location == .custom && Prefs.saveAsCustomLocation == nil {
|
if location == .custom && Prefs.saveAsCustomLocation == nil {
|
||||||
saveLocationPopUp.selectItem(withTag: SaveAsLocation.lastUsed.rawValue)
|
saveLocationPopUp.selectItem(withTag: SaveAsLocation.automatic.rawValue)
|
||||||
} else {
|
} else {
|
||||||
saveLocationPopUp.selectItem(withTag: location.rawValue)
|
saveLocationPopUp.selectItem(withTag: location.rawValue)
|
||||||
}
|
}
|
||||||
@@ -77,7 +77,7 @@ class GeneralPrefsViewController: NSViewController {
|
|||||||
Prefs.saveAsCustomLocation = url
|
Prefs.saveAsCustomLocation = url
|
||||||
Prefs.saveAsLocation = .custom
|
Prefs.saveAsLocation = .custom
|
||||||
} else {
|
} else {
|
||||||
Prefs.saveAsLocation = SaveAsLocation(rawValue: sender.tag) ?? .lastUsed
|
Prefs.saveAsLocation = SaveAsLocation(rawValue: sender.tag) ?? .automatic
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-6
@@ -90,13 +90,9 @@ struct StoredCodable<T: Codable> : Registable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The folder the Save As… panel opens at.
|
|
||||||
enum SaveAsLocation: Int {
|
enum SaveAsLocation: Int {
|
||||||
/// The last folder used, the standard AppKit behaviour.
|
case automatic = 0
|
||||||
case lastUsed = 0
|
|
||||||
/// The folder holding the file the tracks were imported from.
|
|
||||||
case sameAsFile = 1
|
case sameAsFile = 1
|
||||||
/// A folder picked by the user.
|
|
||||||
case custom = 2
|
case custom = 2
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -192,7 +188,7 @@ enum Prefs {
|
|||||||
@Stored(key: "SBLogFormat", defaultValue: 0)
|
@Stored(key: "SBLogFormat", defaultValue: 0)
|
||||||
static var logFormat: Int // 0 = Time Only, 1 = Date and Time
|
static var logFormat: Int // 0 = Time Only, 1 = Date and Time
|
||||||
|
|
||||||
@StoredEnum(key: "SBSaveAsLocationMode", defaultValue: .lastUsed)
|
@StoredEnum(key: "SBSaveAsLocationMode", defaultValue: .automatic)
|
||||||
static var saveAsLocation: SaveAsLocation
|
static var saveAsLocation: SaveAsLocation
|
||||||
|
|
||||||
/// The folder used when saveAsLocation is set to custom.
|
/// The folder used when saveAsLocation is set to custom.
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ final class SaveOptions: NSViewController {
|
|||||||
/// at the last folder used.
|
/// at the last folder used.
|
||||||
private func preferredDirectory(for doc: Document) -> URL? {
|
private func preferredDirectory(for doc: Document) -> URL? {
|
||||||
switch Prefs.saveAsLocation {
|
switch Prefs.saveAsLocation {
|
||||||
case .lastUsed:
|
case .automatic:
|
||||||
return nil
|
return nil
|
||||||
case .sameAsFile:
|
case .sameAsFile:
|
||||||
return doc.fileURL?.deletingLastPathComponent() ?? doc.mp4.firstSourceDirectoryURL()
|
return doc.fileURL?.deletingLastPathComponent() ?? doc.mp4.firstSourceDirectoryURL()
|
||||||
|
|||||||
Reference in new issue
Block a user