swift
Loading...
Searching...
No Matches
swiftlauncher.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (C) 2015 swift Project Community / Contributors
2// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3
5
6#ifndef SWIFTLAUNCHER_H
7#define SWIFTLAUNCHER_H
8
13#include "gui/mainwindowaccess.h"
15#include "misc/db/artifact.h"
16#include "misc/identifiable.h"
17#include "misc/loghistory.h"
19
20#ifdef Q_OS_MAC
22#endif
23
24#include <QMainWindow>
25#include <QNetworkReply>
26#include <QScopedPointer>
27#include <QTimer>
28
29namespace Ui
30{
31 class CSwiftLauncher;
32}
34{
36 class CTextEditDialog;
37} // namespace swift::gui::components
38
46 public QMainWindow,
48 public swift::gui::IMainWindowAccess,
51{
53 Q_INTERFACES(swift::gui::IMainWindowAccess)
54
55public:
57 enum Pages
58 {
59 PageNews = 0,
60 PageWindowType,
61 PageCoreMode,
62 PageUpdates
63 };
64
66 CSwiftLauncher(bool installerMode, QWidget *parent = nullptr);
67
69 ~CSwiftLauncher() override;
70
72 const QString &getExecutable() const { return m_executable; }
73
75 const QStringList &getExecutableArgs() const { return m_executableArgs; }
76
78 QString getCmdLine() const;
79
82 bool startDetached();
83
85 bool shouldStartAppDetached() const;
86
87protected:
90 void mousePressEvent(QMouseEvent *event) override;
91 void mouseMoveEvent(QMouseEvent *event) override;
92 void mouseReleaseEvent(QMouseEvent *event) override;
94
95private slots:
97 void showLogPage();
98
99private:
104 swift::misc::CLogHistoryReplica m_logHistory { this };
105#ifdef Q_OS_MAC
106 swift::misc::CMacOSMicrophoneAccess m_micAccess;
107#endif
108
109 QString m_executable;
110 QStringList m_executableArgs;
111 QTimer m_checkTimer { this };
112 int m_startCoreWaitCycles = 0;
113 int m_startMappingToolWaitCycles = 0;
114 int m_startGuiWaitCycles = 0;
115
117 swift::core::CoreModes::CoreMode getCoreMode() const;
118
121
123 void init();
124
126 void initStyleSheet();
127
129 void initLogDisplay();
130
132 void setHeaderInfo(const swift::misc::db::CArtifact &latestArtifact);
133
135 bool setSwiftCoreExecutable();
136
138 void setSwiftDataExecutable();
139
141 bool setSwiftGuiExecutable();
142
144 bool canConnectSwiftOnDBusServer(const QString &dbusAddress, QString &msg) const;
145
147 bool isStandaloneGuiSelected() const;
148
150 void setDefaults();
151
153 void saveSetup();
154
156 bool warnAboutOtherSwiftApplications();
157
159 void updateInfoAvailable();
160
162 void startButtonPressed();
163
165 void dbusServerModeSelected(bool selected);
166
168 void showStatusMessage(const swift::misc::CStatusMessage &msg);
169
171 void showStatusMessage(const QString &htmlMsg);
172
174 void showMainPage();
175
177 void tabChanged(int current);
178
180 void checkRunningApplicationsAndCore();
181
183 void startWizard();
184
186 void onStyleSheetsChanged();
187
189 void onDBusEditingFinished();
190
192 void onCoreModeReleased();
193
195 void popupExecutableArgs();
196
198 void showSimulatorConfigDirs();
199
201 void requestMacMicrophoneAccess();
202
204 void installerMode();
205
207 void clearWindowsRegistry();
208
210 static QString toCmdLine(const QString &exe, const QStringList &exeArgs);
211};
212
213#endif // SWIFTLAUNCHER_H
const QStringList & getExecutableArgs() const
Arguments.
void mouseReleaseEvent(QMouseEvent *event)
Mouse events for frameless window.
void mouseMoveEvent(QMouseEvent *event)
Mouse events for frameless window.
~CSwiftLauncher()
Destructor.
CSwiftLauncher(bool installerMode, QWidget *parent=nullptr)
Constructor.
bool shouldStartAppDetached() const
Check if an app is set that should be started detached.
const QString & getExecutable() const
Executable (to be started).
bool startDetached()
Start currently set application detached.
void mousePressEvent(QMouseEvent *event)
Mouse events for frameless window.
QString getCmdLine() const
Current command line.
Main window which can be frameless.
Configure the most important settings.
Class template for accessing a specific value in the CDataCache.
Definition datacache.h:315
Base class with a member CIdentifier to be inherited by a class which has an identity in the environm...
Basically a QObject free (delegate based) version of CCentralMultiSimulatorModelSetCachesProvider.
High level reusable GUI components.
QMainWindow(QWidget *parent, Qt::WindowFlags flags)
virtual bool event(QEvent *event) override
Q_INTERFACES(...)
Q_OBJECTQ_OBJECT
QObject * parent() const const
CoreMode
Core runs how and where?