Commit b311142f authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab Committed by Masahiro Yamada

kconfig: qconf: fix support for the split view mode

At least on my tests (building against Qt5.13), it seems to
me that, since Kernel 3.14, the split view mode is broken.

Maybe it was not a top priority during the conversion time.

Anyway, this patch changes the logic in order to properly
support the split view mode and the single view mode.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
parent cce1faba
...@@ -742,7 +742,10 @@ void ConfigList::keyPressEvent(QKeyEvent* ev) ...@@ -742,7 +742,10 @@ void ConfigList::keyPressEvent(QKeyEvent* ev)
type = menu->prompt ? menu->prompt->type : P_UNKNOWN; type = menu->prompt ? menu->prompt->type : P_UNKNOWN;
if (type == P_MENU && rootEntry != menu && if (type == P_MENU && rootEntry != menu &&
mode != fullMode && mode != menuMode) { mode != fullMode && mode != menuMode) {
emit menuSelected(menu); if (mode == menuMode)
emit menuSelected(menu);
else
emit itemSelected(menu);
break; break;
} }
case Qt::Key_Space: case Qt::Key_Space:
...@@ -849,9 +852,12 @@ void ConfigList::mouseDoubleClickEvent(QMouseEvent* e) ...@@ -849,9 +852,12 @@ void ConfigList::mouseDoubleClickEvent(QMouseEvent* e)
if (!menu) if (!menu)
goto skip; goto skip;
ptype = menu->prompt ? menu->prompt->type : P_UNKNOWN; ptype = menu->prompt ? menu->prompt->type : P_UNKNOWN;
if (ptype == P_MENU && (mode == singleMode || mode == symbolMode)) if (ptype == P_MENU) {
emit menuSelected(menu); if (mode == singleMode)
else if (menu->sym) emit itemSelected(menu);
else if (mode == symbolMode)
emit menuSelected(menu);
} else if (menu->sym)
changeValue(item); changeValue(item);
skip: skip:
...@@ -1503,6 +1509,8 @@ ConfigMainWindow::ConfigMainWindow(void) ...@@ -1503,6 +1509,8 @@ ConfigMainWindow::ConfigMainWindow(void)
helpText, SLOT(setInfo(struct menu *))); helpText, SLOT(setInfo(struct menu *)));
connect(configList, SIGNAL(menuSelected(struct menu *)), connect(configList, SIGNAL(menuSelected(struct menu *)),
SLOT(changeMenu(struct menu *))); SLOT(changeMenu(struct menu *)));
connect(configList, SIGNAL(itemSelected(struct menu *)),
SLOT(changeItens(struct menu *)));
connect(configList, SIGNAL(parentSelected()), connect(configList, SIGNAL(parentSelected()),
SLOT(goBack())); SLOT(goBack()));
connect(menuList, SIGNAL(menuChanged(struct menu *)), connect(menuList, SIGNAL(menuChanged(struct menu *)),
...@@ -1599,15 +1607,26 @@ void ConfigMainWindow::searchConfig(void) ...@@ -1599,15 +1607,26 @@ void ConfigMainWindow::searchConfig(void)
searchWindow->show(); searchWindow->show();
} }
void ConfigMainWindow::changeMenu(struct menu *menu) void ConfigMainWindow::changeItens(struct menu *menu)
{ {
configList->setRootMenu(menu); configList->setRootMenu(menu);
if (configList->rootEntry->parent == &rootmenu) if (configList->rootEntry->parent == &rootmenu)
backAction->setEnabled(false); backAction->setEnabled(false);
else else
backAction->setEnabled(true); backAction->setEnabled(true);
} }
void ConfigMainWindow::changeMenu(struct menu *menu)
{
menuList->setRootMenu(menu);
if (menuList->rootEntry->parent == &rootmenu)
backAction->setEnabled(false);
else
backAction->setEnabled(true);
}
void ConfigMainWindow::setMenuLink(struct menu *menu) void ConfigMainWindow::setMenuLink(struct menu *menu)
{ {
struct menu *parent; struct menu *parent;
...@@ -1717,14 +1736,14 @@ void ConfigMainWindow::showSplitView(void) ...@@ -1717,14 +1736,14 @@ void ConfigMainWindow::showSplitView(void)
fullViewAction->setEnabled(true); fullViewAction->setEnabled(true);
fullViewAction->setChecked(false); fullViewAction->setChecked(false);
configList->mode = symbolMode; configList->mode = menuMode;
if (configList->rootEntry == &rootmenu) if (configList->rootEntry == &rootmenu)
configList->updateListAll(); configList->updateListAll();
else else
configList->setRootMenu(&rootmenu); configList->setRootMenu(&rootmenu);
configList->setAllOpen(true); configList->setAllOpen(true);
configApp->processEvents(); configApp->processEvents();
menuList->mode = menuMode; menuList->mode = symbolMode;
menuList->setRootMenu(&rootmenu); menuList->setRootMenu(&rootmenu);
menuList->setAllOpen(true); menuList->setAllOpen(true);
menuView->show(); menuView->show();
......
...@@ -71,6 +71,7 @@ public slots: ...@@ -71,6 +71,7 @@ public slots:
signals: signals:
void menuChanged(struct menu *menu); void menuChanged(struct menu *menu);
void menuSelected(struct menu *menu); void menuSelected(struct menu *menu);
void itemSelected(struct menu *menu);
void parentSelected(void); void parentSelected(void);
void gotFocus(struct menu *); void gotFocus(struct menu *);
...@@ -298,6 +299,7 @@ class ConfigMainWindow : public QMainWindow { ...@@ -298,6 +299,7 @@ class ConfigMainWindow : public QMainWindow {
ConfigMainWindow(void); ConfigMainWindow(void);
public slots: public slots:
void changeMenu(struct menu *); void changeMenu(struct menu *);
void changeItens(struct menu *);
void setMenuLink(struct menu *); void setMenuLink(struct menu *);
void listFocusChanged(void); void listFocusChanged(void);
void goBack(void); void goBack(void);
......
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