aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig/qconf.h
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/kconfig/qconf.h')
-rw-r--r--scripts/kconfig/qconf.h158
1 files changed, 113 insertions, 45 deletions
diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h
index e52f3e90bf0c..6a9e3b14c227 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,64 +34,38 @@ 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, ConfigMainWindow* cview, 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 {
53 promptColIdx, nameColIdx, noColIdx, modColIdx, yesColIdx, dataColIdx, colNr 42 promptColIdx, nameColIdx, noColIdx, modColIdx, yesColIdx, dataColIdx, colNr
54}; 43};
55enum listMode { 44enum listMode {
56 singleMode, menuMode, symbolMode, fullMode 45 singleMode, menuMode, symbolMode, fullMode, listMode
57}; 46};
58 47
59class ConfigList : public QListView { 48class 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, ConfigMainWindow* cview, 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 {
67 return (ConfigView*)Parent::parent(); 56 return (ConfigView*)Parent::parent();
68 } 57 }
58 ConfigItem* findConfigItem(struct menu *);
69 59
70protected: 60protected:
71 ConfigMainWindow* cview;
72
73 void keyPressEvent(QKeyEvent *e); 61 void keyPressEvent(QKeyEvent *e);
74 void contentsMousePressEvent(QMouseEvent *e); 62 void contentsMousePressEvent(QMouseEvent *e);
75 void contentsMouseReleaseEvent(QMouseEvent *e); 63 void contentsMouseReleaseEvent(QMouseEvent *e);
76 void contentsMouseMoveEvent(QMouseEvent *e); 64 void contentsMouseMoveEvent(QMouseEvent *e);
77 void contentsMouseDoubleClickEvent(QMouseEvent *e); 65 void contentsMouseDoubleClickEvent(QMouseEvent *e);
78 void focusInEvent(QFocusEvent *e); 66 void focusInEvent(QFocusEvent *e);
67 void contextMenuEvent(QContextMenuEvent *e);
68
79public slots: 69public slots:
80 void setRootMenu(struct menu *menu); 70 void setRootMenu(struct menu *menu);
81 71
@@ -83,10 +73,12 @@ public slots:
83 void setValue(ConfigItem* item, tristate val); 73 void setValue(ConfigItem* item, tristate val);
84 void changeValue(ConfigItem* item); 74 void changeValue(ConfigItem* item);
85 void updateSelection(void); 75 void updateSelection(void);
76 void saveSettings(void);
86signals: 77signals:
78 void menuChanged(struct menu *menu);
87 void menuSelected(struct menu *menu); 79 void menuSelected(struct menu *menu);
88 void parentSelected(void); 80 void parentSelected(void);
89 void gotFocus(void); 81 void gotFocus(struct menu *);
90 82
91public: 83public:
92 void updateListAll(void) 84 void updateListAll(void)
@@ -137,6 +129,7 @@ public:
137 struct menu *rootEntry; 129 struct menu *rootEntry;
138 QColorGroup disabledColorGroup; 130 QColorGroup disabledColorGroup;
139 QColorGroup inactivedColorGroup; 131 QColorGroup inactivedColorGroup;
132 QPopupMenu* headerPopup;
140 133
141private: 134private:
142 int colMap[colNr]; 135 int colMap[colNr];
@@ -208,9 +201,7 @@ class ConfigLineEdit : public QLineEdit {
208 Q_OBJECT 201 Q_OBJECT
209 typedef class QLineEdit Parent; 202 typedef class QLineEdit Parent;
210public: 203public:
211 ConfigLineEdit(ConfigView* parent) 204 ConfigLineEdit(ConfigView* parent);
212 : Parent(parent)
213 { }
214 ConfigView* parent(void) const 205 ConfigView* parent(void) const
215 { 206 {
216 return (ConfigView*)Parent::parent(); 207 return (ConfigView*)Parent::parent();
@@ -222,26 +213,104 @@ public:
222 ConfigItem *item; 213 ConfigItem *item;
223}; 214};
224 215
216class ConfigView : public QVBox {
217 Q_OBJECT
218 typedef class QVBox Parent;
219public:
220 ConfigView(QWidget* parent, const char *name = 0);
221 ~ConfigView(void);
222 static void updateList(ConfigItem* item);
223 static void updateListAll(void);
224
225 bool showAll(void) const { return list->showAll; }
226 bool showName(void) const { return list->showName; }
227 bool showRange(void) const { return list->showRange; }
228 bool showData(void) const { return list->showData; }
229public slots:
230 void setShowAll(bool);
231 void setShowName(bool);
232 void setShowRange(bool);
233 void setShowData(bool);
234signals:
235 void showAllChanged(bool);
236 void showNameChanged(bool);
237 void showRangeChanged(bool);
238 void showDataChanged(bool);
239public:
240 ConfigList* list;
241 ConfigLineEdit* lineEdit;
242
243 static ConfigView* viewList;
244 ConfigView* nextView;
245};
246
247class ConfigInfoView : public QTextBrowser {
248 Q_OBJECT
249 typedef class QTextBrowser Parent;
250public:
251 ConfigInfoView(QWidget* parent, const char *name = 0);
252 bool showDebug(void) const { return _showDebug; }
253
254public slots:
255 void setInfo(struct menu *menu);
256 void saveSettings(void);
257 void setSource(const QString& name);
258 void setShowDebug(bool);
259
260signals:
261 void showDebugChanged(bool);
262 void menuSelected(struct menu *);
263
264protected:
265 void symbolInfo(void);
266 void menuInfo(void);
267 QString debug_info(struct symbol *sym);
268 static QString print_filter(const QString &str);
269 static void expr_print_help(void *data, struct symbol *sym, const char *str);
270 QPopupMenu* createPopupMenu(const QPoint& pos);
271 void contentsContextMenuEvent(QContextMenuEvent *e);
272
273 struct symbol *sym;
274 struct menu *menu;
275 bool _showDebug;
276};
277
278class ConfigSearchWindow : public QDialog {
279 Q_OBJECT
280 typedef class QDialog Parent;
281public:
282 ConfigSearchWindow(QWidget* parent, const char *name = 0);
283
284public slots:
285 void saveSettings(void);
286 void search(void);
287
288protected:
289 QLineEdit* editField;
290 QPushButton* searchButton;
291 QSplitter* split;
292 ConfigView* list;
293 ConfigInfoView* info;
294
295 struct symbol **result;
296};
297
225class ConfigMainWindow : public QMainWindow { 298class ConfigMainWindow : public QMainWindow {
226 Q_OBJECT 299 Q_OBJECT
227public: 300public:
228 ConfigMainWindow(void); 301 ConfigMainWindow(void);
229public slots: 302public slots:
230 void setHelp(QListViewItem* item);
231 void changeMenu(struct menu *); 303 void changeMenu(struct menu *);
304 void setMenuLink(struct menu *);
232 void listFocusChanged(void); 305 void listFocusChanged(void);
233 void goBack(void); 306 void goBack(void);
234 void loadConfig(void); 307 void loadConfig(void);
235 void saveConfig(void); 308 void saveConfig(void);
236 void saveConfigAs(void); 309 void saveConfigAs(void);
310 void searchConfig(void);
237 void showSingleView(void); 311 void showSingleView(void);
238 void showSplitView(void); 312 void showSplitView(void);
239 void showFullView(void); 313 void showFullView(void);
240 void setShowAll(bool);
241 void setShowDebug(bool);
242 void setShowRange(bool);
243 void setShowName(bool);
244 void setShowData(bool);
245 void showIntro(void); 314 void showIntro(void);
246 void showAbout(void); 315 void showAbout(void);
247 void saveSettings(void); 316 void saveSettings(void);
@@ -249,15 +318,14 @@ public slots:
249protected: 318protected:
250 void closeEvent(QCloseEvent *e); 319 void closeEvent(QCloseEvent *e);
251 320
321 ConfigSearchWindow *searchWindow;
252 ConfigView *menuView; 322 ConfigView *menuView;
253 ConfigList *menuList; 323 ConfigList *menuList;
254 ConfigView *configView; 324 ConfigView *configView;
255 ConfigList *configList; 325 ConfigList *configList;
256 QTextView *helpText; 326 ConfigInfoView *helpText;
257 QToolBar *toolBar; 327 QToolBar *toolBar;
258 QAction *backAction; 328 QAction *backAction;
259 QSplitter* split1; 329 QSplitter* split1;
260 QSplitter* split2; 330 QSplitter* split2;
261
262 bool showDebug;
263}; 331};