1 #include "qui/PathWindow.h"
13 #include "qui/PathScene.h"
14 #include "qui/ThresholdWidget.h"
18 PathWindow::PathWindow(QWidget *) :
19 closeAction(0) // initialize one of the pointers to null as a saftey flag
24 scene = new PathScene(10000, 10, this);
25 setCentralWidget(scene);
27 mussaViewTB = new QToolBar("Path Views");
28 mussaViewTB->addAction(toggleMotifsAction);
30 ThresholdWidget *threshold = new ThresholdWidget;
31 threshold->setRange(21, 30);
32 scene->setClipPlane(21);
33 connect(threshold, SIGNAL(thresholdChanged(int)),
34 scene, SLOT(setClipPlane(int)));
35 mussaViewTB->addWidget(threshold);
36 addToolBar(mussaViewTB);
38 statusBar()->showMessage("Welcome to mussa", 2000);
41 void PathWindow::setupActions()
43 // we really don't want to run this more than once.
44 assert (closeAction == 0);
46 // the ever popular about box
47 aboutAction = new QAction(tr("&About"), this);
48 connect(aboutAction, SIGNAL(triggered()), this, SLOT(about()));
51 closeAction = new QAction(tr("&Close"), this);
52 closeAction->setStatusTip(tr("Close this window"));
53 connect(closeAction, SIGNAL(triggered()), this, SLOT(close()));
55 createNewAnalysisAction = new QAction(tr("Define Analysis"), this);
56 connect(createNewAnalysisAction, SIGNAL(triggered()),
57 this, SLOT(createNewAnalysis()));
59 createSubAnalysisAction = new QAction(tr("Define SubAnalysis"), this);
60 connect(createSubAnalysisAction, SIGNAL(triggered()),
61 this, SLOT(createSubAnalysis()));
63 loadMotifListAction = new QAction(tr("Load Motif List"), this);
64 connect(loadMotifListAction, SIGNAL(triggered()),
65 this, SLOT(loadMotifList()));
67 loadMupaAction = new QAction(tr("Load Mussa Parameters"), this);
68 connect(loadMupaAction, SIGNAL(triggered()),
69 this, SLOT(loadMupa()));
71 loadSavedAnalysisAction = new QAction(tr("Load &Analysis"), this);
72 connect(loadSavedAnalysisAction, SIGNAL(triggered()),
73 this, SLOT(loadSavedAnalysis()));
75 saveMotifListAction = new QAction(tr("Save Motifs"), this);
76 connect(saveMotifListAction, SIGNAL(triggered()),
77 this, SLOT(saveMotifList()));
79 showMussaViewToolbarAction = new QAction(tr("Show Toolbar"), this);
80 connect(showMussaViewToolbarAction, SIGNAL(triggered()),
81 this, SLOT(showMussaToolbar()));
83 toggleMotifsAction = new QAction(tr("Toggle Motifs"), this);
84 connect(toggleMotifsAction, SIGNAL(triggered()),
85 this, SLOT(toggleMotifs()));
87 toggleMotifsAction->setCheckable(true);
88 toggleMotifsAction->setIcon(QIcon("icons/motif_icon.png"));
91 void PathWindow::setupMainMenu()
93 // we need to run setupActions first
94 assert (closeAction != 0);
97 newMenu = menuBar()->addMenu(tr("&File"));
98 newMenu->addAction(createNewAnalysisAction);
99 newMenu->addAction(loadMupaAction);
100 newMenu->addAction(loadSavedAnalysisAction);
101 newMenu->addAction(createSubAnalysisAction);
102 newMenu->addSeparator();
103 newMenu->addAction(loadMotifListAction);
104 newMenu->addAction(saveMotifListAction);
105 newMenu->addSeparator();
106 newMenu->addAction(closeAction);
108 newMenu = menuBar()->addMenu(tr("&View"));
109 newMenu->addAction(showMussaViewToolbarAction);
111 newMenu = menuBar()->addMenu(tr("&Help"));
112 newMenu->addAction(aboutAction);
115 void PathWindow::about()
117 QMessageBox::about(this, tr("About mussa"),
118 tr("Welcome to Multiple Species Sequence Analysis\n"
119 "(c) 2005-2006 California Institute of Technology\n"
120 "Tristan De Buysscher, Diane Trout\n"));
123 void PathWindow::createNewAnalysis()
128 void PathWindow::createSubAnalysis()
133 void PathWindow::loadMotifList()
138 void PathWindow::loadMupa()
140 QString caption("Load a mussa parameter file");
141 QString filter("Mussa Parameters (*.mupa)");
142 QString mupa_path = QFileDialog::getOpenFileName(this,
146 mussaAnalysis.load_mupa_file(mupa_path.toStdString());
149 void PathWindow::loadSavedAnalysis()
154 void PathWindow::saveMotifList()
159 void PathWindow::showMussaToolbar()
161 std::clog << "isVis?" << mussaViewTB->isVisible() <<std::endl;
163 std::clog << "isVis?" << mussaViewTB->isVisible() <<std::endl;
166 void PathWindow::toggleMotifs()
171 void PathWindow::NotImplementedBox()
173 QMessageBox::warning(this, QObject::tr("mussa"), QObject::tr("Not implemented yet"));