statusBar()->showMessage("Welcome to mussa", 2000);
connect(analysis, SIGNAL(progress(const std::string&, int, int)),
this, SLOT(updateProgress(const std::string&, int, int)));
+ updateTitle();
updateAnalysis();
}
clear();
delete analysis;
analysis = new_analysis;
- setWindowTitle(analysis->get_name().c_str());
+ updateTitle();
updateAnalysis();
}
}
m->load_mupa_file(converted_path);
m->analyze();
setAnalysis(m);
- setWindowTitle(converted_path.native_file_string().c_str());
+ updateTitle();
// grab the path ignoring the mupa file portion
default_dir = converted_path.branch_path();
} catch (mussa_load_error e) {
if (analysis->empty()) {
// our current window is empty so load and replace.
setAnalysis(m);
- setWindowTitle(converted_path.native_file_string().c_str());
+ updateTitle();
default_dir = converted_path.branch_path();
} else {
MussaWindow *win = new MussaWindow(m);
- win->setWindowTitle(converted_path.native_file_string().c_str());
+ updateTitle();
win->default_dir = converted_path.branch_path();
win->show();
}
}
qApp->processEvents();
}
+
+void MussaWindow::updateTitle()
+{
+ if (analysis) {
+ fs::path analysis_path = analysis->get_analysis_path();
+ if (not analysis_path.empty()) {
+ setWindowTitle(analysis_path.native_file_string().c_str());
+ } else if (analysis->get_name().size() > 0) {
+ setWindowTitle(analysis->get_name().c_str());
+ }
+ }
+}