Commit 6faef31d authored by Roman Zippel's avatar Roman Zippel Committed by Linus Torvalds

[PATCH] add menuconfig support to the front ends

This adds the support for the menuconfig to the front ends.
qconf also has now an ".." entry to make it more obvious
how to get to a parent menu.
parent bbc115e9
......@@ -302,11 +302,8 @@ static void build_conf(struct menu *menu)
cprint1("%s%*c%s",
menu->data ? "-->" : "++>",
indent + 1, ' ', prompt);
} else {
if (menu->parent != &rootmenu)
cprint1(" %*c", indent + 1, ' ');
cprint1("%s --->", prompt);
}
} else
cprint1(" %*c%s --->", indent + 1, ' ', prompt);
cprint_done();
if (single_menu_mode && menu->data)
......@@ -373,6 +370,11 @@ static void build_conf(struct menu *menu)
}
cprint_done();
} else {
if (menu == current_menu) {
cprint(":%p", menu);
cprint("---%*c%s", indent + 1, ' ', menu_get_prompt(menu));
goto conf_childs;
}
child_count++;
val = sym_get_tristate_value(sym);
if (sym_is_choice_value(sym) && val == yes) {
......@@ -407,6 +409,11 @@ static void build_conf(struct menu *menu)
}
cprint1("%*c%s%s", indent + 1, ' ', menu_get_prompt(menu),
sym_has_value(sym) ? "" : " (NEW)");
if (menu->prompt->type == P_MENU) {
cprint1(" --->");
cprint_done();
return;
}
cprint_done();
}
......@@ -445,9 +452,9 @@ static void conf(struct menu *menu)
cprint(":");
cprint("--- ");
cprint("L");
cprint("Load an Alternate Configuration File");
cprint(" Load an Alternate Configuration File");
cprint("S");
cprint("Save Configuration to an Alternate File");
cprint(" Save Configuration to an Alternate File");
}
stat = exec_conf();
if (stat < 0)
......@@ -484,6 +491,8 @@ static void conf(struct menu *menu)
case 't':
if (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes)
conf_choice(submenu);
else if (submenu->prompt->type == P_MENU)
conf(submenu);
break;
case 's':
conf_string(submenu);
......
This diff is collapsed.
......@@ -101,10 +101,14 @@ public slots:
void setAllOpen(bool open);
void setParentMenu(void);
template <class P>
void ConfigList::updateMenuList(P*, struct menu*);
bool updateAll;
QPixmap symbolYesPix, symbolModPix, symbolNoPix;
QPixmap choiceYesPix, choiceNoPix, menuPix, menuInvPix;
QPixmap choiceYesPix, choiceNoPix;
QPixmap menuPix, menuInvPix, menuBackPix;
bool showAll, showName, showRange, showData;
enum listMode mode;
......@@ -121,12 +125,17 @@ class ConfigItem : public QListViewItem {
typedef class QListViewItem Parent;
public:
ConfigItem(QListView *parent, ConfigItem *after, struct menu *m, bool v)
: Parent(parent, after), menu(m), visible(v)
: Parent(parent, after), menu(m), visible(v), goParent(false)
{
init();
}
ConfigItem(ConfigItem *parent, ConfigItem *after, struct menu *m, bool v)
: Parent(parent, after), menu(m), visible(v)
: Parent(parent, after), menu(m), visible(v), goParent(false)
{
init();
}
ConfigItem(QListView *parent, ConfigItem *after, bool v)
: Parent(parent, after), menu(0), visible(v), goParent(true)
{
init();
}
......@@ -136,7 +145,7 @@ class ConfigItem : public QListViewItem {
void okRename(int col);
#endif
void updateMenu(void);
bool updateNeeded(void);
void testUpdateMenu(bool v);
ConfigList* listView() const
{
return (ConfigList*)Parent::listView();
......@@ -170,6 +179,7 @@ class ConfigItem : public QListViewItem {
ConfigItem* nextItem;
struct menu *menu;
bool visible;
bool goParent;
};
class ConfigLineEdit : public QLineEdit {
......@@ -216,7 +226,9 @@ public slots:
protected:
void closeEvent(QCloseEvent *e);
ConfigView *menuView;
ConfigList *menuList;
ConfigView *configView;
ConfigList *configList;
QTextView *helpText;
QToolBar *toolBar;
......
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