MussaWindow::MussaWindow(Mussa *analysis_, QWidget *parent) :
QMainWindow(parent),
analysis(analysis_),
+ motif_editor(0),
browser(this),
mussaViewTB("Path Views"),
zoomBox(),
// opengl widget.
//scene->setWhatsThis(tr("Mussa in OpenGL!"));
setCentralWidget(&browser);
+ // well updatePosition isn't quite right as we really just need
+ // to call update()
+ connect(this, SIGNAL(changedAnnotations()), &browser, SLOT(update()));
mussaViewTB.addAction(toggleMotifsAction);
connect(createSubAnalysisAction, SIGNAL(triggered()),
this, SLOT(createSubAnalysis()));
+ editMotifsAction = new QAction(tr("Edit Motifs"), this);;
+ connect(editMotifsAction, SIGNAL(triggered()), this, SLOT(editMotifs()));
+
loadMotifListAction = new QAction(tr("Load Motif List"), this);
connect(loadMotifListAction, SIGNAL(triggered()),
this, SLOT(loadMotifList()));
newMenu->addAction(closeAction);
newMenu = menuBar()->addMenu(tr("&View"));
+ newMenu->addAction(editMotifsAction);
newMenu->addAction(viewMussaAlignmentAction);
newMenu->addAction(showMussaViewToolbarAction);
NotImplementedBox();
}
+void MussaWindow::editMotifs()
+{
+ if (motif_editor != 0) {
+ motif_editor->hide();
+ delete motif_editor;
+ }
+ motif_editor = new MotifEditor(analysis);
+ connect(motif_editor, SIGNAL(changedMotifs()),
+ this, SLOT(updateAnnotations()));
+ motif_editor->show();
+}
void MussaWindow::loadMotifList()
{
QObject::tr("you should probably select some paths "
"first"));
} else {
- MussaAlignedWindow *ma_win = new MussaAlignedWindow(*analysis, selected_paths);
+ MussaAlignedWindow *ma_win = new MussaAlignedWindow(*analysis,
+ selected_paths);
+ connect(this, SIGNAL(changedAnnotations()),
+ ma_win, SLOT(update()));
aligned_windows.push_back(ma_win);
ma_win->show();
}
zoomBox.setValue(browser.zoom());
}
+void MussaWindow::updateAnnotations()
+{
+ // motifs were changed in the sequences by
+ // Mussa::update_sequences_motifs
+ emit changedAnnotations();
+ browser.update();
+}
+
void MussaWindow::updateLinks()
{
browser.clear_links();