localize the code for updating the MussaWindow title.
statusBar()->showMessage("Welcome to mussa", 2000);
connect(analysis, SIGNAL(progress(const std::string&, int, int)),
this, SLOT(updateProgress(const std::string&, int, int)));
statusBar()->showMessage("Welcome to mussa", 2000);
connect(analysis, SIGNAL(progress(const std::string&, int, int)),
this, SLOT(updateProgress(const std::string&, int, int)));
clear();
delete analysis;
analysis = new_analysis;
clear();
delete analysis;
analysis = new_analysis;
- setWindowTitle(analysis->get_name().c_str());
m->load_mupa_file(converted_path);
m->analyze();
setAnalysis(m);
m->load_mupa_file(converted_path);
m->analyze();
setAnalysis(m);
- setWindowTitle(converted_path.native_file_string().c_str());
// grab the path ignoring the mupa file portion
default_dir = converted_path.branch_path();
} catch (mussa_load_error e) {
// 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);
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);
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();
}
win->default_dir = converted_path.branch_path();
win->show();
}
}
qApp->processEvents();
}
}
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());
+ }
+ }
+}
void saveAnalysis();
//! save an analysis after prompting for new name
void saveAnalysisAs();
void saveAnalysis();
//! save an analysis after prompting for new name
void saveAnalysisAs();
+ //! try to conver the mussa analysis_path to a title
+ void updateTitle();
//\@}
//! \defgroup MotifHandling Handling of motif lists
//\@}
//! \defgroup MotifHandling Handling of motif lists