kconfig: qconf: move setOptionMode() to ConfigList from ConfigView
ConfigView::setOptionMode() only gets access to the 'list' member. Move it to the more relevant ConfigList class. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
This commit is contained in:
@@ -358,6 +358,18 @@ void ConfigList::reinit(void)
|
|||||||
updateListAll();
|
updateListAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ConfigList::setOptionMode(QAction *action)
|
||||||
|
{
|
||||||
|
if (action == showNormalAction)
|
||||||
|
optMode = normalOpt;
|
||||||
|
else if (action == showAllAction)
|
||||||
|
optMode = allOpt;
|
||||||
|
else
|
||||||
|
optMode = promptOpt;
|
||||||
|
|
||||||
|
updateListAll();
|
||||||
|
}
|
||||||
|
|
||||||
void ConfigList::saveSettings(void)
|
void ConfigList::saveSettings(void)
|
||||||
{
|
{
|
||||||
if (!objectName().isEmpty()) {
|
if (!objectName().isEmpty()) {
|
||||||
@@ -901,9 +913,9 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ConfigView*ConfigView::viewList;
|
ConfigView*ConfigView::viewList;
|
||||||
QAction *ConfigView::showNormalAction;
|
QAction *ConfigList::showNormalAction;
|
||||||
QAction *ConfigView::showAllAction;
|
QAction *ConfigList::showAllAction;
|
||||||
QAction *ConfigView::showPromptAction;
|
QAction *ConfigList::showPromptAction;
|
||||||
|
|
||||||
ConfigView::ConfigView(QWidget* parent, const char *name)
|
ConfigView::ConfigView(QWidget* parent, const char *name)
|
||||||
: Parent(parent)
|
: Parent(parent)
|
||||||
@@ -934,18 +946,6 @@ ConfigView::~ConfigView(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigView::setOptionMode(QAction *act)
|
|
||||||
{
|
|
||||||
if (act == showNormalAction)
|
|
||||||
list->optMode = normalOpt;
|
|
||||||
else if (act == showAllAction)
|
|
||||||
list->optMode = allOpt;
|
|
||||||
else
|
|
||||||
list->optMode = promptOpt;
|
|
||||||
|
|
||||||
list->updateListAll();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ConfigView::setShowName(bool b)
|
void ConfigView::setShowName(bool b)
|
||||||
{
|
{
|
||||||
if (list->showName != b) {
|
if (list->showName != b) {
|
||||||
@@ -1488,17 +1488,17 @@ ConfigMainWindow::ConfigMainWindow(void)
|
|||||||
|
|
||||||
QActionGroup *optGroup = new QActionGroup(this);
|
QActionGroup *optGroup = new QActionGroup(this);
|
||||||
optGroup->setExclusive(true);
|
optGroup->setExclusive(true);
|
||||||
connect(optGroup, SIGNAL(triggered(QAction*)), configView,
|
connect(optGroup, SIGNAL(triggered(QAction*)), configList,
|
||||||
SLOT(setOptionMode(QAction *)));
|
SLOT(setOptionMode(QAction *)));
|
||||||
connect(optGroup, SIGNAL(triggered(QAction *)), menuView,
|
connect(optGroup, SIGNAL(triggered(QAction *)), menuList,
|
||||||
SLOT(setOptionMode(QAction *)));
|
SLOT(setOptionMode(QAction *)));
|
||||||
|
|
||||||
configView->showNormalAction = new QAction("Show Normal Options", optGroup);
|
ConfigList::showNormalAction = new QAction("Show Normal Options", optGroup);
|
||||||
configView->showAllAction = new QAction("Show All Options", optGroup);
|
ConfigList::showNormalAction->setCheckable(true);
|
||||||
configView->showPromptAction = new QAction("Show Prompt Options", optGroup);
|
ConfigList::showAllAction = new QAction("Show All Options", optGroup);
|
||||||
configView->showNormalAction->setCheckable(true);
|
ConfigList::showAllAction->setCheckable(true);
|
||||||
configView->showAllAction->setCheckable(true);
|
ConfigList::showPromptAction = new QAction("Show Prompt Options", optGroup);
|
||||||
configView->showPromptAction->setCheckable(true);
|
ConfigList::showPromptAction->setCheckable(true);
|
||||||
|
|
||||||
QAction *showDebugAction = new QAction("Show Debug Info", this);
|
QAction *showDebugAction = new QAction("Show Debug Info", this);
|
||||||
showDebugAction->setCheckable(true);
|
showDebugAction->setCheckable(true);
|
||||||
|
|||||||
@@ -74,6 +74,8 @@ public slots:
|
|||||||
void changeValue(ConfigItem* item);
|
void changeValue(ConfigItem* item);
|
||||||
void updateSelection(void);
|
void updateSelection(void);
|
||||||
void saveSettings(void);
|
void saveSettings(void);
|
||||||
|
void setOptionMode(QAction *action);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void menuChanged(struct menu *menu);
|
void menuChanged(struct menu *menu);
|
||||||
void menuSelected(struct menu *menu);
|
void menuSelected(struct menu *menu);
|
||||||
@@ -105,6 +107,8 @@ public:
|
|||||||
QPalette disabledColorGroup;
|
QPalette disabledColorGroup;
|
||||||
QPalette inactivedColorGroup;
|
QPalette inactivedColorGroup;
|
||||||
QMenu* headerPopup;
|
QMenu* headerPopup;
|
||||||
|
|
||||||
|
static QAction *showNormalAction, *showAllAction, *showPromptAction;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ConfigItem : public QTreeWidgetItem {
|
class ConfigItem : public QTreeWidgetItem {
|
||||||
@@ -196,7 +200,6 @@ public slots:
|
|||||||
void setShowName(bool);
|
void setShowName(bool);
|
||||||
void setShowRange(bool);
|
void setShowRange(bool);
|
||||||
void setShowData(bool);
|
void setShowData(bool);
|
||||||
void setOptionMode(QAction *);
|
|
||||||
signals:
|
signals:
|
||||||
void showNameChanged(bool);
|
void showNameChanged(bool);
|
||||||
void showRangeChanged(bool);
|
void showRangeChanged(bool);
|
||||||
@@ -207,10 +210,6 @@ public:
|
|||||||
|
|
||||||
static ConfigView* viewList;
|
static ConfigView* viewList;
|
||||||
ConfigView* nextView;
|
ConfigView* nextView;
|
||||||
|
|
||||||
static QAction *showNormalAction;
|
|
||||||
static QAction *showAllAction;
|
|
||||||
static QAction *showPromptAction;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class ConfigInfoView : public QTextBrowser {
|
class ConfigInfoView : public QTextBrowser {
|
||||||
|
|||||||
Reference in New Issue
Block a user