Commit a0fce283 authored by Masahiro Yamada's avatar Masahiro Yamada

kconfig: qconf: remove Y, M, N columns

There are so many ways to toggle bool / tristate options.

I do not know how useful these columns are.
Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
parent 62ed1656
...@@ -139,9 +139,6 @@ void ConfigItem::updateMenu(void) ...@@ -139,9 +139,6 @@ void ConfigItem::updateMenu(void)
if (!sym_is_changeable(sym) && list->optMode == normalOpt) { if (!sym_is_changeable(sym) && list->optMode == normalOpt) {
setIcon(promptColIdx, QIcon()); setIcon(promptColIdx, QIcon());
setText(noColIdx, QString());
setText(modColIdx, QString());
setText(yesColIdx, QString());
break; break;
} }
expr = sym_get_tristate_value(sym); expr = sym_get_tristate_value(sym);
...@@ -151,12 +148,10 @@ void ConfigItem::updateMenu(void) ...@@ -151,12 +148,10 @@ void ConfigItem::updateMenu(void)
setIcon(promptColIdx, choiceYesIcon); setIcon(promptColIdx, choiceYesIcon);
else else
setIcon(promptColIdx, symbolYesIcon); setIcon(promptColIdx, symbolYesIcon);
setText(yesColIdx, "Y");
ch = 'Y'; ch = 'Y';
break; break;
case mod: case mod:
setIcon(promptColIdx, symbolModIcon); setIcon(promptColIdx, symbolModIcon);
setText(modColIdx, "M");
ch = 'M'; ch = 'M';
break; break;
default: default:
...@@ -164,16 +159,9 @@ void ConfigItem::updateMenu(void) ...@@ -164,16 +159,9 @@ void ConfigItem::updateMenu(void)
setIcon(promptColIdx, choiceNoIcon); setIcon(promptColIdx, choiceNoIcon);
else else
setIcon(promptColIdx, symbolNoIcon); setIcon(promptColIdx, symbolNoIcon);
setText(noColIdx, "N");
ch = 'N'; ch = 'N';
break; break;
} }
if (expr != no)
setText(noColIdx, sym_tristate_within_range(sym, no) ? "_" : 0);
if (expr != mod)
setText(modColIdx, sym_tristate_within_range(sym, mod) ? "_" : 0);
if (expr != yes)
setText(yesColIdx, sym_tristate_within_range(sym, yes) ? "_" : 0);
setText(dataColIdx, QChar(ch)); setText(dataColIdx, QChar(ch));
break; break;
...@@ -310,7 +298,7 @@ parent: ...@@ -310,7 +298,7 @@ parent:
ConfigList::ConfigList(QWidget *parent, const char *name) ConfigList::ConfigList(QWidget *parent, const char *name)
: QTreeWidget(parent), : QTreeWidget(parent),
updateAll(false), updateAll(false),
showName(false), showRange(false), mode(singleMode), optMode(normalOpt), showName(false), mode(singleMode), optMode(normalOpt),
rootEntry(0), headerPopup(0) rootEntry(0), headerPopup(0)
{ {
setObjectName(name); setObjectName(name);
...@@ -320,7 +308,7 @@ ConfigList::ConfigList(QWidget *parent, const char *name) ...@@ -320,7 +308,7 @@ ConfigList::ConfigList(QWidget *parent, const char *name)
setVerticalScrollMode(ScrollPerPixel); setVerticalScrollMode(ScrollPerPixel);
setHorizontalScrollMode(ScrollPerPixel); setHorizontalScrollMode(ScrollPerPixel);
setHeaderLabels(QStringList() << "Option" << "Name" << "N" << "M" << "Y" << "Value"); setHeaderLabels(QStringList() << "Option" << "Name" << "Value");
connect(this, SIGNAL(itemSelectionChanged(void)), connect(this, SIGNAL(itemSelectionChanged(void)),
SLOT(updateSelection(void))); SLOT(updateSelection(void)));
...@@ -328,7 +316,6 @@ ConfigList::ConfigList(QWidget *parent, const char *name) ...@@ -328,7 +316,6 @@ ConfigList::ConfigList(QWidget *parent, const char *name)
if (name) { if (name) {
configSettings->beginGroup(name); configSettings->beginGroup(name);
showName = configSettings->value("/showName", false).toBool(); showName = configSettings->value("/showName", false).toBool();
showRange = configSettings->value("/showRange", false).toBool();
optMode = (enum optionMode)configSettings->value("/optionMode", 0).toInt(); optMode = (enum optionMode)configSettings->value("/optionMode", 0).toInt();
configSettings->endGroup(); configSettings->endGroup();
connect(configApp, SIGNAL(aboutToQuit()), SLOT(saveSettings())); connect(configApp, SIGNAL(aboutToQuit()), SLOT(saveSettings()));
...@@ -361,18 +348,10 @@ bool ConfigList::menuSkip(struct menu *menu) ...@@ -361,18 +348,10 @@ bool ConfigList::menuSkip(struct menu *menu)
void ConfigList::reinit(void) void ConfigList::reinit(void)
{ {
hideColumn(yesColIdx);
hideColumn(modColIdx);
hideColumn(noColIdx);
hideColumn(nameColIdx); hideColumn(nameColIdx);
if (showName) if (showName)
showColumn(nameColIdx); showColumn(nameColIdx);
if (showRange) {
showColumn(noColIdx);
showColumn(modColIdx);
showColumn(yesColIdx);
}
updateListAll(); updateListAll();
} }
...@@ -394,7 +373,6 @@ void ConfigList::saveSettings(void) ...@@ -394,7 +373,6 @@ void ConfigList::saveSettings(void)
if (!objectName().isEmpty()) { if (!objectName().isEmpty()) {
configSettings->beginGroup(objectName()); configSettings->beginGroup(objectName());
configSettings->setValue("/showName", showName); configSettings->setValue("/showName", showName);
configSettings->setValue("/showRange", showRange);
configSettings->setValue("/optionMode", (int)optMode); configSettings->setValue("/optionMode", (int)optMode);
configSettings->endGroup(); configSettings->endGroup();
} }
...@@ -841,15 +819,6 @@ void ConfigList::mouseReleaseEvent(QMouseEvent* e) ...@@ -841,15 +819,6 @@ void ConfigList::mouseReleaseEvent(QMouseEvent* e)
} }
} }
break; break;
case noColIdx:
setValue(item, no);
break;
case modColIdx:
setValue(item, mod);
break;
case yesColIdx:
setValue(item, yes);
break;
case dataColIdx: case dataColIdx:
changeValue(item); changeValue(item);
break; break;
...@@ -925,15 +894,6 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e) ...@@ -925,15 +894,6 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e)
action, SLOT(setChecked(bool))); action, SLOT(setChecked(bool)));
action->setChecked(showName); action->setChecked(showName);
headerPopup->addAction(action); headerPopup->addAction(action);
action = new QAction("Show Range", this);
action->setCheckable(true);
connect(action, SIGNAL(toggled(bool)),
SLOT(setShowRange(bool)));
connect(this, SIGNAL(showRangeChanged(bool)),
action, SLOT(setChecked(bool)));
action->setChecked(showRange);
headerPopup->addAction(action);
} }
headerPopup->exec(e->globalPos()); headerPopup->exec(e->globalPos());
...@@ -950,16 +910,6 @@ void ConfigList::setShowName(bool on) ...@@ -950,16 +910,6 @@ void ConfigList::setShowName(bool on)
emit showNameChanged(on); emit showNameChanged(on);
} }
void ConfigList::setShowRange(bool on)
{
if (showRange == on)
return;
showRange = on;
reinit();
emit showRangeChanged(on);
}
QList<ConfigList *> ConfigList::allLists; QList<ConfigList *> ConfigList::allLists;
QAction *ConfigList::showNormalAction; QAction *ConfigList::showNormalAction;
QAction *ConfigList::showAllAction; QAction *ConfigList::showAllAction;
...@@ -1457,10 +1407,6 @@ ConfigMainWindow::ConfigMainWindow(void) ...@@ -1457,10 +1407,6 @@ ConfigMainWindow::ConfigMainWindow(void)
connect(showNameAction, SIGNAL(toggled(bool)), configList, SLOT(setShowName(bool))); connect(showNameAction, SIGNAL(toggled(bool)), configList, SLOT(setShowName(bool)));
showNameAction->setChecked(configList->showName); showNameAction->setChecked(configList->showName);
QAction *showRangeAction = new QAction("Show Range", this);
showRangeAction->setCheckable(true);
connect(showRangeAction, SIGNAL(toggled(bool)), configList, SLOT(setShowRange(bool)));
QActionGroup *optGroup = new QActionGroup(this); QActionGroup *optGroup = new QActionGroup(this);
optGroup->setExclusive(true); optGroup->setExclusive(true);
connect(optGroup, SIGNAL(triggered(QAction*)), configList, connect(optGroup, SIGNAL(triggered(QAction*)), configList,
...@@ -1511,7 +1457,6 @@ ConfigMainWindow::ConfigMainWindow(void) ...@@ -1511,7 +1457,6 @@ ConfigMainWindow::ConfigMainWindow(void)
// create options menu // create options menu
menu = menuBar()->addMenu("&Option"); menu = menuBar()->addMenu("&Option");
menu->addAction(showNameAction); menu->addAction(showNameAction);
menu->addAction(showRangeAction);
menu->addSeparator(); menu->addSeparator();
menu->addActions(optGroup->actions()); menu->addActions(optGroup->actions());
menu->addSeparator(); menu->addSeparator();
......
...@@ -29,7 +29,7 @@ class ConfigSettings : public QSettings { ...@@ -29,7 +29,7 @@ class ConfigSettings : public QSettings {
}; };
enum colIdx { enum colIdx {
promptColIdx, nameColIdx, noColIdx, modColIdx, yesColIdx, dataColIdx promptColIdx, nameColIdx, dataColIdx
}; };
enum listMode { enum listMode {
singleMode, menuMode, symbolMode, fullMode, listMode singleMode, menuMode, symbolMode, fullMode, listMode
...@@ -72,7 +72,6 @@ public slots: ...@@ -72,7 +72,6 @@ public slots:
void saveSettings(void); void saveSettings(void);
void setOptionMode(QAction *action); void setOptionMode(QAction *action);
void setShowName(bool on); void setShowName(bool on);
void setShowRange(bool on);
signals: signals:
void menuChanged(struct menu *menu); void menuChanged(struct menu *menu);
...@@ -81,7 +80,6 @@ public slots: ...@@ -81,7 +80,6 @@ public slots:
void parentSelected(void); void parentSelected(void);
void gotFocus(struct menu *); void gotFocus(struct menu *);
void showNameChanged(bool on); void showNameChanged(bool on);
void showRangeChanged(bool on);
public: public:
void updateListAll(void) void updateListAll(void)
...@@ -100,7 +98,7 @@ public slots: ...@@ -100,7 +98,7 @@ public slots:
bool updateAll; bool updateAll;
bool showName, showRange; bool showName;
enum listMode mode; enum listMode mode;
enum optionMode optMode; enum optionMode optMode;
struct menu *rootEntry; struct menu *rootEntry;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment