# HG changeset patch # User Chris Cannam # Date 1227887120 0 # Node ID 8e13520c907888d0659b01900e8d1793115aba4e # Parent ee96e37a3cbbf7a3407ad75082f150a0669a3a89 * 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) diff -r ee96e37a3cbb -r 8e13520c9078 main/MainWindow.cpp --- 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("RDF refers to audio files
This RDF document refers to one or more audio files.
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()
{
diff -r ee96e37a3cbb -r 8e13520c9078 main/MainWindow.h
--- 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 *);
};