File indexing completed on 2024-05-05 05:38:40
0001 /* 0002 ksmserver - the KDE session management server 0003 0004 SPDX-FileCopyrightText: 2000 Matthias Ettrich <ettrich@kde.org> 0005 0006 SPDX-License-Identifier: MIT 0007 */ 0008 0009 #pragma once 0010 0011 #include <QScreen> 0012 0013 #include <PlasmaQuick/QuickViewSharedEngine> 0014 #include <kworkspace.h> 0015 #include <sessionmanagement.h> 0016 0017 #include <KPackage/Package> 0018 #include <KPackage/PackageLoader> 0019 0020 // The confirmation dialog 0021 class KSMShutdownDlg : public PlasmaQuick::QuickViewSharedEngine 0022 { 0023 Q_OBJECT 0024 0025 public: 0026 KSMShutdownDlg(QWindow *parent, KWorkSpace::ShutdownType sdtype, QScreen *screen); 0027 0028 void setWindowed(bool windowed) 0029 { 0030 m_windowed = windowed; 0031 } 0032 void init(const KPackage::Package &package); 0033 bool result() const; 0034 0035 public Q_SLOTS: 0036 void accept(); 0037 void reject(); 0038 void slotLogout(); 0039 void slotHalt(); 0040 void slotReboot(); 0041 void slotReboot(int); 0042 void slotSuspend(int); 0043 void slotLockScreen(); 0044 void slotCancelSoftwareUpdate(); 0045 0046 Q_SIGNALS: 0047 void accepted(); 0048 void rejected(); 0049 0050 protected: 0051 void resizeEvent(QResizeEvent *e) override; 0052 0053 private: 0054 void checkSoftwareUpdatePending(); 0055 0056 bool m_windowed = false; 0057 QString m_bootOption; 0058 QStringList rebootOptions; 0059 bool m_result : 1; 0060 SessionManagement m_session; 0061 };