aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorBoris Barbulovski <bbarbulovski@gmail.com>2015-09-22 14:36:18 -0400
committerMichal Marek <mmarek@suse.com>2015-10-14 08:59:02 -0400
commit59e564408f88ee14395dd96f713eae2474edb591 (patch)
treea8c1b9c17f76f1280211bca31ac5a64ec40b581f /scripts
parent1019f1a586afe835bf1c6e4e8acfcddd2b7465f6 (diff)
Port xconfig to Qt5 - Put back some of the old implementation.
Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Thiago Macieira <thiago.macieira@intel.com> Signed-off-by: Michal Marek <mmarek@suse.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/kconfig/qconf.cc121
-rw-r--r--scripts/kconfig/qconf.h113
2 files changed, 216 insertions, 18 deletions
diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
index a86409d6f6a6..0987a751d740 100644
--- a/scripts/kconfig/qconf.cc
+++ b/scripts/kconfig/qconf.cc
@@ -84,9 +84,31 @@ bool ConfigSettings::writeSizes(const QString& key, const QList<int>& value)
84 for (it = value.begin(); it != value.end(); ++it) 84 for (it = value.begin(); it != value.end(); ++it)
85 stringList.push_back(QString::number(*it)); 85 stringList.push_back(QString::number(*it));
86 setValue(key, stringList); 86 setValue(key, stringList);
87
87 return true; 88 return true;
88} 89}
89 90
91
92/*
93 * set the new data
94 * TODO check the value
95 */
96void ConfigItem::okRename(int col)
97{
98}
99
100/*
101 * update the displayed of a menu entry
102 */
103void ConfigItem::updateMenu(void)
104{
105}
106
107void ConfigItem::testUpdateMenu(bool v)
108{
109}
110
111
90/* 112/*
91 * construct a menu entry 113 * construct a menu entry
92 */ 114 */
@@ -133,9 +155,92 @@ void ConfigLineEdit::keyPressEvent(QKeyEvent* e)
133} 155}
134 156
135ConfigList::ConfigList(ConfigView* p, const char *name) 157ConfigList::ConfigList(ConfigView* p, const char *name)
136 : Parent(p) 158 : Parent(p),
159 updateAll(false),
160 symbolYesPix(xpm_symbol_yes), symbolModPix(xpm_symbol_mod), symbolNoPix(xpm_symbol_no),
161 choiceYesPix(xpm_choice_yes), choiceNoPix(xpm_choice_no),
162 menuPix(xpm_menu), menuInvPix(xpm_menu_inv), menuBackPix(xpm_menuback), voidPix(xpm_void),
163 showName(false), showRange(false), showData(false), optMode(normalOpt),
164 rootEntry(0), headerPopup(0)
165{
166}
167
168void ConfigList::reinit(void)
169{
170}
171
172void ConfigList::saveSettings(void)
173{
174}
175
176ConfigItem* ConfigList::findConfigItem(struct menu *menu)
177{
178}
179
180void ConfigList::updateSelection(void)
181{
182}
183
184void ConfigList::updateList(ConfigItem* item)
185{
186}
187
188void ConfigList::setValue(ConfigItem* item, tristate val)
189{
190}
191
192void ConfigList::changeValue(ConfigItem* item)
193{
194}
195
196void ConfigList::setRootMenu(struct menu *menu)
197{
198}
199
200void ConfigList::setParentMenu(void)
201{
202}
203
204/*
205 * update all the children of a menu entry
206 * removes/adds the entries from the parent widget as necessary
207 *
208 * parent: either the menu list widget or a menu entry widget
209 * menu: entry to be updated
210 */
211template <class P>
212void ConfigList::updateMenuList(P* parent, struct menu* menu)
213{
214}
215
216void ConfigList::keyPressEvent(QKeyEvent* ev)
217{
218}
219
220void ConfigList::contentsMousePressEvent(QMouseEvent* e)
137{ 221{
138} 222}
223
224void ConfigList::contentsMouseReleaseEvent(QMouseEvent* e)
225{
226}
227
228void ConfigList::contentsMouseMoveEvent(QMouseEvent* e)
229{
230}
231
232void ConfigList::contentsMouseDoubleClickEvent(QMouseEvent* e)
233{
234}
235
236void ConfigList::focusInEvent(QFocusEvent *e)
237{
238}
239
240void ConfigList::contextMenuEvent(QContextMenuEvent *e)
241{
242}
243
139ConfigView*ConfigView::viewList; 244ConfigView*ConfigView::viewList;
140QAction *ConfigView::showNormalAction; 245QAction *ConfigView::showNormalAction;
141QAction *ConfigView::showAllAction; 246QAction *ConfigView::showAllAction;
@@ -206,11 +311,6 @@ ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name)
206 311
207void ConfigInfoView::saveSettings(void) 312void ConfigInfoView::saveSettings(void)
208{ 313{
209 /*if (name()) {
210 configSettings->beginGroup(name());
211 configSettings->setValue("/showDebug", showDebug());
212 configSettings->endGroup();
213 }*/
214} 314}
215 315
216void ConfigInfoView::setShowDebug(bool b) 316void ConfigInfoView::setShowDebug(bool b)
@@ -480,15 +580,6 @@ ConfigSearchWindow::ConfigSearchWindow(ConfigMainWindow* parent, const char *nam
480 580
481void ConfigSearchWindow::saveSettings(void) 581void ConfigSearchWindow::saveSettings(void)
482{ 582{
483 /*if (name()) {
484 configSettings->beginGroup(name());
485 configSettings->setValue("/window x", pos().x());
486 configSettings->setValue("/window y", pos().y());
487 configSettings->setValue("/window width", size().width());
488 configSettings->setValue("/window height", size().height());
489 configSettings->writeSizes("/split", split->sizes());
490 configSettings->endGroup();
491 }*/
492} 583}
493 584
494void ConfigSearchWindow::search(void) 585void ConfigSearchWindow::search(void)
diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h
index 54b3b925139a..7c55b1d97a1a 100644
--- a/scripts/kconfig/qconf.h
+++ b/scripts/kconfig/qconf.h
@@ -44,6 +44,81 @@ class ConfigList : public QTreeWidget {
44 typedef class QTreeWidget Parent; 44 typedef class QTreeWidget Parent;
45public: 45public:
46 ConfigList(ConfigView* p, const char *name = 0); 46 ConfigList(ConfigView* p, const char *name = 0);
47 void reinit(void);
48 ConfigView* parent(void) const
49 {
50 return (ConfigView*)Parent::parent();
51 }
52 ConfigItem* findConfigItem(struct menu *);
53
54protected:
55 void keyPressEvent(QKeyEvent *e);
56 void contentsMousePressEvent(QMouseEvent *e);
57 void contentsMouseReleaseEvent(QMouseEvent *e);
58 void contentsMouseMoveEvent(QMouseEvent *e);
59 void contentsMouseDoubleClickEvent(QMouseEvent *e);
60 void focusInEvent(QFocusEvent *e);
61 void contextMenuEvent(QContextMenuEvent *e);
62
63public slots:
64 void setRootMenu(struct menu *menu);
65
66 void updateList(ConfigItem *item);
67 void setValue(ConfigItem* item, tristate val);
68 void changeValue(ConfigItem* item);
69 void updateSelection(void);
70 void saveSettings(void);
71signals:
72 void menuChanged(struct menu *menu);
73 void menuSelected(struct menu *menu);
74 void parentSelected(void);
75 void gotFocus(struct menu *);
76
77public:
78 void updateListAll(void)
79 {
80 updateAll = true;
81 updateList(NULL);
82 updateAll = false;
83 }
84 ConfigList* listView()
85 {
86 return this;
87 }
88 ConfigItem* firstChild() const
89 {
90 // TODO: Implement me.
91 return NULL;
92 }
93 void addColumn(colIdx idx, const QString& label)
94 {
95 // TODO: Implement me.
96 }
97 void removeColumn(colIdx idx)
98 {
99 // TODO: Implement me.
100 }
101 void setAllOpen(bool open);
102 void setParentMenu(void);
103
104 bool menuSkip(struct menu *);
105
106 template <class P>
107 void updateMenuList(P*, struct menu*);
108
109 bool updateAll;
110
111 QPixmap symbolYesPix, symbolModPix, symbolNoPix;
112 QPixmap choiceYesPix, choiceNoPix;
113 QPixmap menuPix, menuInvPix, menuBackPix, voidPix;
114
115 bool showName, showRange, showData;
116 enum listMode mode;
117 enum optionMode optMode;
118 struct menu *rootEntry;
119 QPalette disabledColorGroup;
120 QPalette inactivedColorGroup;
121 QMenu* headerPopup;
47}; 122};
48 123
49class ConfigItem : public QTreeWidgetItem { 124class ConfigItem : public QTreeWidgetItem {
@@ -66,6 +141,38 @@ public:
66 } 141 }
67 ~ConfigItem(void); 142 ~ConfigItem(void);
68 void init(void); 143 void init(void);
144 void okRename(int col);
145 void updateMenu(void);
146 void testUpdateMenu(bool v);
147 ConfigList* listView() const
148 {
149 return (ConfigList*)Parent::treeWidget();
150 }
151 ConfigItem* firstChild() const
152 {
153 return (ConfigItem *)Parent::child(0);
154 }
155 ConfigItem* nextSibling() const
156 {
157 return NULL; // TODO: Implement me
158 }
159 void setText(colIdx idx, const QString& text)
160 {
161 Parent::setText(idx, text);
162 }
163 QString text(colIdx idx) const
164 {
165 return Parent::text(idx);
166 }
167 void setPixmap(colIdx idx, const QPixmap& pm)
168 {
169 // TODO: Implement me
170 }
171 const QPixmap* pixmap(colIdx idx) const
172 {
173 return NULL; // TODO: Implement me
174 }
175 // Implement paintCell
69 176
70 ConfigItem* nextItem; 177 ConfigItem* nextItem;
71 struct menu *menu; 178 struct menu *menu;
@@ -98,9 +205,9 @@ public:
98 static void updateList(ConfigItem* item); 205 static void updateList(ConfigItem* item);
99 static void updateListAll(void); 206 static void updateListAll(void);
100 207
101 bool showName(void) const { return false; } // TODO: Implement me. 208 bool showName(void) const { return list->showName; }
102 bool showRange(void) const { return false; } // TODO: Implement me. 209 bool showRange(void) const { return list->showRange; }
103 bool showData(void) const { return false; } // TODO: Implement me. 210 bool showData(void) const { return list->showData; }
104public slots: 211public slots:
105 void setShowName(bool); 212 void setShowName(bool);
106 void setShowRange(bool); 213 void setShowRange(bool);