Changeset View
Changeset View
Standalone View
Standalone View
drkonqi/main.cpp
Show All 30 Lines | |||||
31 | #include <KAboutData> | 31 | #include <KAboutData> | ||
32 | #include <KLocalizedString> | 32 | #include <KLocalizedString> | ||
33 | #include <QCommandLineParser> | 33 | #include <QCommandLineParser> | ||
34 | 34 | | |||
35 | #include <config-X11.h> | 35 | #include <config-X11.h> | ||
36 | #if HAVE_X11 | 36 | #if HAVE_X11 | ||
37 | #include <QX11Info> | 37 | #include <QX11Info> | ||
38 | #endif | 38 | #endif | ||
39 | #ifdef Q_OS_MACOS | ||||
40 | #include <KWindowSystem> | ||||
41 | #endif | ||||
39 | 42 | | |||
40 | #include "drkonqi.h" | 43 | #include "drkonqi.h" | ||
41 | #include "drkonqidialog.h" | 44 | #include "drkonqidialog.h" | ||
42 | #include "statusnotifier.h" | 45 | #include "statusnotifier.h" | ||
43 | 46 | | |||
44 | static const char version[] = PROJECT_VERSION; | 47 | static const char version[] = PROJECT_VERSION; | ||
45 | static const char description[] = I18N_NOOP("The KDE Crash Handler gives the user feedback " | 48 | static const char description[] = I18N_NOOP("The KDE Crash Handler gives the user feedback " | ||
46 | "if a program has crashed."); | 49 | "if a program has crashed."); | ||
Show All 27 Lines | 59 | #endif | |||
74 | aboutData.addAuthor(i18nc("@info:credit","Hans Petter Bieker"), QString(), | 77 | aboutData.addAuthor(i18nc("@info:credit","Hans Petter Bieker"), QString(), | ||
75 | QStringLiteral("bieker@kde.org")); | 78 | QStringLiteral("bieker@kde.org")); | ||
76 | aboutData.addAuthor(i18nc("@info:credit","Dario Andres Rodriguez"), QString(), | 79 | aboutData.addAuthor(i18nc("@info:credit","Dario Andres Rodriguez"), QString(), | ||
77 | QStringLiteral("andresbajotierra@gmail.com")); | 80 | QStringLiteral("andresbajotierra@gmail.com")); | ||
78 | aboutData.addAuthor(i18nc("@info:credit","George Kiagiadakis"), QString(), | 81 | aboutData.addAuthor(i18nc("@info:credit","George Kiagiadakis"), QString(), | ||
79 | QStringLiteral("gkiagia@users.sourceforge.net")); | 82 | QStringLiteral("gkiagia@users.sourceforge.net")); | ||
80 | aboutData.addAuthor(i18nc("@info:credit","A. L. Spehr"), QString(), | 83 | aboutData.addAuthor(i18nc("@info:credit","A. L. Spehr"), QString(), | ||
81 | QStringLiteral("spehr@kde.org")); | 84 | QStringLiteral("spehr@kde.org")); | ||
82 | qa.setWindowIcon(QIcon::fromTheme(QStringLiteral("tools-report-bug"))); | 85 | qa.setWindowIcon(QIcon::fromTheme(QStringLiteral("tools-report-bug"), qa.windowIcon())); | ||
83 | 86 | | |||
84 | QCommandLineParser parser; | 87 | QCommandLineParser parser; | ||
85 | parser.setApplicationDescription(description); | 88 | parser.setApplicationDescription(description); | ||
86 | parser.addHelpOption(); | 89 | parser.addHelpOption(); | ||
87 | parser.addVersionOption(); | 90 | parser.addVersionOption(); | ||
88 | 91 | | |||
89 | QCommandLineOption signalOption(QStringLiteral("signal"), i18nc("@info:shell","The signal <number> that was caught"), QStringLiteral("number")); | 92 | QCommandLineOption signalOption(QStringLiteral("signal"), i18nc("@info:shell","The signal <number> that was caught"), QStringLiteral("number")); | ||
90 | QCommandLineOption appNameOption(QStringLiteral("appname"), i18nc("@info:shell","<Name> of the program"), QStringLiteral("name")); | 93 | QCommandLineOption appNameOption(QStringLiteral("appname"), i18nc("@info:shell","<Name> of the program"), QStringLiteral("name")); | ||
▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Line(s) | 143 | #endif | |||
144 | } | 147 | } | ||
145 | 148 | | |||
146 | qa.setQuitOnLastWindowClosed(false); | 149 | qa.setQuitOnLastWindowClosed(false); | ||
147 | 150 | | |||
148 | auto openDrKonqiDialog = [&qa]{ | 151 | auto openDrKonqiDialog = [&qa]{ | ||
149 | DrKonqiDialog *w = new DrKonqiDialog(); | 152 | DrKonqiDialog *w = new DrKonqiDialog(); | ||
150 | QObject::connect(w, &DrKonqiDialog::rejected, &qa, &QApplication::quit); | 153 | QObject::connect(w, &DrKonqiDialog::rejected, &qa, &QApplication::quit); | ||
151 | w->show(); | 154 | w->show(); | ||
155 | #ifdef Q_OS_MACOS | ||||
156 | KWindowSystem::forceActiveWindow(w->winId()); | ||||
157 | #endif | ||||
152 | }; | 158 | }; | ||
153 | 159 | | |||
154 | bool restarted = parser.isSet(restartedOption); | 160 | bool restarted = parser.isSet(restartedOption); | ||
155 | 161 | | |||
156 | // if no notification service is running (eg. shell crashed, or other desktop environment) | 162 | // if no notification service is running (eg. shell crashed, or other desktop environment) | ||
157 | // and we didn't auto-restart the app, open DrKonqi dialog instead of showing an SNI | 163 | // and we didn't auto-restart the app, open DrKonqi dialog instead of showing an SNI | ||
158 | // and emitting a desktop notification | 164 | // and emitting a desktop notification | ||
159 | if (!restarted && !StatusNotifier::notificationServiceRegistered()) { | 165 | if (!restarted && !StatusNotifier::notificationServiceRegistered()) { | ||
Show All 15 Lines |