define window for showing a mussa alignment
[mussa.git] / qui / MussaWindow.cpp
index f8945c4459d9ae391d60a7655972c629c255de44..8696913d407c88b73c96d7edafe7cc5da7bef166 100644 (file)
@@ -11,6 +11,7 @@
 #include <QWhatsThis>
 
 #include "qui/MussaWindow.hpp"
+#include "qui/MussaAlignedWindow.hpp"
 #include "mussa_exceptions.hpp"
 
 #include <iostream>
@@ -124,14 +125,22 @@ void MussaWindow::setupActions()
                                   "You can load motif annotations via "
                                   "'File->Load Motif List' menu option."));
 
-  whatsThisAction = QWhatsThis::createAction(this);
-  whatsThisAction->setIcon(QIcon("icons/help.png"));
-
   //Save pixel map action
   saveBrowserPixmapAction = new QAction(tr("Save to image..."), this);
   connect(saveBrowserPixmapAction, (SIGNAL(triggered())),
          &browser, SLOT(promptSaveBrowserPixmap()));
   saveBrowserPixmapAction->setIcon(QIcon("icons/image2.png"));
+
+  viewMussaAlignmentAction = new QAction(tr("View mussa alignment"), this);
+  connect(viewMussaAlignmentAction, SIGNAL(triggered()),
+          this, SLOT(viewMussaAlignment() ));
+  viewMussaAlignmentAction->setWhatsThis(tr("Create a zoomed in window "
+                                            "showing alignment of the seqcomp "
+                                            "defined paths"));
+
+  whatsThisAction = QWhatsThis::createAction(this);
+  whatsThisAction->setIcon(QIcon("icons/help.png"));
+
 }
 
 void MussaWindow::setupMainMenu()
@@ -154,6 +163,7 @@ void MussaWindow::setupMainMenu()
   newMenu->addAction(closeAction);
 
   newMenu = menuBar()->addMenu(tr("&View"));
+  newMenu->addAction(viewMussaAlignmentAction);
   newMenu->addAction(showMussaViewToolbarAction);
 
   newMenu = menuBar()->addMenu(tr("&Help"));
@@ -295,6 +305,20 @@ void MussaWindow::NotImplementedBox()
   QMessageBox::warning(this, QObject::tr("mussa"), QObject::tr("Not implemented yet"));
 }      
 
+void MussaWindow::viewMussaAlignment()
+{
+  const set<int>& selected_paths = browser.selectedPaths();
+  if (selected_paths.size() == 0 ) {
+    QMessageBox::warning(this, 
+                         QObject::tr("mussa"),
+                         QObject::tr("you should probably select some paths "
+                                     "first"));
+  } else {
+    QWidget *ma_win = new MussaAlignedWindow(*analysis, selected_paths);
+    ma_win->show();
+  }
+}
+                        
 void MussaWindow::updateAnalysis()
 {
   cout << "analysis updated" << endl;