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>
|
||||
<popUpButton verticalHuggingPriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="saveLocationPopUp">
|
||||
<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"/>
|
||||
<font key="font" metaFont="message"/>
|
||||
<menu key="menu" id="saveLocationMenu">
|
||||
<items>
|
||||
<menuItem title="Last Used Folder" state="on" id="saveLocationLastUsed">
|
||||
<menuItem title="Automatic" state="on" id="saveLocationLastUsed">
|
||||
<connections>
|
||||
<action selector="setSaveLocation:" target="-2" id="saveLocationLastUsedAction"/>
|
||||
</connections>
|
||||
|
||||
@@ -66,7 +66,7 @@ class GeneralPrefsViewController: NSViewController {
|
||||
let location = Prefs.saveAsLocation
|
||||
|
||||
if location == .custom && Prefs.saveAsCustomLocation == nil {
|
||||
saveLocationPopUp.selectItem(withTag: SaveAsLocation.lastUsed.rawValue)
|
||||
saveLocationPopUp.selectItem(withTag: SaveAsLocation.automatic.rawValue)
|
||||
} else {
|
||||
saveLocationPopUp.selectItem(withTag: location.rawValue)
|
||||
}
|
||||
@@ -77,7 +77,7 @@ class GeneralPrefsViewController: NSViewController {
|
||||
Prefs.saveAsCustomLocation = url
|
||||
Prefs.saveAsLocation = .custom
|
||||
} 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 {
|
||||
/// The last folder used, the standard AppKit behaviour.
|
||||
case lastUsed = 0
|
||||
/// The folder holding the file the tracks were imported from.
|
||||
case automatic = 0
|
||||
case sameAsFile = 1
|
||||
/// A folder picked by the user.
|
||||
case custom = 2
|
||||
}
|
||||
|
||||
@@ -192,7 +188,7 @@ enum Prefs {
|
||||
@Stored(key: "SBLogFormat", defaultValue: 0)
|
||||
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
|
||||
|
||||
/// The folder used when saveAsLocation is set to custom.
|
||||
|
||||
@@ -59,7 +59,7 @@ final class SaveOptions: NSViewController {
|
||||
/// at the last folder used.
|
||||
private func preferredDirectory(for doc: Document) -> URL? {
|
||||
switch Prefs.saveAsLocation {
|
||||
case .lastUsed:
|
||||
case .automatic:
|
||||
return nil
|
||||
case .sameAsFile:
|
||||
return doc.fileURL?.deletingLastPathComponent() ?? doc.mp4.firstSourceDirectoryURL()
|
||||
|
||||
Reference in new issue
Block a user