default session name
|Assignee:||Matthias Mauch||% Done:|
In the Save Session As... menu the Save As field is currently empty when the dialog opens.
It would be nice if the field were opened in the directory the audio file resides in, and the Save As name defaulted to the audio file name with the extension replaced by .ton.
This request comes from Simon, who has many small files to annotate, and choosing or typing the file name is a significant nuisance.
#3 Updated by Chris Cannam about 6 years ago
Mm, tricky. Never mind how to plumb this through from the GUI logic, I can't work out how to get the Qt file dialog to show a default filename at all.
My guess from the QFileDialog documentation is that calling selectFile("thing.ton") on the dialog might be expected to make "thing.ton" appear in the dialog's filename field. But when I try this, it doesn't work; the filename field remains blank.
That is, if I literally just add
svgui/widgets/InteractiveFileFinder.cpp around line 340, nothing looks any different. (Does it on the Mac? Can you see any other clues in the documentation about how to do this, given that we aren't using the static functions like
QFileDialog::getSaveFileName() to retrieve our filename, and that this isn't going to change in a hurry?)
If we can't get this to work, an alternative would be a "Save Session As thing.ton" option in the File menu which shows the session name derived from the current audio file name. That would actually be even quicker, it's just less appealing because it becomes completely redundant as soon as you've saved the session once.
#8 Updated by Chris Cannam about 6 years ago
OK, as of eef5c50e7e34 the Save Session As and Save Session to Audio Path options are enabled/disabled based on the existence of the main model. Also, the new function will ask for confirmation if saving to a session file that already exists, unless this session has already been saved to that file.
This reminds me that one of the bigger problems with Tony and sessions is that you can't safely save the session until after the initial analysis is done. At this point the easiest solution to that (although an annoyingly time-consuming one for the user) would be to make the save options only become available after analysis has completed, so the user has to wait before saving (but at least the save works properly, which is better than saving early but having an incomplete session). Should I do that for now?
#9 Updated by Chris Cannam about 6 years ago
At this point the easiest solution to that (although an annoyingly time-consuming one for the user) would be to make the save options only become available after analysis has completed
I took a slightly different approach -- you can ask to save but (after it's asked for the filename, if necessary) it will pop up a dialog telling you you have to wait. The save happens after analysis is complete, or you can cancel through the dialog.
This is in 2a2fd6eb8fa8, please test.