Commit 7930dd91 authored by Masahiro Yamada's avatar Masahiro Yamada

kconfig: qconf: move setShowName/Range() to ConfigList from ConfigView

ConfigView::setShowName/Range() only get access to the 'list' member.

Move them to the more relevant ConfigList class.
Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
parent f3eea294
...@@ -920,8 +920,8 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e) ...@@ -920,8 +920,8 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e)
action = new QAction("Show Name", this); action = new QAction("Show Name", this);
action->setCheckable(true); action->setCheckable(true);
connect(action, SIGNAL(toggled(bool)), connect(action, SIGNAL(toggled(bool)),
parent(), SLOT(setShowName(bool))); SLOT(setShowName(bool)));
connect(parent(), SIGNAL(showNameChanged(bool)), connect(this, SIGNAL(showNameChanged(bool)),
action, SLOT(setChecked(bool))); action, SLOT(setChecked(bool)));
action->setChecked(showName); action->setChecked(showName);
headerPopup->addAction(action); headerPopup->addAction(action);
...@@ -929,8 +929,8 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e) ...@@ -929,8 +929,8 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e)
action = new QAction("Show Range", this); action = new QAction("Show Range", this);
action->setCheckable(true); action->setCheckable(true);
connect(action, SIGNAL(toggled(bool)), connect(action, SIGNAL(toggled(bool)),
parent(), SLOT(setShowRange(bool))); SLOT(setShowRange(bool)));
connect(parent(), SIGNAL(showRangeChanged(bool)), connect(this, SIGNAL(showRangeChanged(bool)),
action, SLOT(setChecked(bool))); action, SLOT(setChecked(bool)));
action->setChecked(showRange); action->setChecked(showRange);
headerPopup->addAction(action); headerPopup->addAction(action);
...@@ -940,6 +940,26 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e) ...@@ -940,6 +940,26 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e)
e->accept(); e->accept();
} }
void ConfigList::setShowName(bool on)
{
if (showName == on)
return;
showName = on;
reinit();
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;
...@@ -956,24 +976,6 @@ ConfigView::ConfigView(QWidget* parent, const char *name) ...@@ -956,24 +976,6 @@ ConfigView::ConfigView(QWidget* parent, const char *name)
verticalLayout->addWidget(list); verticalLayout->addWidget(list);
} }
void ConfigView::setShowName(bool b)
{
if (list->showName != b) {
list->showName = b;
list->reinit();
emit showNameChanged(b);
}
}
void ConfigView::setShowRange(bool b)
{
if (list->showRange != b) {
list->showRange = b;
list->reinit();
emit showRangeChanged(b);
}
}
void ConfigList::setAllOpen(bool open) void ConfigList::setAllOpen(bool open)
{ {
QTreeWidgetItemIterator it(this); QTreeWidgetItemIterator it(this);
...@@ -1465,11 +1467,12 @@ ConfigMainWindow::ConfigMainWindow(void) ...@@ -1465,11 +1467,12 @@ ConfigMainWindow::ConfigMainWindow(void)
QAction *showNameAction = new QAction("Show Name", this); QAction *showNameAction = new QAction("Show Name", this);
showNameAction->setCheckable(true); showNameAction->setCheckable(true);
connect(showNameAction, SIGNAL(toggled(bool)), configView, SLOT(setShowName(bool))); connect(showNameAction, SIGNAL(toggled(bool)), configList, SLOT(setShowName(bool)));
showNameAction->setChecked(configView->showName()); showNameAction->setChecked(configList->showName);
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)), configList, SLOT(setShowRange(bool)));
QActionGroup *optGroup = new QActionGroup(this); QActionGroup *optGroup = new QActionGroup(this);
optGroup->setExclusive(true); optGroup->setExclusive(true);
......
...@@ -76,6 +76,8 @@ public slots: ...@@ -76,6 +76,8 @@ public slots:
void updateSelection(void); void updateSelection(void);
void saveSettings(void); void saveSettings(void);
void setOptionMode(QAction *action); void setOptionMode(QAction *action);
void setShowName(bool on);
void setShowRange(bool on);
signals: signals:
void menuChanged(struct menu *menu); void menuChanged(struct menu *menu);
...@@ -83,6 +85,8 @@ public slots: ...@@ -83,6 +85,8 @@ public slots:
void itemSelected(struct menu *menu); void itemSelected(struct menu *menu);
void parentSelected(void); void parentSelected(void);
void gotFocus(struct menu *); void gotFocus(struct menu *);
void showNameChanged(bool on);
void showRangeChanged(bool on);
public: public:
void updateListAll(void) void updateListAll(void)
...@@ -192,14 +196,6 @@ class ConfigView : public QWidget { ...@@ -192,14 +196,6 @@ class ConfigView : public QWidget {
public: public:
ConfigView(QWidget* parent, const char *name = 0); ConfigView(QWidget* parent, const char *name = 0);
bool showName(void) const { return list->showName; }
bool showRange(void) const { return list->showRange; }
public slots:
void setShowName(bool);
void setShowRange(bool);
signals:
void showNameChanged(bool);
void showRangeChanged(bool);
public: public:
ConfigList* list; ConfigList* list;
}; };
......
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