Feature #975

default session name

Added by Matthias Mauch over 5 years ago. Updated 20 days ago.

Status:ClosedStart date:2014-06-12
Priority:NormalDue date:
Assignee:Matthias Mauch% Done:

50%

Category:-
Target version:-

Description

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.

History

#1 Updated by Chris Cannam over 5 years ago

  • Assignee set to Chris Cannam

#2 Updated by Matthias Mauch over 5 years ago

I'm relieved the Assignee was set to Chris... I was just looking into this, with mixed results.

#3 Updated by Chris Cannam over 5 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

dialog.selectFile("thing.ton");

to 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.

#4 Updated by Chris Cannam over 5 years ago

  • Assignee changed from Chris Cannam to Matthias Mauch

#5 Updated by Matthias Mauch over 5 years ago

  • % Done changed from 0 to 50

For now I've added an option that saves in the same directory as the audio file.

Accessible from file menu (but it doesn't say exactly what the file name is) or Ctrl-Alt-S.

#6 Updated by Chris Cannam over 5 years ago

That could be OK -- except for some reason the menu option is currently always greyed out for me.

#7 Updated by Chris Cannam over 5 years ago

... and I notice Save Session As is always available even when no session is present. Looking into it.

#8 Updated by Chris Cannam over 5 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 over 5 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.

#10 Updated by Matthias Mauch over 5 years ago

This is in 2a2fd6eb8fa8, please test.

Works for me.

#11 Updated by Chris Cannam 20 days ago

  • Status changed from New to Closed

Also available in: Atom PDF