warn the user if we're going to replace an analysis
authorDiane Trout <diane@caltech.edu>
Tue, 12 Sep 2006 23:54:19 +0000 (23:54 +0000)
committerDiane Trout <diane@caltech.edu>
Tue, 12 Sep 2006 23:54:19 +0000 (23:54 +0000)
though users would prefer a new window when they pick load, that causes
problems because I don't have an easy way for the new window to be
responsible for the Mussa::analyze() call.

So currently the create new window mode will occasionally cause mussa to
hang. As a result I loading will replace the current window.

qui/MussaWindow.cpp
qui/mussa_setup_dialog/MussaSetupDialog.cpp

index 8d51ab542d208b2d6b473a1adeaeab5225e9ee79..8f87a1ffa13f1fdd6acab9f057342b79c640744b 100644 (file)
@@ -297,12 +297,14 @@ void MussaWindow::clear()
 void MussaWindow::createNewAnalysis()
 {
   try {
+    // ideally we should open a new window if there's an analysis
+    // but this should work for the moment.
+    if (not isClearingAnalysisSafe()) return;
+
     if (setup_analysis_dialog.exec()) {
       Mussa *m = 0;
       m = setup_analysis_dialog.getMussa();
       setAnalysis(m);
-    } else {
-      std::cout << "New mussa exp. aborted!\n";
     }
   } catch(mussa_error e) {
     QString msg(e.what());
@@ -459,6 +461,10 @@ void MussaWindow::loadMupa()
     return;
   // try to load safely
   try {
+    // ideally we should open a new window if there's an analysis
+    // but this should work for the moment.
+    if (not isClearingAnalysisSafe()) return;
+
     Mussa *m = new Mussa;
     fs::path converted_path(mupa_path.toStdString(), fs::native);
     connect(m, SIGNAL(progress(const std::string&, int, int)),
@@ -488,6 +494,10 @@ void MussaWindow::loadSavedAnalysis()
     return;
   // try to safely load
   try {
+    // ideally we should open a new window if there's an analysis
+    // but this should work for the moment.
+    if (not isClearingAnalysisSafe()) return;
+
     Mussa *m = new Mussa;
     fs::path converted_path(muway_dir.toStdString(), fs::native);
     connect(m, SIGNAL(progress(const std::string&, int, int)),
index c4d5fbb774f7e3145a8a46e8ec5a3466f00b1c48..23bc3a9456760efdff1a6b6b0607081a59675665 100644 (file)
@@ -33,7 +33,6 @@ void MussaSetupDialog::accept()
 
 void MussaSetupDialog::reject()
 {
-  std::cout << "Rejected\n";
   done(0);
 }