diff main/main.cpp @ 145:dfaf4f9330b5

* minor usability fixes
author Chris Cannam
date Fri, 18 May 2007 16:47:38 +0000
parents c3114dffdff4
children 33280c031d19
line wrap: on
line diff
--- a/main/main.cpp	Fri May 11 11:22:06 2007 +0000
+++ b/main/main.cpp	Fri May 18 16:47:38 2007 +0000
@@ -278,6 +278,7 @@
 
     bool haveSession = false;
     bool haveMainModel = false;
+    bool havePriorCommandLineModel = false;
 
     for (QStringList::iterator i = args.begin(); i != args.end(); ++i) {
 
@@ -308,9 +309,18 @@
         if (status != MainWindow::FileOpenSucceeded) {
             if (!haveMainModel) {
                 status = gui.openSomeFile(path, MainWindow::ReplaceMainModel);
-                if (status == MainWindow::FileOpenSucceeded) haveMainModel = true;
+                if (status == MainWindow::FileOpenSucceeded) {
+                    haveMainModel = true;
+                }
             } else {
-                status = gui.openSomeFile(path, MainWindow::CreateAdditionalModel);
+                if (haveSession && !havePriorCommandLineModel) {
+                    status = gui.openSomeFile(path, MainWindow::AskUser);
+                    if (status == MainWindow::FileOpenSucceeded) {
+                        havePriorCommandLineModel = true;
+                    }
+                } else {
+                    status = gui.openSomeFile(path, MainWindow::CreateAdditionalModel);
+                }
             }
         }
         if (status == MainWindow::FileOpenFailed) {