|
Lines 4-27
Link Here
|
| 4 |
*/ |
4 |
*/ |
| 5 |
|
5 |
|
| 6 |
#include <qapplication.h> |
6 |
#include <qapplication.h> |
| 7 |
#include <qmainwindow.h> |
7 |
#include <q3mainwindow.h> |
| 8 |
#include <qdesktopwidget.h> |
8 |
#include <qdesktopwidget.h> |
| 9 |
#include <qtoolbar.h> |
9 |
#include <q3toolbar.h> |
| 10 |
#include <qlayout.h> |
10 |
#include <qlayout.h> |
| 11 |
#include <qvbox.h> |
11 |
#include <q3vbox.h> |
| 12 |
#include <qsplitter.h> |
12 |
#include <qsplitter.h> |
| 13 |
#include <qlistview.h> |
13 |
#include <q3listview.h> |
| 14 |
#include <qtextbrowser.h> |
14 |
#include <q3textbrowser.h> |
| 15 |
#include <qlineedit.h> |
15 |
#include <qlineedit.h> |
| 16 |
#include <qlabel.h> |
16 |
#include <qlabel.h> |
| 17 |
#include <qpushbutton.h> |
17 |
#include <qpushbutton.h> |
| 18 |
#include <qmenubar.h> |
18 |
#include <qmenubar.h> |
| 19 |
#include <qmessagebox.h> |
19 |
#include <qmessagebox.h> |
| 20 |
#include <qaction.h> |
20 |
#include <qaction.h> |
| 21 |
#include <qheader.h> |
21 |
#include <q3header.h> |
| 22 |
#include <qfiledialog.h> |
22 |
#include <q3filedialog.h> |
| 23 |
#include <qdragobject.h> |
23 |
#include <q3dragobject.h> |
| 24 |
#include <qregexp.h> |
24 |
#include <qregexp.h> |
|
|
25 |
//Added by qt3to4: |
| 26 |
#include <QContextMenuEvent> |
| 27 |
#include <QPixmap> |
| 28 |
#include <QFocusEvent> |
| 29 |
#include <QMouseEvent> |
| 30 |
#include <QCloseEvent> |
| 31 |
#include <Q3ValueList> |
| 32 |
#include <QKeyEvent> |
| 33 |
#include <Q3HBoxLayout> |
| 34 |
#include <Q3VBoxLayout> |
| 35 |
#include <Q3PopupMenu> |
| 25 |
|
36 |
|
| 26 |
#include <stdlib.h> |
37 |
#include <stdlib.h> |
| 27 |
|
38 |
|
|
Lines 54-62
Link Here
|
| 54 |
/** |
65 |
/** |
| 55 |
* Reads a list of integer values from the application settings. |
66 |
* Reads a list of integer values from the application settings. |
| 56 |
*/ |
67 |
*/ |
| 57 |
QValueList<int> ConfigSettings::readSizes(const QString& key, bool *ok) |
68 |
Q3ValueList<int> ConfigSettings::readSizes(const QString& key, bool *ok) |
| 58 |
{ |
69 |
{ |
| 59 |
QValueList<int> result; |
70 |
Q3ValueList<int> result; |
| 60 |
QStringList entryList = readListEntry(key, ok); |
71 |
QStringList entryList = readListEntry(key, ok); |
| 61 |
QStringList::Iterator it; |
72 |
QStringList::Iterator it; |
| 62 |
|
73 |
|
|
Lines 69-78
Link Here
|
| 69 |
/** |
80 |
/** |
| 70 |
* Writes a list of integer values to the application settings. |
81 |
* Writes a list of integer values to the application settings. |
| 71 |
*/ |
82 |
*/ |
| 72 |
bool ConfigSettings::writeSizes(const QString& key, const QValueList<int>& value) |
83 |
bool ConfigSettings::writeSizes(const QString& key, const Q3ValueList<int>& value) |
| 73 |
{ |
84 |
{ |
| 74 |
QStringList stringList; |
85 |
QStringList stringList; |
| 75 |
QValueList<int>::ConstIterator it; |
86 |
Q3ValueList<int>::ConstIterator it; |
| 76 |
|
87 |
|
| 77 |
for (it = value.begin(); it != value.end(); ++it) |
88 |
for (it = value.begin(); it != value.end(); ++it) |
| 78 |
stringList.push_back(QString::number(*it)); |
89 |
stringList.push_back(QString::number(*it)); |
|
Lines 395-401
Link Here
|
| 395 |
} |
406 |
} |
| 396 |
} |
407 |
} |
| 397 |
|
408 |
|
| 398 |
ConfigItem* ConfigList::findConfigItem(struct menu *menu) |
409 |
ConfigItem* ConfigList::findConfigItem(KCMenu *menu) |
| 399 |
{ |
410 |
{ |
| 400 |
ConfigItem* item = (ConfigItem*)menu->data; |
411 |
ConfigItem* item = (ConfigItem*)menu->data; |
| 401 |
|
412 |
|
|
Lines 409-415
Link Here
|
| 409 |
|
420 |
|
| 410 |
void ConfigList::updateSelection(void) |
421 |
void ConfigList::updateSelection(void) |
| 411 |
{ |
422 |
{ |
| 412 |
struct menu *menu; |
423 |
KCMenu *menu; |
| 413 |
enum prop_type type; |
424 |
enum prop_type type; |
| 414 |
|
425 |
|
| 415 |
ConfigItem* item = (ConfigItem*)selectedItem(); |
426 |
ConfigItem* item = (ConfigItem*)selectedItem(); |
|
Lines 432-438
Link Here
|
| 432 |
if (!rootEntry) { |
443 |
if (!rootEntry) { |
| 433 |
if (mode != listMode) |
444 |
if (mode != listMode) |
| 434 |
goto update; |
445 |
goto update; |
| 435 |
QListViewItemIterator it(this); |
446 |
Q3ListViewItemIterator it(this); |
| 436 |
ConfigItem* item; |
447 |
ConfigItem* item; |
| 437 |
|
448 |
|
| 438 |
for (; it.current(); ++it) { |
449 |
for (; it.current(); ++it) { |
|
Lines 496-502
Link Here
|
| 496 |
void ConfigList::changeValue(ConfigItem* item) |
507 |
void ConfigList::changeValue(ConfigItem* item) |
| 497 |
{ |
508 |
{ |
| 498 |
struct symbol* sym; |
509 |
struct symbol* sym; |
| 499 |
struct menu* menu; |
510 |
KCMenu* menu; |
| 500 |
int type, oldexpr, newexpr; |
511 |
int type, oldexpr, newexpr; |
| 501 |
|
512 |
|
| 502 |
menu = item->menu; |
513 |
menu = item->menu; |
|
Lines 537-543
Link Here
|
| 537 |
} |
548 |
} |
| 538 |
} |
549 |
} |
| 539 |
|
550 |
|
| 540 |
void ConfigList::setRootMenu(struct menu *menu) |
551 |
void ConfigList::setRootMenu(KCMenu *menu) |
| 541 |
{ |
552 |
{ |
| 542 |
enum prop_type type; |
553 |
enum prop_type type; |
| 543 |
|
554 |
|
|
Lines 556-569
Link Here
|
| 556 |
void ConfigList::setParentMenu(void) |
567 |
void ConfigList::setParentMenu(void) |
| 557 |
{ |
568 |
{ |
| 558 |
ConfigItem* item; |
569 |
ConfigItem* item; |
| 559 |
struct menu *oldroot; |
570 |
KCMenu *oldroot; |
| 560 |
|
571 |
|
| 561 |
oldroot = rootEntry; |
572 |
oldroot = rootEntry; |
| 562 |
if (rootEntry == &rootmenu) |
573 |
if (rootEntry == &rootmenu) |
| 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); |
|
Lines 581-589
Link Here
|
| 581 |
* menu: entry to be updated |
592 |
* menu: entry to be updated |
| 582 |
*/ |
593 |
*/ |
| 583 |
template <class P> |
594 |
template <class P> |
| 584 |
void ConfigList::updateMenuList(P* parent, struct menu* menu) |
595 |
void ConfigList::updateMenuList(P* parent, KCMenu* menu) |
| 585 |
{ |
596 |
{ |
| 586 |
struct menu* child; |
597 |
KCMenu* child; |
| 587 |
ConfigItem* item; |
598 |
ConfigItem* item; |
| 588 |
ConfigItem* last; |
599 |
ConfigItem* last; |
| 589 |
bool visible; |
600 |
bool visible; |
|
Lines 645-653
Link Here
|
| 645 |
|
656 |
|
| 646 |
void ConfigList::keyPressEvent(QKeyEvent* ev) |
657 |
void 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 |
KCMenu *menu; |
| 651 |
enum prop_type type; |
662 |
enum prop_type type; |
| 652 |
|
663 |
|
| 653 |
if (ev->key() == Qt::Key_Escape && mode != fullMode && mode != listMode) { |
664 |
if (ev->key() == Qt::Key_Escape && mode != fullMode && mode != listMode) { |
|
Lines 708-714
Link Here
|
| 708 |
{ |
719 |
{ |
| 709 |
QPoint p(contentsToViewport(e->pos())); |
720 |
QPoint p(contentsToViewport(e->pos())); |
| 710 |
ConfigItem* item = (ConfigItem*)itemAt(p); |
721 |
ConfigItem* item = (ConfigItem*)itemAt(p); |
| 711 |
struct menu *menu; |
722 |
KCMenu *menu; |
| 712 |
enum prop_type ptype; |
723 |
enum prop_type ptype; |
| 713 |
const QPixmap* pm; |
724 |
const QPixmap* pm; |
| 714 |
int idx, x; |
725 |
int idx, x; |
|
Lines 770-776
Link Here
|
| 770 |
{ |
781 |
{ |
| 771 |
QPoint p(contentsToViewport(e->pos())); |
782 |
QPoint p(contentsToViewport(e->pos())); |
| 772 |
ConfigItem* item = (ConfigItem*)itemAt(p); |
783 |
ConfigItem* item = (ConfigItem*)itemAt(p); |
| 773 |
struct menu *menu; |
784 |
KCMenu *menu; |
| 774 |
enum prop_type ptype; |
785 |
enum prop_type ptype; |
| 775 |
|
786 |
|
| 776 |
if (!item) |
787 |
if (!item) |
|
Lines 795-801
Link Here
|
| 795 |
|
806 |
|
| 796 |
void ConfigList::focusInEvent(QFocusEvent *e) |
807 |
void ConfigList::focusInEvent(QFocusEvent *e) |
| 797 |
{ |
808 |
{ |
| 798 |
struct menu *menu = NULL; |
809 |
KCMenu *menu = NULL; |
| 799 |
|
810 |
|
| 800 |
Parent::focusInEvent(e); |
811 |
Parent::focusInEvent(e); |
| 801 |
|
812 |
|
|
Lines 813-820
Link Here
|
| 813 |
if (!headerPopup) { |
824 |
if (!headerPopup) { |
| 814 |
QAction *action; |
825 |
QAction *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 QAction(_("Show Name"), 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))); |
|
Lines 822-828
Link Here
|
| 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 QAction(_("Show Range"), 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))); |
|
Lines 830-836
Link Here
|
| 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 QAction(_("Show Data"), 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))); |
|
Lines 914-920
Link Here
|
| 914 |
|
925 |
|
| 915 |
void ConfigList::setAllOpen(bool open) |
926 |
void 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); |
|
Lines 968-974
Link Here
|
| 968 |
} |
979 |
} |
| 969 |
} |
980 |
} |
| 970 |
|
981 |
|
| 971 |
void ConfigInfoView::setInfo(struct menu *m) |
982 |
void ConfigInfoView::setInfo(KCMenu *m) |
| 972 |
{ |
983 |
{ |
| 973 |
if (menu == m) |
984 |
if (menu == m) |
| 974 |
return; |
985 |
return; |
|
Lines 1150-1159
Link Here
|
| 1150 |
*text += str2; |
1161 |
*text += str2; |
| 1151 |
} |
1162 |
} |
| 1152 |
|
1163 |
|
| 1153 |
QPopupMenu* ConfigInfoView::createPopupMenu(const QPoint& pos) |
1164 |
Q3PopupMenu* 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 |
QAction* action = new QAction(_("Show Debug Info"), 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))); |
|
Lines 1173-1180
Link Here
|
| 1173 |
{ |
1184 |
{ |
| 1174 |
setCaption("Search Config"); |
1185 |
setCaption("Search Config"); |
| 1175 |
|
1186 |
|
| 1176 |
QVBoxLayout* layout1 = new QVBoxLayout(this, 11, 6); |
1187 |
Q3VBoxLayout* layout1 = new Q3VBoxLayout(this, 11, 6); |
| 1177 |
QHBoxLayout* layout2 = new QHBoxLayout(0, 0, 6); |
1188 |
Q3HBoxLayout* layout2 = new Q3HBoxLayout(0, 0, 6); |
| 1178 |
layout2->addWidget(new QLabel(_("Find:"), this)); |
1189 |
layout2->addWidget(new QLabel(_("Find:"), this)); |
| 1179 |
editField = new QLineEdit(this); |
1190 |
editField = new QLineEdit(this); |
| 1180 |
connect(editField, SIGNAL(returnPressed()), SLOT(search())); |
1191 |
connect(editField, SIGNAL(returnPressed()), SLOT(search())); |
|
Lines 1190-1199
Link Here
|
| 1190 |
list = new ConfigView(split, name); |
1201 |
list = new ConfigView(split, name); |
| 1191 |
list->list->mode = listMode; |
1202 |
list->list->mode = listMode; |
| 1192 |
info = new ConfigInfoView(split, name); |
1203 |
info = new ConfigInfoView(split, name); |
| 1193 |
connect(list->list, SIGNAL(menuChanged(struct menu *)), |
1204 |
connect(list->list, SIGNAL(menuChanged(KCMenu *)), |
| 1194 |
info, SLOT(setInfo(struct menu *))); |
1205 |
info, SLOT(setInfo(KCMenu *))); |
| 1195 |
connect(list->list, SIGNAL(menuChanged(struct menu *)), |
1206 |
connect(list->list, SIGNAL(menuChanged(KCMenu *)), |
| 1196 |
parent, SLOT(setMenuLink(struct menu *))); |
1207 |
parent, SLOT(setMenuLink(KCMenu *))); |
| 1197 |
|
1208 |
|
| 1198 |
layout1->addWidget(split); |
1209 |
layout1->addWidget(split); |
| 1199 |
|
1210 |
|
|
Lines 1210-1216
Link Here
|
| 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(); |
|
Lines 1297-1338
Link Here
|
| 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 QAction(QPixmap(xpm_back), _("Back"), 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 |
QAction *quitAction = new QAction(_("&Quit"), Qt::CTRL + Qt::Key_Q, this, 0); |
| 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 |
QAction *loadAction = new QAction(QPixmap(xpm_load), _("&Load"), Qt::CTRL + Qt::Key_L, this, 0); |
| 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 QAction(QPixmap(xpm_save), _("&Save"), Qt::CTRL + Qt::Key_S, this, 0); |
| 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 |
QAction *saveAsAction = new QAction(_("Save &As..."), 0, this, "Save As..."); |
| 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 |
QAction *searchAction = new QAction(_("&Find"), Qt::CTRL + Qt::Key_F, this, "Find"); |
| 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 |
QAction *singleViewAction = new QAction(QPixmap(xpm_single_view), _("Single View"), 0, this, "Single View"); |
| 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 |
QAction *splitViewAction = new QAction(QPixmap(xpm_split_view), _("Split View"), 0, this, "Split View"); |
| 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 |
QAction *fullViewAction = new QAction(QPixmap(xpm_tree_view), _("Full View"), 0, this, "Full View"); |
| 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 |
QAction *showNameAction = new QAction(_("Show Name"), 0, this, 0); |
| 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 |
QAction *showRangeAction = new QAction(_("Show Range"), 0, this, 0); |
| 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 |
QAction *showDataAction = new QAction(_("Show Data"), 0, this, 0); |
| 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))); |
|
Lines 1345-1353
Link Here
|
| 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 |
configView->showNormalAction = new QAction(_("Show Normal Options"), 0, optGroup, 0); |
| 1349 |
configView->showAllAction = new QAction(NULL, _("Show All Options"), 0, optGroup); |
1360 |
configView->showAllAction = new QAction(_("Show All Options"), 0, optGroup, 0); |
| 1350 |
configView->showPromptAction = new QAction(NULL, _("Show Prompt Options"), 0, optGroup); |
1361 |
configView->showPromptAction = new QAction(_("Show Prompt Options"), 0, optGroup, 0); |
| 1351 |
configView->showNormalAction->setToggleAction(TRUE); |
1362 |
configView->showNormalAction->setToggleAction(TRUE); |
| 1352 |
configView->showNormalAction->setOn(configList->optMode == normalOpt); |
1363 |
configView->showNormalAction->setOn(configList->optMode == normalOpt); |
| 1353 |
configView->showAllAction->setToggleAction(TRUE); |
1364 |
configView->showAllAction->setToggleAction(TRUE); |
|
Lines 1355-1369
Link Here
|
| 1355 |
configView->showPromptAction->setToggleAction(TRUE); |
1366 |
configView->showPromptAction->setToggleAction(TRUE); |
| 1356 |
configView->showPromptAction->setOn(configList->optMode == promptOpt); |
1367 |
configView->showPromptAction->setOn(configList->optMode == promptOpt); |
| 1357 |
|
1368 |
|
| 1358 |
QAction *showDebugAction = new QAction(NULL, _("Show Debug Info"), 0, this); |
1369 |
QAction *showDebugAction = new QAction(_("Show Debug Info"), 0, this, 0); |
| 1359 |
showDebugAction->setToggleAction(TRUE); |
1370 |
showDebugAction->setToggleAction(TRUE); |
| 1360 |
connect(showDebugAction, SIGNAL(toggled(bool)), helpText, SLOT(setShowDebug(bool))); |
1371 |
connect(showDebugAction, SIGNAL(toggled(bool)), helpText, SLOT(setShowDebug(bool))); |
| 1361 |
connect(helpText, SIGNAL(showDebugChanged(bool)), showDebugAction, SLOT(setOn(bool))); |
1372 |
connect(helpText, SIGNAL(showDebugChanged(bool)), showDebugAction, SLOT(setOn(bool))); |
| 1362 |
showDebugAction->setOn(helpText->showDebug()); |
1373 |
showDebugAction->setOn(helpText->showDebug()); |
| 1363 |
|
1374 |
|
| 1364 |
QAction *showIntroAction = new QAction(NULL, _("Introduction"), 0, this); |
1375 |
QAction *showIntroAction = new QAction(_("Introduction"), 0, this, 0); |
| 1365 |
connect(showIntroAction, SIGNAL(activated()), SLOT(showIntro())); |
1376 |
connect(showIntroAction, SIGNAL(activated()), SLOT(showIntro())); |
| 1366 |
QAction *showAboutAction = new QAction(NULL, _("About"), 0, this); |
1377 |
QAction *showAboutAction = new QAction(_("About"), 0, this, 0); |
| 1367 |
connect(showAboutAction, SIGNAL(activated()), SLOT(showAbout())); |
1378 |
connect(showAboutAction, SIGNAL(activated()), SLOT(showAbout())); |
| 1368 |
|
1379 |
|
| 1369 |
// init tool bar |
1380 |
// init tool bar |
|
Lines 1377-1383
Link Here
|
| 1377 |
fullViewAction->addTo(toolBar); |
1388 |
fullViewAction->addTo(toolBar); |
| 1378 |
|
1389 |
|
| 1379 |
// create config menu |
1390 |
// create config menu |
| 1380 |
QPopupMenu* config = new QPopupMenu(this); |
1391 |
Q3PopupMenu* config = new Q3PopupMenu(this); |
| 1381 |
menu->insertItem(_("&File"), config); |
1392 |
menu->insertItem(_("&File"), config); |
| 1382 |
loadAction->addTo(config); |
1393 |
loadAction->addTo(config); |
| 1383 |
saveAction->addTo(config); |
1394 |
saveAction->addTo(config); |
|
Lines 1386-1397
Link Here
|
| 1386 |
quitAction->addTo(config); |
1397 |
quitAction->addTo(config); |
| 1387 |
|
1398 |
|
| 1388 |
// create edit menu |
1399 |
// create edit menu |
| 1389 |
QPopupMenu* editMenu = new QPopupMenu(this); |
1400 |
Q3PopupMenu* editMenu = new Q3PopupMenu(this); |
| 1390 |
menu->insertItem(_("&Edit"), editMenu); |
1401 |
menu->insertItem(_("&Edit"), editMenu); |
| 1391 |
searchAction->addTo(editMenu); |
1402 |
searchAction->addTo(editMenu); |
| 1392 |
|
1403 |
|
| 1393 |
// create options menu |
1404 |
// create options menu |
| 1394 |
QPopupMenu* optionMenu = new QPopupMenu(this); |
1405 |
Q3PopupMenu* optionMenu = new Q3PopupMenu(this); |
| 1395 |
menu->insertItem(_("&Option"), optionMenu); |
1406 |
menu->insertItem(_("&Option"), optionMenu); |
| 1396 |
showNameAction->addTo(optionMenu); |
1407 |
showNameAction->addTo(optionMenu); |
| 1397 |
showRangeAction->addTo(optionMenu); |
1408 |
showRangeAction->addTo(optionMenu); |
|
Lines 1402-1432
Link Here
|
| 1402 |
showDebugAction->addTo(optionMenu); |
1413 |
showDebugAction->addTo(optionMenu); |
| 1403 |
|
1414 |
|
| 1404 |
// create help menu |
1415 |
// create help menu |
| 1405 |
QPopupMenu* helpMenu = new QPopupMenu(this); |
1416 |
Q3PopupMenu* helpMenu = new Q3PopupMenu(this); |
| 1406 |
menu->insertSeparator(); |
1417 |
menu->insertSeparator(); |
| 1407 |
menu->insertItem(_("&Help"), helpMenu); |
1418 |
menu->insertItem(_("&Help"), helpMenu); |
| 1408 |
showIntroAction->addTo(helpMenu); |
1419 |
showIntroAction->addTo(helpMenu); |
| 1409 |
showAboutAction->addTo(helpMenu); |
1420 |
showAboutAction->addTo(helpMenu); |
| 1410 |
|
1421 |
|
| 1411 |
connect(configList, SIGNAL(menuChanged(struct menu *)), |
1422 |
connect(configList, SIGNAL(menuChanged(KCMenu *)), |
| 1412 |
helpText, SLOT(setInfo(struct menu *))); |
1423 |
helpText, SLOT(setInfo(KCMenu *))); |
| 1413 |
connect(configList, SIGNAL(menuSelected(struct menu *)), |
1424 |
connect(configList, SIGNAL(menuSelected(KCMenu *)), |
| 1414 |
SLOT(changeMenu(struct menu *))); |
1425 |
SLOT(changeMenu(KCMenu *))); |
| 1415 |
connect(configList, SIGNAL(parentSelected()), |
1426 |
connect(configList, SIGNAL(parentSelected()), |
| 1416 |
SLOT(goBack())); |
1427 |
SLOT(goBack())); |
| 1417 |
connect(menuList, SIGNAL(menuChanged(struct menu *)), |
1428 |
connect(menuList, SIGNAL(menuChanged(KCMenu *)), |
| 1418 |
helpText, SLOT(setInfo(struct menu *))); |
1429 |
helpText, SLOT(setInfo(KCMenu *))); |
| 1419 |
connect(menuList, SIGNAL(menuSelected(struct menu *)), |
1430 |
connect(menuList, SIGNAL(menuSelected(KCMenu *)), |
| 1420 |
SLOT(changeMenu(struct menu *))); |
1431 |
SLOT(changeMenu(KCMenu *))); |
| 1421 |
|
1432 |
|
| 1422 |
connect(configList, SIGNAL(gotFocus(struct menu *)), |
1433 |
connect(configList, SIGNAL(gotFocus(KCMenu *)), |
| 1423 |
helpText, SLOT(setInfo(struct menu *))); |
1434 |
helpText, SLOT(setInfo(KCMenu *))); |
| 1424 |
connect(menuList, SIGNAL(gotFocus(struct menu *)), |
1435 |
connect(menuList, SIGNAL(gotFocus(KCMenu *)), |
| 1425 |
helpText, SLOT(setInfo(struct menu *))); |
1436 |
helpText, SLOT(setInfo(KCMenu *))); |
| 1426 |
connect(menuList, SIGNAL(gotFocus(struct menu *)), |
1437 |
connect(menuList, SIGNAL(gotFocus(KCMenu *)), |
| 1427 |
SLOT(listFocusChanged(void))); |
1438 |
SLOT(listFocusChanged(void))); |
| 1428 |
connect(helpText, SIGNAL(menuSelected(struct menu *)), |
1439 |
connect(helpText, SIGNAL(menuSelected(KCMenu *)), |
| 1429 |
SLOT(setMenuLink(struct menu *))); |
1440 |
SLOT(setMenuLink(KCMenu *))); |
| 1430 |
|
1441 |
|
| 1431 |
QString listMode = configSettings->readEntry("/listMode", "symbol"); |
1442 |
QString listMode = configSettings->readEntry("/listMode", "symbol"); |
| 1432 |
if (listMode == "single") |
1443 |
if (listMode == "single") |
|
Lines 1437-1443
Link Here
|
| 1437 |
showSplitView(); |
1448 |
showSplitView(); |
| 1438 |
|
1449 |
|
| 1439 |
// UI setup done, restore splitter positions |
1450 |
// UI setup done, restore splitter positions |
| 1440 |
QValueList<int> sizes = configSettings->readSizes("/split1", &ok); |
1451 |
Q3ValueList<int> sizes = configSettings->readSizes("/split1", &ok); |
| 1441 |
if (ok) |
1452 |
if (ok) |
| 1442 |
split1->setSizes(sizes); |
1453 |
split1->setSizes(sizes); |
| 1443 |
|
1454 |
|
|
Lines 1448-1454
Link Here
|
| 1448 |
|
1459 |
|
| 1449 |
void ConfigMainWindow::loadConfig(void) |
1460 |
void ConfigMainWindow::loadConfig(void) |
| 1450 |
{ |
1461 |
{ |
| 1451 |
QString s = QFileDialog::getOpenFileName(conf_get_configname(), NULL, this); |
1462 |
QString s = Q3FileDialog::getOpenFileName(conf_get_configname(), NULL, this); |
| 1452 |
if (s.isNull()) |
1463 |
if (s.isNull()) |
| 1453 |
return; |
1464 |
return; |
| 1454 |
if (conf_read(QFile::encodeName(s))) |
1465 |
if (conf_read(QFile::encodeName(s))) |
|
Lines 1464-1470
Link Here
|
| 1464 |
|
1475 |
|
| 1465 |
void ConfigMainWindow::saveConfigAs(void) |
1476 |
void ConfigMainWindow::saveConfigAs(void) |
| 1466 |
{ |
1477 |
{ |
| 1467 |
QString s = QFileDialog::getSaveFileName(conf_get_configname(), NULL, this); |
1478 |
QString s = Q3FileDialog::getSaveFileName(conf_get_configname(), NULL, this); |
| 1468 |
if (s.isNull()) |
1479 |
if (s.isNull()) |
| 1469 |
return; |
1480 |
return; |
| 1470 |
if (conf_write(QFile::encodeName(s))) |
1481 |
if (conf_write(QFile::encodeName(s))) |
|
Lines 1478-1484
Link Here
|
| 1478 |
searchWindow->show(); |
1489 |
searchWindow->show(); |
| 1479 |
} |
1490 |
} |
| 1480 |
|
1491 |
|
| 1481 |
void ConfigMainWindow::changeMenu(struct menu *menu) |
1492 |
void ConfigMainWindow::changeMenu(KCMenu *menu) |
| 1482 |
{ |
1493 |
{ |
| 1483 |
configList->setRootMenu(menu); |
1494 |
configList->setRootMenu(menu); |
| 1484 |
if (configList->rootEntry->parent == &rootmenu) |
1495 |
if (configList->rootEntry->parent == &rootmenu) |
|
Lines 1487-1495
Link Here
|
| 1487 |
backAction->setEnabled(TRUE); |
1498 |
backAction->setEnabled(TRUE); |
| 1488 |
} |
1499 |
} |
| 1489 |
|
1500 |
|
| 1490 |
void ConfigMainWindow::setMenuLink(struct menu *menu) |
1501 |
void ConfigMainWindow::setMenuLink(KCMenu *menu) |
| 1491 |
{ |
1502 |
{ |
| 1492 |
struct menu *parent; |
1503 |
KCMenu *parent; |
| 1493 |
ConfigList* list = NULL; |
1504 |
ConfigList* list = NULL; |
| 1494 |
ConfigItem* item; |
1505 |
ConfigItem* item; |
| 1495 |
|
1506 |
|
|
Lines 1692-1700
Link Here
|
| 1692 |
saveAction->setEnabled(conf_get_changed()); |
1703 |
saveAction->setEnabled(conf_get_changed()); |
| 1693 |
} |
1704 |
} |
| 1694 |
|
1705 |
|
| 1695 |
void fixup_rootmenu(struct menu *menu) |
1706 |
void fixup_rootmenu(KCMenu *menu) |
| 1696 |
{ |
1707 |
{ |
| 1697 |
struct menu *child; |
1708 |
KCMenu *child; |
| 1698 |
static int menu_cnt = 0; |
1709 |
static int menu_cnt = 0; |
| 1699 |
|
1710 |
|
| 1700 |
menu->flags |= MENU_ROOT; |
1711 |
menu->flags |= MENU_ROOT; |