MussaAlignedWindow::MussaAlignedWindow(MussaRef m,
const set<int>& sel_paths,
+ SubanalysisWindowRef window,
QWidget *parent)
: QMainWindow(parent),
analysis(m),
+ subanalysis_window(window),
pick_align_menu(tr("Choose Alignment")),
view_align_menu(tr("View Alignment")),
zoom(0),
void MussaAlignedWindow::setupActions()
{
+ // more cut-n-paste from MussaWindow
+ createSubAnalysisAction = new QAction(tr("Add to Subanalysis"), this);
+ connect(createSubAnalysisAction, SIGNAL(triggered()),
+ this, SLOT(createSubAnalysis()));
+
//Save pixel map action
saveBrowserPixmapAction = new QAction(tr("Save to image..."), this);
connect(saveBrowserPixmapAction, (SIGNAL(triggered())),
newMenu = menuBar()->addMenu(tr("&Edit"));
newMenu->addAction(browser.getCopySelectedSequenceAsFastaAction());
+ newMenu->addAction(createSubAnalysisAction);
+
+ // add some extra features to the context menu
+ QMenu *popupMenu = browser.getPopupMenu();
+ if (popupMenu) {
+ popupMenu->addAction(createSubAnalysisAction);
+ }
}
void MussaAlignedWindow::setupAlignmentMenus()
}
}
+// FIXME: this is a cut-n-paste from MussaWindow, perhaps they should be refactored to
+// some shared place
+void MussaAlignedWindow::createSubAnalysis()
+{
+ list<SequenceLocation> result;
+ SequenceLocationModel& model = subanalysis_window->getModel();
+ browser.copySelectedTracksAsSeqLocation(result);
+ for(list<SequenceLocation>::iterator result_itor = result.begin();
+ result_itor != result.end();
+ ++result_itor)
+ {
+ model.push_back(*result_itor);
+ }
+
+ if (not subanalysis_window->isVisible()) {
+ subanalysis_window->show();
+ }
+}
+
void MussaAlignedWindow::setAlignment(int alignment_index)
{
if (selected_paths.size() > 0) {