Kstars

kswizard.h
1/*
2 SPDX-FileCopyrightText: 2004 Jason Harris <kstars@30doradus.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include <QDialog>
10#include <QDialogButtonBox>
11#include <QProcess>
12#include <QPlainTextEdit>
13#include <qsystemdetection.h>
14
15#include <QNetworkAccessManager>
16#include <QNetworkRequest>
17#include <QNetworkReply>
18
19#include "ui_wizwelcome.h"
20#include "ui_wizlocation.h"
21#include "ui_wizdownload.h"
22
23#ifdef Q_OS_MACOS
24#include "ui_wizdata.h"
25#endif
26
27#include "QProgressIndicator.h"
28
29class GeoLocation;
30class QStackedWidget;
31
32class WizWelcomeUI : public QFrame, public Ui::WizWelcome
33{
35
36 public:
37 explicit WizWelcomeUI(QWidget *parent = nullptr);
38};
39
40class WizLocationUI : public QFrame, public Ui::WizLocation
41{
43
44 public:
45 explicit WizLocationUI(QWidget *parent = nullptr);
46};
47
48#ifdef Q_OS_MACOS
49class WizDataUI : public QFrame, public Ui::WizData
50{
51 Q_OBJECT
52
53 public:
54 explicit WizDataUI(QWidget *parent = nullptr);
55};
56#endif
57
58class WizDownloadUI : public QFrame, public Ui::WizDownload
59{
61
62 public:
63 explicit WizDownloadUI(QWidget *parent = nullptr);
64};
65
66/**
67 * @class KSWizard
68 * The Startup Wizard will be automatically opened when KStars runs
69 * for the first time. It allows the user to set up some basic parameters:
70 * @li Geographic Location
71 * @li Download extra data files
72 *
73 * @author Jason Harris
74 * @version 1.0
75 */
76class KSWizard : public QDialog
77{
79 public:
80 /**
81 * Constructor
82 * @param parent Pointer to the parent widget
83 */
84 explicit KSWizard(QWidget *parent = nullptr);
85
86 // Do NOT delete members of filteredCityList! They are not created by KSWizard.
87 ~KSWizard() override = default;
88
89 /** @return pointer to the geographic location selected by the user */
90 const GeoLocation *geo() const
91 {
92 return Geo;
93 }
94
95 private slots:
96 void slotNextPage();
97 void slotPrevPage();
98
99 /**
100 * Set the geo pointer to the user's selected city, and display
101 * its longitude and latitude in the window.
102 * @note called when the highlighted city in the list box changes
103 */
104 void slotChangeCity();
105
106 /**
107 * Display only those cities which meet the user's search criteria in the city list box.
108 * @note called when one of the name filters is modified
109 */
110 void slotFilterCities();
111
112 void slotDownload();
113
114 void slotInstallGSC();
115
116 void slotExtractGSC();
117
118 void slotGSCInstallerFinished();
119
120 void slotUpdateDataButtons();
121
122 void slotOpenOrCopyKStarsDataDirectory();
123
124 private:
125 /**
126 * @short Initialize the geographic location page.
127 * Populate the city list box, and highlight the current location in the list.
128 */
129 void initGeoPage();
130
131 /** @short set enabled/disable state of Next/Prev buttins based on current page */
132 void setButtonsEnabled();
133
134#ifdef Q_OS_MACOS
135
136 bool GSCExists();
137 bool dataDirExists();
138
139
140 QProgressIndicator *gscMonitor { nullptr };
141 QTimer *downloadMonitor { nullptr };
142 QString gscZipPath;
143 WizDataUI *data { nullptr };
144#endif
145
146 QStackedWidget *wizardStack { nullptr };
147 WizWelcomeUI *welcome { nullptr };
148 WizLocationUI *location { nullptr };
149 QPushButton *nextB { nullptr };
150 QPushButton *backB { nullptr };
151 QPushButton *completeB { nullptr };
152 QDialogButtonBox *buttonBox { nullptr };
153 GeoLocation *Geo { nullptr };
154 QList<GeoLocation *> filteredCityList;
155};
Contains all relevant information for specifying a location on Earth: City Name, State/Province name,...
Definition geolocation.h:28
The Startup Wizard will be automatically opened when KStars runs for the first time.
Definition kswizard.h:77
const GeoLocation * geo() const
Definition kswizard.h:90
KSWizard(QWidget *parent=nullptr)
Constructor.
Definition kswizard.cpp:64
The QProgressIndicator class lets an application display a progress indicator to show that a long tas...
Q_OBJECTQ_OBJECT
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 27 2024 11:51:44 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.