~ubuntu-branches/ubuntu/precise/stellarium/precise

« back to all changes in this revision

Viewing changes to src/gui/StelGui.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Cédric Delfosse
  • Date: 2009-03-13 20:07:22 UTC
  • mfrom: (1.1.8 upstream) (4.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090313200722-l66s4zy2s3e8up0s
Tags: 0.10.2-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#include "DateTimeDialog.hpp"
30
30
#include "SearchDialog.hpp"
31
31
#include "ConfigurationDialog.hpp"
 
32
#include "DownloadPopup.hpp"
32
33
#include <QDebug>
33
34
#include <QGraphicsItem>
34
35
 
44
45
{
45
46
public:
46
47
        InfoPanel(QGraphicsItem* parent);
47
 
        void setInfoTextFilters(const StelObject::InfoStringGroup& flags) {infoTextFilters=flags;}
 
48
        void setInfoTextFilters(const StelObject::InfoStringGroup& aflags) {infoTextFilters=aflags;}
48
49
        const StelObject::InfoStringGroup& getInfoTextFilters(void) const {return infoTextFilters;}
49
50
        void setTextFromObjects(const QList<StelObjectP>&);
50
51
private:
56
57
//! It manages the various qt configuration windows, the buttons bars, the list of QAction/shortcuts.
57
58
class StelGui : public StelModule
58
59
{
59
 
        Q_OBJECT;
 
60
        Q_OBJECT
60
61
public:
61
62
        friend class ViewDialog;
62
63
        
87
88
        //! Add a new progress bar in the lower right corner of the screen.
88
89
        //! When the progress bar is deleted with removeProgressBar() the layout is automatically rearranged.
89
90
        //! @return a pointer to the progress bar
90
 
        class QProgressBar* addProgessBar();
 
91
        class QProgressBar* addProgressBar();
91
92
        
92
93
        //! Add a new action managed by the GUI. This method should be used to add new shortcuts to the program
93
94
        //! @param actionName qt object name. Used as a reference for later uses
107
108
        //! Get the button bar at the bottom of the screen
108
109
        BottomStelBar* getButtonBar() {return buttonBar;}
109
110
        
 
111
        //! Get the button bar of the left of the screen
 
112
        class LeftStelBar* getWindowsButtonBar() {return winBar;}
 
113
        
110
114
        //! Transform the pixmap so that it look red for night vision mode
111
115
        static QPixmap makeRed(const QPixmap& p);
112
116
 
113
 
        bool getFlagShowFlipButtons(void) {return flagShowFlipButtons;}
 
117
        //! Get whether the buttons toggling image flip are visible
 
118
        bool getFlagShowFlipButtons() {return flagShowFlipButtons;}
 
119
        
 
120
        //! Get whether the button toggling nebulae background is visible
 
121
        bool getFlagShowNebulaBackgroundButton() {return flagShowNebulaBackgroundButton;}
 
122
 
 
123
        //! returns true if the gui has complted init process.
 
124
        bool initComplete(void) {return initDone;}
 
125
        
 
126
        DownloadPopup* getDownloadPopup() {return &downloadPopup;}
114
127
 
115
128
public slots:
 
129
        //! Define whether the buttons toggling image flip should be visible
116
130
        void setFlagShowFlipButtons(bool b);
117
131
        
 
132
        //! Define whether the button toggling nebulae background should be visible
 
133
        void setFlagShowNebulaBackgroundButton(bool b);
 
134
 
 
135
        //! Get the auto-hide status of the horizontal toolbar.
 
136
        bool getAutoHideHorizontalButtonBar() const {return autoHideHorizontalButtonBar;}
 
137
        //! Set the auto-hide status of the horizontal toolbar.
 
138
        //! When set to true, the horizontal toolbar will auto-hide itself, only
 
139
        //! making an appearance when the mouse is nearby.  When false, it will 
 
140
        //! remain on screen.
 
141
        //! @param b to hide or not to hide     
 
142
        void setAutoHideHorizontalButtonBar(bool b) {autoHideHorizontalButtonBar=b;}
 
143
        
 
144
        //! Get the auto-hide status of the vertical toolbar.
 
145
        bool getAutoHideVerticalButtonBar() const {return autoHideVerticalButtonBar;}
 
146
        //! Set the auto-hide status of the vertical toolbar.
 
147
        //! When set to true, the vertical toolbar will auto-hide itself, only
 
148
        //! making an appearance when the mouse is nearby.  When false, it will 
 
149
        //! remain on screen.
 
150
        //! @param b to hide or not to hide
 
151
        void setAutoHideVerticalButtonBar(bool b) {autoHideVerticalButtonBar=b;}
 
152
 
 
153
        //! show or hide the toolbars
 
154
        //! @param b when true, toolbars will be shown, else they will be hidden.
 
155
        void setHideGui(bool b);
 
156
        //! get the current visible status of the toolbars
 
157
        bool getHideGui();
 
158
        
 
159
        void quitStellarium();
 
160
 
118
161
private slots:
119
162
        //! Update the position of the button bars in the main window
120
163
        void updateBarsPos();
121
164
        void reloadStyle();
122
 
        void quitStellarium();
123
 
        
124
 
        bool getAutoHideHorizontalButtonBar() const {return autoHideHorizontalButtonBar;}
125
 
        void setAutoHideHorizontalButtonBar(bool b) {autoHideHorizontalButtonBar=b;}
126
 
        
127
 
        bool getAutoHideVerticalButtonBar() const {return autoHideVerticalButtonBar;}
128
 
        void setAutoHideVerticalButtonBar(bool b) {autoHideVerticalButtonBar=b;}
129
 
 
 
165
        void cancelDownloadAndQuit();
 
166
        void dontQuit();
 
167
        
130
168
        //! Called each time a GUI action is triggered
131
169
        void guiActionTriggered(bool b=false);
132
170
        
133
171
private:
134
 
        void retranslateUi(QWidget *Form);
135
172
        
136
173
        class LeftStelBar* winBar;
137
174
        BottomStelBar* buttonBar;
154
191
        SearchDialog searchDialog;
155
192
        ViewDialog viewDialog;
156
193
        ConfigurationDialog configurationDialog;
 
194
        DownloadPopup downloadPopup;
157
195
        
158
196
        class StelProgressBarMgr* progressBarMgr;
159
197
        
171
209
        bool flagShowFlipButtons;
172
210
        class StelButton* flipVert;
173
211
        class StelButton* flipHoriz;
 
212
        
 
213
        bool flagShowNebulaBackgroundButton;
 
214
        class StelButton* btShowNebulaeBackground;
174
215
 
 
216
        bool initDone;
 
217
        bool guiHidden;
175
218
};
176
219
 
177
220
#endif // _STELGUI_HPP_