Changeset View
Changeset View
Standalone View
Standalone View
kcms/componentchooser/componentchooser.h
Show All 33 Lines | |||||
34 | class CfgPlugin | 34 | class CfgPlugin | ||
35 | { | 35 | { | ||
36 | public: | 36 | public: | ||
37 | CfgPlugin(){} | 37 | CfgPlugin(){} | ||
38 | virtual ~CfgPlugin(){} | 38 | virtual ~CfgPlugin(){} | ||
39 | virtual void load(KConfig *cfg)=0; | 39 | virtual void load(KConfig *cfg)=0; | ||
40 | virtual void save(KConfig *cfg)=0; | 40 | virtual void save(KConfig *cfg)=0; | ||
41 | virtual void defaults()=0; | 41 | virtual void defaults()=0; | ||
42 | virtual bool isDefaults() const { | ||||
43 | return false; | ||||
44 | }; | ||||
42 | }; | 45 | }; | ||
43 | 46 | | |||
44 | class CfgComponent: public QWidget, public Ui::ComponentConfig_UI, public CfgPlugin | 47 | class CfgComponent: public QWidget, public Ui::ComponentConfig_UI, public CfgPlugin | ||
45 | { | 48 | { | ||
46 | Q_OBJECT | 49 | Q_OBJECT | ||
47 | public: | 50 | public: | ||
48 | CfgComponent(QWidget *parent); | 51 | CfgComponent(QWidget *parent); | ||
49 | ~CfgComponent() override; | 52 | ~CfgComponent() override; | ||
50 | void load(KConfig *cfg) override; | 53 | void load(KConfig *cfg) override; | ||
51 | void save(KConfig *cfg) override; | 54 | void save(KConfig *cfg) override; | ||
52 | void defaults() override; | 55 | void defaults() override; | ||
53 | 56 | | |||
54 | protected: | 57 | protected: | ||
55 | QHash<QString, QString> m_lookupDict,m_revLookupDict; | 58 | QHash<QString, QString> m_lookupDict,m_revLookupDict; | ||
56 | 59 | | |||
57 | protected Q_SLOTS: | 60 | protected Q_SLOTS: | ||
58 | void slotComponentChanged(const QString&); | 61 | void slotComponentChanged(const QString&); | ||
59 | Q_SIGNALS: | 62 | Q_SIGNALS: | ||
60 | void changed(bool); | 63 | void changed(bool); | ||
64 | void defaulted(bool); | ||||
61 | }; | 65 | }; | ||
62 | 66 | | |||
63 | class ComponentChooser : public QWidget, public Ui::ComponentChooser_UI | 67 | class ComponentChooser : public QWidget, public Ui::ComponentChooser_UI | ||
64 | { | 68 | { | ||
65 | 69 | | |||
66 | Q_OBJECT | 70 | Q_OBJECT | ||
67 | 71 | | |||
68 | public: | 72 | public: | ||
Show All 13 Lines | 79 | private: | |||
82 | void loadConfigWidget(const QString &, const QString &, const QString &); | 86 | void loadConfigWidget(const QString &, const QString &, const QString &); | ||
83 | 87 | | |||
84 | protected Q_SLOTS: | 88 | protected Q_SLOTS: | ||
85 | void emitChanged(bool); | 89 | void emitChanged(bool); | ||
86 | void slotServiceSelected(QListWidgetItem *); | 90 | void slotServiceSelected(QListWidgetItem *); | ||
87 | 91 | | |||
88 | Q_SIGNALS: | 92 | Q_SIGNALS: | ||
89 | void changed(bool); | 93 | void changed(bool); | ||
94 | void defaulted(bool); | ||||
90 | 95 | | |||
91 | }; | 96 | }; | ||
92 | 97 | | |||
93 | 98 | | |||
94 | #endif | 99 | #endif |