MussaWindow::MussaWindow(MussaRef analysis_, QWidget *parent) :
QMainWindow(parent),
analysis(analysis_),
- default_dir(QDir::home().absolutePath()),
+ default_dir(new QDir(QDir::home().absolutePath())),
motif_editor(0),
setup_analysis_dialog(new MussaSetupDialog(this)),
subanalysis_window(new SubanalysisWindow(analysis)),
- browser(new SequenceBrowserWidget(this)),
+ browser(new SequenceBrowserWidget(default_dir, this)),
mussaViewTB(new QToolBar("Path Views")),
zoom(new ZoomWidget),
threshold(new ThresholdWidget),
std::auto_ptr<QFileDialog> dialog(new QFileDialog(this));
dialog->setAcceptMode(QFileDialog::AcceptSave);
dialog->setFileMode(QFileDialog::AnyFile);
- dialog->setDirectory(default_dir);
+ dialog->setDirectory(*default_dir);
QStringList fileNames;
if (not dialog->exec()) {
}
analysis->save(save_path);
fs::path normalized_path = (save_path / "..").normalize();
- default_dir = normalized_path.native_directory_string().c_str();
+ default_dir->setPath(normalized_path.native_directory_string().c_str());
}
bool MussaWindow::isClearingAnalysisSafe()
QString filter("Motif list(*.txt *.mtl)");
QString path = QFileDialog::getOpenFileName(this,
caption,
- default_dir.absolutePath(),
+ default_dir->absolutePath(),
filter);
// user hit cancel?
if (path.isNull())
try {
fs::path converted_path(path.toStdString(), fs::native);
analysis->load_motifs(converted_path);
- default_dir = converted_path.branch_path().native_directory_string().c_str();
+ default_dir->setPath(converted_path.branch_path().native_directory_string().c_str());
emit changedMotifs();
} catch (runtime_error e) {
QString msg("Unable to load ");
QString filter("Motif list(*.txt *.mtl)");
QString path = QFileDialog::getSaveFileName(this,
caption,
- default_dir.absolutePath(),
+ default_dir->absolutePath(),
filter);
// user hit cancel?
if (path.isNull())
try {
fs::path converted_path(path.toStdString(), fs::native);
analysis->save_motifs(converted_path);
- default_dir = converted_path.branch_path().native_directory_string().c_str();
+ default_dir->setPath(converted_path.branch_path().native_directory_string().c_str());
} catch (runtime_error e) {
QString msg("Unable to save ");
msg += path;
QString mupa_path = QFileDialog::getOpenFileName(
this,
caption,
- default_dir.absolutePath(),
+ default_dir->absolutePath(),
filter
);
// user hit cancel?
setAnalysis(m);
updateTitle();
// grab the path ignoring the mupa file portion
- default_dir = converted_path.branch_path().native_directory_string().c_str();
+ default_dir->setPath(converted_path.branch_path().native_directory_string().c_str());
} catch (mussa_load_error e) {
QString msg("Unable to load ");
msg += mupa_path;
QString muway_dir = QFileDialog::getExistingDirectory(
this,
caption,
- default_dir.absolutePath()
+ default_dir->absolutePath()
);
// user hit cancel?
if (muway_dir.isNull())
// our current window is empty so load and replace.
setAnalysis(m);
updateTitle();
- default_dir = converted_path.branch_path().native_directory_string().c_str();
+ default_dir->setPath(converted_path.branch_path().native_directory_string().c_str());
} else {
MussaWindow *win = new MussaWindow(m);
updateTitle();
- win->default_dir = converted_path.branch_path().native_directory_string().c_str();
+ win->default_dir->setPath(converted_path.branch_path().native_directory_string().c_str());
win->show();
}
} catch (mussa_load_error e) {
"first"));
} else {
MussaAlignedWindowRef ma_win(
- new MussaAlignedWindow(analysis, selected_paths, subanalysis_window)
+ new MussaAlignedWindow(analysis, default_dir, selected_paths, subanalysis_window)
);
aligned_windows.push_back(ma_win);