From: Diane Trout Date: Tue, 12 Sep 2006 23:54:19 +0000 (+0000) Subject: warn the user if we're going to replace an analysis X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=mussa.git;a=commitdiff_plain;h=e41b42b0f9b172c64926791cb87de4a39b8fd613 warn the user if we're going to replace an analysis 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. --- diff --git a/qui/MussaWindow.cpp b/qui/MussaWindow.cpp index 8d51ab5..8f87a1f 100644 --- a/qui/MussaWindow.cpp +++ b/qui/MussaWindow.cpp @@ -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)), diff --git a/qui/mussa_setup_dialog/MussaSetupDialog.cpp b/qui/mussa_setup_dialog/MussaSetupDialog.cpp index c4d5fbb..23bc3a9 100644 --- a/qui/mussa_setup_dialog/MussaSetupDialog.cpp +++ b/qui/mussa_setup_dialog/MussaSetupDialog.cpp @@ -33,7 +33,6 @@ void MussaSetupDialog::accept() void MussaSetupDialog::reject() { - std::cout << "Rejected\n"; done(0); }