Commit 43bf612af2d4f2615dcbf86af8206e2f40231237

Authored by Roman Zippel
Committed by Sam Ravnborg
1 parent face4374e2

kconfig: Add search option for xconfig

Implement a simple search request for xconfig.  Currently the capabilities are
rather simple (the same as menuconfig).

Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

Showing 2 changed files with 333 additions and 172 deletions Side-by-side Diff

scripts/kconfig/qconf.cc
... ... @@ -6,16 +6,20 @@
6 6 #include <qapplication.h>
7 7 #include <qmainwindow.h>
8 8 #include <qtoolbar.h>
  9 +#include <qlayout.h>
9 10 #include <qvbox.h>
10 11 #include <qsplitter.h>
11 12 #include <qlistview.h>
12   -#include <qtextview.h>
  13 +#include <qtextbrowser.h>
13 14 #include <qlineedit.h>
  15 +#include <qlabel.h>
  16 +#include <qpushbutton.h>
14 17 #include <qmenubar.h>
15 18 #include <qmessagebox.h>
16 19 #include <qaction.h>
17 20 #include <qheader.h>
18 21 #include <qfiledialog.h>
  22 +#include <qdragobject.h>
19 23 #include <qregexp.h>
20 24  
21 25 #include <stdlib.h>
22 26  
... ... @@ -35,12 +39,12 @@
35 39  
36 40 static inline QString qgettext(const char* str)
37 41 {
38   - return QString::fromLocal8Bit(gettext(str));
  42 + return QString::fromLocal8Bit(gettext(str));
39 43 }
40 44  
41 45 static inline QString qgettext(const QString& str)
42 46 {
43   - return QString::fromLocal8Bit(gettext(str.latin1()));
  47 + return QString::fromLocal8Bit(gettext(str.latin1()));
44 48 }
45 49  
46 50 ConfigSettings::ConfigSettings()
... ... @@ -355,6 +359,12 @@
355 359 }
356 360 }
357 361  
  362 +ConfigLineEdit::ConfigLineEdit(ConfigView* parent)
  363 + : Parent(parent)
  364 +{
  365 + connect(this, SIGNAL(lostFocus()), SLOT(hide()));
  366 +}
  367 +
358 368 void ConfigLineEdit::show(ConfigItem* i)
359 369 {
360 370 item = i;
... ... @@ -385,8 +395,8 @@
385 395 hide();
386 396 }
387 397  
388   -ConfigList::ConfigList(ConfigView* p, ConfigMainWindow* cv, ConfigSettings* configSettings)
389   - : Parent(p), cview(cv),
  398 +ConfigList::ConfigList(ConfigView* p, ConfigSettings* configSettings)
  399 + : Parent(p),
390 400 updateAll(false),
391 401 symbolYesPix(xpm_symbol_yes), symbolModPix(xpm_symbol_mod), symbolNoPix(xpm_symbol_no),
392 402 choiceYesPix(xpm_choice_yes), choiceNoPix(xpm_choice_no),
393 403  
... ... @@ -450,9 +460,8 @@
450 460 if (!item)
451 461 return;
452 462  
453   - cview->setHelp(item);
454   -
455 463 menu = item->menu;
  464 + emit menuChanged(menu);
456 465 if (!menu)
457 466 return;
458 467 type = menu->prompt ? menu->prompt->type : P_UNKNOWN;
459 468  
... ... @@ -464,9 +473,21 @@
464 473 {
465 474 ConfigItem* last = 0;
466 475  
467   - if (!rootEntry)
468   - goto update;
  476 + if (!rootEntry) {
  477 + if (mode != listMode)
  478 + goto update;
  479 + QListViewItemIterator it(this);
  480 + ConfigItem* item;
469 481  
  482 + for (; it.current(); ++it) {
  483 + item = (ConfigItem*)it.current();
  484 + if (!item->menu)
  485 + continue;
  486 + item->testUpdateMenu(menu_is_visible(item->menu));
  487 + }
  488 + return;
  489 + }
  490 +
470 491 if (rootEntry != &rootmenu && (mode == singleMode ||
471 492 (mode == symbolMode && rootEntry->parent != &rootmenu))) {
472 493 item = firstChild();
... ... @@ -610,7 +631,7 @@
610 631 struct menu *menu;
611 632 enum prop_type type;
612 633  
613   - if (ev->key() == Key_Escape && mode != fullMode) {
  634 + if (ev->key() == Key_Escape && mode != fullMode && mode != listMode) {
614 635 emit parentSelected();
615 636 ev->accept();
616 637 return;
617 638  
... ... @@ -767,11 +788,10 @@
767 788  
768 789 ConfigView* ConfigView::viewList;
769 790  
770   -ConfigView::ConfigView(QWidget* parent, ConfigMainWindow* cview,
771   - ConfigSettings *configSettings)
  791 +ConfigView::ConfigView(QWidget* parent, ConfigSettings *configSettings)
772 792 : Parent(parent)
773 793 {
774   - list = new ConfigList(this, cview, configSettings);
  794 + list = new ConfigList(this, configSettings);
775 795 lineEdit = new ConfigLineEdit(this);
776 796 lineEdit->hide();
777 797  
778 798  
... ... @@ -807,13 +827,238 @@
807 827 v->list->updateListAll();
808 828 }
809 829  
  830 +ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name)
  831 + : Parent(parent, name), menu(0)
  832 +{
  833 +}
  834 +
  835 +void ConfigInfoView::setShowDebug(bool b)
  836 +{
  837 + if (_showDebug != b) {
  838 + _showDebug = b;
  839 + if (menu)
  840 + menuInfo();
  841 + emit showDebugChanged(b);
  842 + }
  843 +}
  844 +
  845 +void ConfigInfoView::setInfo(struct menu *m)
  846 +{
  847 + menu = m;
  848 + if (!menu)
  849 + clear();
  850 + else
  851 + menuInfo();
  852 +}
  853 +
  854 +void ConfigInfoView::setSource(const QString& name)
  855 +{
  856 + const char *p = name.latin1();
  857 +
  858 + menu = NULL;
  859 +
  860 + switch (p[0]) {
  861 + case 'm':
  862 + if (sscanf(p, "m%p", &menu) == 1)
  863 + menuInfo();
  864 + break;
  865 + }
  866 +}
  867 +
  868 +void ConfigInfoView::menuInfo(void)
  869 +{
  870 + struct symbol* sym;
  871 + QString head, debug, help;
  872 +
  873 + sym = menu->sym;
  874 + if (sym) {
  875 + if (menu->prompt) {
  876 + head += "<big><b>";
  877 + head += print_filter(_(menu->prompt->text));
  878 + head += "</b></big>";
  879 + if (sym->name) {
  880 + head += " (";
  881 + head += print_filter(sym->name);
  882 + head += ")";
  883 + }
  884 + } else if (sym->name) {
  885 + head += "<big><b>";
  886 + head += print_filter(sym->name);
  887 + head += "</b></big>";
  888 + }
  889 + head += "<br><br>";
  890 +
  891 + if (showDebug())
  892 + debug = debug_info(sym);
  893 +
  894 + help = print_filter(_(sym->help));
  895 + } else if (menu->prompt) {
  896 + head += "<big><b>";
  897 + head += print_filter(_(menu->prompt->text));
  898 + head += "</b></big><br><br>";
  899 + if (showDebug()) {
  900 + if (menu->prompt->visible.expr) {
  901 + debug += "&nbsp;&nbsp;dep: ";
  902 + expr_print(menu->prompt->visible.expr, expr_print_help, &debug, E_NONE);
  903 + debug += "<br><br>";
  904 + }
  905 + }
  906 + }
  907 + if (showDebug())
  908 + debug += QString().sprintf("defined at %s:%d<br><br>", menu->file->name, menu->lineno);
  909 +
  910 + setText(head + debug + help);
  911 +}
  912 +
  913 +QString ConfigInfoView::debug_info(struct symbol *sym)
  914 +{
  915 + QString debug;
  916 +
  917 + debug += "type: ";
  918 + debug += print_filter(sym_type_name(sym->type));
  919 + if (sym_is_choice(sym))
  920 + debug += " (choice)";
  921 + debug += "<br>";
  922 + if (sym->rev_dep.expr) {
  923 + debug += "reverse dep: ";
  924 + expr_print(sym->rev_dep.expr, expr_print_help, &debug, E_NONE);
  925 + debug += "<br>";
  926 + }
  927 + for (struct property *prop = sym->prop; prop; prop = prop->next) {
  928 + switch (prop->type) {
  929 + case P_PROMPT:
  930 + case P_MENU:
  931 + debug += "prompt: ";
  932 + debug += print_filter(_(prop->text));
  933 + debug += "<br>";
  934 + break;
  935 + case P_DEFAULT:
  936 + debug += "default: ";
  937 + expr_print(prop->expr, expr_print_help, &debug, E_NONE);
  938 + debug += "<br>";
  939 + break;
  940 + case P_CHOICE:
  941 + if (sym_is_choice(sym)) {
  942 + debug += "choice: ";
  943 + expr_print(prop->expr, expr_print_help, &debug, E_NONE);
  944 + debug += "<br>";
  945 + }
  946 + break;
  947 + case P_SELECT:
  948 + debug += "select: ";
  949 + expr_print(prop->expr, expr_print_help, &debug, E_NONE);
  950 + debug += "<br>";
  951 + break;
  952 + case P_RANGE:
  953 + debug += "range: ";
  954 + expr_print(prop->expr, expr_print_help, &debug, E_NONE);
  955 + debug += "<br>";
  956 + break;
  957 + default:
  958 + debug += "unknown property: ";
  959 + debug += prop_get_type_name(prop->type);
  960 + debug += "<br>";
  961 + }
  962 + if (prop->visible.expr) {
  963 + debug += "&nbsp;&nbsp;&nbsp;&nbsp;dep: ";
  964 + expr_print(prop->visible.expr, expr_print_help, &debug, E_NONE);
  965 + debug += "<br>";
  966 + }
  967 + }
  968 + debug += "<br>";
  969 +
  970 + return debug;
  971 +}
  972 +
  973 +QString ConfigInfoView::print_filter(const QString &str)
  974 +{
  975 + QRegExp re("[<>&\"\\n]");
  976 + QString res = str;
  977 + for (int i = 0; (i = res.find(re, i)) >= 0;) {
  978 + switch (res[i].latin1()) {
  979 + case '<':
  980 + res.replace(i, 1, "&lt;");
  981 + i += 4;
  982 + break;
  983 + case '>':
  984 + res.replace(i, 1, "&gt;");
  985 + i += 4;
  986 + break;
  987 + case '&':
  988 + res.replace(i, 1, "&amp;");
  989 + i += 5;
  990 + break;
  991 + case '"':
  992 + res.replace(i, 1, "&quot;");
  993 + i += 6;
  994 + break;
  995 + case '\n':
  996 + res.replace(i, 1, "<br>");
  997 + i += 4;
  998 + break;
  999 + }
  1000 + }
  1001 + return res;
  1002 +}
  1003 +
  1004 +void ConfigInfoView::expr_print_help(void *data, const char *str)
  1005 +{
  1006 + reinterpret_cast<QString*>(data)->append(print_filter(str));
  1007 +}
  1008 +
  1009 +ConfigSearchWindow::ConfigSearchWindow(QWidget* parent)
  1010 + : Parent(parent), result(NULL)
  1011 +{
  1012 + setCaption("Search Config");
  1013 +
  1014 + QVBoxLayout* layout1 = new QVBoxLayout(this, 11, 6);
  1015 + QHBoxLayout* layout2 = new QHBoxLayout(0, 0, 6);
  1016 + layout2->addWidget(new QLabel("Find:", this));
  1017 + editField = new QLineEdit(this);
  1018 + connect(editField, SIGNAL(returnPressed()), SLOT(search()));
  1019 + layout2->addWidget(editField);
  1020 + searchButton = new QPushButton("Search", this);
  1021 + searchButton->setAutoDefault(FALSE);
  1022 + connect(searchButton, SIGNAL(clicked()), SLOT(search()));
  1023 + layout2->addWidget(searchButton);
  1024 + layout1->addLayout(layout2);
  1025 +
  1026 + QSplitter* split = new QSplitter(this);
  1027 + split->setOrientation(QSplitter::Vertical);
  1028 + list = new ConfigView(split, NULL);
  1029 + list->list->mode = listMode;
  1030 + info = new ConfigInfoView(split);
  1031 + connect(list->list, SIGNAL(menuChanged(struct menu *)),
  1032 + info, SLOT(setInfo(struct menu *)));
  1033 + layout1->addWidget(split);
  1034 +}
  1035 +
  1036 +void ConfigSearchWindow::search(void)
  1037 +{
  1038 + struct symbol **p;
  1039 + struct property *prop;
  1040 + ConfigItem *lastItem = NULL;
  1041 +
  1042 + free(result);
  1043 + list->list->clear();
  1044 +
  1045 + result = sym_re_search(editField->text().latin1());
  1046 + if (!result)
  1047 + return;
  1048 + for (p = result; *p; p++) {
  1049 + for_all_prompts((*p), prop)
  1050 + lastItem = new ConfigItem(list->list, lastItem, prop->menu,
  1051 + menu_is_visible(prop->menu));
  1052 + }
  1053 +}
  1054 +
810 1055 /*
811 1056 * Construct the complete config widget
812 1057 */
813 1058 ConfigMainWindow::ConfigMainWindow(void)
814 1059 {
815 1060 QMenuBar* menu;
816   - bool ok;
  1061 + bool ok, showDebug;
817 1062 int x, y, width, height;
818 1063  
819 1064 QWidget *d = configApp->desktop();
820 1065  
821 1066  
822 1067  
... ... @@ -843,18 +1088,19 @@
843 1088 split1->setOrientation(QSplitter::Horizontal);
844 1089 setCentralWidget(split1);
845 1090  
846   - menuView = new ConfigView(split1, this, configSettings);
  1091 + menuView = new ConfigView(split1, configSettings);
847 1092 menuList = menuView->list;
848 1093  
849 1094 split2 = new QSplitter(split1);
850 1095 split2->setOrientation(QSplitter::Vertical);
851 1096  
852 1097 // create config tree
853   - configView = new ConfigView(split2, this, configSettings);
  1098 + configView = new ConfigView(split2, configSettings);
854 1099 configList = configView->list;
855 1100  
856   - helpText = new QTextView(split2);
  1101 + helpText = new ConfigInfoView(split2);
857 1102 helpText->setTextFormat(Qt::RichText);
  1103 + helpText->setShowDebug(showDebug);
858 1104  
859 1105 setTabOrder(configList, helpText);
860 1106 configList->setFocus();
... ... @@ -873,6 +1119,8 @@
873 1119 connect(saveAction, SIGNAL(activated()), SLOT(saveConfig()));
874 1120 QAction *saveAsAction = new QAction("Save As...", "Save &As...", 0, this);
875 1121 connect(saveAsAction, SIGNAL(activated()), SLOT(saveConfigAs()));
  1122 + QAction *searchAction = new QAction("Search", "&Search", CTRL+Key_F, this);
  1123 + connect(searchAction, SIGNAL(activated()), SLOT(searchConfig()));
876 1124 QAction *singleViewAction = new QAction("Single View", QPixmap(xpm_single_view), "Split View", 0, this);
877 1125 connect(singleViewAction, SIGNAL(activated()), SLOT(showSingleView()));
878 1126 QAction *splitViewAction = new QAction("Split View", QPixmap(xpm_split_view), "Split View", 0, this);
... ... @@ -899,7 +1147,8 @@
899 1147 QAction *showDebugAction = new QAction(NULL, "Show Debug Info", 0, this);
900 1148 showDebugAction->setToggleAction(TRUE);
901 1149 showDebugAction->setOn(showDebug);
902   - connect(showDebugAction, SIGNAL(toggled(bool)), SLOT(setShowDebug(bool)));
  1150 + connect(showDebugAction, SIGNAL(toggled(bool)), helpText, SLOT(setShowDebug(bool)));
  1151 + connect(helpText, SIGNAL(showDebugChanged(bool)), showDebugAction, SLOT(setOn(bool)));
903 1152  
904 1153 QAction *showIntroAction = new QAction(NULL, "Introduction", 0, this);
905 1154 connect(showIntroAction, SIGNAL(activated()), SLOT(showIntro()));
... ... @@ -923,6 +1172,8 @@
923 1172 saveAction->addTo(config);
924 1173 saveAsAction->addTo(config);
925 1174 config->insertSeparator();
  1175 + searchAction->addTo(config);
  1176 + config->insertSeparator();
926 1177 quitAction->addTo(config);
927 1178  
928 1179 // create options menu
929 1180  
... ... @@ -942,10 +1193,14 @@
942 1193 showIntroAction->addTo(helpMenu);
943 1194 showAboutAction->addTo(helpMenu);
944 1195  
  1196 + connect(configList, SIGNAL(menuChanged(struct menu *)),
  1197 + helpText, SLOT(setInfo(struct menu *)));
945 1198 connect(configList, SIGNAL(menuSelected(struct menu *)),
946 1199 SLOT(changeMenu(struct menu *)));
947 1200 connect(configList, SIGNAL(parentSelected()),
948 1201 SLOT(goBack()));
  1202 + connect(menuList, SIGNAL(menuChanged(struct menu *)),
  1203 + helpText, SLOT(setInfo(struct menu *)));
949 1204 connect(menuList, SIGNAL(menuSelected(struct menu *)),
950 1205 SLOT(changeMenu(struct menu *)));
951 1206  
... ... @@ -977,42 +1232,6 @@
977 1232 delete configSettings;
978 1233 }
979 1234  
980   -static QString print_filter(const QString &str)
981   -{
982   - QRegExp re("[<>&\"\\n]");
983   - QString res = str;
984   - for (int i = 0; (i = res.find(re, i)) >= 0;) {
985   - switch (res[i].latin1()) {
986   - case '<':
987   - res.replace(i, 1, "&lt;");
988   - i += 4;
989   - break;
990   - case '>':
991   - res.replace(i, 1, "&gt;");
992   - i += 4;
993   - break;
994   - case '&':
995   - res.replace(i, 1, "&amp;");
996   - i += 5;
997   - break;
998   - case '"':
999   - res.replace(i, 1, "&quot;");
1000   - i += 6;
1001   - break;
1002   - case '\n':
1003   - res.replace(i, 1, "<br>");
1004   - i += 4;
1005   - break;
1006   - }
1007   - }
1008   - return res;
1009   -}
1010   -
1011   -static void expr_print_help(void *data, const char *str)
1012   -{
1013   - reinterpret_cast<QString*>(data)->append(print_filter(str));
1014   -}
1015   -
1016 1235 /*
1017 1236 * display a new help entry as soon as a new menu entry is selected
1018 1237 */
1019 1238  
... ... @@ -1021,105 +1240,9 @@
1021 1240 struct symbol* sym;
1022 1241 struct menu* menu = 0;
1023 1242  
1024   - configList->parent()->lineEdit->hide();
1025 1243 if (item)
1026 1244 menu = ((ConfigItem*)item)->menu;
1027   - if (!menu) {
1028   - helpText->setText(QString::null);
1029   - return;
1030   - }
1031   -
1032   - QString head, debug, help;
1033   - menu = ((ConfigItem*)item)->menu;
1034   - sym = menu->sym;
1035   - if (sym) {
1036   - if (menu->prompt) {
1037   - head += "<big><b>";
1038   - head += print_filter(_(menu->prompt->text));
1039   - head += "</b></big>";
1040   - if (sym->name) {
1041   - head += " (";
1042   - head += print_filter(_(sym->name));
1043   - head += ")";
1044   - }
1045   - } else if (sym->name) {
1046   - head += "<big><b>";
1047   - head += print_filter(_(sym->name));
1048   - head += "</b></big>";
1049   - }
1050   - head += "<br><br>";
1051   -
1052   - if (showDebug) {
1053   - debug += "type: ";
1054   - debug += print_filter(sym_type_name(sym->type));
1055   - if (sym_is_choice(sym))
1056   - debug += " (choice)";
1057   - debug += "<br>";
1058   - if (sym->rev_dep.expr) {
1059   - debug += "reverse dep: ";
1060   - expr_print(sym->rev_dep.expr, expr_print_help, &debug, E_NONE);
1061   - debug += "<br>";
1062   - }
1063   - for (struct property *prop = sym->prop; prop; prop = prop->next) {
1064   - switch (prop->type) {
1065   - case P_PROMPT:
1066   - case P_MENU:
1067   - debug += "prompt: ";
1068   - debug += print_filter(_(prop->text));
1069   - debug += "<br>";
1070   - break;
1071   - case P_DEFAULT:
1072   - debug += "default: ";
1073   - expr_print(prop->expr, expr_print_help, &debug, E_NONE);
1074   - debug += "<br>";
1075   - break;
1076   - case P_CHOICE:
1077   - if (sym_is_choice(sym)) {
1078   - debug += "choice: ";
1079   - expr_print(prop->expr, expr_print_help, &debug, E_NONE);
1080   - debug += "<br>";
1081   - }
1082   - break;
1083   - case P_SELECT:
1084   - debug += "select: ";
1085   - expr_print(prop->expr, expr_print_help, &debug, E_NONE);
1086   - debug += "<br>";
1087   - break;
1088   - case P_RANGE:
1089   - debug += "range: ";
1090   - expr_print(prop->expr, expr_print_help, &debug, E_NONE);
1091   - debug += "<br>";
1092   - break;
1093   - default:
1094   - debug += "unknown property: ";
1095   - debug += prop_get_type_name(prop->type);
1096   - debug += "<br>";
1097   - }
1098   - if (prop->visible.expr) {
1099   - debug += "&nbsp;&nbsp;&nbsp;&nbsp;dep: ";
1100   - expr_print(prop->visible.expr, expr_print_help, &debug, E_NONE);
1101   - debug += "<br>";
1102   - }
1103   - }
1104   - debug += "<br>";
1105   - }
1106   -
1107   - help = print_filter(_(sym->help));
1108   - } else if (menu->prompt) {
1109   - head += "<big><b>";
1110   - head += print_filter(_(menu->prompt->text));
1111   - head += "</b></big><br><br>";
1112   - if (showDebug) {
1113   - if (menu->prompt->visible.expr) {
1114   - debug += "&nbsp;&nbsp;dep: ";
1115   - expr_print(menu->prompt->visible.expr, expr_print_help, &debug, E_NONE);
1116   - debug += "<br><br>";
1117   - }
1118   - }
1119   - }
1120   - if (showDebug)
1121   - debug += QString().sprintf("defined at %s:%d<br><br>", menu->file->name, menu->lineno);
1122   - helpText->setText(head + debug + help);
  1245 + helpText->setInfo(menu);
1123 1246 }
1124 1247  
1125 1248 void ConfigMainWindow::loadConfig(void)
... ... @@ -1147,6 +1270,13 @@
1147 1270 QMessageBox::information(this, "qconf", "Unable to save configuration!");
1148 1271 }
1149 1272  
  1273 +void ConfigMainWindow::searchConfig(void)
  1274 +{
  1275 + if (!searchWindow)
  1276 + searchWindow = new ConfigSearchWindow(this);
  1277 + searchWindow->show();
  1278 +}
  1279 +
1150 1280 void ConfigMainWindow::changeMenu(struct menu *menu)
1151 1281 {
1152 1282 configList->setRootMenu(menu);
... ... @@ -1233,13 +1363,6 @@
1233 1363 menuList->updateListAll();
1234 1364 }
1235 1365  
1236   -void ConfigMainWindow::setShowDebug(bool b)
1237   -{
1238   - if (showDebug == b)
1239   - return;
1240   - showDebug = b;
1241   -}
1242   -
1243 1366 void ConfigMainWindow::setShowName(bool b)
1244 1367 {
1245 1368 if (configList->showName == b)
... ... @@ -1334,7 +1457,7 @@
1334 1457 configSettings->writeEntry("/kconfig/qconf/showRange", configList->showRange);
1335 1458 configSettings->writeEntry("/kconfig/qconf/showData", configList->showData);
1336 1459 configSettings->writeEntry("/kconfig/qconf/showAll", configList->showAll);
1337   - configSettings->writeEntry("/kconfig/qconf/showDebug", showDebug);
  1460 + configSettings->writeEntry("/kconfig/qconf/showDebug", helpText->showDebug());
1338 1461  
1339 1462 QString entry;
1340 1463 switch(configList->mode) {
1341 1464  
... ... @@ -1417,9 +1540,10 @@
1417 1540 v = new ConfigMainWindow();
1418 1541  
1419 1542 //zconfdump(stdout);
1420   - v->show();
  1543 + configApp->setMainWidget(v);
1421 1544 configApp->connect(configApp, SIGNAL(lastWindowClosed()), SLOT(quit()));
1422 1545 configApp->connect(configApp, SIGNAL(aboutToQuit()), v, SLOT(saveSettings()));
  1546 + v->show();
1423 1547 configApp->exec();
1424 1548  
1425 1549 return 0;
scripts/kconfig/qconf.h
... ... @@ -36,7 +36,7 @@
36 36 Q_OBJECT
37 37 typedef class QVBox Parent;
38 38 public:
39   - ConfigView(QWidget* parent, ConfigMainWindow* cview, ConfigSettings* configSettings);
  39 + ConfigView(QWidget* parent, ConfigSettings* configSettings);
40 40 ~ConfigView(void);
41 41 static void updateList(ConfigItem* item);
42 42 static void updateListAll(void);
43 43  
... ... @@ -53,14 +53,14 @@
53 53 promptColIdx, nameColIdx, noColIdx, modColIdx, yesColIdx, dataColIdx, colNr
54 54 };
55 55 enum listMode {
56   - singleMode, menuMode, symbolMode, fullMode
  56 + singleMode, menuMode, symbolMode, fullMode, listMode
57 57 };
58 58  
59 59 class ConfigList : public QListView {
60 60 Q_OBJECT
61 61 typedef class QListView Parent;
62 62 public:
63   - ConfigList(ConfigView* p, ConfigMainWindow* cview, ConfigSettings *configSettings);
  63 + ConfigList(ConfigView* p, ConfigSettings *configSettings);
64 64 void reinit(void);
65 65 ConfigView* parent(void) const
66 66 {
... ... @@ -68,8 +68,6 @@
68 68 }
69 69  
70 70 protected:
71   - ConfigMainWindow* cview;
72   -
73 71 void keyPressEvent(QKeyEvent *e);
74 72 void contentsMousePressEvent(QMouseEvent *e);
75 73 void contentsMouseReleaseEvent(QMouseEvent *e);
... ... @@ -84,6 +82,7 @@
84 82 void changeValue(ConfigItem* item);
85 83 void updateSelection(void);
86 84 signals:
  85 + void menuChanged(struct menu *menu);
87 86 void menuSelected(struct menu *menu);
88 87 void parentSelected(void);
89 88 void gotFocus(void);
... ... @@ -208,9 +207,7 @@
208 207 Q_OBJECT
209 208 typedef class QLineEdit Parent;
210 209 public:
211   - ConfigLineEdit(ConfigView* parent)
212   - : Parent(parent)
213   - { }
  210 + ConfigLineEdit(ConfigView* parent);
214 211 ConfigView* parent(void) const
215 212 {
216 213 return (ConfigView*)Parent::parent();
... ... @@ -222,6 +219,47 @@
222 219 ConfigItem *item;
223 220 };
224 221  
  222 +class ConfigInfoView : public QTextBrowser {
  223 + Q_OBJECT
  224 + typedef class QTextBrowser Parent;
  225 +public:
  226 + ConfigInfoView(QWidget* parent, const char *name = 0);
  227 + bool showDebug(void) const { return _showDebug; }
  228 +
  229 +public slots:
  230 + void setInfo(struct menu *menu);
  231 + void setSource(const QString& name);
  232 + void setShowDebug(bool);
  233 +
  234 +signals:
  235 + void showDebugChanged(bool);
  236 +
  237 +protected:
  238 + void menuInfo(void);
  239 + QString debug_info(struct symbol *sym);
  240 + static QString print_filter(const QString &str);
  241 + static void expr_print_help(void *data, const char *str);
  242 +
  243 + struct menu *menu;
  244 + bool _showDebug;
  245 +};
  246 +
  247 +class ConfigSearchWindow : public QDialog {
  248 + Q_OBJECT
  249 + typedef class QDialog Parent;
  250 +public:
  251 + ConfigSearchWindow(QWidget* parent);
  252 +public slots:
  253 + void search(void);
  254 +protected:
  255 + QLineEdit* editField;
  256 + QPushButton* searchButton;
  257 + ConfigView* list;
  258 + ConfigInfoView* info;
  259 +
  260 + struct symbol **result;
  261 +};
  262 +
225 263 class ConfigMainWindow : public QMainWindow {
226 264 Q_OBJECT
227 265 public:
228 266  
... ... @@ -234,11 +272,11 @@
234 272 void loadConfig(void);
235 273 void saveConfig(void);
236 274 void saveConfigAs(void);
  275 + void searchConfig(void);
237 276 void showSingleView(void);
238 277 void showSplitView(void);
239 278 void showFullView(void);
240 279 void setShowAll(bool);
241   - void setShowDebug(bool);
242 280 void setShowRange(bool);
243 281 void setShowName(bool);
244 282 void setShowData(bool);
245 283  
246 284  
... ... @@ -249,16 +287,15 @@
249 287 protected:
250 288 void closeEvent(QCloseEvent *e);
251 289  
  290 + ConfigSearchWindow *searchWindow;
252 291 ConfigView *menuView;
253 292 ConfigList *menuList;
254 293 ConfigView *configView;
255 294 ConfigList *configList;
256   - QTextView *helpText;
  295 + ConfigInfoView *helpText;
257 296 QToolBar *toolBar;
258 297 QAction *backAction;
259 298 QSplitter* split1;
260 299 QSplitter* split2;
261   -
262   - bool showDebug;
263 300 };