Add a Save As location preference - #145
Open
mindprint wants to merge 1 commit into
Open
Conversation
Add a General preferences option controlling where the Save As panel opens: the last used folder (default), the same folder as the imported file, or a custom folder chosen by the user. The custom folder is stored as a security scoped bookmark so it stays reachable after a relaunch, and MP42File gains a helper to find the source file's directory when "Same as File" is selected.
mindprint
force-pushed
the
save-as-location
branch
from
September 2, 2026 15:01
f0dfd2d to
fe50dca
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Subler imports some files instead of editing them. It then makes an untitled document, which has no file URL. Thus the Save As panel does not know the source folder. The panel shows the last folder that you used.
This happens in two conditions.
SBDocumentControlleropensmkv,mka,mks,mov,264andh264files as new untitled documents. Also,Document.makeWindowControllers()setsfileURLto nil for a file that Subler cannot edit.Subler already finds the source file for the name.
MP42File.preferredFileName()reads the URL of the first track.SaveOptionsputs this name in the panel. But the panel does not get the folder.The queue does this correctly. Its
Location:menu has a "Same as file" item, andQueueController.destination(for:)writes the new file next to the source file. Thus the two parts of the app do not agree.Change
This change adds a
Save As:menu to the General preferences. The menu has three items:SaveOptions.viewDidLoadsetssavePanel.directoryURL, next to the code for the file name. Save As and Send To Queue both useDocument.prepareSavePanel. Thus the two commands operate in the same manner.MP42File.preferredFileDirectory()uses the same track lookup aspreferredFileName(). Thus the name and the folder come from the same source file.Design notes
MP42SecurityAccessTokenfunctions. Thus the folder stays available after a restart. The// TODO: Sandboxcomment inOptionsViewController.saveRecentDestinations()asks for this.Tests
I built the app with Xcode 26.6 and tested a sandboxed build manually. First I set the last used folder to a different folder than the source folder. If you do not do this, all three items give the same result.
The selected folder stayed available after a restart. Send To Queue used the same preference.
Notes
This change does not correct #94.
DocumentWindowController.export(_:)makes its ownNSSavePaneland does not useprepareSavePanel. Thus subtitle export is a different path. I can correct it later.I edited
Base.lproj/GeneralPrefsViewController.xibmanually as XML, to keep the difference small. Interface Builder writes the full file again, if you open and save it.