Changeset View
Changeset View
Standalone View
Standalone View
logout-greeter/shutdowndlg.cpp
- This file was moved from ksmserver/logout-greeter/shutdowndlg.cpp.
1 | /***************************************************************** | 1 | /***************************************************************** | ||
---|---|---|---|---|---|
2 | ksmserver - the KDE session management server | | |||
3 | | ||||
4 | Copyright 2000 Matthias Ettrich <ettrich@kde.org> | 2 | Copyright 2000 Matthias Ettrich <ettrich@kde.org> | ||
broulik: fix "session management server"
or just remove this line | |||||
5 | Copyright 2007 Urs Wolfer <uwolfer @ kde.org> | 3 | Copyright 2007 Urs Wolfer <uwolfer @ kde.org> | ||
6 | 4 | | |||
7 | Permission is hereby granted, free of charge, to any person obtaining a copy | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy | ||
8 | of this software and associated documentation files (the "Software"), to deal | 6 | of this software and associated documentation files (the "Software"), to deal | ||
9 | in the Software without restriction, including without limitation the rights | 7 | in the Software without restriction, including without limitation the rights | ||
10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
11 | copies of the Software, and to permit persons to whom the Software is | 9 | copies of the Software, and to permit persons to whom the Software is | ||
12 | furnished to do so, subject to the following conditions: | 10 | furnished to do so, subject to the following conditions: | ||
13 | 11 | | |||
14 | The above copyright notice and this permission notice shall be included in | 12 | The above copyright notice and this permission notice shall be included in | ||
15 | all copies or substantial portions of the Software. | 13 | all copies or substantial portions of the Software. | ||
16 | 14 | | |||
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
20 | AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN | 18 | AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN | ||
21 | AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | 19 | AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
22 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
23 | 21 | | |||
24 | ******************************************************************/ | 22 | ******************************************************************/ | ||
25 | 23 | | |||
26 | #include "shutdowndlg.h" | 24 | #include "shutdowndlg.h" | ||
27 | #include "ksmserver_debug.h" | | |||
28 | 25 | | |||
29 | #include <QApplication> | 26 | #include <QApplication> | ||
30 | #include <QQuickItem> | 27 | #include <QQuickItem> | ||
31 | #include <QTimer> | 28 | #include <QTimer> | ||
32 | #include <QFile> | 29 | #include <QFile> | ||
33 | #include <QDBusConnection> | 30 | #include <QDBusConnection> | ||
34 | #include <QDBusMessage> | 31 | #include <QDBusMessage> | ||
35 | #include <QDBusPendingCall> | 32 | #include <QDBusPendingCall> | ||
Show All 23 Lines | |||||
59 | #include <stdio.h> | 56 | #include <stdio.h> | ||
60 | #include <netwm.h> | 57 | #include <netwm.h> | ||
61 | 58 | | |||
62 | #include <X11/Xutil.h> | 59 | #include <X11/Xutil.h> | ||
63 | #include <X11/Xatom.h> | 60 | #include <X11/Xatom.h> | ||
64 | #include <fixx11h.h> | 61 | #include <fixx11h.h> | ||
65 | 62 | | |||
66 | #include <config-workspace.h> | 63 | #include <config-workspace.h> | ||
64 | #include <debug.h> | ||||
67 | 65 | | |||
68 | #include <KWayland/Client/surface.h> | 66 | #include <KWayland/Client/surface.h> | ||
69 | #include <KWayland/Client/plasmashell.h> | 67 | #include <KWayland/Client/plasmashell.h> | ||
70 | 68 | | |||
71 | Q_DECLARE_METATYPE(Solid::PowerManagement::SleepState) | 69 | Q_DECLARE_METATYPE(Solid::PowerManagement::SleepState) | ||
72 | 70 | | |||
73 | KSMShutdownDlg::KSMShutdownDlg( QWindow* parent, | 71 | KSMShutdownDlg::KSMShutdownDlg( QWindow* parent, | ||
74 | bool maysd, bool choose, KWorkSpace::ShutdownType sdtype, | 72 | bool maysd, bool choose, KWorkSpace::ShutdownType sdtype, | ||
▲ Show 20 Lines • Show All 75 Lines • ▼ Show 20 Line(s) | 141 | { | |||
150 | const QString packageName = cg.readEntry("LookAndFeelPackage", QString()); | 148 | const QString packageName = cg.readEntry("LookAndFeelPackage", QString()); | ||
151 | if (!packageName.isEmpty()) { | 149 | if (!packageName.isEmpty()) { | ||
152 | package.setPath(packageName); | 150 | package.setPath(packageName); | ||
153 | } | 151 | } | ||
154 | 152 | | |||
155 | fileName = package.filePath("logoutmainscript"); | 153 | fileName = package.filePath("logoutmainscript"); | ||
156 | 154 | | |||
157 | if (QFile::exists(fileName)) { | 155 | if (QFile::exists(fileName)) { | ||
158 | //qCDebug(KSMSERVER) << "Using QML theme" << fileName; | | |||
159 | setSource(package.fileUrl("logoutmainscript")); | 156 | setSource(package.fileUrl("logoutmainscript")); | ||
160 | } else { | 157 | } else { | ||
161 | qCWarning(KSMSERVER) << "Couldn't find a theme for the Shutdown dialog" << fileName; | 158 | qCWarning(LOGOUT_GREETER) << "Couldn't find a theme for the Shutdown dialog" << fileName; | ||
162 | return; | 159 | return; | ||
163 | } | 160 | } | ||
164 | 161 | | |||
165 | if(!errors().isEmpty()) { | 162 | if(!errors().isEmpty()) { | ||
166 | qCWarning(KSMSERVER) << errors(); | 163 | qCWarning(LOGOUT_GREETER) << errors(); | ||
167 | } | 164 | } | ||
168 | 165 | | |||
169 | connect(rootObject(), SIGNAL(logoutRequested()), SLOT(slotLogout())); | 166 | connect(rootObject(), SIGNAL(logoutRequested()), SLOT(slotLogout())); | ||
170 | connect(rootObject(), SIGNAL(haltRequested()), SLOT(slotHalt())); | 167 | connect(rootObject(), SIGNAL(haltRequested()), SLOT(slotHalt())); | ||
171 | connect(rootObject(), SIGNAL(suspendRequested(int)), SLOT(slotSuspend(int)) ); | 168 | connect(rootObject(), SIGNAL(suspendRequested(int)), SLOT(slotSuspend(int)) ); | ||
172 | connect(rootObject(), SIGNAL(rebootRequested()), SLOT(slotReboot())); | 169 | connect(rootObject(), SIGNAL(rebootRequested()), SLOT(slotReboot())); | ||
173 | connect(rootObject(), SIGNAL(rebootRequested2(int)), SLOT(slotReboot(int)) ); | 170 | connect(rootObject(), SIGNAL(rebootRequested2(int)), SLOT(slotReboot(int)) ); | ||
174 | connect(rootObject(), SIGNAL(cancelRequested()), SLOT(reject())); | 171 | connect(rootObject(), SIGNAL(cancelRequested()), SLOT(reject())); | ||
▲ Show 20 Lines • Show All 136 Lines • Show Last 20 Lines |
fix "session management server"
or just remove this line