kconfig: qconf: show data column all the time
The next commit will allow users to edit "int", "hex", "string" menus in-place from the data column. The data column should be always displayed. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
This commit is contained in:
parent
f9b918fae6
commit
669a1ee46a
|
@ -288,7 +288,7 @@ void ConfigLineEdit::keyPressEvent(QKeyEvent* e)
|
||||||
ConfigList::ConfigList(ConfigView* p, const char *name)
|
ConfigList::ConfigList(ConfigView* p, const char *name)
|
||||||
: Parent(p),
|
: Parent(p),
|
||||||
updateAll(false),
|
updateAll(false),
|
||||||
showName(false), showRange(false), showData(false), mode(singleMode), optMode(normalOpt),
|
showName(false), showRange(false), mode(singleMode), optMode(normalOpt),
|
||||||
rootEntry(0), headerPopup(0)
|
rootEntry(0), headerPopup(0)
|
||||||
{
|
{
|
||||||
setObjectName(name);
|
setObjectName(name);
|
||||||
|
@ -307,7 +307,6 @@ ConfigList::ConfigList(ConfigView* p, const char *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();
|
showRange = configSettings->value("/showRange", false).toBool();
|
||||||
showData = configSettings->value("/showData", 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()));
|
||||||
|
@ -338,7 +337,6 @@ bool ConfigList::menuSkip(struct menu *menu)
|
||||||
|
|
||||||
void ConfigList::reinit(void)
|
void ConfigList::reinit(void)
|
||||||
{
|
{
|
||||||
hideColumn(dataColIdx);
|
|
||||||
hideColumn(yesColIdx);
|
hideColumn(yesColIdx);
|
||||||
hideColumn(modColIdx);
|
hideColumn(modColIdx);
|
||||||
hideColumn(noColIdx);
|
hideColumn(noColIdx);
|
||||||
|
@ -351,8 +349,6 @@ void ConfigList::reinit(void)
|
||||||
showColumn(modColIdx);
|
showColumn(modColIdx);
|
||||||
showColumn(yesColIdx);
|
showColumn(yesColIdx);
|
||||||
}
|
}
|
||||||
if (showData)
|
|
||||||
showColumn(dataColIdx);
|
|
||||||
|
|
||||||
updateListAll();
|
updateListAll();
|
||||||
}
|
}
|
||||||
|
@ -375,7 +371,6 @@ void ConfigList::saveSettings(void)
|
||||||
configSettings->beginGroup(objectName());
|
configSettings->beginGroup(objectName());
|
||||||
configSettings->setValue("/showName", showName);
|
configSettings->setValue("/showName", showName);
|
||||||
configSettings->setValue("/showRange", showRange);
|
configSettings->setValue("/showRange", showRange);
|
||||||
configSettings->setValue("/showData", showData);
|
|
||||||
configSettings->setValue("/optionMode", (int)optMode);
|
configSettings->setValue("/optionMode", (int)optMode);
|
||||||
configSettings->endGroup();
|
configSettings->endGroup();
|
||||||
}
|
}
|
||||||
|
@ -918,15 +913,6 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e)
|
||||||
action, SLOT(setChecked(bool)));
|
action, SLOT(setChecked(bool)));
|
||||||
action->setChecked(showRange);
|
action->setChecked(showRange);
|
||||||
headerPopup->addAction(action);
|
headerPopup->addAction(action);
|
||||||
|
|
||||||
action = new QAction("Show Data", this);
|
|
||||||
action->setCheckable(true);
|
|
||||||
connect(action, SIGNAL(toggled(bool)),
|
|
||||||
parent(), SLOT(setShowData(bool)));
|
|
||||||
connect(parent(), SIGNAL(showDataChanged(bool)),
|
|
||||||
action, SLOT(setChecked(bool)));
|
|
||||||
action->setChecked(showData);
|
|
||||||
headerPopup->addAction(action);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
headerPopup->exec(e->globalPos());
|
headerPopup->exec(e->globalPos());
|
||||||
|
@ -970,15 +956,6 @@ void ConfigView::setShowRange(bool b)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigView::setShowData(bool b)
|
|
||||||
{
|
|
||||||
if (list->showData != b) {
|
|
||||||
list->showData = b;
|
|
||||||
list->reinit();
|
|
||||||
emit showDataChanged(b);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ConfigList::setAllOpen(bool open)
|
void ConfigList::setAllOpen(bool open)
|
||||||
{
|
{
|
||||||
QTreeWidgetItemIterator it(this);
|
QTreeWidgetItemIterator it(this);
|
||||||
|
@ -1475,9 +1452,6 @@ ConfigMainWindow::ConfigMainWindow(void)
|
||||||
QAction *showRangeAction = new QAction("Show Range", this);
|
QAction *showRangeAction = new QAction("Show Range", this);
|
||||||
showRangeAction->setCheckable(true);
|
showRangeAction->setCheckable(true);
|
||||||
connect(showRangeAction, SIGNAL(toggled(bool)), configView, SLOT(setShowRange(bool)));
|
connect(showRangeAction, SIGNAL(toggled(bool)), configView, SLOT(setShowRange(bool)));
|
||||||
QAction *showDataAction = new QAction("Show Data", this);
|
|
||||||
showDataAction->setCheckable(true);
|
|
||||||
connect(showDataAction, SIGNAL(toggled(bool)), configView, SLOT(setShowData(bool)));
|
|
||||||
|
|
||||||
QActionGroup *optGroup = new QActionGroup(this);
|
QActionGroup *optGroup = new QActionGroup(this);
|
||||||
optGroup->setExclusive(true);
|
optGroup->setExclusive(true);
|
||||||
|
@ -1530,7 +1504,6 @@ ConfigMainWindow::ConfigMainWindow(void)
|
||||||
menu = menuBar()->addMenu("&Option");
|
menu = menuBar()->addMenu("&Option");
|
||||||
menu->addAction(showNameAction);
|
menu->addAction(showNameAction);
|
||||||
menu->addAction(showRangeAction);
|
menu->addAction(showRangeAction);
|
||||||
menu->addAction(showDataAction);
|
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
menu->addActions(optGroup->actions());
|
menu->addActions(optGroup->actions());
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
|
|
|
@ -101,7 +101,7 @@ public:
|
||||||
|
|
||||||
bool updateAll;
|
bool updateAll;
|
||||||
|
|
||||||
bool showName, showRange, showData;
|
bool showName, showRange;
|
||||||
enum listMode mode;
|
enum listMode mode;
|
||||||
enum optionMode optMode;
|
enum optionMode optMode;
|
||||||
struct menu *rootEntry;
|
struct menu *rootEntry;
|
||||||
|
@ -196,15 +196,12 @@ public:
|
||||||
|
|
||||||
bool showName(void) const { return list->showName; }
|
bool showName(void) const { return list->showName; }
|
||||||
bool showRange(void) const { return list->showRange; }
|
bool showRange(void) const { return list->showRange; }
|
||||||
bool showData(void) const { return list->showData; }
|
|
||||||
public slots:
|
public slots:
|
||||||
void setShowName(bool);
|
void setShowName(bool);
|
||||||
void setShowRange(bool);
|
void setShowRange(bool);
|
||||||
void setShowData(bool);
|
|
||||||
signals:
|
signals:
|
||||||
void showNameChanged(bool);
|
void showNameChanged(bool);
|
||||||
void showRangeChanged(bool);
|
void showRangeChanged(bool);
|
||||||
void showDataChanged(bool);
|
|
||||||
public:
|
public:
|
||||||
ConfigList* list;
|
ConfigList* list;
|
||||||
ConfigLineEdit* lineEdit;
|
ConfigLineEdit* lineEdit;
|
||||||
|
|
Loading…
Reference in a new issue