aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig/qconf.cc
diff options
context:
space:
mode:
authorAlexander Stein <alexander.stein@informatik.tu-chemnitz.de>2010-08-31 11:34:37 -0400
committerMichal Marek <mmarek@suse.cz>2010-09-01 10:14:29 -0400
commit133c5f7c10e4552ba41bcf03b9bda6c4e3413804 (patch)
tree06af2cdf01dfa289937537f31c88ce0498e1ac13 /scripts/kconfig/qconf.cc
parentc94d3fb01fb6db1899cdf53ea4eb9d38e08a08fe (diff)
kconfig qconf: port to QT4
A straight forward port to QT4 using qt3to4 and compiling against qt3support * Use pkg-config to detect QT4 which is hopefully portable enough * If no QT4, QT3 will by tried instead * Classes renamed using qt3to4 * If build using QT3 renamed to QT3 class names using defines * ConfigInfoView::menu has to be renamed as QT4 moc strips struct from struct menu and creates a name conflict * QT2 support has been dropped * The hidden options inserted in 39a4897c1bb66e8a36043c105d7fd73d8b32b480 are use in native API Signed-off-by: Alexander Stein <alexander.stein@informatik.tu-chemnitz.de> Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'scripts/kconfig/qconf.cc')
-rw-r--r--scripts/kconfig/qconf.cc162
1 files changed, 89 insertions, 73 deletions
diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
index 820df2d1217b..88d3874ca8f4 100644
--- a/scripts/kconfig/qconf.cc
+++ b/scripts/kconfig/qconf.cc
@@ -3,25 +3,42 @@
3 * Released under the terms of the GNU GPL v2.0. 3 * Released under the terms of the GNU GPL v2.0.
4 */ 4 */
5 5
6#include <qapplication.h> 6#include <qglobal.h>
7
8#if QT_VERSION < 0x040000
7#include <qmainwindow.h> 9#include <qmainwindow.h>
10#include <qvbox.h>
11#include <qvaluelist.h>
12#include <qtextbrowser.h>
13#include <qaction.h>
14#include <qheader.h>
15#include <qfiledialog.h>
16#include <qdragobject.h>
17#include <qpopupmenu.h>
18#else
19#include <q3mainwindow.h>
20#include <q3vbox.h>
21#include <q3valuelist.h>
22#include <q3textbrowser.h>
23#include <q3action.h>
24#include <q3header.h>
25#include <q3filedialog.h>
26#include <q3dragobject.h>
27#include <q3popupmenu.h>
28#endif
29
30#include <qapplication.h>
8#include <qdesktopwidget.h> 31#include <qdesktopwidget.h>
9#include <qtoolbar.h> 32#include <qtoolbar.h>
10#include <qlayout.h> 33#include <qlayout.h>
11#include <qvbox.h>
12#include <qsplitter.h> 34#include <qsplitter.h>
13#include <qlistview.h>
14#include <qtextbrowser.h>
15#include <qlineedit.h> 35#include <qlineedit.h>
16#include <qlabel.h> 36#include <qlabel.h>
17#include <qpushbutton.h> 37#include <qpushbutton.h>
18#include <qmenubar.h> 38#include <qmenubar.h>
19#include <qmessagebox.h> 39#include <qmessagebox.h>
20#include <qaction.h>
21#include <qheader.h>
22#include <qfiledialog.h>
23#include <qdragobject.h>
24#include <qregexp.h> 40#include <qregexp.h>
41#include <qevent.h>
25 42
26#include <stdlib.h> 43#include <stdlib.h>
27 44
@@ -39,7 +56,7 @@
39static QApplication *configApp; 56static QApplication *configApp;
40static ConfigSettings *configSettings; 57static ConfigSettings *configSettings;
41 58
42QAction *ConfigMainWindow::saveAction; 59Q3Action *ConfigMainWindow::saveAction;
43 60
44static inline QString qgettext(const char* str) 61static inline QString qgettext(const char* str)
45{ 62{
@@ -54,9 +71,9 @@ static inline QString qgettext(const QString& str)
54/** 71/**
55 * Reads a list of integer values from the application settings. 72 * Reads a list of integer values from the application settings.
56 */ 73 */
57QValueList<int> ConfigSettings::readSizes(const QString& key, bool *ok) 74Q3ValueList<int> ConfigSettings::readSizes(const QString& key, bool *ok)
58{ 75{
59 QValueList<int> result; 76 Q3ValueList<int> result;
60 QStringList entryList = readListEntry(key, ok); 77 QStringList entryList = readListEntry(key, ok);
61 QStringList::Iterator it; 78 QStringList::Iterator it;
62 79
@@ -69,10 +86,10 @@ QValueList<int> ConfigSettings::readSizes(const QString& key, bool *ok)
69/** 86/**
70 * Writes a list of integer values to the application settings. 87 * Writes a list of integer values to the application settings.
71 */ 88 */
72bool ConfigSettings::writeSizes(const QString& key, const QValueList<int>& value) 89bool ConfigSettings::writeSizes(const QString& key, const Q3ValueList<int>& value)
73{ 90{
74 QStringList stringList; 91 QStringList stringList;
75 QValueList<int>::ConstIterator it; 92 Q3ValueList<int>::ConstIterator it;
76 93
77 for (it = value.begin(); it != value.end(); ++it) 94 for (it = value.begin(); it != value.end(); ++it)
78 stringList.push_back(QString::number(*it)); 95 stringList.push_back(QString::number(*it));
@@ -80,7 +97,6 @@ bool ConfigSettings::writeSizes(const QString& key, const QValueList<int>& value
80} 97}
81 98
82 99
83#if QT_VERSION >= 300
84/* 100/*
85 * set the new data 101 * set the new data
86 * TODO check the value 102 * TODO check the value
@@ -91,7 +107,6 @@ void ConfigItem::okRename(int col)
91 sym_set_string_value(menu->sym, text(dataColIdx).latin1()); 107 sym_set_string_value(menu->sym, text(dataColIdx).latin1());
92 listView()->updateList(this); 108 listView()->updateList(this);
93} 109}
94#endif
95 110
96/* 111/*
97 * update the displayed of a menu entry 112 * update the displayed of a menu entry
@@ -195,11 +210,9 @@ void ConfigItem::updateMenu(void)
195 210
196 data = sym_get_string_value(sym); 211 data = sym_get_string_value(sym);
197 212
198#if QT_VERSION >= 300
199 int i = list->mapIdx(dataColIdx); 213 int i = list->mapIdx(dataColIdx);
200 if (i >= 0) 214 if (i >= 0)
201 setRenameEnabled(i, TRUE); 215 setRenameEnabled(i, TRUE);
202#endif
203 setText(dataColIdx, data); 216 setText(dataColIdx, data);
204 if (type == S_STRING) 217 if (type == S_STRING)
205 prompt = QString("%1: %2").arg(prompt).arg(data); 218 prompt = QString("%1: %2").arg(prompt).arg(data);
@@ -432,7 +445,7 @@ void ConfigList::updateList(ConfigItem* item)
432 if (!rootEntry) { 445 if (!rootEntry) {
433 if (mode != listMode) 446 if (mode != listMode)
434 goto update; 447 goto update;
435 QListViewItemIterator it(this); 448 Q3ListViewItemIterator it(this);
436 ConfigItem* item; 449 ConfigItem* item;
437 450
438 for (; it.current(); ++it) { 451 for (; it.current(); ++it) {
@@ -527,11 +540,9 @@ void ConfigList::changeValue(ConfigItem* item)
527 case S_INT: 540 case S_INT:
528 case S_HEX: 541 case S_HEX:
529 case S_STRING: 542 case S_STRING:
530#if QT_VERSION >= 300
531 if (colMap[dataColIdx] >= 0) 543 if (colMap[dataColIdx] >= 0)
532 item->startRename(colMap[dataColIdx]); 544 item->startRename(colMap[dataColIdx]);
533 else 545 else
534#endif
535 parent()->lineEdit->show(item); 546 parent()->lineEdit->show(item);
536 break; 547 break;
537 } 548 }
@@ -563,7 +574,7 @@ void ConfigList::setParentMenu(void)
563 return; 574 return;
564 setRootMenu(menu_get_parent_menu(rootEntry->parent)); 575 setRootMenu(menu_get_parent_menu(rootEntry->parent));
565 576
566 QListViewItemIterator it(this); 577 Q3ListViewItemIterator it(this);
567 for (; (item = (ConfigItem*)it.current()); it++) { 578 for (; (item = (ConfigItem*)it.current()); it++) {
568 if (item->menu == oldroot) { 579 if (item->menu == oldroot) {
569 setCurrentItem(item); 580 setCurrentItem(item);
@@ -645,7 +656,7 @@ void ConfigList::updateMenuList(P* parent, struct menu* menu)
645 656
646void ConfigList::keyPressEvent(QKeyEvent* ev) 657void ConfigList::keyPressEvent(QKeyEvent* ev)
647{ 658{
648 QListViewItem* i = currentItem(); 659 Q3ListViewItem* i = currentItem();
649 ConfigItem* item; 660 ConfigItem* item;
650 struct menu *menu; 661 struct menu *menu;
651 enum prop_type type; 662 enum prop_type type;
@@ -811,10 +822,10 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e)
811{ 822{
812 if (e->y() <= header()->geometry().bottom()) { 823 if (e->y() <= header()->geometry().bottom()) {
813 if (!headerPopup) { 824 if (!headerPopup) {
814 QAction *action; 825 Q3Action *action;
815 826
816 headerPopup = new QPopupMenu(this); 827 headerPopup = new Q3PopupMenu(this);
817 action = new QAction(NULL, _("Show Name"), 0, this); 828 action = new Q3Action(NULL, _("Show Name"), 0, this);
818 action->setToggleAction(TRUE); 829 action->setToggleAction(TRUE);
819 connect(action, SIGNAL(toggled(bool)), 830 connect(action, SIGNAL(toggled(bool)),
820 parent(), SLOT(setShowName(bool))); 831 parent(), SLOT(setShowName(bool)));
@@ -822,7 +833,7 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e)
822 action, SLOT(setOn(bool))); 833 action, SLOT(setOn(bool)));
823 action->setOn(showName); 834 action->setOn(showName);
824 action->addTo(headerPopup); 835 action->addTo(headerPopup);
825 action = new QAction(NULL, _("Show Range"), 0, this); 836 action = new Q3Action(NULL, _("Show Range"), 0, this);
826 action->setToggleAction(TRUE); 837 action->setToggleAction(TRUE);
827 connect(action, SIGNAL(toggled(bool)), 838 connect(action, SIGNAL(toggled(bool)),
828 parent(), SLOT(setShowRange(bool))); 839 parent(), SLOT(setShowRange(bool)));
@@ -830,7 +841,7 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e)
830 action, SLOT(setOn(bool))); 841 action, SLOT(setOn(bool)));
831 action->setOn(showRange); 842 action->setOn(showRange);
832 action->addTo(headerPopup); 843 action->addTo(headerPopup);
833 action = new QAction(NULL, _("Show Data"), 0, this); 844 action = new Q3Action(NULL, _("Show Data"), 0, this);
834 action->setToggleAction(TRUE); 845 action->setToggleAction(TRUE);
835 connect(action, SIGNAL(toggled(bool)), 846 connect(action, SIGNAL(toggled(bool)),
836 parent(), SLOT(setShowData(bool))); 847 parent(), SLOT(setShowData(bool)));
@@ -914,7 +925,7 @@ void ConfigView::setShowData(bool b)
914 925
915void ConfigList::setAllOpen(bool open) 926void ConfigList::setAllOpen(bool open)
916{ 927{
917 QListViewItemIterator it(this); 928 Q3ListViewItemIterator it(this);
918 929
919 for (; it.current(); it++) 930 for (; it.current(); it++)
920 it.current()->setOpen(open); 931 it.current()->setOpen(open);
@@ -937,7 +948,7 @@ void ConfigView::updateListAll(void)
937} 948}
938 949
939ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name) 950ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name)
940 : Parent(parent, name), sym(0), menu(0) 951 : Parent(parent, name), sym(0), _menu(0)
941{ 952{
942 if (name) { 953 if (name) {
943 configSettings->beginGroup(name); 954 configSettings->beginGroup(name);
@@ -960,7 +971,7 @@ void ConfigInfoView::setShowDebug(bool b)
960{ 971{
961 if (_showDebug != b) { 972 if (_showDebug != b) {
962 _showDebug = b; 973 _showDebug = b;
963 if (menu) 974 if (_menu)
964 menuInfo(); 975 menuInfo();
965 else if (sym) 976 else if (sym)
966 symbolInfo(); 977 symbolInfo();
@@ -970,11 +981,11 @@ void ConfigInfoView::setShowDebug(bool b)
970 981
971void ConfigInfoView::setInfo(struct menu *m) 982void ConfigInfoView::setInfo(struct menu *m)
972{ 983{
973 if (menu == m) 984 if (_menu == m)
974 return; 985 return;
975 menu = m; 986 _menu = m;
976 sym = NULL; 987 sym = NULL;
977 if (!menu) 988 if (!_menu)
978 clear(); 989 clear();
979 else 990 else
980 menuInfo(); 991 menuInfo();
@@ -1001,11 +1012,11 @@ void ConfigInfoView::menuInfo(void)
1001 struct symbol* sym; 1012 struct symbol* sym;
1002 QString head, debug, help; 1013 QString head, debug, help;
1003 1014
1004 sym = menu->sym; 1015 sym = _menu->sym;
1005 if (sym) { 1016 if (sym) {
1006 if (menu->prompt) { 1017 if (_menu->prompt) {
1007 head += "<big><b>"; 1018 head += "<big><b>";
1008 head += print_filter(_(menu->prompt->text)); 1019 head += print_filter(_(_menu->prompt->text));
1009 head += "</b></big>"; 1020 head += "</b></big>";
1010 if (sym->name) { 1021 if (sym->name) {
1011 head += " ("; 1022 head += " (";
@@ -1031,23 +1042,23 @@ void ConfigInfoView::menuInfo(void)
1031 debug = debug_info(sym); 1042 debug = debug_info(sym);
1032 1043
1033 struct gstr help_gstr = str_new(); 1044 struct gstr help_gstr = str_new();
1034 menu_get_ext_help(menu, &help_gstr); 1045 menu_get_ext_help(_menu, &help_gstr);
1035 help = print_filter(str_get(&help_gstr)); 1046 help = print_filter(str_get(&help_gstr));
1036 str_free(&help_gstr); 1047 str_free(&help_gstr);
1037 } else if (menu->prompt) { 1048 } else if (_menu->prompt) {
1038 head += "<big><b>"; 1049 head += "<big><b>";
1039 head += print_filter(_(menu->prompt->text)); 1050 head += print_filter(_(_menu->prompt->text));
1040 head += "</b></big><br><br>"; 1051 head += "</b></big><br><br>";
1041 if (showDebug()) { 1052 if (showDebug()) {
1042 if (menu->prompt->visible.expr) { 1053 if (_menu->prompt->visible.expr) {
1043 debug += "&nbsp;&nbsp;dep: "; 1054 debug += "&nbsp;&nbsp;dep: ";
1044 expr_print(menu->prompt->visible.expr, expr_print_help, &debug, E_NONE); 1055 expr_print(_menu->prompt->visible.expr, expr_print_help, &debug, E_NONE);
1045 debug += "<br><br>"; 1056 debug += "<br><br>";
1046 } 1057 }
1047 } 1058 }
1048 } 1059 }
1049 if (showDebug()) 1060 if (showDebug())
1050 debug += QString().sprintf("defined at %s:%d<br><br>", menu->file->name, menu->lineno); 1061 debug += QString().sprintf("defined at %s:%d<br><br>", _menu->file->name, _menu->lineno);
1051 1062
1052 setText(head + debug + help); 1063 setText(head + debug + help);
1053} 1064}
@@ -1150,10 +1161,10 @@ void ConfigInfoView::expr_print_help(void *data, struct symbol *sym, const char
1150 *text += str2; 1161 *text += str2;
1151} 1162}
1152 1163
1153QPopupMenu* ConfigInfoView::createPopupMenu(const QPoint& pos) 1164Q3PopupMenu* ConfigInfoView::createPopupMenu(const QPoint& pos)
1154{ 1165{
1155 QPopupMenu* popup = Parent::createPopupMenu(pos); 1166 Q3PopupMenu* popup = Parent::createPopupMenu(pos);
1156 QAction* action = new QAction(NULL, _("Show Debug Info"), 0, popup); 1167 Q3Action* action = new Q3Action(NULL, _("Show Debug Info"), 0, popup);
1157 action->setToggleAction(TRUE); 1168 action->setToggleAction(TRUE);
1158 connect(action, SIGNAL(toggled(bool)), SLOT(setShowDebug(bool))); 1169 connect(action, SIGNAL(toggled(bool)), SLOT(setShowDebug(bool)));
1159 connect(this, SIGNAL(showDebugChanged(bool)), action, SLOT(setOn(bool))); 1170 connect(this, SIGNAL(showDebugChanged(bool)), action, SLOT(setOn(bool)));
@@ -1210,7 +1221,7 @@ ConfigSearchWindow::ConfigSearchWindow(ConfigMainWindow* parent, const char *nam
1210 y = configSettings->readNumEntry("/window y", 0, &ok); 1221 y = configSettings->readNumEntry("/window y", 0, &ok);
1211 if (ok) 1222 if (ok)
1212 move(x, y); 1223 move(x, y);
1213 QValueList<int> sizes = configSettings->readSizes("/split", &ok); 1224 Q3ValueList<int> sizes = configSettings->readSizes("/split", &ok);
1214 if (ok) 1225 if (ok)
1215 split->setSizes(sizes); 1226 split->setSizes(sizes);
1216 configSettings->endGroup(); 1227 configSettings->endGroup();
@@ -1297,42 +1308,42 @@ ConfigMainWindow::ConfigMainWindow(void)
1297 configList->setFocus(); 1308 configList->setFocus();
1298 1309
1299 menu = menuBar(); 1310 menu = menuBar();
1300 toolBar = new QToolBar("Tools", this); 1311 toolBar = new Q3ToolBar("Tools", this);
1301 1312
1302 backAction = new QAction("Back", QPixmap(xpm_back), _("Back"), 0, this); 1313 backAction = new Q3Action("Back", QPixmap(xpm_back), _("Back"), 0, this);
1303 connect(backAction, SIGNAL(activated()), SLOT(goBack())); 1314 connect(backAction, SIGNAL(activated()), SLOT(goBack()));
1304 backAction->setEnabled(FALSE); 1315 backAction->setEnabled(FALSE);
1305 QAction *quitAction = new QAction("Quit", _("&Quit"), Qt::CTRL + Qt::Key_Q, this); 1316 Q3Action *quitAction = new Q3Action("Quit", _("&Quit"), Qt::CTRL + Qt::Key_Q, this);
1306 connect(quitAction, SIGNAL(activated()), SLOT(close())); 1317 connect(quitAction, SIGNAL(activated()), SLOT(close()));
1307 QAction *loadAction = new QAction("Load", QPixmap(xpm_load), _("&Load"), Qt::CTRL + Qt::Key_L, this); 1318 Q3Action *loadAction = new Q3Action("Load", QPixmap(xpm_load), _("&Load"), Qt::CTRL + Qt::Key_L, this);
1308 connect(loadAction, SIGNAL(activated()), SLOT(loadConfig())); 1319 connect(loadAction, SIGNAL(activated()), SLOT(loadConfig()));
1309 saveAction = new QAction("Save", QPixmap(xpm_save), _("&Save"), Qt::CTRL + Qt::Key_S, this); 1320 saveAction = new Q3Action("Save", QPixmap(xpm_save), _("&Save"), Qt::CTRL + Qt::Key_S, this);
1310 connect(saveAction, SIGNAL(activated()), SLOT(saveConfig())); 1321 connect(saveAction, SIGNAL(activated()), SLOT(saveConfig()));
1311 conf_set_changed_callback(conf_changed); 1322 conf_set_changed_callback(conf_changed);
1312 // Set saveAction's initial state 1323 // Set saveAction's initial state
1313 conf_changed(); 1324 conf_changed();
1314 QAction *saveAsAction = new QAction("Save As...", _("Save &As..."), 0, this); 1325 Q3Action *saveAsAction = new Q3Action("Save As...", _("Save &As..."), 0, this);
1315 connect(saveAsAction, SIGNAL(activated()), SLOT(saveConfigAs())); 1326 connect(saveAsAction, SIGNAL(activated()), SLOT(saveConfigAs()));
1316 QAction *searchAction = new QAction("Find", _("&Find"), Qt::CTRL + Qt::Key_F, this); 1327 Q3Action *searchAction = new Q3Action("Find", _("&Find"), Qt::CTRL + Qt::Key_F, this);
1317 connect(searchAction, SIGNAL(activated()), SLOT(searchConfig())); 1328 connect(searchAction, SIGNAL(activated()), SLOT(searchConfig()));
1318 QAction *singleViewAction = new QAction("Single View", QPixmap(xpm_single_view), _("Single View"), 0, this); 1329 Q3Action *singleViewAction = new Q3Action("Single View", QPixmap(xpm_single_view), _("Single View"), 0, this);
1319 connect(singleViewAction, SIGNAL(activated()), SLOT(showSingleView())); 1330 connect(singleViewAction, SIGNAL(activated()), SLOT(showSingleView()));
1320 QAction *splitViewAction = new QAction("Split View", QPixmap(xpm_split_view), _("Split View"), 0, this); 1331 Q3Action *splitViewAction = new Q3Action("Split View", QPixmap(xpm_split_view), _("Split View"), 0, this);
1321 connect(splitViewAction, SIGNAL(activated()), SLOT(showSplitView())); 1332 connect(splitViewAction, SIGNAL(activated()), SLOT(showSplitView()));
1322 QAction *fullViewAction = new QAction("Full View", QPixmap(xpm_tree_view), _("Full View"), 0, this); 1333 Q3Action *fullViewAction = new Q3Action("Full View", QPixmap(xpm_tree_view), _("Full View"), 0, this);
1323 connect(fullViewAction, SIGNAL(activated()), SLOT(showFullView())); 1334 connect(fullViewAction, SIGNAL(activated()), SLOT(showFullView()));
1324 1335
1325 QAction *showNameAction = new QAction(NULL, _("Show Name"), 0, this); 1336 Q3Action *showNameAction = new Q3Action(NULL, _("Show Name"), 0, this);
1326 showNameAction->setToggleAction(TRUE); 1337 showNameAction->setToggleAction(TRUE);
1327 connect(showNameAction, SIGNAL(toggled(bool)), configView, SLOT(setShowName(bool))); 1338 connect(showNameAction, SIGNAL(toggled(bool)), configView, SLOT(setShowName(bool)));
1328 connect(configView, SIGNAL(showNameChanged(bool)), showNameAction, SLOT(setOn(bool))); 1339 connect(configView, SIGNAL(showNameChanged(bool)), showNameAction, SLOT(setOn(bool)));
1329 showNameAction->setOn(configView->showName()); 1340 showNameAction->setOn(configView->showName());
1330 QAction *showRangeAction = new QAction(NULL, _("Show Range"), 0, this); 1341 Q3Action *showRangeAction = new Q3Action(NULL, _("Show Range"), 0, this);
1331 showRangeAction->setToggleAction(TRUE); 1342 showRangeAction->setToggleAction(TRUE);
1332 connect(showRangeAction, SIGNAL(toggled(bool)), configView, SLOT(setShowRange(bool))); 1343 connect(showRangeAction, SIGNAL(toggled(bool)), configView, SLOT(setShowRange(bool)));
1333 connect(configView, SIGNAL(showRangeChanged(bool)), showRangeAction, SLOT(setOn(bool))); 1344 connect(configView, SIGNAL(showRangeChanged(bool)), showRangeAction, SLOT(setOn(bool)));
1334 showRangeAction->setOn(configList->showRange); 1345 showRangeAction->setOn(configList->showRange);
1335 QAction *showDataAction = new QAction(NULL, _("Show Data"), 0, this); 1346 Q3Action *showDataAction = new Q3Action(NULL, _("Show Data"), 0, this);
1336 showDataAction->setToggleAction(TRUE); 1347 showDataAction->setToggleAction(TRUE);
1337 connect(showDataAction, SIGNAL(toggled(bool)), configView, SLOT(setShowData(bool))); 1348 connect(showDataAction, SIGNAL(toggled(bool)), configView, SLOT(setShowData(bool)));
1338 connect(configView, SIGNAL(showDataChanged(bool)), showDataAction, SLOT(setOn(bool))); 1349 connect(configView, SIGNAL(showDataChanged(bool)), showDataAction, SLOT(setOn(bool)));
@@ -1345,9 +1356,15 @@ ConfigMainWindow::ConfigMainWindow(void)
1345 connect(optGroup, SIGNAL(selected(QAction *)), menuView, 1356 connect(optGroup, SIGNAL(selected(QAction *)), menuView,
1346 SLOT(setOptionMode(QAction *))); 1357 SLOT(setOptionMode(QAction *)));
1347 1358
1348 configView->showNormalAction = new QAction(NULL, _("Show Normal Options"), 0, optGroup); 1359#if QT_VERSION >= 0x040000
1349 configView->showAllAction = new QAction(NULL, _("Show All Options"), 0, optGroup); 1360 configView->showNormalAction = new QAction(_("Show Normal Options"), optGroup);
1350 configView->showPromptAction = new QAction(NULL, _("Show Prompt Options"), 0, optGroup); 1361 configView->showAllAction = new QAction(_("Show All Options"), optGroup);
1362 configView->showPromptAction = new QAction(_("Show Prompt Options"), optGroup);
1363#else
1364 configView->showNormalAction = new QAction(_("Show Normal Options"), 0, optGroup);
1365 configView->showAllAction = new QAction(_("Show All Options"), 0, optGroup);
1366 configView->showPromptAction = new QAction(_("Show Prompt Options"), 0, optGroup);
1367#endif
1351 configView->showNormalAction->setToggleAction(TRUE); 1368 configView->showNormalAction->setToggleAction(TRUE);
1352 configView->showNormalAction->setOn(configList->optMode == normalOpt); 1369 configView->showNormalAction->setOn(configList->optMode == normalOpt);
1353 configView->showAllAction->setToggleAction(TRUE); 1370 configView->showAllAction->setToggleAction(TRUE);
@@ -1355,15 +1372,15 @@ ConfigMainWindow::ConfigMainWindow(void)
1355 configView->showPromptAction->setToggleAction(TRUE); 1372 configView->showPromptAction->setToggleAction(TRUE);
1356 configView->showPromptAction->setOn(configList->optMode == promptOpt); 1373 configView->showPromptAction->setOn(configList->optMode == promptOpt);
1357 1374
1358 QAction *showDebugAction = new QAction(NULL, _("Show Debug Info"), 0, this); 1375 Q3Action *showDebugAction = new Q3Action(NULL, _("Show Debug Info"), 0, this);
1359 showDebugAction->setToggleAction(TRUE); 1376 showDebugAction->setToggleAction(TRUE);
1360 connect(showDebugAction, SIGNAL(toggled(bool)), helpText, SLOT(setShowDebug(bool))); 1377 connect(showDebugAction, SIGNAL(toggled(bool)), helpText, SLOT(setShowDebug(bool)));
1361 connect(helpText, SIGNAL(showDebugChanged(bool)), showDebugAction, SLOT(setOn(bool))); 1378 connect(helpText, SIGNAL(showDebugChanged(bool)), showDebugAction, SLOT(setOn(bool)));
1362 showDebugAction->setOn(helpText->showDebug()); 1379 showDebugAction->setOn(helpText->showDebug());
1363 1380
1364 QAction *showIntroAction = new QAction(NULL, _("Introduction"), 0, this); 1381 Q3Action *showIntroAction = new Q3Action(NULL, _("Introduction"), 0, this);
1365 connect(showIntroAction, SIGNAL(activated()), SLOT(showIntro())); 1382 connect(showIntroAction, SIGNAL(activated()), SLOT(showIntro()));
1366 QAction *showAboutAction = new QAction(NULL, _("About"), 0, this); 1383 Q3Action *showAboutAction = new Q3Action(NULL, _("About"), 0, this);
1367 connect(showAboutAction, SIGNAL(activated()), SLOT(showAbout())); 1384 connect(showAboutAction, SIGNAL(activated()), SLOT(showAbout()));
1368 1385
1369 // init tool bar 1386 // init tool bar
@@ -1377,7 +1394,7 @@ ConfigMainWindow::ConfigMainWindow(void)
1377 fullViewAction->addTo(toolBar); 1394 fullViewAction->addTo(toolBar);
1378 1395
1379 // create config menu 1396 // create config menu
1380 QPopupMenu* config = new QPopupMenu(this); 1397 Q3PopupMenu* config = new Q3PopupMenu(this);
1381 menu->insertItem(_("&File"), config); 1398 menu->insertItem(_("&File"), config);
1382 loadAction->addTo(config); 1399 loadAction->addTo(config);
1383 saveAction->addTo(config); 1400 saveAction->addTo(config);
@@ -1386,12 +1403,12 @@ ConfigMainWindow::ConfigMainWindow(void)
1386 quitAction->addTo(config); 1403 quitAction->addTo(config);
1387 1404
1388 // create edit menu 1405 // create edit menu
1389 QPopupMenu* editMenu = new QPopupMenu(this); 1406 Q3PopupMenu* editMenu = new Q3PopupMenu(this);
1390 menu->insertItem(_("&Edit"), editMenu); 1407 menu->insertItem(_("&Edit"), editMenu);
1391 searchAction->addTo(editMenu); 1408 searchAction->addTo(editMenu);
1392 1409
1393 // create options menu 1410 // create options menu
1394 QPopupMenu* optionMenu = new QPopupMenu(this); 1411 Q3PopupMenu* optionMenu = new Q3PopupMenu(this);
1395 menu->insertItem(_("&Option"), optionMenu); 1412 menu->insertItem(_("&Option"), optionMenu);
1396 showNameAction->addTo(optionMenu); 1413 showNameAction->addTo(optionMenu);
1397 showRangeAction->addTo(optionMenu); 1414 showRangeAction->addTo(optionMenu);
@@ -1399,10 +1416,9 @@ ConfigMainWindow::ConfigMainWindow(void)
1399 optionMenu->insertSeparator(); 1416 optionMenu->insertSeparator();
1400 optGroup->addTo(optionMenu); 1417 optGroup->addTo(optionMenu);
1401 optionMenu->insertSeparator(); 1418 optionMenu->insertSeparator();
1402 showDebugAction->addTo(optionMenu);
1403 1419
1404 // create help menu 1420 // create help menu
1405 QPopupMenu* helpMenu = new QPopupMenu(this); 1421 Q3PopupMenu* helpMenu = new Q3PopupMenu(this);
1406 menu->insertSeparator(); 1422 menu->insertSeparator();
1407 menu->insertItem(_("&Help"), helpMenu); 1423 menu->insertItem(_("&Help"), helpMenu);
1408 showIntroAction->addTo(helpMenu); 1424 showIntroAction->addTo(helpMenu);
@@ -1437,7 +1453,7 @@ ConfigMainWindow::ConfigMainWindow(void)
1437 showSplitView(); 1453 showSplitView();
1438 1454
1439 // UI setup done, restore splitter positions 1455 // UI setup done, restore splitter positions
1440 QValueList<int> sizes = configSettings->readSizes("/split1", &ok); 1456 Q3ValueList<int> sizes = configSettings->readSizes("/split1", &ok);
1441 if (ok) 1457 if (ok)
1442 split1->setSizes(sizes); 1458 split1->setSizes(sizes);
1443 1459
@@ -1448,7 +1464,7 @@ ConfigMainWindow::ConfigMainWindow(void)
1448 1464
1449void ConfigMainWindow::loadConfig(void) 1465void ConfigMainWindow::loadConfig(void)
1450{ 1466{
1451 QString s = QFileDialog::getOpenFileName(conf_get_configname(), NULL, this); 1467 QString s = Q3FileDialog::getOpenFileName(conf_get_configname(), NULL, this);
1452 if (s.isNull()) 1468 if (s.isNull())
1453 return; 1469 return;
1454 if (conf_read(QFile::encodeName(s))) 1470 if (conf_read(QFile::encodeName(s)))
@@ -1464,7 +1480,7 @@ void ConfigMainWindow::saveConfig(void)
1464 1480
1465void ConfigMainWindow::saveConfigAs(void) 1481void ConfigMainWindow::saveConfigAs(void)
1466{ 1482{
1467 QString s = QFileDialog::getSaveFileName(conf_get_configname(), NULL, this); 1483 QString s = Q3FileDialog::getSaveFileName(conf_get_configname(), NULL, this);
1468 if (s.isNull()) 1484 if (s.isNull())
1469 return; 1485 return;
1470 if (conf_write(QFile::encodeName(s))) 1486 if (conf_write(QFile::encodeName(s)))