add more spacing
[personal-kdebase.git] / runtime / kcontrol / componentchooser / componentchooserwm.h
blobd81fd16616d54bf5b6922cd720943896a5f089cc
1 /***************************************************************************
2 componentchooserwm.h - description
3 -------------------
4 copyright : (C) 2002 by Joseph Wenninger
5 email : jowenn@kde.org
6 ***************************************************************************/
8 /***************************************************************************
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License version 2 as *
12 * published by the Free Software Foundationi *
13 * *
14 ***************************************************************************/
16 #ifndef _COMPONENTCHOOSERWM_H_
17 #define _COMPONENTCHOOSERWM_H_
19 #include "ui_wmconfig_ui.h"
20 #include "componentchooser.h"
22 #include <kprocess.h>
24 class KTimerDialog;
26 class CfgWm: public QWidget, public Ui::WmConfig_UI, public CfgPlugin
28 Q_OBJECT
29 public:
30 CfgWm(QWidget *parent);
31 virtual ~CfgWm();
32 virtual void load(KConfig *cfg);
33 virtual void save(KConfig *cfg);
34 virtual void defaults();
36 protected Q_SLOTS:
37 void configChanged();
38 void configureWm();
39 void checkConfigureWm();
40 void wmLaunchError();
41 void wmLaunchFinished( int exitcode, QProcess::ExitStatus exitstatus );
43 Q_SIGNALS:
44 void changed(bool);
45 private:
46 bool tryWmLaunch();
47 void loadWMs( const QString& current );
48 QString currentWm() const;
49 bool saveAndConfirm();
50 struct WmData
52 QString internalName;
53 QString exec;
54 QString configureCommand;
55 QString restartArgument;
56 QString parentArgument;
58 WmData currentWmData() const;
59 QHash< QString, WmData > wms; // i18n text -> data
60 QString oldwm; // the original value
61 enum Launch
63 WmNone, // not trying to launch any WM at the moment
64 WmLaunching, // launching
65 WmOk, // was successful
66 WmFailed // it failed
68 Launch wmLaunchingState;
69 KTimerDialog* wmDialog;
70 KProcess* wmProcess;
73 #endif