diff options
Diffstat (limited to 'scripts/kconfig/qconf.h')
-rw-r--r-- | scripts/kconfig/qconf.h | 93 |
1 files changed, 48 insertions, 45 deletions
diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h index b3b5657b6b3..91677d900db 100644 --- a/scripts/kconfig/qconf.h +++ b/scripts/kconfig/qconf.h | |||
@@ -3,26 +3,25 @@ | |||
3 | * Released under the terms of the GNU GPL v2.0. | 3 | * Released under the terms of the GNU GPL v2.0. |
4 | */ | 4 | */ |
5 | 5 | ||
6 | #if QT_VERSION < 0x040000 | ||
6 | #include <qlistview.h> | 7 | #include <qlistview.h> |
7 | #if QT_VERSION >= 300 | ||
8 | #include <qsettings.h> | ||
9 | #else | 8 | #else |
10 | class QSettings { | 9 | #include <q3listview.h> |
11 | public: | 10 | #endif |
12 | void beginGroup(const QString& group) { } | 11 | #include <qsettings.h> |
13 | void endGroup(void) { } | 12 | |
14 | bool readBoolEntry(const QString& key, bool def = FALSE, bool* ok = 0) const | 13 | #if QT_VERSION < 0x040000 |
15 | { if (ok) *ok = FALSE; return def; } | 14 | #define Q3ValueList QValueList |
16 | int readNumEntry(const QString& key, int def = 0, bool* ok = 0) const | 15 | #define Q3PopupMenu QPopupMenu |
17 | { if (ok) *ok = FALSE; return def; } | 16 | #define Q3ListView QListView |
18 | QString readEntry(const QString& key, const QString& def = QString::null, bool* ok = 0) const | 17 | #define Q3ListViewItem QListViewItem |
19 | { if (ok) *ok = FALSE; return def; } | 18 | #define Q3VBox QVBox |
20 | QStringList readListEntry(const QString& key, bool* ok = 0) const | 19 | #define Q3TextBrowser QTextBrowser |
21 | { if (ok) *ok = FALSE; return QStringList(); } | 20 | #define Q3MainWindow QMainWindow |
22 | template <class t> | 21 | #define Q3Action QAction |
23 | bool writeEntry(const QString& key, t value) | 22 | #define Q3ToolBar QToolBar |
24 | { return TRUE; } | 23 | #define Q3ListViewItemIterator QListViewItemIterator |
25 | }; | 24 | #define Q3FileDialog QFileDialog |
26 | #endif | 25 | #endif |
27 | 26 | ||
28 | class ConfigView; | 27 | class ConfigView; |
@@ -31,11 +30,10 @@ class ConfigItem; | |||
31 | class ConfigLineEdit; | 30 | class ConfigLineEdit; |
32 | class ConfigMainWindow; | 31 | class ConfigMainWindow; |
33 | 32 | ||
34 | |||
35 | class ConfigSettings : public QSettings { | 33 | class ConfigSettings : public QSettings { |
36 | public: | 34 | public: |
37 | QValueList<int> readSizes(const QString& key, bool *ok); | 35 | Q3ValueList<int> readSizes(const QString& key, bool *ok); |
38 | bool writeSizes(const QString& key, const QValueList<int>& value); | 36 | bool writeSizes(const QString& key, const Q3ValueList<int>& value); |
39 | }; | 37 | }; |
40 | 38 | ||
41 | enum colIdx { | 39 | enum colIdx { |
@@ -44,10 +42,13 @@ enum colIdx { | |||
44 | enum listMode { | 42 | enum listMode { |
45 | singleMode, menuMode, symbolMode, fullMode, listMode | 43 | singleMode, menuMode, symbolMode, fullMode, listMode |
46 | }; | 44 | }; |
45 | enum optionMode { | ||
46 | normalOpt = 0, allOpt, promptOpt | ||
47 | }; | ||
47 | 48 | ||
48 | class ConfigList : public QListView { | 49 | class ConfigList : public Q3ListView { |
49 | Q_OBJECT | 50 | Q_OBJECT |
50 | typedef class QListView Parent; | 51 | typedef class Q3ListView Parent; |
51 | public: | 52 | public: |
52 | ConfigList(ConfigView* p, const char *name = 0); | 53 | ConfigList(ConfigView* p, const char *name = 0); |
53 | void reinit(void); | 54 | void reinit(void); |
@@ -115,6 +116,8 @@ public: | |||
115 | void setAllOpen(bool open); | 116 | void setAllOpen(bool open); |
116 | void setParentMenu(void); | 117 | void setParentMenu(void); |
117 | 118 | ||
119 | bool menuSkip(struct menu *); | ||
120 | |||
118 | template <class P> | 121 | template <class P> |
119 | void updateMenuList(P*, struct menu*); | 122 | void updateMenuList(P*, struct menu*); |
120 | 123 | ||
@@ -124,22 +127,23 @@ public: | |||
124 | QPixmap choiceYesPix, choiceNoPix; | 127 | QPixmap choiceYesPix, choiceNoPix; |
125 | QPixmap menuPix, menuInvPix, menuBackPix, voidPix; | 128 | QPixmap menuPix, menuInvPix, menuBackPix, voidPix; |
126 | 129 | ||
127 | bool showAll, showName, showRange, showData; | 130 | bool showName, showRange, showData; |
128 | enum listMode mode; | 131 | enum listMode mode; |
132 | enum optionMode optMode; | ||
129 | struct menu *rootEntry; | 133 | struct menu *rootEntry; |
130 | QColorGroup disabledColorGroup; | 134 | QColorGroup disabledColorGroup; |
131 | QColorGroup inactivedColorGroup; | 135 | QColorGroup inactivedColorGroup; |
132 | QPopupMenu* headerPopup; | 136 | Q3PopupMenu* headerPopup; |
133 | 137 | ||
134 | private: | 138 | private: |
135 | int colMap[colNr]; | 139 | int colMap[colNr]; |
136 | int colRevMap[colNr]; | 140 | int colRevMap[colNr]; |
137 | }; | 141 | }; |
138 | 142 | ||
139 | class ConfigItem : public QListViewItem { | 143 | class ConfigItem : public Q3ListViewItem { |
140 | typedef class QListViewItem Parent; | 144 | typedef class Q3ListViewItem Parent; |
141 | public: | 145 | public: |
142 | ConfigItem(QListView *parent, ConfigItem *after, struct menu *m, bool v) | 146 | ConfigItem(Q3ListView *parent, ConfigItem *after, struct menu *m, bool v) |
143 | : Parent(parent, after), menu(m), visible(v), goParent(false) | 147 | : Parent(parent, after), menu(m), visible(v), goParent(false) |
144 | { | 148 | { |
145 | init(); | 149 | init(); |
@@ -149,16 +153,14 @@ public: | |||
149 | { | 153 | { |
150 | init(); | 154 | init(); |
151 | } | 155 | } |
152 | ConfigItem(QListView *parent, ConfigItem *after, bool v) | 156 | ConfigItem(Q3ListView *parent, ConfigItem *after, bool v) |
153 | : Parent(parent, after), menu(0), visible(v), goParent(true) | 157 | : Parent(parent, after), menu(0), visible(v), goParent(true) |
154 | { | 158 | { |
155 | init(); | 159 | init(); |
156 | } | 160 | } |
157 | ~ConfigItem(void); | 161 | ~ConfigItem(void); |
158 | void init(void); | 162 | void init(void); |
159 | #if QT_VERSION >= 300 | ||
160 | void okRename(int col); | 163 | void okRename(int col); |
161 | #endif | ||
162 | void updateMenu(void); | 164 | void updateMenu(void); |
163 | void testUpdateMenu(bool v); | 165 | void testUpdateMenu(bool v); |
164 | ConfigList* listView() const | 166 | ConfigList* listView() const |
@@ -213,26 +215,24 @@ public: | |||
213 | ConfigItem *item; | 215 | ConfigItem *item; |
214 | }; | 216 | }; |
215 | 217 | ||
216 | class ConfigView : public QVBox { | 218 | class ConfigView : public Q3VBox { |
217 | Q_OBJECT | 219 | Q_OBJECT |
218 | typedef class QVBox Parent; | 220 | typedef class Q3VBox Parent; |
219 | public: | 221 | public: |
220 | ConfigView(QWidget* parent, const char *name = 0); | 222 | ConfigView(QWidget* parent, const char *name = 0); |
221 | ~ConfigView(void); | 223 | ~ConfigView(void); |
222 | static void updateList(ConfigItem* item); | 224 | static void updateList(ConfigItem* item); |
223 | static void updateListAll(void); | 225 | static void updateListAll(void); |
224 | 226 | ||
225 | bool showAll(void) const { return list->showAll; } | ||
226 | bool showName(void) const { return list->showName; } | 227 | bool showName(void) const { return list->showName; } |
227 | bool showRange(void) const { return list->showRange; } | 228 | bool showRange(void) const { return list->showRange; } |
228 | bool showData(void) const { return list->showData; } | 229 | bool showData(void) const { return list->showData; } |
229 | public slots: | 230 | public slots: |
230 | void setShowAll(bool); | ||
231 | void setShowName(bool); | 231 | void setShowName(bool); |
232 | void setShowRange(bool); | 232 | void setShowRange(bool); |
233 | void setShowData(bool); | 233 | void setShowData(bool); |
234 | void setOptionMode(QAction *); | ||
234 | signals: | 235 | signals: |
235 | void showAllChanged(bool); | ||
236 | void showNameChanged(bool); | 236 | void showNameChanged(bool); |
237 | void showRangeChanged(bool); | 237 | void showRangeChanged(bool); |
238 | void showDataChanged(bool); | 238 | void showDataChanged(bool); |
@@ -242,11 +242,15 @@ public: | |||
242 | 242 | ||
243 | static ConfigView* viewList; | 243 | static ConfigView* viewList; |
244 | ConfigView* nextView; | 244 | ConfigView* nextView; |
245 | |||
246 | static QAction *showNormalAction; | ||
247 | static QAction *showAllAction; | ||
248 | static QAction *showPromptAction; | ||
245 | }; | 249 | }; |
246 | 250 | ||
247 | class ConfigInfoView : public QTextBrowser { | 251 | class ConfigInfoView : public Q3TextBrowser { |
248 | Q_OBJECT | 252 | Q_OBJECT |
249 | typedef class QTextBrowser Parent; | 253 | typedef class Q3TextBrowser Parent; |
250 | public: | 254 | public: |
251 | ConfigInfoView(QWidget* parent, const char *name = 0); | 255 | ConfigInfoView(QWidget* parent, const char *name = 0); |
252 | bool showDebug(void) const { return _showDebug; } | 256 | bool showDebug(void) const { return _showDebug; } |
@@ -254,7 +258,6 @@ public: | |||
254 | public slots: | 258 | public slots: |
255 | void setInfo(struct menu *menu); | 259 | void setInfo(struct menu *menu); |
256 | void saveSettings(void); | 260 | void saveSettings(void); |
257 | void setSource(const QString& name); | ||
258 | void setShowDebug(bool); | 261 | void setShowDebug(bool); |
259 | 262 | ||
260 | signals: | 263 | signals: |
@@ -267,11 +270,11 @@ protected: | |||
267 | QString debug_info(struct symbol *sym); | 270 | QString debug_info(struct symbol *sym); |
268 | static QString print_filter(const QString &str); | 271 | static QString print_filter(const QString &str); |
269 | static void expr_print_help(void *data, struct symbol *sym, const char *str); | 272 | static void expr_print_help(void *data, struct symbol *sym, const char *str); |
270 | QPopupMenu* createPopupMenu(const QPoint& pos); | 273 | Q3PopupMenu* createPopupMenu(const QPoint& pos); |
271 | void contentsContextMenuEvent(QContextMenuEvent *e); | 274 | void contentsContextMenuEvent(QContextMenuEvent *e); |
272 | 275 | ||
273 | struct symbol *sym; | 276 | struct symbol *sym; |
274 | struct menu *menu; | 277 | struct menu *_menu; |
275 | bool _showDebug; | 278 | bool _showDebug; |
276 | }; | 279 | }; |
277 | 280 | ||
@@ -295,10 +298,10 @@ protected: | |||
295 | struct symbol **result; | 298 | struct symbol **result; |
296 | }; | 299 | }; |
297 | 300 | ||
298 | class ConfigMainWindow : public QMainWindow { | 301 | class ConfigMainWindow : public Q3MainWindow { |
299 | Q_OBJECT | 302 | Q_OBJECT |
300 | 303 | ||
301 | static QAction *saveAction; | 304 | static Q3Action *saveAction; |
302 | static void conf_changed(void); | 305 | static void conf_changed(void); |
303 | public: | 306 | public: |
304 | ConfigMainWindow(void); | 307 | ConfigMainWindow(void); |
@@ -327,8 +330,8 @@ protected: | |||
327 | ConfigView *configView; | 330 | ConfigView *configView; |
328 | ConfigList *configList; | 331 | ConfigList *configList; |
329 | ConfigInfoView *helpText; | 332 | ConfigInfoView *helpText; |
330 | QToolBar *toolBar; | 333 | Q3ToolBar *toolBar; |
331 | QAction *backAction; | 334 | Q3Action *backAction; |
332 | QSplitter* split1; | 335 | QSplitter* split1; |
333 | QSplitter* split2; | 336 | QSplitter* split2; |
334 | }; | 337 | }; |