bugfixes and added confirmation dialog before executing specified command
[qbat.git] / powermanager.h
blobc97af04e33c03ccc233b9ab8bde156e6b4d730bd
1 //
2 // C++ Interface: cpowermanager
3 //
4 // Author: Oliver Groß <z.o.gross@gmx.de>, (C) 2008
5 //
6 // Copyright: See COPYING file that comes with this distribution
7 //
8 #ifndef QBAT_POWERMANAGER_H
9 #define QBAT_POWERMANAGER_H
11 #include <QHash>
12 #include <QDir>
13 #include <QMenu>
14 #include <QSettings>
15 #include <QSystemTrayIcon>
16 #include "common.h"
18 namespace qbat {
19 class CBatteryIcon;
21 class CPowerManager : public QObject {
22 Q_OBJECT
23 private:
24 enum messageType {MSGT_INFORMATION, MSGT_WARNING};
26 int m_Timer;
27 bool m_CriticalHandled;
28 QDir m_SysfsDir;
30 Settings m_Settings;
31 QSettings m_SettingsFile;
33 QMenu m_ContextMenu;
35 QHash<QString, CBatteryIcon *> m_BatteryIcons;
36 QSystemTrayIcon m_DefaultTrayIcon;
38 inline void readSettings();
39 inline void writeSettings();
41 void timerEvent(QTimerEvent * event);
42 public:
43 CPowerManager(QObject * parent = 0);
44 ~CPowerManager();
45 private slots:
46 void updateData();
47 void restartTimer();
48 public slots:
49 void showSettings();
50 void showAbout();
54 #endif