From 26f330047648a71e8753dfbf97a02c944cd6492f Mon Sep 17 00:00:00 2001 From: Diane Trout Date: Sat, 16 Sep 2006 00:12:53 +0000 Subject: [PATCH] Load saved analysis can open new windows ticket:105 this makes mussa behave a bit more like a traditional gui app, in that saved analyses will replace empty windows, but will create new windows if there's already something loaded. Also new windows will copy the default_dir from the parent window. --- qui/MussaWindow.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/qui/MussaWindow.cpp b/qui/MussaWindow.cpp index f22fe1d..47c9111 100644 --- a/qui/MussaWindow.cpp +++ b/qui/MussaWindow.cpp @@ -517,9 +517,17 @@ void MussaWindow::loadSavedAnalysis() this, SLOT(updateProgress(const std::string&, int, int))); m->load(converted_path); // only switch mussas if we loaded without error - setAnalysis(m); - setWindowTitle(converted_path.native_file_string().c_str()); - default_dir = converted_path.branch_path(); + if (analysis->empty()) { + // our current window is empty so load and replace. + setAnalysis(m); + setWindowTitle(converted_path.native_file_string().c_str()); + default_dir = converted_path.branch_path(); + } else { + MussaWindow *win = new MussaWindow(m); + win->setWindowTitle(converted_path.native_file_string().c_str()); + win->default_dir = converted_path.branch_path(); + win->show(); + } } catch (mussa_load_error e) { QString msg("Unable to load "); msg += muway_dir; @@ -534,6 +542,7 @@ void MussaWindow::newMussaWindow() { Mussa *a = new Mussa(); MussaWindow *win = new MussaWindow(a); + win->default_dir = default_dir; win->show(); } -- 2.30.2