Skip to content

Commit b311142

Browse files
mchehabmasahir0y
authored andcommitted
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: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
1 parent cce1fab commit b311142

File tree

2 files changed

+28
-7
lines changed

2 files changed

+28
-7
lines changed

scripts/kconfig/qconf.cc

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,10 @@ void ConfigList::keyPressEvent(QKeyEvent* ev)
742742
type = menu->prompt ? menu->prompt->type : P_UNKNOWN;
743743
if (type == P_MENU && rootEntry != menu &&
744744
mode != fullMode && mode != menuMode) {
745-
emit menuSelected(menu);
745+
if (mode == menuMode)
746+
emit menuSelected(menu);
747+
else
748+
emit itemSelected(menu);
746749
break;
747750
}
748751
case Qt::Key_Space:
@@ -849,9 +852,12 @@ void ConfigList::mouseDoubleClickEvent(QMouseEvent* e)
849852
if (!menu)
850853
goto skip;
851854
ptype = menu->prompt ? menu->prompt->type : P_UNKNOWN;
852-
if (ptype == P_MENU && (mode == singleMode || mode == symbolMode))
853-
emit menuSelected(menu);
854-
else if (menu->sym)
855+
if (ptype == P_MENU) {
856+
if (mode == singleMode)
857+
emit itemSelected(menu);
858+
else if (mode == symbolMode)
859+
emit menuSelected(menu);
860+
} else if (menu->sym)
855861
changeValue(item);
856862

857863
skip:
@@ -1503,6 +1509,8 @@ ConfigMainWindow::ConfigMainWindow(void)
15031509
helpText, SLOT(setInfo(struct menu *)));
15041510
connect(configList, SIGNAL(menuSelected(struct menu *)),
15051511
SLOT(changeMenu(struct menu *)));
1512+
connect(configList, SIGNAL(itemSelected(struct menu *)),
1513+
SLOT(changeItens(struct menu *)));
15061514
connect(configList, SIGNAL(parentSelected()),
15071515
SLOT(goBack()));
15081516
connect(menuList, SIGNAL(menuChanged(struct menu *)),
@@ -1599,15 +1607,26 @@ void ConfigMainWindow::searchConfig(void)
15991607
searchWindow->show();
16001608
}
16011609

1602-
void ConfigMainWindow::changeMenu(struct menu *menu)
1610+
void ConfigMainWindow::changeItens(struct menu *menu)
16031611
{
16041612
configList->setRootMenu(menu);
1613+
16051614
if (configList->rootEntry->parent == &rootmenu)
16061615
backAction->setEnabled(false);
16071616
else
16081617
backAction->setEnabled(true);
16091618
}
16101619

1620+
void ConfigMainWindow::changeMenu(struct menu *menu)
1621+
{
1622+
menuList->setRootMenu(menu);
1623+
1624+
if (menuList->rootEntry->parent == &rootmenu)
1625+
backAction->setEnabled(false);
1626+
else
1627+
backAction->setEnabled(true);
1628+
}
1629+
16111630
void ConfigMainWindow::setMenuLink(struct menu *menu)
16121631
{
16131632
struct menu *parent;
@@ -1717,14 +1736,14 @@ void ConfigMainWindow::showSplitView(void)
17171736
fullViewAction->setEnabled(true);
17181737
fullViewAction->setChecked(false);
17191738

1720-
configList->mode = symbolMode;
1739+
configList->mode = menuMode;
17211740
if (configList->rootEntry == &rootmenu)
17221741
configList->updateListAll();
17231742
else
17241743
configList->setRootMenu(&rootmenu);
17251744
configList->setAllOpen(true);
17261745
configApp->processEvents();
1727-
menuList->mode = menuMode;
1746+
menuList->mode = symbolMode;
17281747
menuList->setRootMenu(&rootmenu);
17291748
menuList->setAllOpen(true);
17301749
menuView->show();

scripts/kconfig/qconf.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ public slots:
7171
signals:
7272
void menuChanged(struct menu *menu);
7373
void menuSelected(struct menu *menu);
74+
void itemSelected(struct menu *menu);
7475
void parentSelected(void);
7576
void gotFocus(struct menu *);
7677

@@ -298,6 +299,7 @@ class ConfigMainWindow : public QMainWindow {
298299
ConfigMainWindow(void);
299300
public slots:
300301
void changeMenu(struct menu *);
302+
void changeItens(struct menu *);
301303
void setMenuLink(struct menu *);
302304
void listFocusChanged(void);
303305
void goBack(void);

0 commit comments

Comments
 (0)