History

kconfig: Add search option for xconfig

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

Roman Zippel committed 20 years ago

Commit 43bf6121 parent face4372 files · +333 −172Browse files

Unified · Split

2 files
  1. scripts/kconfig/qconf.cc +284 −160
  2. scripts/kconfig/qconf.h +49 −12
scripts/kconfig/qconf.cc+284−160
@@ -6,16 +6,20 @@ · 5 unmodified lines
66 #include <qapplication.h>
77 #include <qmainwindow.h>
88 #include <qtoolbar.h>
9+#include <qlayout.h>
910 #include <qvbox.h>
1011 #include <qsplitter.h>
1112 #include <qlistview.h>
12−#include <qtextview.h>
13+#include <qtextbrowser.h>
1314 #include <qlineedit.h>
15+#include <qlabel.h>
16+#include <qpushbutton.h>
1417 #include <qmenubar.h>
1518 #include <qmessagebox.h>
1619 #include <qaction.h>
1720 #include <qheader.h>
1821 #include <qfiledialog.h>
22+#include <qdragobject.h>
1923 #include <qregexp.h>
2024
2125 #include <stdlib.h>
@@ -35,12 +39,12 @@ static QApplication *configApp; · 13 unmodified lines
3539
3640 static inline QString qgettext(const char* str)
3741 {
38− return QString::fromLocal8Bit(gettext(str));
42+ return QString::fromLocal8Bit(gettext(str));
3943 }
4044
4145 static inline QString qgettext(const QString& str)
4246 {
43− return QString::fromLocal8Bit(gettext(str.latin1()));
47+ return QString::fromLocal8Bit(gettext(str.latin1()));
4448 }
4549
4650 ConfigSettings::ConfigSettings()
@@ -355,6 +359,12 @@ ConfigItem::~ConfigItem(void) · 308 unmodified lines
355359 }
356360 }
357361
362+ConfigLineEdit::ConfigLineEdit(ConfigView* parent)
363+ : Parent(parent)
364+{
365+ connect(this, SIGNAL(lostFocus()), SLOT(hide()));
366+}
367+
358368 void ConfigLineEdit::show(ConfigItem* i)
359369 {
360370 item = i;
@@ -385,8 +395,8 @@ void ConfigLineEdit::keyPressEvent(QKeyEvent* e) · 24 unmodified lines
385395 hide();
386396 }
387397
388−ConfigList::ConfigList(ConfigView* p, ConfigMainWindow* cv, ConfigSettings* configSettings)
389− : Parent(p), cview(cv),
398+ConfigList::ConfigList(ConfigView* p, ConfigSettings* configSettings)
399+ : Parent(p),
390400 updateAll(false),
391401 symbolYesPix(xpm_symbol_yes), symbolModPix(xpm_symbol_mod), symbolNoPix(xpm_symbol_no),
392402 choiceYesPix(xpm_choice_yes), choiceNoPix(xpm_choice_no),
@@ -450,9 +460,8 @@ void ConfigList::updateSelection(void) · 57 unmodified lines
450460 if (!item)
451461 return;
452462
453− cview->setHelp(item);
454−
455463 menu = item->menu;
464+ emit menuChanged(menu);
456465 if (!menu)
457466 return;
458467 type = menu->prompt ? menu->prompt->type : P_UNKNOWN;
@@ -464,8 +473,20 @@ void ConfigList::updateList(ConfigItem* item) · 5 unmodified lines
464473 {
465474 ConfigItem* last = 0;
466475
467− if (!rootEntry)
468− goto update;
476+ if (!rootEntry) {
477+ if (mode != listMode)
478+ goto update;
479+ QListViewItemIterator it(this);
480+ ConfigItem* item;
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+ }
469490
470491 if (rootEntry != &rootmenu && (mode == singleMode ||
471492 (mode == symbolMode && rootEntry->parent != &rootmenu))) {
@@ -610,7 +631,7 @@ void ConfigList::keyPressEvent(QKeyEvent* ev) · 138 unmodified lines
610631 struct menu *menu;
611632 enum prop_type type;
612633
613− if (ev->key() == Key_Escape && mode != fullMode) {
634+ if (ev->key() == Key_Escape && mode != fullMode && mode != listMode) {
614635 emit parentSelected();
615636 ev->accept();
616637 return;
@@ -767,11 +788,10 @@ void ConfigList::focusInEvent(QFocusEvent *e) · 150 unmodified lines
767788
768789 ConfigView* ConfigView::viewList;
769790
770−ConfigView::ConfigView(QWidget* parent, ConfigMainWindow* cview,
771− ConfigSettings *configSettings)
791+ConfigView::ConfigView(QWidget* parent, ConfigSettings *configSettings)
772792 : Parent(parent)
773793 {
774− list = new ConfigList(this, cview, configSettings);
794+ list = new ConfigList(this, configSettings);
775795 lineEdit = new ConfigLineEdit(this);
776796 lineEdit->hide();
777797
@@ -807,13 +827,238 @@ void ConfigView::updateListAll(void) · 29 unmodified lines
807827 v->list->updateListAll();
808828 }
809829
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+
8101055 /*
8111056 * Construct the complete config widget
8121057 */
8131058 ConfigMainWindow::ConfigMainWindow(void)
8141059 {
8151060 QMenuBar* menu;
816− bool ok;
1061+ bool ok, showDebug;
8171062 int x, y, width, height;
8181063
8191064 QWidget *d = configApp->desktop();
@@ -843,18 +1088,19 @@ ConfigMainWindow::ConfigMainWindow(void) · 23 unmodified lines
8431088 split1->setOrientation(QSplitter::Horizontal);
8441089 setCentralWidget(split1);
8451090
846− menuView = new ConfigView(split1, this, configSettings);
1091+ menuView = new ConfigView(split1, configSettings);
8471092 menuList = menuView->list;
8481093
8491094 split2 = new QSplitter(split1);
8501095 split2->setOrientation(QSplitter::Vertical);
8511096
8521097 // create config tree
853− configView = new ConfigView(split2, this, configSettings);
1098+ configView = new ConfigView(split2, configSettings);
8541099 configList = configView->list;
8551100
856− helpText = new QTextView(split2);
1101+ helpText = new ConfigInfoView(split2);
8571102 helpText->setTextFormat(Qt::RichText);
1103+ helpText->setShowDebug(showDebug);
8581104
8591105 setTabOrder(configList, helpText);
8601106 configList->setFocus();
@@ -873,6 +1119,8 @@ ConfigMainWindow::ConfigMainWindow(void) · 12 unmodified lines
8731119 connect(saveAction, SIGNAL(activated()), SLOT(saveConfig()));
8741120 QAction *saveAsAction = new QAction("Save As...", "Save &As...", 0, this);
8751121 connect(saveAsAction, SIGNAL(activated()), SLOT(saveConfigAs()));
1122+ QAction *searchAction = new QAction("Search", "&Search", CTRL+Key_F, this);
1123+ connect(searchAction, SIGNAL(activated()), SLOT(searchConfig()));
8761124 QAction *singleViewAction = new QAction("Single View", QPixmap(xpm_single_view), "Split View", 0, this);
8771125 connect(singleViewAction, SIGNAL(activated()), SLOT(showSingleView()));
8781126 QAction *splitViewAction = new QAction("Split View", QPixmap(xpm_split_view), "Split View", 0, this);
@@ -899,7 +1147,8 @@ ConfigMainWindow::ConfigMainWindow(void) · 20 unmodified lines
8991147 QAction *showDebugAction = new QAction(NULL, "Show Debug Info", 0, this);
9001148 showDebugAction->setToggleAction(TRUE);
9011149 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)));
9031152
9041153 QAction *showIntroAction = new QAction(NULL, "Introduction", 0, this);
9051154 connect(showIntroAction, SIGNAL(activated()), SLOT(showIntro()));
@@ -923,6 +1172,8 @@ ConfigMainWindow::ConfigMainWindow(void) · 17 unmodified lines
9231172 saveAction->addTo(config);
9241173 saveAsAction->addTo(config);
9251174 config->insertSeparator();
1175+ searchAction->addTo(config);
1176+ config->insertSeparator();
9261177 quitAction->addTo(config);
9271178
9281179 // create options menu
@@ -942,10 +1193,14 @@ ConfigMainWindow::ConfigMainWindow(void) · 13 unmodified lines
9421193 showIntroAction->addTo(helpMenu);
9431194 showAboutAction->addTo(helpMenu);
9441195
1196+ connect(configList, SIGNAL(menuChanged(struct menu *)),
1197+ helpText, SLOT(setInfo(struct menu *)));
9451198 connect(configList, SIGNAL(menuSelected(struct menu *)),
9461199 SLOT(changeMenu(struct menu *)));
9471200 connect(configList, SIGNAL(parentSelected()),
9481201 SLOT(goBack()));
1202+ connect(menuList, SIGNAL(menuChanged(struct menu *)),
1203+ helpText, SLOT(setInfo(struct menu *)));
9491204 connect(menuList, SIGNAL(menuSelected(struct menu *)),
9501205 SLOT(changeMenu(struct menu *)));
9511206
@@ -977,42 +1232,6 @@ ConfigMainWindow::ConfigMainWindow(void) · 25 unmodified lines
9771232 delete configSettings;
9781233 }
9791234
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−
10161235 /*
10171236 * display a new help entry as soon as a new menu entry is selected
10181237 */
@@ -1021,105 +1240,9 @@ void ConfigMainWindow::setHelp(QListViewItem* item) · 2 unmodified lines
10211240 struct symbol* sym;
10221241 struct menu* menu = 0;
10231242
1024− configList->parent()->lineEdit->hide();
10251243 if (item)
10261244 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);
11231246 }
11241247
11251248 void ConfigMainWindow::loadConfig(void)
@@ -1147,6 +1270,13 @@ void ConfigMainWindow::saveConfigAs(void) · 21 unmodified lines
11471270 QMessageBox::information(this, "qconf", "Unable to save configuration!");
11481271 }
11491272
1273+void ConfigMainWindow::searchConfig(void)
1274+{
1275+ if (!searchWindow)
1276+ searchWindow = new ConfigSearchWindow(this);
1277+ searchWindow->show();
1278+}
1279+
11501280 void ConfigMainWindow::changeMenu(struct menu *menu)
11511281 {
11521282 configList->setRootMenu(menu);
@@ -1233,13 +1363,6 @@ void ConfigMainWindow::setShowAll(bool b) · 80 unmodified lines
12331363 menuList->updateListAll();
12341364 }
12351365
1236−void ConfigMainWindow::setShowDebug(bool b)
1237−{
1238− if (showDebug == b)
1239− return;
1240− showDebug = b;
1241−}
1242−
12431366 void ConfigMainWindow::setShowName(bool b)
12441367 {
12451368 if (configList->showName == b)
@@ -1334,7 +1457,7 @@ void ConfigMainWindow::saveSettings(void) · 88 unmodified lines
13341457 configSettings->writeEntry("/kconfig/qconf/showRange", configList->showRange);
13351458 configSettings->writeEntry("/kconfig/qconf/showData", configList->showData);
13361459 configSettings->writeEntry("/kconfig/qconf/showAll", configList->showAll);
1337− configSettings->writeEntry("/kconfig/qconf/showDebug", showDebug);
1460+ configSettings->writeEntry("/kconfig/qconf/showDebug", helpText->showDebug());
13381461
13391462 QString entry;
13401463 switch(configList->mode) {
@@ -1417,9 +1540,10 @@ int main(int ac, char** av) · 76 unmodified lines
14171540 v = new ConfigMainWindow();
14181541
14191542 //zconfdump(stdout);
1420− v->show();
1543+ configApp->setMainWidget(v);
14211544 configApp->connect(configApp, SIGNAL(lastWindowClosed()), SLOT(quit()));
14221545 configApp->connect(configApp, SIGNAL(aboutToQuit()), v, SLOT(saveSettings()));
1546+ v->show();
14231547 configApp->exec();
14241548
14251549 return 0;
scripts/kconfig/qconf.h+49−12
@@ -36,7 +36,7 @@ class ConfigView : public QVBox { · 35 unmodified lines
3636 Q_OBJECT
3737 typedef class QVBox Parent;
3838 public:
39− ConfigView(QWidget* parent, ConfigMainWindow* cview, ConfigSettings* configSettings);
39+ ConfigView(QWidget* parent, ConfigSettings* configSettings);
4040 ~ConfigView(void);
4141 static void updateList(ConfigItem* item);
4242 static void updateListAll(void);
@@ -53,14 +53,14 @@ enum colIdx { · 10 unmodified lines
5353 promptColIdx, nameColIdx, noColIdx, modColIdx, yesColIdx, dataColIdx, colNr
5454 };
5555 enum listMode {
56− singleMode, menuMode, symbolMode, fullMode
56+ singleMode, menuMode, symbolMode, fullMode, listMode
5757 };
5858
5959 class ConfigList : public QListView {
6060 Q_OBJECT
6161 typedef class QListView Parent;
6262 public:
63− ConfigList(ConfigView* p, ConfigMainWindow* cview, ConfigSettings *configSettings);
63+ ConfigList(ConfigView* p, ConfigSettings *configSettings);
6464 void reinit(void);
6565 ConfigView* parent(void) const
6666 {
@@ -68,8 +68,6 @@ public: · 1 unmodified line
6868 }
6969
7070 protected:
71− ConfigMainWindow* cview;
72−
7371 void keyPressEvent(QKeyEvent *e);
7472 void contentsMousePressEvent(QMouseEvent *e);
7573 void contentsMouseReleaseEvent(QMouseEvent *e);
@@ -84,6 +82,7 @@ public slots: · 8 unmodified lines
8482 void changeValue(ConfigItem* item);
8583 void updateSelection(void);
8684 signals:
85+ void menuChanged(struct menu *menu);
8786 void menuSelected(struct menu *menu);
8887 void parentSelected(void);
8988 void gotFocus(void);
@@ -208,9 +207,7 @@ class ConfigLineEdit : public QLineEdit { · 118 unmodified lines
208207 Q_OBJECT
209208 typedef class QLineEdit Parent;
210209 public:
211− ConfigLineEdit(ConfigView* parent)
212− : Parent(parent)
213− { }
210+ ConfigLineEdit(ConfigView* parent);
214211 ConfigView* parent(void) const
215212 {
216213 return (ConfigView*)Parent::parent();
@@ -222,6 +219,47 @@ public: · 5 unmodified lines
222219 ConfigItem *item;
223220 };
224221
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+
225263 class ConfigMainWindow : public QMainWindow {
226264 Q_OBJECT
227265 public:
@@ -234,11 +272,11 @@ public slots: · 6 unmodified lines
234272 void loadConfig(void);
235273 void saveConfig(void);
236274 void saveConfigAs(void);
275+ void searchConfig(void);
237276 void showSingleView(void);
238277 void showSplitView(void);
239278 void showFullView(void);
240279 void setShowAll(bool);
241− void setShowDebug(bool);
242280 void setShowRange(bool);
243281 void setShowName(bool);
244282 void setShowData(bool);
@@ -249,15 +287,14 @@ public slots: · 4 unmodified lines
249287 protected:
250288 void closeEvent(QCloseEvent *e);
251289
290+ ConfigSearchWindow *searchWindow;
252291 ConfigView *menuView;
253292 ConfigList *menuList;
254293 ConfigView *configView;
255294 ConfigList *configList;
256− QTextView *helpText;
295+ ConfigInfoView *helpText;
257296 QToolBar *toolBar;
258297 QAction *backAction;
259298 QSplitter* split1;
260299 QSplitter* split2;
261−
262− bool showDebug;
263300 };

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t