~ubuntu-branches/debian/jessie/stellarium/jessie

« back to all changes in this revision

Viewing changes to plugins/Oculars/src/gui/OcularsGuiPanel.hpp

  • Committer: Package Import Robot
  • Author(s): Tomasz Buchert
  • Date: 2012-05-18 13:26:18 UTC
  • mfrom: (1.2.7)
  • Revision ID: package-import@ubuntu.com-20120518132618-3uso09fo68c218cx
Tags: 0.11.2-1
* Imported Upstream version 0.11.1 and then 0.11.2 (Closes: #658431)
* Change maintainer (Closes: #668916)
* Machine-readable copyright file
* Bump Standards-Version to 3.9.3
* Update debhelper compat to 9
* Fix lintian duplicate-font-file warning
* Fix copyright-refers-to-symlink-license lintian tag
* Add lintian override for embedded-library error

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
Oculars plug-in for Stellarium: graphical user interface widget
 
3
Copyright (C) 2011  Bogdan Marinov
 
4
 
 
5
This program is free software; you can redistribute it and/or
 
6
modify it under the terms of the GNU General Public License
 
7
as published by the Free Software Foundation; either version 2
 
8
of the License, or (at your option) any later version.
 
9
 
 
10
This program is distributed in the hope that it will be useful,
 
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
GNU General Public License for more details.
 
14
 
 
15
You should have received a copy of the GNU General Public License
 
16
along with this program; if not, write to the Free Software
 
17
Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA  02110-1335, USA.
 
18
*/
 
19
 
 
20
#ifndef OCULARSGUIPANEL_HPP
 
21
#define OCULARSGUIPANEL_HPP
 
22
 
 
23
#include <QGraphicsWidget>
 
24
 
 
25
class Oculars;
 
26
class StelButton;
 
27
class QGraphicsLinearLayout;
 
28
class QGraphicsProxyWidget;
 
29
class QLabel;
 
30
class QPushButton;
 
31
class QWidget;
 
32
 
 
33
//! A screen widget similar to InfoPanel. Contains controls and information.
 
34
class OcularsGuiPanel : public QGraphicsWidget
 
35
{
 
36
        Q_OBJECT
 
37
 
 
38
public:
 
39
        OcularsGuiPanel(Oculars* ocularsPlugin,
 
40
                        QGraphicsWidget * parent = 0,
 
41
                        Qt::WindowFlags wFlags = 0);
 
42
        ~OcularsGuiPanel();
 
43
 
 
44
public slots:
 
45
        //! Show only the controls used with an ocular overlay.
 
46
        void showOcularGui();
 
47
        //! Show only the controls used with a CCD overlay.
 
48
        void showCcdGui();
 
49
        //! Hide the controls, leaving only the button bar.
 
50
        void foldGui();
 
51
 
 
52
private slots:
 
53
        //! Update the position of the widget within the parent.
 
54
        //! Tied to the parent's geometryChanged() signal.
 
55
        void updatePosition();
 
56
 
 
57
        //! Updates the information shown when an ocular overlay is displayed
 
58
        void updateOcularControls();
 
59
        //! Updates the information shown when a sensor overlay is displayed
 
60
        void updateCcdControls();
 
61
        //! Updates the information that depends on the current telescope.
 
62
        //! Called in both updateOcularControls() and updateCcdControls().
 
63
        void updateTelescopeControls();
 
64
 
 
65
        //! Sets the color scheme (day/night mode)
 
66
        void setColorScheme(const QString& schemeName);
 
67
 
 
68
private:
 
69
        Oculars* ocularsPlugin;
 
70
 
 
71
        //! This is actually SkyGui. Perhaps it should be more specific?
 
72
        QGraphicsWidget* parentWidget;
 
73
 
 
74
        QGraphicsLinearLayout* mainLayout;
 
75
 
 
76
        QGraphicsPathItem* borderPath;
 
77
 
 
78
        //! Mini-toolbar holding StelButtons
 
79
        QGraphicsWidget* buttonBar;
 
80
        QGraphicsWidget* ocularControls;
 
81
        QGraphicsWidget* ccdControls;
 
82
        QGraphicsWidget* telescopeControls;
 
83
 
 
84
        //Mini-toolbar
 
85
        StelButton* buttonOcular;
 
86
        StelButton* buttonCrosshairs;
 
87
        StelButton* buttonCcd;
 
88
        StelButton* buttonTelrad;
 
89
        StelButton* buttonConfiguration;
 
90
 
 
91
        //Information display
 
92
        StelButton* prevOcularButton;
 
93
        StelButton* nextOcularButton;
 
94
        StelButton* prevTelescopeButton;
 
95
        StelButton* nextTelescopeButton;
 
96
        StelButton* prevCcdButton;
 
97
        StelButton* nextCcdButton;
 
98
        QGraphicsTextItem* fieldOcularName;
 
99
        QGraphicsTextItem* fieldOcularFl;
 
100
        QGraphicsTextItem* fieldOcularAfov;
 
101
        QGraphicsTextItem* fieldCcdName;
 
102
        QGraphicsTextItem* fieldCcdDimensions;
 
103
        QGraphicsTextItem* fieldCcdRotation;
 
104
        QGraphicsTextItem* fieldTelescopeName;
 
105
        QGraphicsTextItem* fieldMagnification;
 
106
        QGraphicsTextItem* fieldFov;
 
107
 
 
108
        //Sensor frame rotation controls
 
109
        StelButton* rotateCcdMinus15Button;
 
110
        StelButton* rotateCcdMinus5Button;
 
111
        StelButton* rotateCcdMinus1Button;
 
112
        StelButton* resetCcdRotationButton;
 
113
        StelButton* rotateCcdPlus1Button;
 
114
        StelButton* rotateCcdPlus5Button;
 
115
        StelButton* rotateCcdPlus15Button;
 
116
 
 
117
        //! Sets the visibility of the ocular name label and the associated buttons.
 
118
        void setOcularControlsVisible(bool show);
 
119
        void setCcdControlsVisible(bool show);
 
120
        void setTelescopeControlsVisible(bool show);
 
121
        //! Updates the positions of the buttons inside the button bar.
 
122
        void updateMainButtonsPositions();
 
123
 
 
124
        void setControlsColor(const QColor& color);
 
125
        void setControlsFont(const QFont& font);
 
126
        //! Sets the night mode flag on all StelButton-s.
 
127
        void setButtonsNightMode(bool nightMode);
 
128
 
 
129
        static QPixmap createPixmapFromText(const QString& text,
 
130
                                            int width,
 
131
                                            int height,
 
132
                                            const QFont& font,
 
133
                                            const QColor& textColor,
 
134
                                            const QColor& backgroundColor = QColor(0,0,0,0));
 
135
};
 
136
 
 
137
#endif // OCULARSGUIPANEL_HPP