try to reduce number of moveToThread warnings
[mussa.git] / qui / MussaWindow.cpp
index 11eb02f4ac21392e71466adec05ad26263902b05..2342ee783fbfc75bb06673923f5eed26ef3c69eb 100644 (file)
@@ -35,14 +35,12 @@ using namespace std;
 MussaWindow::MussaWindow(MussaRef analysis_, QWidget *parent) :
   QMainWindow(parent),
   analysis(analysis_),
-  default_dir(new QDir(QDir::home().absolutePath())),
   motif_editor(0),
-  setup_analysis_dialog(new MussaSetupDialog(this)),
-  subanalysis_window(new SubanalysisWindow(analysis)),
-  browser(new SequenceBrowserWidget(default_dir, this)),  
-  mussaViewTB(new QToolBar("Path Views")),
-  zoom(new ZoomWidget),
-  threshold(new ThresholdWidget),
+  setup_analysis_dialog(0),
+  browser(0),
+  mussaViewTB(0),
+  zoom(0),
+  threshold(0),
   progress_dialog(0),
   aboutAction(0),
   closeAction(0),
@@ -62,14 +60,14 @@ MussaWindow::MussaWindow(MussaRef analysis_, QWidget *parent) :
   viewMussaAlignmentAction(0),
   manualAssistant(0)
 {
+  setupWidgets();
   setupActions();
-  setupMainMenu();
   setupAssistant();
+  setupMainMenu();
+  
+  setWindowIcon(QIcon(":/icons/mussa.png"));
+  default_dir.reset(new QDir(QDir::home().absolutePath()));
 
-  //This next setWhatsThis function prevents
-  // a segfault when using WhatsThis feature with 
-  // opengl widget.
-  //scene->setWhatsThis(tr("Mussa in OpenGL!"));
   setCentralWidget(browser);
   // well updatePosition isn't quite right as we really just need
   // to call update()
@@ -77,19 +75,11 @@ MussaWindow::MussaWindow(MussaRef analysis_, QWidget *parent) :
   connect(this, SIGNAL(changedMotifs()), this, SLOT(updateAnnotations()));
   connect(browser, SIGNAL(basepairsCopied(size_t)), 
           this, SLOT(showBasePairsCopied(size_t)));
-
-  //mussaViewTB->addAction(toggleMotifsAction);
-  mussaViewTB->addWidget(zoom);
-  
   connect(zoom, SIGNAL(valueChanged(double)), 
           browser, SLOT(setZoom(double)));
-  
-  // threshold range is set in updateAnalysis
-  
-  //scene->setClipPlane(20);
-  // FIXME: for when we get the paths drawn at the appropriate depth
-  //connect(threshold, SIGNAL(thresholdChanged(int)),
-  //        this, SLOT(setClipPlane(int)));
+  mussaViewTB->addWidget(zoom);
+
+  // threshold range is set in updateAnalysis  
   connect(threshold, SIGNAL(thresholdChanged(int)),
           this, SLOT(setSoftThreshold(int)));
   mussaViewTB->addWidget(threshold);
@@ -97,6 +87,7 @@ MussaWindow::MussaWindow(MussaRef analysis_, QWidget *parent) :
   addToolBar(mussaViewTB);
 
   statusBar()->showMessage("Welcome to mussa", 2000);
+
   // FIXME: we should start refactoring the connect call to updateAnalysis or something
   if (analysis) {
     connect(analysis.get(), SIGNAL(progress(const QString&, int, int)),
@@ -178,7 +169,7 @@ void MussaWindow::setupActions()
   mussaManualAssistantAction = new QAction(tr("Mussagl Manual..."), this);
   mussaManualAssistantAction->setIcon(QIcon(":/icons/contents.png"));
   connect(mussaManualAssistantAction, SIGNAL(triggered()),
-         this, SLOT(showManual()));
+               this, SLOT(showManual()));
 
   newMussaWindowAction = new QAction(tr("&New Mussa Window"), this);
   newMussaWindowAction->setStatusTip("open another mussa window to allow comparing results");
@@ -280,6 +271,16 @@ void MussaWindow::setupMainMenu()
   }
 }
 
+void MussaWindow::setupWidgets()
+{
+  setup_analysis_dialog = new MussaSetupDialog;
+  subanalysis_window.reset(new SubanalysisWindow(analysis));
+  browser = new SequenceBrowserWidget(default_dir);
+  mussaViewTB = new QToolBar("Path Views", this);
+  zoom = new ZoomWidget(mussaViewTB);
+  threshold = new ThresholdWidget(mussaViewTB);
+}
+
 void MussaWindow::setupAssistant()
 {
 #if defined(QT_QTASSISTANT_FOUND)