1 #include "qui/PathWindow.h"
12 #include "qui/PathScene.h"
13 #include "qui/ThresholdWidget.h"
17 PathWindow::PathWindow(QWidget *) :
18 closeAction(0) // initialize one of the pointers to null as a saftey flag
23 scene = new PathScene(10000, 10, this);
24 setCentralWidget(scene);
26 mussaViewTB = new QToolBar("Path Views");
27 mussaViewTB->addAction(toggleMotifsAction);
29 ThresholdWidget *threshold = new ThresholdWidget;
30 threshold->setRange(21, 30);
31 scene->setClipPlane(21);
32 connect(threshold, SIGNAL(thresholdChanged(int)),
33 scene, SLOT(setClipPlane(int)));
34 mussaViewTB->addWidget(threshold);
35 addToolBar(mussaViewTB);
37 statusBar()->showMessage("Welcome to mussa", 2000);
40 void PathWindow::setupActions()
42 // we really don't want to run this more than once.
43 assert (closeAction == 0);
45 // the ever popular about box
46 aboutAction = new QAction(tr("&About"), this);
47 connect(aboutAction, SIGNAL(triggered()), this, SLOT(about()));
50 closeAction = new QAction(tr("&Close"), this);
51 closeAction->setStatusTip(tr("Close this window"));
52 connect(closeAction, SIGNAL(triggered()), this, SLOT(close()));
54 createNewAnalysisAction = new QAction(tr("Define Analysis"), this);
55 connect(createNewAnalysisAction, SIGNAL(triggered()),
56 this, SLOT(createNewAnalysis()));
58 createSubAnalysisAction = new QAction(tr("Define SubAnalysis"), this);
59 connect(createSubAnalysisAction, SIGNAL(triggered()),
60 this, SLOT(createSubAnalysis()));
62 loadMotifListAction = new QAction(tr("Load Motif List"), this);
63 connect(loadMotifListAction, SIGNAL(triggered()),
64 this, SLOT(loadMotifList()));
66 loadMupaAction = new QAction(tr("Load Mussa Parameters"), this);
67 connect(loadMupaAction, SIGNAL(triggered()),
68 this, SLOT(loadMupa()));
70 loadSavedAnalysisAction = new QAction(tr("Load &Analysis"), this);
71 connect(loadSavedAnalysisAction, SIGNAL(triggered()),
72 this, SLOT(loadSavedAnalysis()));
74 saveMotifListAction = new QAction(tr("Save Motifs"), this);
75 connect(saveMotifListAction, SIGNAL(triggered()),
76 this, SLOT(saveMotifList()));
78 showMussaViewToolbarAction = new QAction(tr("Show Toolbar"), this);
79 connect(showMussaViewToolbarAction, SIGNAL(triggered()),
80 this, SLOT(showMussaToolbar()));
82 toggleMotifsAction = new QAction(tr("Toggle Motifs"), this);
83 connect(toggleMotifsAction, SIGNAL(triggered()),
84 this, SLOT(toggleMotifs()));
87 void PathWindow::setupMainMenu()
89 // we need to run setupActions first
90 assert (closeAction != 0);
93 newMenu = menuBar()->addMenu(tr("&File"));
94 newMenu->addAction(createNewAnalysisAction);
95 newMenu->addAction(loadMupaAction);
96 newMenu->addAction(loadSavedAnalysisAction);
97 newMenu->addAction(createSubAnalysisAction);
98 newMenu->addSeparator();
99 newMenu->addAction(loadMotifListAction);
100 newMenu->addAction(saveMotifListAction);
101 newMenu->addSeparator();
102 newMenu->addAction(closeAction);
104 newMenu = menuBar()->addMenu(tr("&View"));
105 newMenu->addAction(showMussaViewToolbarAction);
107 newMenu = menuBar()->addMenu(tr("&Help"));
108 newMenu->addAction(aboutAction);
111 void PathWindow::about()
113 QMessageBox::about(this, tr("About mussa"),
114 tr("Welcome to Multiple Species Sequence Analysis\n"
115 "(c) 2005-2006 California Institute of Technology\n"
116 "Tristan De Buysscher, Diane Trout\n"));
119 void PathWindow::createNewAnalysis()
124 void PathWindow::createSubAnalysis()
129 void PathWindow::loadMotifList()
134 void PathWindow::loadMupa()
136 QString caption("Load a mussa parameter file");
137 QString filter("Mussa Parameters (*.mupa)");
138 QString mupa_path = QFileDialog::getOpenFileName(this,
142 mussaAnalysis.load_mupa_file(mupa_path.toStdString());
145 void PathWindow::loadSavedAnalysis()
150 void PathWindow::saveMotifList()
155 void PathWindow::showMussaToolbar()
157 std::clog << "isVis?" << mussaViewTB->isVisible() <<std::endl;
159 std::clog << "isVis?" << mussaViewTB->isVisible() <<std::endl;
162 void PathWindow::toggleMotifs()
167 void PathWindow::NotImplementedBox()
169 QMessageBox::warning(this, QObject::tr("mussa"), QObject::tr("Not implemented yet"));