1 #include "qui/PathWindow.h"
12 #include "qui/PathScene.h"
13 #include "qui/ThresholdWidget.h"
15 PathWindow::PathWindow(QWidget *) :
16 closeAction(0) // initialize one of the pointers to null as a saftey flag
21 scene = new PathScene(10000, 10, this);
22 setCentralWidget(scene);
24 mussaViewTB = new QToolBar("Path Views");
25 mussaViewTB->addAction(toggleMotifsAction);
27 ThresholdWidget *threshold = new ThresholdWidget;
28 threshold->setRange(21, 30);
29 scene->setClipPlane(21);
30 connect(threshold, SIGNAL(thresholdChanged(int)),
31 scene, SLOT(setClipPlane(int)));
32 mussaViewTB->addWidget(threshold);
33 addToolBar(mussaViewTB);
35 statusBar()->showMessage("Welcome to mussa", 2000);
38 void PathWindow::setupActions()
40 // we really don't want to run this more than once.
41 assert (closeAction == 0);
43 // the ever popular about box
44 aboutAction = new QAction(tr("&About"), this);
45 connect(aboutAction, SIGNAL(triggered()), this, SLOT(about()));
48 closeAction = new QAction(tr("&Close"), this);
49 closeAction->setStatusTip(tr("Close this window"));
50 connect(closeAction, SIGNAL(triggered()), this, SLOT(close()));
52 createNewAnalysisAction = new QAction(tr("Define Analysis"), this);
53 connect(createNewAnalysisAction, SIGNAL(triggered()),
54 this, SLOT(createNewAnalysis()));
56 createSubAnalysisAction = new QAction(tr("Define SubAnalysis"), this);
57 connect(createSubAnalysisAction, SIGNAL(triggered()),
58 this, SLOT(createSubAnalysis()));
60 loadMotifListAction = new QAction(tr("Load Motif List"), this);
61 connect(loadMotifListAction, SIGNAL(triggered()),
62 this, SLOT(loadMotifList()));
64 loadMupaAction = new QAction(tr("Load Mussa Parameters"), this);
65 connect(loadMupaAction, SIGNAL(triggered()),
66 this, SLOT(loadMupa()));
68 loadSavedAnalysisAction = new QAction(tr("Load &Analysis"), this);
69 connect(loadSavedAnalysisAction, SIGNAL(triggered()),
70 this, SLOT(loadSavedAnalysis()));
72 saveMotifListAction = new QAction(tr("Save Motifs"), this);
73 connect(saveMotifListAction, SIGNAL(triggered()),
74 this, SLOT(saveMotifList()));
76 toggleMotifsAction = new QAction(tr("Toggle Motifs"), this);
77 connect(toggleMotifsAction, SIGNAL(triggered()),
78 this, SLOT(toggleMotifs()));
81 void PathWindow::setupMainMenu()
83 // we need to run setupActions first
84 assert (closeAction != 0);
87 newMenu = menuBar()->addMenu(tr("&File"));
88 newMenu->addAction(createNewAnalysisAction);
89 newMenu->addAction(loadMupaAction);
90 newMenu->addAction(loadSavedAnalysisAction);
91 newMenu->addAction(createSubAnalysisAction);
92 newMenu->addSeparator();
93 newMenu->addAction(loadMotifListAction);
94 newMenu->addAction(saveMotifListAction);
95 newMenu->addSeparator();
96 newMenu->addAction(closeAction);
98 newMenu = menuBar()->addMenu(tr("&Help"));
99 newMenu->addAction(aboutAction);
102 void PathWindow::about()
104 QMessageBox::about(this, tr("About mussa"),
105 tr("Welcome to Multiple Species Sequence Analysis\n"
106 "(c) 2005-2006 California Institute of Technology\n"
107 "Tristan De Buysscher, Diane Trout\n"));
110 void PathWindow::createNewAnalysis()
115 void PathWindow::createSubAnalysis()
120 void PathWindow::loadMotifList()
125 void PathWindow::loadMupa()
127 QString caption("Load a mussa parameter file");
128 QString filter("Mussa Parameters (*.mupa)");
129 QString mupa_path = QFileDialog::getOpenFileName(this,
133 mussaAnalysis.load_mupa_file(mupa_path.toStdString());
136 void PathWindow::loadSavedAnalysis()
141 void PathWindow::saveMotifList()
146 void PathWindow::toggleMotifs()
151 void PathWindow::NotImplementedBox()
153 QMessageBox::warning(this, QObject::tr("mussa"), QObject::tr("Not implemented yet"));