MussaWindow::MussaWindow(MussaRef analysis_, QWidget *parent) :
QMainWindow(parent),
analysis(analysis_),
- default_dir(QDir::home().absolutePath().toStdString(), fs::native),
+ default_dir(QDir::home().absolutePath()),
motif_editor(0),
setup_analysis_dialog(new MussaSetupDialog(this)),
subanalysis_window(new SubanalysisWindow(analysis)),
std::auto_ptr<QFileDialog> dialog(new QFileDialog(this));
dialog->setAcceptMode(QFileDialog::AcceptSave);
dialog->setFileMode(QFileDialog::AnyFile);
- dialog->setDirectory(QDir(default_dir.native_directory_string().c_str()));
+ dialog->setDirectory(default_dir);
QStringList fileNames;
if (not dialog->exec()) {
return;
}
analysis->save(save_path);
- default_dir = (save_path / "..").normalize();
+ fs::path normalized_path = (save_path / "..").normalize();
+ default_dir = normalized_path.native_directory_string().c_str();
}
bool MussaWindow::isClearingAnalysisSafe()
{
QString caption("Mussa Load Motifs");
QString filter("Motif list(*.txt *.mtl)");
- QDir default_qdir(default_dir.native_directory_string().c_str());
QString path = QFileDialog::getOpenFileName(this,
caption,
- default_qdir.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();
+ default_dir = converted_path.branch_path().native_directory_string().c_str();
emit changedMotifs();
} catch (runtime_error e) {
QString msg("Unable to load ");
{
QString caption("Mussa Save Motifs");
QString filter("Motif list(*.txt *.mtl)");
- QDir default_qdir(default_dir.native_directory_string().c_str());
QString path = QFileDialog::getSaveFileName(this,
caption,
- default_qdir.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();
+ default_dir = converted_path.branch_path().native_directory_string().c_str();
} catch (runtime_error e) {
QString msg("Unable to save ");
msg += path;
{
QString caption("Load a mussa parameter file");
QString filter("Mussa Parameters (*.mupa)");
- QDir default_qdir(QDir(default_dir.native_directory_string().c_str()));
-
QString mupa_path = QFileDialog::getOpenFileName(
this,
caption,
- default_qdir.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();
+ default_dir = converted_path.branch_path().native_directory_string().c_str();
} catch (mussa_load_error e) {
QString msg("Unable to load ");
msg += mupa_path;
void MussaWindow::loadSavedAnalysis()
{
- QDir default_qdir(QDir(default_dir.native_directory_string().c_str()));
QString caption("Load a previously run analysis");
QString muway_dir = QFileDialog::getExistingDirectory(
this,
caption,
- default_qdir.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();
+ default_dir = converted_path.branch_path().native_directory_string().c_str();
} else {
MussaWindow *win = new MussaWindow(m);
updateTitle();
- win->default_dir = converted_path.branch_path();
+ win->default_dir = converted_path.branch_path().native_directory_string().c_str();
win->show();
}
} catch (mussa_load_error e) {