Add window titles
[mussa.git] / qui / SubanalysisWindow.cpp
index 34ef9aa9b0b2dbe8b778d69bdd22b46d4a28abfe..1ecbcbca28d80b40c7f12b6b63e5c54507716e1e 100644 (file)
@@ -8,8 +8,9 @@
 #include <QHBoxLayout>
 #include <QGridLayout>
 
-SubanalysisWindow::SubanalysisWindow(QWidget *parent)
+SubanalysisWindow::SubanalysisWindow(MussaRef m, QWidget *parent)
   : QWidget(parent),
+    analysis(m),
     window(0),
     threshold(0),
     table(0),
@@ -56,6 +57,8 @@ SubanalysisWindow::SubanalysisWindow(QWidget *parent)
           this, SLOT(modelUpdated(const QModelIndex&, int, int)));
   connect(&model, SIGNAL(rowsRemoved(const QModelIndex&, int, int)), 
           this, SLOT(modelUpdated(const QModelIndex&, int, int)));
+          
+  updateTitle();        
 }
 
 SequenceLocationModel& SubanalysisWindow::getModel()
@@ -105,3 +108,12 @@ void SubanalysisWindow::modelUpdated(const QModelIndex&, int, int )
   // if the model is empty we shouldn't be able to click ok
   if (ok) ok->setEnabled(not model.empty());
 }
+
+void SubanalysisWindow::updateTitle()
+{
+  std::string title("Subanalysis: ");
+  if (analysis) {
+    title += analysis->get_title();
+  }
+  setWindowTitle(title.c_str());  
+}
\ No newline at end of file