summaryrefslogtreecommitdiffstats
path: root/ksmserver/shutdowndlg.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-12-11 20:21:27 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-12-11 20:21:27 +0000
commit10e41144596fc9ced40fc349d9ecd099b1c2ea19 (patch)
tree88ab04e475ff5a4cd889cb082f5760b6e0bf5e4e /ksmserver/shutdowndlg.h
parent4aed2c8219774f5d797760606b8489a92ddc5163 (diff)
downloadtdebase-10e41144596fc9ced40fc349d9ecd099b1c2ea19.tar.gz
tdebase-10e41144596fc9ced40fc349d9ecd099b1c2ea19.zip
Initial import of Trinity 3.5.11 to kdebase
Extends krandrtray, adds iccconfig kcontrol module, adds run dialog autocomplete and lots of bugfixes Will need to check for commit warnings and repair as encountered Also needs full compile test git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1061475 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ksmserver/shutdowndlg.h')
-rw-r--r--ksmserver/shutdowndlg.h88
1 files changed, 84 insertions, 4 deletions
diff --git a/ksmserver/shutdowndlg.h b/ksmserver/shutdowndlg.h
index 9fcb77c51..d696dff71 100644
--- a/ksmserver/shutdowndlg.h
+++ b/ksmserver/shutdowndlg.h
@@ -8,23 +8,40 @@ Copyright (C) 2000 Matthias Ettrich <[email protected]>
#define SHUTDOWNDLG_H
#include <qpixmap.h>
+#include <qimage.h>
+#include <qdatetime.h>
#include <qdialog.h>
#include <kpushbutton.h>
+#include <qpushbutton.h>
+#include <qframe.h>
+#include <kguiitem.h>
+#include <qtoolbutton.h>
+
class QPushButton;
class QVButtonGroup;
class QPopupMenu;
class QTimer;
+class QPainter;
+class QString;
+class KAction;
+
#include <kapplication.h>
+#include <kpixmapio.h>
-// The (singleton) widget that makes the desktop gray.
+/* We acknowledge the the dbus API is unstable */
+#define DBUS_API_SUBJECT_TO_CHANGE
+#include <dbus/connection.h>
+#include <libhal.h>
+
+// The (singleton) widget that makes/fades the desktop gray.
class KSMShutdownFeedback : public QWidget
{
Q_OBJECT
public:
- static void start() { s_pSelf = new KSMShutdownFeedback(); s_pSelf->show(); }
- static void stop() { delete s_pSelf; s_pSelf = 0L; }
+ static void start() { s_pSelf = new KSMShutdownFeedback(); }
+ static void stop() { if ( s_pSelf != 0L ) s_pSelf->fadeBack(); delete s_pSelf; s_pSelf = 0L; }
static KSMShutdownFeedback * self() { return s_pSelf; }
protected:
@@ -38,6 +55,17 @@ private:
KSMShutdownFeedback();
int m_currentY;
QPixmap m_root;
+ void fadeBack( void );
+ float m_grayOpacity;
+ float m_compensation;
+ bool m_fadeBackwards;
+ bool m_readDelayComplete;
+ QImage m_unfadedImage;
+ QImage m_grayImage;
+ QTime m_fadeTime;
+ int m_rowsDone;
+ KPixmapIO m_pmio;
+
};
@@ -54,9 +82,11 @@ public slots:
void slotHalt();
void slotReboot();
void slotReboot(int);
+ void slotSuspend();
+ void slotHibernate();
protected:
- ~KSMShutdownDlg() {};
+ ~KSMShutdownDlg();
private:
KSMShutdownDlg( QWidget* parent, bool maysd, KApplication::ShutdownType sdtype );
@@ -64,6 +94,9 @@ private:
QString m_bootOption;
QPopupMenu *targets;
QStringList rebootOptions;
+ LibHalContext* m_halCtx;
+ DBusConnection *m_dbusConn;
+ bool m_lockOnResume;
};
class KSMDelayedPushButton : public KPushButton
@@ -85,4 +118,51 @@ private:
QTimer *popt;
};
+class KSMPushButton : public KPushButton
+{
+ Q_OBJECT
+
+public:
+
+ KSMPushButton( const KGuiItem &item, QWidget *parent, const char *name = 0 );
+
+protected:
+ virtual void keyPressEvent(QKeyEvent*e);
+ virtual void keyReleaseEvent(QKeyEvent*e);
+
+private:
+
+ bool m_pressed;
+
+};
+
+
+
+class FlatButton : public QToolButton
+{
+ Q_OBJECT
+
+ public:
+
+ FlatButton( QWidget *parent = 0, const char *name = 0 );
+ ~FlatButton();
+
+ protected:
+ virtual void keyPressEvent(QKeyEvent*e);
+ virtual void keyReleaseEvent(QKeyEvent*e);
+
+ private slots:
+
+ private:
+ void init();
+
+ bool m_pressed;
+ QString m_text;
+ QPixmap m_pixmap;
+
+};
+
+
+
+
#endif