• 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/MissingStars/src/gui/MissingStarsDialog.cpp
1
/*
2
 * Stellarium Missing Stars Plug-in GUI
3
 *
4
 * Copyright (C) 2023 Alexander Wolf
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, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA  02110-1335, USA.
19
*/
20

21
#include <QDebug>
22
#include <QFileDialog>
23

24
#include "StelApp.hpp"
25
#include "ui_missingStarsDialog.h"
26
#include "MissingStarsDialog.hpp"
27
#include "MissingStars.hpp"
28
#include "StelModuleMgr.hpp"
29
#include "StelStyle.hpp"
30
#include "StelGui.hpp"
31
#include "StelTranslator.hpp"
32

33
MissingStarsDialog::MissingStarsDialog()
×
34
        : StelDialog("MissingStars")
35
        , msm(nullptr)
×
36
{
37
        ui = new Ui_missingStarsDialog;
×
38
}
×
39

40
MissingStarsDialog::~MissingStarsDialog()
×
41
{
42
        delete ui;
×
43
}
×
44

45
void MissingStarsDialog::retranslate()
×
46
{
47
        if (dialog)
×
48
        {
49
                ui->retranslateUi(dialog);
×
50
                setAboutHtml();
×
51
        }
52
}
×
53

54
// Initialize the dialog widgets and connect the signals/slots
55
void MissingStarsDialog::createDialogContent()
×
56
{
57
        msm = GETSTELMODULE(MissingStars);
×
58
        ui->setupUi(dialog);
×
59
        ui->tabs->setCurrentIndex(0);        
×
60
        connect(&StelApp::getInstance(), SIGNAL(languageChanged()),
×
61
                this, SLOT(retranslate()));
62

63
        // Kinetic scrolling
64
        kineticScrollingList << ui->aboutTextBrowser;
×
65
        StelGui* gui= dynamic_cast<StelGui*>(StelApp::getInstance().getGui());
×
66
        if (gui)
×
67
        {
68
                enableKineticScrolling(gui->getFlagUseKineticScrolling());
×
69
                connect(gui, SIGNAL(flagUseKineticScrollingChanged(bool)), this, SLOT(enableKineticScrolling(bool)));
×
70
        }
71

72
        connect(ui->titleBar, &TitleBar::closeClicked, this, &StelDialog::close);
×
73
        connect(ui->titleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMovedTo(QPoint)));
×
74

75
        // About tab
76
        setAboutHtml();
×
77
        if(gui!=nullptr)
×
78
                ui->aboutTextBrowser->document()->setDefaultStyleSheet(QString(gui->getStelStyle().htmlStyleSheet));
×
79
}
×
80

81
void MissingStarsDialog::setAboutHtml(void)
×
82
{
83
        QString html = "<html><head></head><body>";
×
84
        html += "<h2>" + q_("Missing Stars Plug-in") + "</h2><table width=\"90%\">";
×
85
        html += "<tr width=\"30%\"><td><strong>" + q_("Version") + ":</strong></td><td>" + MISSINGSTARS_PLUGIN_VERSION + "</td></tr>";
×
86
        html += "<tr><td><strong>" + q_("License") + ":</strong></td><td>" + MISSINGSTARS_PLUGIN_LICENSE + "</td></tr>";
×
87
        html += "<tr><td><strong>" + q_("Author") + ":</strong></td><td>Alexander Wolf</td></tr>";
×
88
        html += "</table>";
×
89

90
        html += "<p>" + q_("This plugin allows you to see some missing stars: ");
×
91
        html += msm->getMissingStarsList();
×
92
        html += "</p>";
×
93

94
        html += StelApp::getInstance().getModuleMgr().getStandardSupportLinksInfo("Missing Stars plugin");
×
95
        html += "</body></html>";
×
96

97
        StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui());
×
98
        if(gui!=nullptr)
×
99
        {
100
                QString htmlStyleSheet(gui->getStelStyle().htmlStyleSheet);
×
101
                ui->aboutTextBrowser->document()->setDefaultStyleSheet(htmlStyleSheet);
×
102
        }
×
103

104
        ui->aboutTextBrowser->setHtml(html);
×
105
}
×
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