swift
Loading...
Searching...
No Matches
main.cpp
1// SPDX-FileCopyrightText: Copyright (C) 2013 swift Project Community / Contributors
2// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3
4#include <cstdlib>
5
6#include <QApplication>
7#include <QString>
8#include <QSystemTrayIcon>
9#include <Qt>
10
12#include "gui/guiapplication.h"
13#include "misc/crashhandler.h"
14#include "misc/icons.h"
15#include "swiftcore.h"
16
17using namespace swift::misc;
18using namespace swift::core;
19using namespace swift::gui;
20
21int main(int argc, char *argv[])
22{
23 QApplication qa(argc, argv);
24 Q_UNUSED(qa) // init of qa is required, but qa not used
25
27 CGuiApplication a(CApplicationInfo::swiftCore(), CApplicationInfo::PilotClientCore, CIcons::swiftCore24());
28 a.addWindowStateOption();
29 a.addDBusAddressOption();
30 a.addAudioOptions();
31 if (!a.parseCommandLineArgsAndLoadSetup())
32 {
33 return EXIT_FAILURE;
34 }
35
36 const QString dBusAddress(a.getCmdDBusAddressValue());
37 a.initContextsAndStartCoreFacade(CCoreFacadeConfig(CCoreFacadeConfig::LocalInDBusServer, dBusAddress));
38 if (!a.start())
39 {
40 a.gracefulShutdown();
41 return EXIT_FAILURE;
42 }
43
45 {
46 a.cmdLineErrorMessage("System tray missing", "I could not detect any system tray on this system.");
47 a.gracefulShutdown();
48 return EXIT_FAILURE;
49 }
50
51 CSwiftCore w;
52 if (a.getWindowState() != Qt::WindowMinimized)
53 {
54 w.show();
55 }
56 return a.exec();
57}
swift core control GUI
Definition swiftcore.h:39
Configuration object for the contexts.
@ LocalInDBusServer
context runs in same process.
GUI application, a specialized version of swift::core::CApplication for GUI applications.
static const QString & swiftCore()
Name of swift core.
void init()
Initialize and start crashpad handler process.
static CCrashHandler * instance()
Get singleton instance.
static const QPixmap & swiftCore24()
swift icon
Backend services of the swift project, like dealing with the network or the simulators.
Definition actionbind.cpp:7
GUI related classes.
Free functions in swift::misc.
bool isSystemTrayAvailable()
WindowMinimized
void show()