void MussaWindow::loadMotifList()
{
- QString caption("Load a motif list");
+ 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,
msg += path;
msg += "\n";
msg += e.what();
- QMessageBox::warning(this, "Load Motifs", msg);
+ QMessageBox::warning(this, caption, msg);
}
- assert (analysis != 0);
}
void MussaWindow::saveMotifList()
{
- NotImplementedBox();
-}
+ 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(),
+ filter);
+ // user hit cancel?
+ if (path.isNull())
+ return;
+ // try to load safely
+ try {
+ fs::path converted_path(path.toStdString(), fs::native);
+ analysis->save_motifs(converted_path);
+ default_dir = converted_path.branch_path();
+ } catch (runtime_error e) {
+ QString msg("Unable to save ");
+ msg += path;
+ msg += "\n";
+ msg += e.what();
+ QMessageBox::warning(this, caption, msg);
+ }}
void MussaWindow::loadMupa()
{