5 Copyright (C) 1997, 1998 Steffen Hansen <hansen@kde.org>
6 Copyright (C) 2000-2003,2005 Oswald Buddenhagen <ossi@kde.org>
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
29 #include "kdmconfig.h" // for HAVE_VTS
32 #include <kpushbutton.h>
34 #include <QRadioButton>
44 enum { Authed
= QDialog::Accepted
+ 1, Schedule
};
46 class KDMShutdownBase
: public FDialog
, public KGVerifyHandler
{
48 typedef FDialog inherited
;
51 KDMShutdownBase( int _uid
, QWidget
*_parent
);
52 virtual ~KDMShutdownBase();
55 virtual void accept();
58 virtual void accepted();
61 void updateNeedRoot();
62 void complete( QWidget
*prevWidget
);
68 static const bool willShut
= true;
70 bool mayNuke
, doesNuke
, mayOk
, maySched
;
74 void slotActivatePlugMenu();
77 KPushButton
*okButton
, *cancelButton
;
83 static PluginList pluginList
;
85 public: // from KGVerifyHandler
86 virtual void verifyPluginChanged( int id
);
87 virtual void verifyOk();
88 virtual void verifyFailed();
89 virtual void verifyRetry();
90 virtual void verifySetUser( const QString
&user
);
94 class KDMShutdown
: public KDMShutdownBase
{
96 typedef KDMShutdownBase inherited
;
99 KDMShutdown( int _uid
, QWidget
*_parent
= 0 );
100 static void scheduleShutdown( QWidget
*_parent
= 0 );
103 virtual void accept();
106 virtual void accepted();
109 void slotTargetChanged();
110 void slotWhenChanged();
114 QGroupBox
*schedGroup
;
115 QRadioButton
*restart_rb
;
116 QLineEdit
*le_start
, *le_timeout
;
124 class KDMRadioButton
: public QRadioButton
{
126 typedef QRadioButton inherited
;
129 KDMRadioButton( const QString
&label
, QWidget
*parent
);
132 virtual void mouseDoubleClickEvent( QMouseEvent
* );
135 void doubleClicked();
139 class KDMDelayedPushButton
: public KPushButton
{
141 typedef KPushButton inherited
;
144 KDMDelayedPushButton( const KGuiItem
&item
, QWidget
*parent
);
145 void setDelayedMenu( QMenu
*pop
);
151 class KDMSlimShutdown
: public FDialog
{
153 typedef FDialog inherited
;
156 KDMSlimShutdown( QWidget
*_parent
= 0 );
157 static void externShutdown( int type
, const QString
&os
, int uid
);
162 void slotReboot( QAction
* );
166 bool checkShutdown( int type
, const QString
&os
);
167 QStringList targetList
;
171 class KDMConfShutdown
: public KDMShutdownBase
{
173 typedef KDMShutdownBase inherited
;
176 KDMConfShutdown( int _uid
, const QList
<DpySpec
> &sessions
, int type
,
177 const QString
&os
, QWidget
*_parent
= 0 );
180 class KDMCancelShutdown
: public KDMShutdownBase
{
182 typedef KDMShutdownBase inherited
;
185 KDMCancelShutdown( int how
, int start
, int timeout
, int force
, int uid
,
186 const QString
&os
, QWidget
*_parent
);
189 #endif /* KDMSHUTDOWN_H */