Fix initialization of QtAssistant
[mussa.git] / qui / MussaWindow.hpp
1 #ifndef _MUSSAWINDOW_H_
2 #define _MUSSAWINDOW_H_
3
4 #include <list>
5 #include <boost/shared_ptr.hpp>
6
7 #include <QMainWindow>
8 #include <QPixmap>
9 #include <QProgressDialog>
10 #include <QSpinBox>
11 #include <QToolBar>
12
13 #include "qui/MussaAlignedWindow.hpp"
14 #include "qui/motif_editor/MotifEditor.hpp"
15 #include "qui/mussa_setup_dialog/MussaSetupDialog.hpp"
16 #include "qui/seqbrowser/SequenceBrowserWidget.hpp"
17 #include "qui/SubanalysisWindow.hpp"
18 #include "qui/ThresholdWidget.hpp"
19 #include "qui/ZoomWidget.hpp"
20
21
22 class QAction;
23 class QLabel;
24 class QStringList;
25 class Mussa;
26 class QAssistantClient;
27
28 class MussaWindow : public QMainWindow
29 {
30   Q_OBJECT
31
32 public: 
33   MussaWindow(MussaRef analysis=0, QWidget *parent=0);
34
35   //! reset any attached window
36   void clear();
37
38   //! switch to a new analysis
39   void setAnalysis(MussaRef new_analysis);
40
41   //! ask the user what to do if we're going to lose data
42   //! returns true if getting rid of this analysis is safe
43   bool isClearingAnalysisSafe();
44
45 public slots:
46   //! display an about box, contemplating the politics of the author list
47   void about();
48
49   //! \defgroup AnalysisFunctions Components related to running analyses
50   //\@{
51   //! open a window to collect the information needed to create a new analysis
52   void createNewAnalysis();
53   //! launch a sub analysis
54   void createSubAnalysis();
55   //! save an analysis
56   void saveAnalysis();
57   //! save an analysis after prompting for new name
58   void saveAnalysisAs();
59   //! try to conver the mussa analysis_path to a title
60   void updateTitle();
61   //\@}
62
63   //! \defgroup MotifHandling Handling of motif lists
64   //\@{
65   //! load motifs
66   void editMotifs();
67   void loadMotifList();
68   void saveMotifList();
69   void toggleMotifs();
70   //\@}
71
72   //! load a mussa parameter file (which specifies an analysis to run)
73   void loadMupa();
74   //! load a previously run analysis
75   void loadSavedAnalysis();
76   //! set the soft threshold used by the Nway_Path algorithm
77   void setSoftThreshold(int thres);
78   //! update progress bar
79   void updateProgress(const std::string& description, int cur, int max);
80
81   //! open a new mussa window so one can compare analyses
82   void newMussaWindow();
83
84   void showMussaToolbar();
85
86   //! open new window showing our alignment
87   void viewMussaAlignment();
88
89   //! display mussagl manual
90   void showManual();
91
92   void assistantError(const QString message);
93
94 signals:
95   void changedAnnotations();
96   void changedMotifs();
97
98 protected:
99   //! shared_ptr to our analysis
100   MussaRef analysis;
101   //! the default directory we should loand and save from
102   boost::filesystem::path default_dir;
103   std::list<boost::shared_ptr<MussaAlignedWindow> > aligned_windows;
104   MotifEditor *motif_editor;
105   MussaSetupDialog *setup_analysis_dialog;
106   SubanalysisWindowRef subanalysis_window;
107
108   // display our wonderful mussa output
109   SequenceBrowserWidget *browser;
110   QToolBar *mussaViewTB;
111   ZoomWidget *zoom;
112   ThresholdWidget *threshold;
113   QProgressDialog *progress_dialog;
114
115   QAction *aboutAction;
116   QAction *closeAction;
117   QAction *createNewAnalysisAction;
118   QAction *createSubAnalysisAction;
119   QAction *saveAnalysisAction;
120   QAction *saveAnalysisAsAction;
121   QAction *editMotifsAction;
122   QAction *loadMotifListAction;
123   QAction *loadMupaAction;
124   QAction *loadSavedAnalysisAction;
125   QAction *mussaManualAssistantAction;
126   QAction *newMussaWindowAction;
127   QAction *saveMotifListAction;
128   QAction *showMussaViewToolbarAction;
129   QAction *toggleMotifsAction;
130   QAction *saveBrowserPixmapAction;
131   QAction *whatsThisAction;
132   QAction *viewMussaAlignmentAction;
133
134   QAssistantClient *manualAssistant;
135
136   //! initialze the actions
137   void setupActions();
138   //! handle close events (AKA prompt if we should save)
139   void closeEvent(QCloseEvent *event);
140   //! initialize this windows menu object
141   void setupMainMenu();
142   //! initialize assistant client
143   void setupAssistant();
144   //! stub function to fill in QActions
145   void NotImplementedBox();
146
147 protected slots:  
148   //! update the SequenceBrowser with our analysis
149   void updateAnalysis();
150   //! update the view of conserved windows
151   void updateLinks();
152   //! update annotations?
153   void updateAnnotations();
154 };
155
156 #endif