Added WhatsThis feature to Mussa.
[mussa.git] / qui / PathWindow.cxx
index 477270a90092f5b03394a32945dc6cb782e4e3d8..488a3f9db03740921624ff16da9bf379ae076578 100644 (file)
@@ -9,6 +9,7 @@
 #include <QStatusBar>
 #include <QString>
 #include <QToolBar>
+#include <QWhatsThis>
 
 #include "qui/PathScene.h"
 #include "qui/ThresholdWidget.h"
@@ -22,6 +23,10 @@ PathWindow::PathWindow(QWidget *) :
   setupMainMenu();
 
   scene = new PathScene(10000, 10, this);
+  //This next setWhatsThis function prevents
+  // a segfault when using WhatsThis feature with 
+  // opengl widget.
+  scene->setWhatsThis(tr("Mussa in OpenGL!"));
   setCentralWidget(scene);
 
   mussaViewTB = new QToolBar("Path Views");
@@ -90,9 +95,14 @@ void PathWindow::setupActions()
   toggleMotifsAction = new QAction(tr("Toggle Motifs"), this);
   connect(toggleMotifsAction, SIGNAL(triggered()), 
           this, SLOT(toggleMotifs()));
-
   toggleMotifsAction->setCheckable(true);
   toggleMotifsAction->setIcon(QIcon("icons/motif_icon.png"));
+  toggleMotifsAction->setWhatsThis(tr("Toggle motif annotations on/off\n\n"
+                                  "You can load motif annotations via "
+                                  "'File->Load Motif List' menu option."));
+
+  whatsThisAction = QWhatsThis::createAction(this);
+  whatsThisAction->setIcon(QIcon("icons/help.png"));
 }
 
 void PathWindow::setupMainMenu()
@@ -116,6 +126,8 @@ void PathWindow::setupMainMenu()
   newMenu->addAction(showMussaViewToolbarAction);
 
   newMenu = menuBar()->addMenu(tr("&Help"));
+  newMenu->addAction(whatsThisAction);
+  newMenu->addSeparator();
   newMenu->addAction(aboutAction);
 }