summaryrefslogtreecommitdiff
path: root/scripts/kconfig/qconf.h
Unidiff
Diffstat (limited to 'scripts/kconfig/qconf.h') (more/less context) (ignore whitespace changes)
-rw-r--r--scripts/kconfig/qconf.h59
1 files changed, 42 insertions, 17 deletions
diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h
index f8f3669..6f096b4 100644
--- a/scripts/kconfig/qconf.h
+++ b/scripts/kconfig/qconf.h
@@ -1,58 +1,78 @@
1/* 1/*
2 * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org> 2 * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
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#include <qlistview.h> 6#include <qlistview.h>
7 7
8class ConfigLineEdit; 8class ConfigList;
9class ConfigItem; 9class ConfigItem;
10class ConfigView; 10class ConfigLineEdit;
11class ConfigMainWindow;
12
13class ConfigView : public QVBox {
14 Q_OBJECT
15 typedef class QVBox Parent;
16public:
17 ConfigView(QWidget* parent, ConfigMainWindow* cview);
18 ~ConfigView(void);
19 static void updateList(ConfigItem* item);
20 static void updateListAll(void);
21
22public:
23 ConfigList* list;
24 ConfigLineEdit* lineEdit;
25
26 static ConfigView* viewList;
27 ConfigView* nextView;
28};
11 29
12enum colIdx { 30enum colIdx {
13 promptColIdx, nameColIdx, noColIdx, modColIdx, yesColIdx, dataColIdx, colNr 31 promptColIdx, nameColIdx, noColIdx, modColIdx, yesColIdx, dataColIdx, colNr
14}; 32};
15enum listMode { 33enum listMode {
16 singleMode, menuMode, symbolMode, fullMode 34 singleMode, menuMode, symbolMode, fullMode
17}; 35};
18 36
19class ConfigList : public QListView { 37class ConfigList : public QListView {
20 Q_OBJECT 38 Q_OBJECT
21 typedef class QListView Parent; 39 typedef class QListView Parent;
22public: 40public:
23 ConfigList(QWidget* p, ConfigView* cview); 41 ConfigList(ConfigView* p, ConfigMainWindow* cview);
24 void reinit(void); 42 void reinit(void);
43 ConfigView* parent(void) const
44 {
45 return (ConfigView*)Parent::parent();
46 }
25 47
26 ConfigLineEdit* lineEdit;
27protected: 48protected:
28 ConfigView* cview; 49 ConfigMainWindow* cview;
29 50
30 void keyPressEvent(QKeyEvent *e); 51 void keyPressEvent(QKeyEvent *e);
31 void contentsMousePressEvent(QMouseEvent *e); 52 void contentsMousePressEvent(QMouseEvent *e);
32 void contentsMouseReleaseEvent(QMouseEvent *e); 53 void contentsMouseReleaseEvent(QMouseEvent *e);
33 void contentsMouseMoveEvent(QMouseEvent *e); 54 void contentsMouseMoveEvent(QMouseEvent *e);
34 void contentsMouseDoubleClickEvent(QMouseEvent *e); 55 void contentsMouseDoubleClickEvent(QMouseEvent *e);
35 void focusInEvent(QFocusEvent *e); 56 void focusInEvent(QFocusEvent *e);
36public slots: 57public slots:
37 void setRootMenu(struct menu *menu); 58 void setRootMenu(struct menu *menu);
38 59
39 void updateList(ConfigItem *item); 60 void updateList(ConfigItem *item);
40 void setValue(ConfigItem* item, tristate val); 61 void setValue(ConfigItem* item, tristate val);
41 void changeValue(ConfigItem* item); 62 void changeValue(ConfigItem* item);
42 void updateSelection(void); 63 void updateSelection(void);
43signals: 64signals:
44 void menuSelected(struct menu *menu); 65 void menuSelected(struct menu *menu);
45 void parentSelected(void); 66 void parentSelected(void);
46 void symbolChanged(ConfigItem* item);
47 void gotFocus(void); 67 void gotFocus(void);
48 68
49public: 69public:
50 void updateListAll(void) 70 void updateListAll(void)
51 { 71 {
52 updateAll = true; 72 updateAll = true;
53 updateList(NULL); 73 updateList(NULL);
54 updateAll = false; 74 updateAll = false;
55 } 75 }
56 ConfigList* listView() 76 ConfigList* listView()
57 { 77 {
58 return this; 78 return this;
@@ -91,40 +111,41 @@ public:
91 struct menu *rootEntry; 111 struct menu *rootEntry;
92 QColorGroup disabledColorGroup; 112 QColorGroup disabledColorGroup;
93 QColorGroup inactivedColorGroup; 113 QColorGroup inactivedColorGroup;
94 114
95private: 115private:
96 int colMap[colNr]; 116 int colMap[colNr];
97 int colRevMap[colNr]; 117 int colRevMap[colNr];
98}; 118};
99 119
100class ConfigItem : public QListViewItem { 120class ConfigItem : public QListViewItem {
101 typedef class QListViewItem Parent; 121 typedef class QListViewItem Parent;
102public: 122public:
103 ConfigItem(QListView *parent, ConfigItem *after, struct menu *m) 123 ConfigItem(QListView *parent, ConfigItem *after, struct menu *m, bool v)
104 : Parent(parent, after), menu(m) 124 : Parent(parent, after), menu(m), visible(v)
105 { 125 {
106 init(); 126 init();
107 } 127 }
108 ConfigItem(ConfigItem *parent, ConfigItem *after, struct menu *m) 128 ConfigItem(ConfigItem *parent, ConfigItem *after, struct menu *m, bool v)
109 : Parent(parent, after), menu(m) 129 : Parent(parent, after), menu(m), visible(v)
110 { 130 {
111 init(); 131 init();
112 } 132 }
113 ~ConfigItem(void); 133 ~ConfigItem(void);
114 void init(void); 134 void init(void);
115#if QT_VERSION >= 300 135#if QT_VERSION >= 300
116 void okRename(int col); 136 void okRename(int col);
117#endif 137#endif
118 void updateMenu(void); 138 void updateMenu(void);
139 bool updateNeeded(void);
119 ConfigList* listView() const 140 ConfigList* listView() const
120 { 141 {
121 return (ConfigList*)Parent::listView(); 142 return (ConfigList*)Parent::listView();
122 } 143 }
123 ConfigItem* firstChild() const 144 ConfigItem* firstChild() const
124 { 145 {
125 return (ConfigItem *)Parent::firstChild(); 146 return (ConfigItem *)Parent::firstChild();
126 } 147 }
127 ConfigItem* nextSibling() const 148 ConfigItem* nextSibling() const
128 { 149 {
129 return (ConfigItem *)Parent::nextSibling(); 150 return (ConfigItem *)Parent::nextSibling();
130 } 151 }
@@ -137,65 +158,69 @@ public:
137 return Parent::text(listView()->mapIdx(idx)); 158 return Parent::text(listView()->mapIdx(idx));
138 } 159 }
139 void setPixmap(colIdx idx, const QPixmap& pm) 160 void setPixmap(colIdx idx, const QPixmap& pm)
140 { 161 {
141 Parent::setPixmap(listView()->mapIdx(idx), pm); 162 Parent::setPixmap(listView()->mapIdx(idx), pm);
142 } 163 }
143 const QPixmap* pixmap(colIdx idx) const 164 const QPixmap* pixmap(colIdx idx) const
144 { 165 {
145 return Parent::pixmap(listView()->mapIdx(idx)); 166 return Parent::pixmap(listView()->mapIdx(idx));
146 } 167 }
147 void paintCell(QPainter* p, const QColorGroup& cg, int column, int width, int align); 168 void paintCell(QPainter* p, const QColorGroup& cg, int column, int width, int align);
148 169
170 ConfigItem* nextItem;
149 struct menu *menu; 171 struct menu *menu;
150 bool visible; 172 bool visible;
151 bool doInit;
152}; 173};
153 174
154class ConfigLineEdit : public QLineEdit { 175class ConfigLineEdit : public QLineEdit {
155 Q_OBJECT 176 Q_OBJECT
156 typedef class QLineEdit Parent; 177 typedef class QLineEdit Parent;
157public: 178public:
158 ConfigLineEdit(QWidget * parent) 179 ConfigLineEdit(ConfigView* parent)
159 : QLineEdit(parent) 180 : Parent(parent)
160 { } 181 { }
182 ConfigView* parent(void) const
183 {
184 return (ConfigView*)Parent::parent();
185 }
161 void show(ConfigItem *i); 186 void show(ConfigItem *i);
162 void keyPressEvent(QKeyEvent *e); 187 void keyPressEvent(QKeyEvent *e);
163signals:
164 void lineChanged(ConfigItem *item);
165 188
166public: 189public:
167 ConfigItem *item; 190 ConfigItem *item;
168}; 191};
169 192
170class ConfigView : public QMainWindow { 193class ConfigMainWindow : public QMainWindow {
171 Q_OBJECT 194 Q_OBJECT
172public: 195public:
173 ConfigView(void); 196 ConfigMainWindow(void);
174public slots: 197public slots:
175 void setHelp(QListViewItem* item); 198 void setHelp(QListViewItem* item);
176 void changeMenu(struct menu *); 199 void changeMenu(struct menu *);
177 void listFocusChanged(void); 200 void listFocusChanged(void);
178 void goBack(void); 201 void goBack(void);
179 void loadConfig(void); 202 void loadConfig(void);
180 void saveConfig(void); 203 void saveConfig(void);
181 void saveConfigAs(void); 204 void saveConfigAs(void);
182 void showSingleView(void); 205 void showSingleView(void);
183 void showSplitView(void); 206 void showSplitView(void);
184 void showFullView(void); 207 void showFullView(void);
185 void setShowAll(bool); 208 void setShowAll(bool);
186 void setShowDebug(bool); 209 void setShowDebug(bool);
187 void setShowRange(bool); 210 void setShowRange(bool);
188 void setShowName(bool); 211 void setShowName(bool);
189 void setShowData(bool); 212 void setShowData(bool);
213 void showIntro(void);
214 void showAbout(void);
190 215
191protected: 216protected:
192 void closeEvent(QCloseEvent *e); 217 void closeEvent(QCloseEvent *e);
193 218
194 ConfigList *menuList; 219 ConfigList *menuList;
195 ConfigList *configList; 220 ConfigList *configList;
196 QTextView *helpText; 221 QTextView *helpText;
197 QToolBar *toolBar; 222 QToolBar *toolBar;
198 QAction *backAction; 223 QAction *backAction;
199 224
200 bool showDebug; 225 bool showDebug;
201}; 226};