• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Stellarium / stellarium / 6686107986

29 Oct 2023 10:17PM UTC coverage: 11.734% (-0.001%) from 11.735%
6686107986

Pull #3483

github

gzotti
Improve Regular expressions to remove HTML style annotations.

Thanks to @10110111 for help.
Pull Request #3483: TUI fixes

22 of 22 new or added lines in 3 files covered. (100.0%)

14842 of 126485 relevant lines covered (11.73%)

25952.34 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/plugins/TextUserInterface/src/TextUserInterface.hpp
1
/*
2
 * Copyright (C) 2009 Matthew Gates
3
 *
4
 * This program is free software; you can redistribute it and/or
5
 * modify it under the terms of the GNU General Public License
6
 * as published by the Free Software Foundation; either version 2
7
 * of the License, or (at your option) any later version.
8
 *
9
 * This program is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 * GNU General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU General Public License
15
 * along with this program; if not, write to the Free Software
16
 * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA  02110-1335, USA.
17
 */
18
 
19
#ifndef TEXTUSERINTERFACE_HPP
20
#define TEXTUSERINTERFACE_HPP
21

22
#include "StelModule.hpp"
23
#include "DummyDialog.hpp"
24
#include "StelCore.hpp"
25

26
#include <QObject>
27
#include <QString>
28
#include <QFont>
29

30
class TuiNode;
31

32
//! The Text User Interface (TUI) plugin replaces the old (pre-0.10 series) text user interface.
33
//! It used to be activated with M until the 0.14 series, but was changed to Alt-T for 0.15 and later (to be consistent with the Ctrl-T hiding of the GUI).
34
class TextUserInterface : public StelModule
35
{
36
        Q_OBJECT
37

38
        Q_PROPERTY(bool tuiDateTime READ getTuiDateTime WRITE setTuiDateTime NOTIFY flagShowDateTimeChanged)
39
        Q_PROPERTY(bool tuiObjInfo  READ getTuiObjInfo  WRITE setTuiObjInfo  NOTIFY flagShowObjInfoChanged)
40
public:
41
        TextUserInterface();
42
        virtual ~TextUserInterface() Q_DECL_OVERRIDE;
43
        
44
        ///////////////////////////////////////////////////////////////////////////
45
        // Methods defined in the StelModule class
46
        virtual void init() Q_DECL_OVERRIDE;
47
        virtual void draw(StelCore* core) Q_DECL_OVERRIDE;
48
        virtual double getCallOrder(StelModuleActionName actionName) const Q_DECL_OVERRIDE;
49
        virtual void handleKeys(class QKeyEvent* event) Q_DECL_OVERRIDE;
50

51
        ///////////////////////////////////////////////////////////////////////////
52
        // Methods specific to TextUserInterface
53
        //! Loads the module's configuration from the config file.
54
        void loadConfiguration(void);
55

56
public slots:
57
        //! Show/hide the TUI menu
58
        void setTuiMenuActive(bool tActive) { tuiActive = tActive;}
×
59
        //! Show/hide the TUI date time display
60
        void setTuiDateTime(bool tDateTime) { tuiDateTime = tDateTime; emit flagShowDateTimeChanged(tDateTime);}
×
61
        bool getTuiDateTime(){return tuiDateTime;}
×
62
        //! Show/hide the selected object's short object information 
63
        void setTuiObjInfo(bool tObjInfo) { tuiObjInfo = tObjInfo; emit flagShowObjInfoChanged(tObjInfo);}
×
64
        bool getTuiObjInfo(){return tuiObjInfo;}
×
65
        //! Set Gravity text for the TUI text
66
        void setTuiGravityUi(bool tGravityUi) { tuiGravityUi = tGravityUi; }
×
67
        //! Set light pollution level
68
        void setLightPollutionLevel(int level);
69

70
private slots:
71
        void setHomePlanet(QString planetName);
72
        void setAltitude(int altitude);
73
        void setLatitude(double latitude);
74
        void setLongitude(double longitude);
75
        void setStartupDateMode(QString mode);
76
        void setDateFormat(QString format);
77
        void setTimeFormat(QString format);
78
        void setSkyCulture(QString i18);
79
        void setAppLanguage(QString lang);
80
        void setSkyLanguage(QString lang);
81
        void saveDefaultSettings(void);
82
        void shutDown(void);
83

84
signals:
85
        void flagShowDateTimeChanged(bool);
86
        void flagShowObjInfoChanged(bool);
87

88
private:
89
        DummyDialog dummyDialog;
90
        QFont font;
91
        bool tuiActive;
92
        bool tuiDateTime; // property
93
        bool tuiObjInfo;  // property
94
        bool tuiGravityUi;
95
        TuiNode* currentNode;
96
        Vec3f color;
97

98
        double getLatitude(void);
99
        double getLongitude(void);
100
};
101

102

103

104
#include <QObject>
105
#include "StelPluginInterface.hpp"
106

107
//! This class is used by Qt to manage a plug-in interface
108
class TextUserInterfaceStelPluginInterface : public QObject, public StelPluginInterface
109
{
110
        Q_OBJECT
111
        Q_PLUGIN_METADATA(IID StelPluginInterface_iid)
112
        Q_INTERFACES(StelPluginInterface)
113
public:
114
        virtual StelModule* getStelModule() const Q_DECL_OVERRIDE;
115
        virtual StelPluginInfo getPluginInfo() const Q_DECL_OVERRIDE;
116
        //virtual QObjectList getExtensionList() const Q_DECL_OVERRIDE { return QObjectList(); }
117
};
118

119
#endif /* TEXTUSERINTERFACE_HPP*/
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc