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