dont crash when loading a new analysis
[mussa.git] / qui / MussaWindow.hpp
1 #ifndef _MUSSAWINDOW_H_
2 #define _MUSSAWINDOW_H_
3
4 #include <list>
5
6 #include <QMainWindow>
7 #include <QPixmap>
8 #include <QSpinBox>
9 #include <QToolBar>
10
11 #include "qui/MussaAlignedWindow.hpp"
12 #include "qui/seqbrowser/SequenceBrowserWidget.hpp"
13 #include "qui/ThresholdWidget.hpp"
14
15 class QAction;
16 class QLabel;
17 class Mussa;
18
19 class MussaWindow : public QMainWindow
20 {
21   Q_OBJECT
22
23 public: 
24   MussaWindow(Mussa* analysis=0, QWidget *parent=0);
25
26 public slots:
27   //! display an about box, contemplating the politics of the author list
28   void about();
29
30   //! \defgroup AnalysisFunctions Components related to running analyses
31   //\@{
32   //! open a window to collect the information needed to create a new analysis
33   void createNewAnalysis();
34   //! launch a sub analysis
35   void createSubAnalysis();
36   //\@}
37
38   //! \defgroup MotifHandling Handling of motif lists
39   //\@{
40   //! load motifs
41   void loadMotifList();
42   void saveMotifList();
43   void toggleMotifs();
44   //\@}
45
46   //! load a mussa parameter file (which specifies an analysis to run)
47   void loadMupa();
48   //! load a previously run analysis
49   void loadSavedAnalysis();
50   //! set the soft threshold used by the Nway_Path algorithm
51   void setSoftThreshold(int thres);
52
53   void showMussaToolbar();
54
55   //! open new window showing our alignment
56   void viewMussaAlignment();
57   
58 protected:
59   Mussa *analysis;
60   std::list<MussaAlignedWindow *> aligned_windows;
61
62   // display our wonderful mussa output
63   SequenceBrowserWidget browser;
64   QToolBar mussaViewTB;
65   QSpinBox zoomBox;
66   ThresholdWidget threshold;
67   QLabel zoomLabel;
68
69   QAction *aboutAction;
70   QAction *closeAction;
71   QAction *createNewAnalysisAction;
72   QAction *createSubAnalysisAction;
73   QAction *loadMotifListAction;
74   QAction *loadMupaAction;
75   QAction *loadSavedAnalysisAction;
76   QAction *saveMotifListAction;
77   QAction *showMussaViewToolbarAction;
78   QAction *toggleMotifsAction;
79   QAction *saveBrowserPixmapAction;
80   QAction *whatsThisAction;
81   QAction *viewMussaAlignmentAction;
82
83   //! initialze the actions
84   void setupActions();
85   //! initialize this windows menu object
86   void setupMainMenu();
87   //! stub function to fill in QActions
88   void NotImplementedBox();
89   //! update the SequenceBrowser with our analysis
90   void updateAnalysis();
91   //! update the view of conserved windows
92   void updateLinks();
93 };
94
95 #endif