Mercurial > hg > sonic-visualiser
changeset 290:8e13520c9078
* Much more sensible pane layouts, etc., when loading RDF; also offer
choice of adding to current session or starting new session if RDF
references audio (needs some refinement)
author | Chris Cannam |
---|---|
date | Fri, 28 Nov 2008 15:45:20 +0000 |
parents | ee96e37a3cbb |
children | f262f283a655 |
files | main/MainWindow.cpp main/MainWindow.h |
diffstat | 2 files changed, 19 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/main/MainWindow.cpp Fri Nov 21 18:03:14 2008 +0000 +++ b/main/MainWindow.cpp Fri Nov 28 15:45:20 2008 +0000 @@ -2719,6 +2719,23 @@ return false; } +bool +MainWindow::shouldCreateNewSessionForRDFAudio() +{ + QMessageBox mb; + mb.setWindowTitle("Open as new session?"); + mb.setText("<b>RDF refers to audio files</b><p>This RDF document refers to one or more audio files.<br>Do you want to load it as a new session, or as a set of additional panes in the existing session?"); + QPushButton *a = mb.addButton(tr("Create new session"), QMessageBox::AcceptRole); + QPushButton *b = mb.addButton(tr("Add to current session"), QMessageBox::RejectRole); + mb.setDefaultButton(a); + mb.exec(); + if (mb.clickedButton() == a) { + return true; + } else { + return false; + } +} + void MainWindow::saveSession() {
--- a/main/MainWindow.h Fri Nov 21 18:03:14 2008 +0000 +++ b/main/MainWindow.h Fri Nov 28 15:45:20 2008 +0000 @@ -260,6 +260,8 @@ virtual bool checkSaveModified(); virtual void updateVisibleRangeDisplay(Pane *p) const; + + virtual bool shouldCreateNewSessionForRDFAudio(); virtual void connectLayerEditDialog(ModelDataTableDialog *); };