You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
241 lines
4.8 KiB
241 lines
4.8 KiB
15 years ago
|
/*
|
||
|
|
||
|
Shutdown dialog
|
||
|
|
||
|
Copyright (C) 1997, 1998 Steffen Hansen <hansen@kde.org>
|
||
|
Copyright (C) 2000-2003,2005 Oswald Buddenhagen <ossi@kde.org>
|
||
|
|
||
|
|
||
|
This program is free software; you can redistribute it and/or modify
|
||
|
it under the terms of the GNU General Public License as published by
|
||
|
the Free Software Foundation; either version 2 of the License, or
|
||
|
(at your option) any later version.
|
||
|
|
||
|
This program is distributed in the hope that it will be useful,
|
||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
GNU General Public License for more details.
|
||
|
|
||
|
You should have received a copy of the GNU General Public License
|
||
|
along with this program; if not, write to the Free Software
|
||
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||
|
|
||
|
*/
|
||
|
|
||
|
|
||
13 years ago
|
#ifndef TDMSHUTDOWN_H
|
||
|
#define TDMSHUTDOWN_H
|
||
15 years ago
|
|
||
13 years ago
|
#include "tdmconfig.h" // for HAVE_VTS
|
||
15 years ago
|
#include "kgverify.h"
|
||
|
|
||
|
#include <kpushbutton.h>
|
||
|
|
||
15 years ago
|
#include <tqradiobutton.h>
|
||
|
#include <tqtoolbutton.h>
|
||
|
#include <tqpixmap.h>
|
||
15 years ago
|
|
||
14 years ago
|
class TQLabel;
|
||
15 years ago
|
class KPushButton;
|
||
14 years ago
|
class TQButtonGroup;
|
||
|
class TQGroupBox;
|
||
|
class TQComboBox;
|
||
|
class TQCheckBox;
|
||
|
class TQLineEdit;
|
||
15 years ago
|
|
||
15 years ago
|
enum { Authed = TQDialog::Accepted + 1, Schedule };
|
||
15 years ago
|
|
||
13 years ago
|
class TDMShutdownBase : public FDialog, public KGVerifyHandler {
|
||
15 years ago
|
Q_OBJECT
|
||
|
typedef FDialog inherited;
|
||
|
|
||
|
public:
|
||
13 years ago
|
TDMShutdownBase( int _uid, TQWidget *_parent );
|
||
|
virtual ~TDMShutdownBase();
|
||
15 years ago
|
|
||
|
protected slots:
|
||
|
virtual void accept();
|
||
|
|
||
|
protected:
|
||
|
virtual void accepted();
|
||
|
|
||
|
protected:
|
||
|
void updateNeedRoot();
|
||
15 years ago
|
void complete( TQWidget *prevWidget );
|
||
15 years ago
|
|
||
15 years ago
|
TQVBoxLayout *box;
|
||
15 years ago
|
#ifdef HAVE_VTS
|
||
|
bool willShut;
|
||
|
#else
|
||
|
static const bool willShut = true;
|
||
|
#endif
|
||
|
bool mayNuke, doesNuke, mayOk, maySched;
|
||
|
|
||
|
private slots:
|
||
|
void slotSched();
|
||
|
void slotActivatePlugMenu();
|
||
|
|
||
|
private:
|
||
|
KPushButton *okButton, *cancelButton;
|
||
15 years ago
|
TQLabel *rootlab;
|
||
15 years ago
|
KGStdVerify *verify;
|
||
|
int needRoot, uid;
|
||
|
|
||
|
static int curPlugin;
|
||
|
static PluginList pluginList;
|
||
|
|
||
|
public: // from KGVerifyHandler
|
||
|
virtual void verifyPluginChanged( int id );
|
||
|
virtual void verifyOk();
|
||
|
virtual void verifyFailed();
|
||
|
virtual void verifyRetry();
|
||
15 years ago
|
virtual void verifySetUser( const TQString &user );
|
||
15 years ago
|
};
|
||
|
|
||
|
|
||
13 years ago
|
class TDMShutdown : public TDMShutdownBase {
|
||
15 years ago
|
Q_OBJECT
|
||
13 years ago
|
typedef TDMShutdownBase inherited;
|
||
15 years ago
|
|
||
|
public:
|
||
13 years ago
|
TDMShutdown( int _uid, TQWidget *_parent = 0 );
|
||
15 years ago
|
static void scheduleShutdown( TQWidget *_parent = 0 );
|
||
15 years ago
|
|
||
|
protected slots:
|
||
|
virtual void accept();
|
||
|
|
||
|
protected:
|
||
|
virtual void accepted();
|
||
|
|
||
|
private slots:
|
||
|
void slotTargetChanged();
|
||
|
void slotWhenChanged();
|
||
|
|
||
|
private:
|
||
15 years ago
|
TQButtonGroup *howGroup;
|
||
|
TQGroupBox *schedGroup;
|
||
|
TQRadioButton *restart_rb;
|
||
|
TQLineEdit *le_start, *le_timeout;
|
||
|
TQCheckBox *cb_force;
|
||
|
TQComboBox *targets;
|
||
15 years ago
|
int oldTarget;
|
||
|
int sch_st, sch_to;
|
||
|
|
||
|
};
|
||
|
|
||
13 years ago
|
class TDMRadioButton : public TQRadioButton {
|
||
15 years ago
|
Q_OBJECT
|
||
15 years ago
|
typedef TQRadioButton inherited;
|
||
15 years ago
|
|
||
|
public:
|
||
13 years ago
|
TDMRadioButton( const TQString &label, TQWidget *parent );
|
||
15 years ago
|
|
||
|
private:
|
||
15 years ago
|
virtual void mouseDoubleClickEvent( TQMouseEvent * );
|
||
15 years ago
|
|
||
|
signals:
|
||
|
void doubleClicked();
|
||
|
|
||
|
};
|
||
|
|
||
13 years ago
|
class TDMDelayedPushButton : public KPushButton {
|
||
15 years ago
|
Q_OBJECT
|
||
|
typedef KPushButton inherited;
|
||
|
|
||
|
public:
|
||
13 years ago
|
TDMDelayedPushButton( const KGuiItem &item, TQWidget *parent, const char *name = 0 );
|
||
15 years ago
|
void setPopup( TQPopupMenu *pop );
|
||
15 years ago
|
|
||
|
private slots:
|
||
|
void slotTimeout();
|
||
|
void slotPressed();
|
||
|
void slotReleased();
|
||
|
|
||
|
private:
|
||
15 years ago
|
TQPopupMenu *pop;
|
||
|
TQTimer popt;
|
||
15 years ago
|
};
|
||
|
|
||
13 years ago
|
class TDMSlimShutdown : public FDialog {
|
||
15 years ago
|
Q_OBJECT
|
||
|
typedef FDialog inherited;
|
||
|
|
||
|
public:
|
||
13 years ago
|
TDMSlimShutdown( TQWidget *_parent = 0 );
|
||
|
~TDMSlimShutdown();
|
||
15 years ago
|
static void externShutdown( int type, const char *os, int uid );
|
||
|
|
||
|
private slots:
|
||
|
void slotHalt();
|
||
|
void slotReboot();
|
||
|
void slotReboot( int );
|
||
|
void slotSched();
|
||
|
|
||
|
private:
|
||
|
bool checkShutdown( int type, const char *os );
|
||
|
char **targetList;
|
||
|
|
||
|
};
|
||
|
|
||
13 years ago
|
class TDMConfShutdown : public TDMShutdownBase {
|
||
15 years ago
|
Q_OBJECT
|
||
13 years ago
|
typedef TDMShutdownBase inherited;
|
||
15 years ago
|
|
||
|
public:
|
||
13 years ago
|
TDMConfShutdown( int _uid, struct dpySpec *sess, int type, const char *os,
|
||
15 years ago
|
TQWidget *_parent = 0 );
|
||
15 years ago
|
};
|
||
|
|
||
13 years ago
|
class TDMCancelShutdown : public TDMShutdownBase {
|
||
15 years ago
|
Q_OBJECT
|
||
13 years ago
|
typedef TDMShutdownBase inherited;
|
||
15 years ago
|
|
||
|
public:
|
||
13 years ago
|
TDMCancelShutdown( int how, int start, int timeout, int force, int uid,
|
||
15 years ago
|
const char *os, TQWidget *_parent );
|
||
15 years ago
|
};
|
||
|
|
||
15 years ago
|
class KSMPushButton : public KPushButton
|
||
|
{
|
||
|
Q_OBJECT
|
||
|
|
||
|
public:
|
||
|
|
||
15 years ago
|
KSMPushButton( const KGuiItem &item, TQWidget *parent, const char *name = 0 );
|
||
15 years ago
|
|
||
|
protected:
|
||
15 years ago
|
virtual void keyPressEvent(TQKeyEvent*e);
|
||
|
virtual void keyReleaseEvent(TQKeyEvent*e);
|
||
15 years ago
|
|
||
|
private:
|
||
|
|
||
|
bool m_pressed;
|
||
|
|
||
|
};
|
||
|
|
||
14 years ago
|
class FlatButton : public TQToolButton
|
||
15 years ago
|
{
|
||
|
Q_OBJECT
|
||
|
|
||
|
public:
|
||
|
|
||
15 years ago
|
FlatButton( TQWidget *parent = 0, const char *name = 0 );
|
||
15 years ago
|
~FlatButton();
|
||
|
|
||
|
protected:
|
||
15 years ago
|
virtual void keyPressEvent(TQKeyEvent*e);
|
||
|
virtual void keyReleaseEvent(TQKeyEvent*e);
|
||
15 years ago
|
|
||
|
private slots:
|
||
|
|
||
|
private:
|
||
|
void init();
|
||
|
|
||
|
bool m_pressed;
|
||
15 years ago
|
TQString m_text;
|
||
|
TQPixmap m_pixmap;
|
||
15 years ago
|
|
||
|
};
|
||
|
|
||
13 years ago
|
#endif /* TDMSHUTDOWN_H */
|