diff options
Diffstat (limited to 'kshutdown/systemconfig.h')
-rw-r--r-- | kshutdown/systemconfig.h | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/kshutdown/systemconfig.h b/kshutdown/systemconfig.h new file mode 100644 index 0000000..6fd3729 --- /dev/null +++ b/kshutdown/systemconfig.h @@ -0,0 +1,60 @@ +/* + systemconfig.h - A system configuration manager + Copyright (C) 2005 Konrad Twardowski <kdtonline@poczta.onet.pl> + + 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef __SYSTEMCONFIG_H__ +#define __SYSTEMCONFIG_H__ + +#include <kdialogbase.h> + +class KListView; +class KListViewItem; + +/** @short A system configuration manager. */ +class SystemConfig: KDialogBase +{ + Q_OBJECT +public: + /** + * Returns @c true if the <b>shut down</b> and @b reboot functions are available. + */ + static bool canShutDown(); + + /** + * Shows a modal dialog, and checks the system configuration. + * @param parent A parent widget + */ + static void check(QWidget *parent); +private: + enum Type { Info, OK, Warning }; + static int _canShutDown; + int _problems; + KListView *_messages; + KListViewItem + *_kdmNotDetected, + *_shutdownAllowItem; + SystemConfig(QWidget *parent); + KListViewItem *add(const Type type, const QString &message); + void checkFile(const QString &file); + void checkKDE(); + void checkKDM(); +private slots: + void slotExecuted(QListViewItem *item); +}; + +#endif // __SYSTEMCONFIG_H__ |