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

Stellarium / stellarium / 6685397774

29 Oct 2023 07:37PM UTC coverage: 11.735% (-0.002%) from 11.737%
6685397774

push

github

10110111
Deduplicate title bar implementation

131 of 131 new or added lines in 56 files covered. (100.0%)

14842 of 126472 relevant lines covered (11.74%)

21617.74 hits per line

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

0.0
/plugins/AngleMeasure/src/gui/AngleMeasureDialog.cpp
1
/*
2
 * Angle Measure plug-in for Stellarium
3
 *
4
 * Copyright (C) 2014 Alexander Wolf, Georg Zotti
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18
 */
19

20
#include "AngleMeasure.hpp"
21
#include "AngleMeasureDialog.hpp"
22
#include "ui_angleMeasureDialog.h"
23

24
#include "StelGui.hpp"
25
#include "StelTranslator.hpp"
26
#include "StelApp.hpp"
27
#include "StelModule.hpp"
28
#include "StelModuleMgr.hpp"
29

30
AngleMeasureDialog::AngleMeasureDialog()
×
31
        : StelDialog("AngleMeasure")
×
32
{
33
        ui = new Ui_angleMeasureDialog();
×
34
}
×
35

36
AngleMeasureDialog::~AngleMeasureDialog()
×
37
{
38
        delete ui;
×
39
}
×
40

41
void AngleMeasureDialog::retranslate()
×
42
{
43
        if (dialog)
×
44
        {
45
                ui->retranslateUi(dialog);
×
46
                setAboutHtml();
×
47
        }
48
}
×
49

50
void AngleMeasureDialog::createDialogContent()
×
51
{
52
        ui->setupUi(dialog);
×
53

54
        // Kinetic scrolling
55
        kineticScrollingList << ui->aboutTextBrowser;
×
56
        StelGui* gui= static_cast<StelGui*>(StelApp::getInstance().getGui());
×
57
        enableKineticScrolling(gui->getFlagUseKineticScrolling());
×
58
        connect(gui, SIGNAL(flagUseKineticScrollingChanged(bool)), this, SLOT(enableKineticScrolling(bool)));
×
59

60
        connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate()));
×
61
        connect(ui->titleBar, &TitleBar::closeClicked, this, &StelDialog::close);
×
62
        connect(ui->titleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMovedTo(QPoint)));
×
63

64
        connectBoolProperty(ui->panAndSelectCheckBox,                        "AngleMeasure.flagPanAndSelect");
×
65
        connectBoolProperty(ui->followCursorCheckBox,                         "AngleMeasure.flagFollowCursor");
×
66
        connectBoolProperty(ui->useDmsFormatCheckBox,                         "AngleMeasure.dmsFormat");
×
67
        connectBoolProperty(ui->showPositionAngleCheckBox,                 "AngleMeasure.flagShowEquatorialPA");
×
68
        connectBoolProperty(ui->showPositionAngleHorizontalCheckBox,        "AngleMeasure.flagShowHorizontalPA");
×
69
        connectBoolProperty(ui->showEquatorial_GroupBox,                "AngleMeasure.flagShowEquatorial");
×
70
        connectBoolProperty(ui->showHorizontal_GroupBox,                "AngleMeasure.flagShowHorizontal");
×
71
        connectBoolProperty(ui->azAltStartOnSkyCheckBox,                "AngleMeasure.flagShowHorizontalStartSkylinked");
×
72
        connectBoolProperty(ui->azAltEndOnSkyCheckBox,                        "AngleMeasure.flagShowHorizontalEndSkylinked");
×
73

74
        connectColorButton(ui->equatorialLineColorToolButton,        "AngleMeasure.equatorialLineColor", "AngleMeasure/line_color");
×
75
        connectColorButton(ui->equatorialTextColorToolButton,        "AngleMeasure.equatorialTextColor", "AngleMeasure/text_color");
×
76
        connectColorButton(ui->horizontalLineColorToolButton,        "AngleMeasure.horizontalLineColor", "AngleMeasure/line_color_horizontal");
×
77
        connectColorButton(ui->horizontalTextColorToolButton,        "AngleMeasure.horizontalTextColor", "AngleMeasure/text_color_horizontal");
×
78

79
        connect(ui->restoreDefaultsButton, SIGNAL(clicked()), this, SLOT(restoreDefaults()));
×
80

81
        setAboutHtml();
×
82
}
×
83

84
void AngleMeasureDialog::restoreDefaults()
×
85
{
86
        if (askConfirmation())
×
87
        {
88
                qDebug() << "[AngleMeasure] restore defaults...";
×
89
                GETSTELMODULE(AngleMeasure)->restoreDefaultSettings();
×
90
        }
91
        else
92
                qDebug() << "[AngleMeasure] restore defaults is canceled...";
×
93
}
×
94

95
void AngleMeasureDialog::setAboutHtml(void)
×
96
{
97
        QString html = "<html><head></head><body>";
×
98
        html += "<h2>" + q_("Angle Measure Plug-in") + "</h2><table width=\"90%\">";
×
99
        html += "<tr width=\"30%\"><td><strong>" + q_("Version") + ":</strong></td><td>" + ANGLEMEASURE_PLUGIN_VERSION + "</td></tr>";
×
100
        html += "<tr><td><strong>" + q_("License") + ":</strong></td><td>" + ANGLEMEASURE_PLUGIN_LICENSE + "</td></tr>";
×
101
        html += "<tr><td><strong>" + q_("Author") + ":</strong></td><td>Matthew Gates</td></tr>";
×
102
        html += "<tr><td rowspan=3><strong>" + q_("Contributors") + ":</strong></td><td>Bogdan Marinov</td></tr>";
×
103
        html += "<tr><td>Alexander Wolf</td></tr>";
×
104
        html += "<tr><td>Georg Zotti</td></tr>";
×
105
        html += "</table>";
×
106

107
        html += "<p>" + q_("The Angle Measure plugin is a small tool which is used to measure the angular distance between two points on the sky (and calculation of position angle between those two points).") + "</p>";
×
108
        html += "<p>" + q_("Start and end points in horizontal mode can be linked to the rotating sky, which may be helpful to keep relations between landscape and some celestial object or (with both linked) for Dobsonian starhopping.") + "</p>";
×
109
        html += "<p>" + q_("*goes misty eyed* I recall measuring the size of the Cassini Division when I was a student. It was not the high academic glamor one might expect... It was cloudy... It was rainy... The observatory lab had some old scopes set up at one end, pointing at a <em>photograph</em> of Saturn at the other end of the lab. We measured. We calculated. We wished we were in Hawaii.") + "</p>";
×
110

111
        html += StelApp::getInstance().getModuleMgr().getStandardSupportLinksInfo("Angle Measure plugin");
×
112
        html += "</body></html>";
×
113

114
        StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui());
×
115
        if(gui!=Q_NULLPTR)
×
116
        {
117
                QString htmlStyleSheet(gui->getStelStyle().htmlStyleSheet);
×
118
                ui->aboutTextBrowser->document()->setDefaultStyleSheet(htmlStyleSheet);
×
119
        }
×
120
        ui->aboutTextBrowser->setHtml(html);
×
121
}
×
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