History

xconfig: add support to show hidden options which have prompts

This feature has been supported in menuconfig and gconfig, so here add it to xconfig.

Li Zefan committed 16 years ago

Commit 39a48971 parent 120d63e2 files · +62 −23Browse files

Showing the changes to scripts (2 of 2 files). Show all

Unified · Split

2 files
  1. scripts/kconfig/qconf.cc +50 −19
  2. scripts/kconfig/qconf.h +12 −4
scripts/kconfig/qconf.cc+50−19
@@ -148,7 +148,7 @@ void ConfigItem::updateMenu(void) · 147 unmodified lines
148 case S_TRISTATE:148 case S_TRISTATE:
149 char ch;149 char ch;
150 150
151 if (!sym_is_changable(sym) && !list->showAll) {151 if (!sym_is_changable(sym) && list->optMode == normalOpt) {
152 setPixmap(promptColIdx, 0);152 setPixmap(promptColIdx, 0);
153 setText(noColIdx, QString::null);153 setText(noColIdx, QString::null);
154 setText(modColIdx, QString::null);154 setText(modColIdx, QString::null);
@@ -319,7 +319,7 @@ ConfigList::ConfigList(ConfigView* p, const char *name) · 164 unmodified lines
319 symbolYesPix(xpm_symbol_yes), symbolModPix(xpm_symbol_mod), symbolNoPix(xpm_symbol_no),319 symbolYesPix(xpm_symbol_yes), symbolModPix(xpm_symbol_mod), symbolNoPix(xpm_symbol_no),
320 choiceYesPix(xpm_choice_yes), choiceNoPix(xpm_choice_no),320 choiceYesPix(xpm_choice_yes), choiceNoPix(xpm_choice_no),
321 menuPix(xpm_menu), menuInvPix(xpm_menu_inv), menuBackPix(xpm_menuback), voidPix(xpm_void),321 menuPix(xpm_menu), menuInvPix(xpm_menu_inv), menuBackPix(xpm_menuback), voidPix(xpm_void),
322 showAll(false), showName(false), showRange(false), showData(false),322 showName(false), showRange(false), showData(false), optMode(normalOpt),
323 rootEntry(0), headerPopup(0)323 rootEntry(0), headerPopup(0)
324{324{
325 int i;325 int i;
@@ -336,10 +336,10 @@ ConfigList::ConfigList(ConfigView* p, const char *name) · 10 unmodified lines
336 336
337 if (name) {337 if (name) {
338 configSettings->beginGroup(name);338 configSettings->beginGroup(name);
339 showAll = configSettings->readBoolEntry("/showAll", false);
340 showName = configSettings->readBoolEntry("/showName", false);339 showName = configSettings->readBoolEntry("/showName", false);
341 showRange = configSettings->readBoolEntry("/showRange", false);340 showRange = configSettings->readBoolEntry("/showRange", false);
342 showData = configSettings->readBoolEntry("/showData", false);341 showData = configSettings->readBoolEntry("/showData", false);
342 optMode = (enum optionMode)configSettings->readNumEntry("/optionMode", false);
343 configSettings->endGroup();343 configSettings->endGroup();
344 connect(configApp, SIGNAL(aboutToQuit()), SLOT(saveSettings()));344 connect(configApp, SIGNAL(aboutToQuit()), SLOT(saveSettings()));
345 }345 }
@@ -351,6 +351,17 @@ ConfigList::ConfigList(ConfigView* p, const char *name) · 5 unmodified lines
351 reinit();351 reinit();
352}352}
353 353
354bool ConfigList::menuSkip(struct menu *menu)
355{
356 if (optMode == normalOpt && menu_is_visible(menu))
357 return false;
358 if (optMode == promptOpt && menu_has_prompt(menu))
359 return false;
360 if (optMode == allOpt)
361 return false;
362 return true;
363}
364
354void ConfigList::reinit(void)365void ConfigList::reinit(void)
355{366{
356 removeColumn(dataColIdx);367 removeColumn(dataColIdx);
@@ -379,7 +390,7 @@ void ConfigList::saveSettings(void) · 22 unmodified lines
379 configSettings->writeEntry("/showName", showName);390 configSettings->writeEntry("/showName", showName);
380 configSettings->writeEntry("/showRange", showRange);391 configSettings->writeEntry("/showRange", showRange);
381 configSettings->writeEntry("/showData", showData);392 configSettings->writeEntry("/showData", showData);
382 configSettings->writeEntry("/showAll", showAll);393 configSettings->writeEntry("/optionMode", (int)optMode);
383 configSettings->endGroup();394 configSettings->endGroup();
384 }395 }
385}396}
@@ -605,7 +616,7 @@ void ConfigList::updateMenuList(P* parent, struct menu* menu) · 219 unmodified lines
605 }616 }
606 617
607 visible = menu_is_visible(child);618 visible = menu_is_visible(child);
608 if (showAll || visible) {619 if (!menuSkip(child)) {
609 if (!child->sym && !child->list && !child->prompt)620 if (!child->sym && !child->list && !child->prompt)
610 continue;621 continue;
611 if (!item || item->menu != child)622 if (!item || item->menu != child)
@@ -834,7 +845,10 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e) · 222 unmodified lines
834 e->ignore();845 e->ignore();
835}846}
836 847
837ConfigView* ConfigView::viewList;848ConfigView*ConfigView::viewList;
849QAction *ConfigView::showNormalAction;
850QAction *ConfigView::showAllAction;
851QAction *ConfigView::showPromptAction;
838 852
839ConfigView::ConfigView(QWidget* parent, const char *name)853ConfigView::ConfigView(QWidget* parent, const char *name)
840 : Parent(parent, name)854 : Parent(parent, name)
@@ -859,13 +873,16 @@ ConfigView::~ConfigView(void) · 18 unmodified lines
859 }873 }
860}874}
861 875
862void ConfigView::setShowAll(bool b)876void ConfigView::setOptionMode(QAction *act)
863{877{
864 if (list->showAll != b) {878 if (act == showNormalAction)
865 list->showAll = b;879 list->optMode = normalOpt;
866 list->updateListAll();880 else if (act == showAllAction)
867 emit showAllChanged(b);881 list->optMode = allOpt;
868 }882 else
883 list->optMode = promptOpt;
884
885 list->updateListAll();
869}886}
870 887
871void ConfigView::setShowName(bool b)888void ConfigView::setShowName(bool b)
@@ -1320,11 +1337,24 @@ ConfigMainWindow::ConfigMainWindow(void) · 448 unmodified lines
1320 connect(showDataAction, SIGNAL(toggled(bool)), configView, SLOT(setShowData(bool)));1337 connect(showDataAction, SIGNAL(toggled(bool)), configView, SLOT(setShowData(bool)));
1321 connect(configView, SIGNAL(showDataChanged(bool)), showDataAction, SLOT(setOn(bool)));1338 connect(configView, SIGNAL(showDataChanged(bool)), showDataAction, SLOT(setOn(bool)));
1322 showDataAction->setOn(configList->showData);1339 showDataAction->setOn(configList->showData);
1323 QAction *showAllAction = new QAction(NULL, _("Show All Options"), 0, this);1340
1324 showAllAction->setToggleAction(TRUE);1341 QActionGroup *optGroup = new QActionGroup(this);
1325 connect(showAllAction, SIGNAL(toggled(bool)), configView, SLOT(setShowAll(bool)));1342 optGroup->setExclusive(TRUE);
1326 connect(showAllAction, SIGNAL(toggled(bool)), menuView, SLOT(setShowAll(bool)));1343 connect(optGroup, SIGNAL(selected(QAction *)), configView,
1327 showAllAction->setOn(configList->showAll);1344 SLOT(setOptionMode(QAction *)));
1345 connect(optGroup, SIGNAL(selected(QAction *)), menuView,
1346 SLOT(setOptionMode(QAction *)));
1347
1348 configView->showNormalAction = new QAction(NULL, _("Show Normal Options"), 0, optGroup);
1349 configView->showAllAction = new QAction(NULL, _("Show All Options"), 0, optGroup);
1350 configView->showPromptAction = new QAction(NULL, _("Show Prompt Options"), 0, optGroup);
1351 configView->showNormalAction->setToggleAction(TRUE);
1352 configView->showNormalAction->setOn(configList->optMode == normalOpt);
1353 configView->showAllAction->setToggleAction(TRUE);
1354 configView->showAllAction->setOn(configList->optMode == allOpt);
1355 configView->showPromptAction->setToggleAction(TRUE);
1356 configView->showPromptAction->setOn(configList->optMode == promptOpt);
1357
1328 QAction *showDebugAction = new QAction(NULL, _("Show Debug Info"), 0, this);1358 QAction *showDebugAction = new QAction(NULL, _("Show Debug Info"), 0, this);
1329 showDebugAction->setToggleAction(TRUE);1359 showDebugAction->setToggleAction(TRUE);
1330 connect(showDebugAction, SIGNAL(toggled(bool)), helpText, SLOT(setShowDebug(bool)));1360 connect(showDebugAction, SIGNAL(toggled(bool)), helpText, SLOT(setShowDebug(bool)));
@@ -1367,7 +1397,8 @@ ConfigMainWindow::ConfigMainWindow(void) · 36 unmodified lines
1367 showRangeAction->addTo(optionMenu);1397 showRangeAction->addTo(optionMenu);
1368 showDataAction->addTo(optionMenu);1398 showDataAction->addTo(optionMenu);
1369 optionMenu->insertSeparator();1399 optionMenu->insertSeparator();
1370 showAllAction->addTo(optionMenu);1400 optGroup->addTo(optionMenu);
1401 optionMenu->insertSeparator();
1371 showDebugAction->addTo(optionMenu);1402 showDebugAction->addTo(optionMenu);
1372 1403
1373 // create help menu1404 // create help menu
@@ -1462,7 +1493,7 @@ void ConfigMainWindow::setMenuLink(struct menu *menu) · 88 unmodified lines
1462 ConfigList* list = NULL;1493 ConfigList* list = NULL;
1463 ConfigItem* item;1494 ConfigItem* item;
1464 1495
1465 if (!menu_is_visible(menu) && !configView->showAll())1496 if (configList->menuSkip(menu))
1466 return;1497 return;
1467 1498
1468 switch (configList->mode) {1499 switch (configList->mode) {
scripts/kconfig/qconf.h+12−4
@@ -44,6 +44,9 @@ enum colIdx { · 43 unmodified lines
44enum listMode {44enum listMode {
45 singleMode, menuMode, symbolMode, fullMode, listMode45 singleMode, menuMode, symbolMode, fullMode, listMode
46};46};
47enum optionMode {
48 normalOpt = 0, allOpt, promptOpt
49};
47 50
48class ConfigList : public QListView {51class ConfigList : public QListView {
49 Q_OBJECT52 Q_OBJECT
@@ -115,6 +118,8 @@ public: · 65 unmodified lines
115 void setAllOpen(bool open);118 void setAllOpen(bool open);
116 void setParentMenu(void);119 void setParentMenu(void);
117 120
121 bool menuSkip(struct menu *);
122
118 template <class P>123 template <class P>
119 void updateMenuList(P*, struct menu*);124 void updateMenuList(P*, struct menu*);
120 125
@@ -124,8 +129,9 @@ public: · 3 unmodified lines
124 QPixmap choiceYesPix, choiceNoPix;129 QPixmap choiceYesPix, choiceNoPix;
125 QPixmap menuPix, menuInvPix, menuBackPix, voidPix;130 QPixmap menuPix, menuInvPix, menuBackPix, voidPix;
126 131
127 bool showAll, showName, showRange, showData;132 bool showName, showRange, showData;
128 enum listMode mode;133 enum listMode mode;
134 enum optionMode optMode;
129 struct menu *rootEntry;135 struct menu *rootEntry;
130 QColorGroup disabledColorGroup;136 QColorGroup disabledColorGroup;
131 QColorGroup inactivedColorGroup;137 QColorGroup inactivedColorGroup;
@@ -222,17 +228,15 @@ public: · 90 unmodified lines
222 static void updateList(ConfigItem* item);228 static void updateList(ConfigItem* item);
223 static void updateListAll(void);229 static void updateListAll(void);
224 230
225 bool showAll(void) const { return list->showAll; }
226 bool showName(void) const { return list->showName; }231 bool showName(void) const { return list->showName; }
227 bool showRange(void) const { return list->showRange; }232 bool showRange(void) const { return list->showRange; }
228 bool showData(void) const { return list->showData; }233 bool showData(void) const { return list->showData; }
229public slots:234public slots:
230 void setShowAll(bool);
231 void setShowName(bool);235 void setShowName(bool);
232 void setShowRange(bool);236 void setShowRange(bool);
233 void setShowData(bool);237 void setShowData(bool);
238 void setOptionMode(QAction *);
234signals:239signals:
235 void showAllChanged(bool);
236 void showNameChanged(bool);240 void showNameChanged(bool);
237 void showRangeChanged(bool);241 void showRangeChanged(bool);
238 void showDataChanged(bool);242 void showDataChanged(bool);
@@ -242,6 +246,10 @@ public: · 3 unmodified lines
242 246
243 static ConfigView* viewList;247 static ConfigView* viewList;
244 ConfigView* nextView;248 ConfigView* nextView;
249
250 static QAction *showNormalAction;
251 static QAction *showAllAction;
252 static QAction *showPromptAction;
245};253};
246 254
247class ConfigInfoView : public QTextBrowser {255class ConfigInfoView : public QTextBrowser {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t