aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig/qconf.h
diff options
context:
space:
mode:
authorRoman Zippel <zippel@linux-m68k.org>2006-06-09 01:12:46 -0400
committerSam Ravnborg <sam@mars.ravnborg.org>2006-06-09 01:31:31 -0400
commit7fc925fd6a4c24e1db879d227fc0a0f65a335aa1 (patch)
tree35ff433ba285d150a3347bee23afcd79a3d2aa31 /scripts/kconfig/qconf.h
parent43bf612af2d4f2615dcbf86af8206e2f40231237 (diff)
kconfig: finer customization via popup menus
This allows to configure every symbol list and info window separately via a popup menu, these settings are also separately saved and restored. Cleanup the ConfigSettings class a bit to reduce the number of #ifdef. Signed-off-by: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts/kconfig/qconf.h')
-rw-r--r--scripts/kconfig/qconf.h95
1 files changed, 61 insertions, 34 deletions
diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h
index a548d13149b3..fb50e1c6029f 100644
--- a/scripts/kconfig/qconf.h
+++ b/scripts/kconfig/qconf.h
@@ -7,9 +7,25 @@
7#if QT_VERSION >= 300 7#if QT_VERSION >= 300
8#include <qsettings.h> 8#include <qsettings.h>
9#else 9#else
10class QSettings { }; 10class QSettings {
11public:
12 void beginGroup(const QString& group) { }
13 void endGroup(void) { }
14 bool readBoolEntry(const QString& key, bool def = FALSE, bool* ok = 0) const
15 { if (ok) *ok = FALSE; return def; }
16 int readNumEntry(const QString& key, int def = 0, bool* ok = 0) const
17 { if (ok) *ok = FALSE; return def; }
18 QString readEntry(const QString& key, const QString& def = QString::null, bool* ok = 0) const
19 { if (ok) *ok = FALSE; return def; }
20 QStringList readListEntry(const QString& key, bool* ok = 0) const
21 { if (ok) *ok = FALSE; return QStringList(); }
22 template <class t>
23 bool writeEntry(const QString& key, t value)
24 { return TRUE; }
25};
11#endif 26#endif
12 27
28class ConfigView;
13class ConfigList; 29class ConfigList;
14class ConfigItem; 30class ConfigItem;
15class ConfigLineEdit; 31class ConfigLineEdit;
@@ -18,35 +34,8 @@ class ConfigMainWindow;
18 34
19class ConfigSettings : public QSettings { 35class ConfigSettings : public QSettings {
20public: 36public:
21 ConfigSettings();
22
23#if QT_VERSION >= 300
24 void readListSettings();
25 QValueList<int> readSizes(const QString& key, bool *ok); 37 QValueList<int> readSizes(const QString& key, bool *ok);
26 bool writeSizes(const QString& key, const QValueList<int>& value); 38 bool writeSizes(const QString& key, const QValueList<int>& value);
27#endif
28
29 bool showAll;
30 bool showName;
31 bool showRange;
32 bool showData;
33};
34
35class ConfigView : public QVBox {
36 Q_OBJECT
37 typedef class QVBox Parent;
38public:
39 ConfigView(QWidget* parent, ConfigSettings* configSettings);
40 ~ConfigView(void);
41 static void updateList(ConfigItem* item);
42 static void updateListAll(void);
43
44public:
45 ConfigList* list;
46 ConfigLineEdit* lineEdit;
47
48 static ConfigView* viewList;
49 ConfigView* nextView;
50}; 39};
51 40
52enum colIdx { 41enum colIdx {
@@ -60,7 +49,7 @@ class ConfigList : public QListView {
60 Q_OBJECT 49 Q_OBJECT
61 typedef class QListView Parent; 50 typedef class QListView Parent;
62public: 51public:
63 ConfigList(ConfigView* p, ConfigSettings *configSettings); 52 ConfigList(ConfigView* p, const char *name = 0);
64 void reinit(void); 53 void reinit(void);
65 ConfigView* parent(void) const 54 ConfigView* parent(void) const
66 { 55 {
@@ -74,6 +63,8 @@ protected:
74 void contentsMouseMoveEvent(QMouseEvent *e); 63 void contentsMouseMoveEvent(QMouseEvent *e);
75 void contentsMouseDoubleClickEvent(QMouseEvent *e); 64 void contentsMouseDoubleClickEvent(QMouseEvent *e);
76 void focusInEvent(QFocusEvent *e); 65 void focusInEvent(QFocusEvent *e);
66 void contextMenuEvent(QContextMenuEvent *e);
67
77public slots: 68public slots:
78 void setRootMenu(struct menu *menu); 69 void setRootMenu(struct menu *menu);
79 70
@@ -81,6 +72,7 @@ public slots:
81 void setValue(ConfigItem* item, tristate val); 72 void setValue(ConfigItem* item, tristate val);
82 void changeValue(ConfigItem* item); 73 void changeValue(ConfigItem* item);
83 void updateSelection(void); 74 void updateSelection(void);
75 void saveSettings(void);
84signals: 76signals:
85 void menuChanged(struct menu *menu); 77 void menuChanged(struct menu *menu);
86 void menuSelected(struct menu *menu); 78 void menuSelected(struct menu *menu);
@@ -136,6 +128,7 @@ public:
136 struct menu *rootEntry; 128 struct menu *rootEntry;
137 QColorGroup disabledColorGroup; 129 QColorGroup disabledColorGroup;
138 QColorGroup inactivedColorGroup; 130 QColorGroup inactivedColorGroup;
131 QPopupMenu* headerPopup;
139 132
140private: 133private:
141 int colMap[colNr]; 134 int colMap[colNr];
@@ -219,6 +212,37 @@ public:
219 ConfigItem *item; 212 ConfigItem *item;
220}; 213};
221 214
215class ConfigView : public QVBox {
216 Q_OBJECT
217 typedef class QVBox Parent;
218public:
219 ConfigView(QWidget* parent, const char *name = 0);
220 ~ConfigView(void);
221 static void updateList(ConfigItem* item);
222 static void updateListAll(void);
223
224 bool showAll(void) const { return list->showAll; }
225 bool showName(void) const { return list->showName; }
226 bool showRange(void) const { return list->showRange; }
227 bool showData(void) const { return list->showData; }
228public slots:
229 void setShowAll(bool);
230 void setShowName(bool);
231 void setShowRange(bool);
232 void setShowData(bool);
233signals:
234 void showAllChanged(bool);
235 void showNameChanged(bool);
236 void showRangeChanged(bool);
237 void showDataChanged(bool);
238public:
239 ConfigList* list;
240 ConfigLineEdit* lineEdit;
241
242 static ConfigView* viewList;
243 ConfigView* nextView;
244};
245
222class ConfigInfoView : public QTextBrowser { 246class ConfigInfoView : public QTextBrowser {
223 Q_OBJECT 247 Q_OBJECT
224 typedef class QTextBrowser Parent; 248 typedef class QTextBrowser Parent;
@@ -228,6 +252,7 @@ public:
228 252
229public slots: 253public slots:
230 void setInfo(struct menu *menu); 254 void setInfo(struct menu *menu);
255 void saveSettings(void);
231 void setSource(const QString& name); 256 void setSource(const QString& name);
232 void setShowDebug(bool); 257 void setShowDebug(bool);
233 258
@@ -239,6 +264,8 @@ protected:
239 QString debug_info(struct symbol *sym); 264 QString debug_info(struct symbol *sym);
240 static QString print_filter(const QString &str); 265 static QString print_filter(const QString &str);
241 static void expr_print_help(void *data, const char *str); 266 static void expr_print_help(void *data, const char *str);
267 QPopupMenu* createPopupMenu(const QPoint& pos);
268 void contentsContextMenuEvent(QContextMenuEvent *e);
242 269
243 struct menu *menu; 270 struct menu *menu;
244 bool _showDebug; 271 bool _showDebug;
@@ -248,12 +275,16 @@ class ConfigSearchWindow : public QDialog {
248 Q_OBJECT 275 Q_OBJECT
249 typedef class QDialog Parent; 276 typedef class QDialog Parent;
250public: 277public:
251 ConfigSearchWindow(QWidget* parent); 278 ConfigSearchWindow(QWidget* parent, const char *name = 0);
279
252public slots: 280public slots:
281 void saveSettings(void);
253 void search(void); 282 void search(void);
283
254protected: 284protected:
255 QLineEdit* editField; 285 QLineEdit* editField;
256 QPushButton* searchButton; 286 QPushButton* searchButton;
287 QSplitter* split;
257 ConfigView* list; 288 ConfigView* list;
258 ConfigInfoView* info; 289 ConfigInfoView* info;
259 290
@@ -276,10 +307,6 @@ public slots:
276 void showSingleView(void); 307 void showSingleView(void);
277 void showSplitView(void); 308 void showSplitView(void);
278 void showFullView(void); 309 void showFullView(void);
279 void setShowAll(bool);
280 void setShowRange(bool);
281 void setShowName(bool);
282 void setShowData(bool);
283 void showIntro(void); 310 void showIntro(void);
284 void showAbout(void); 311 void showAbout(void);
285 void saveSettings(void); 312 void saveSettings(void);