aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoris Barbulovski <bbarbulovski@gmail.com>2015-09-22 14:36:15 -0400
committerMichal Marek <mmarek@suse.com>2015-10-14 08:59:02 -0400
commit68ccb7ef4974bfce0d99a4425324a1c7ef85a82e (patch)
tree23c612b886155b99429ff0b260b96efb34a57312
parent76538660fb08f2f794d569a594a95fc55eb03932 (diff)
Port xconfig to Qt5 - Fix the code so it compiles with Qt5
Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Thiago Macieira <thiago.macieira@intel.com> Signed-off-by: Michal Marek <mmarek@suse.com>
-rw-r--r--scripts/kconfig/qconf.cc185
-rw-r--r--scripts/kconfig/qconf.h23
2 files changed, 108 insertions, 100 deletions
diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
index 319559f361ac..d134a89bfdce 100644
--- a/scripts/kconfig/qconf.cc
+++ b/scripts/kconfig/qconf.cc
@@ -9,7 +9,6 @@
9#include <QList> 9#include <QList>
10#include <qtextbrowser.h> 10#include <qtextbrowser.h>
11#include <QAction> 11#include <QAction>
12#include <q3header.h>
13#include <QFileDialog> 12#include <QFileDialog>
14#include <QMenu> 13#include <QMenu>
15 14
@@ -51,7 +50,7 @@ static inline QString qgettext(const char* str)
51 50
52static inline QString qgettext(const QString& str) 51static inline QString qgettext(const QString& str)
53{ 52{
54 return QString::fromLocal8Bit(gettext(str.latin1())); 53 return QString::fromLocal8Bit(gettext(str.toLatin1()));
55} 54}
56 55
57ConfigSettings::ConfigSettings() 56ConfigSettings::ConfigSettings()
@@ -65,7 +64,7 @@ ConfigSettings::ConfigSettings()
65QList<int> ConfigSettings::readSizes(const QString& key, bool *ok) 64QList<int> ConfigSettings::readSizes(const QString& key, bool *ok)
66{ 65{
67 QList<int> result; 66 QList<int> result;
68 QStringList entryList = readListEntry(key, ok); 67 QStringList entryList = value(key).toStringList();
69 QStringList::Iterator it; 68 QStringList::Iterator it;
70 69
71 for (it = entryList.begin(); it != entryList.end(); ++it) 70 for (it = entryList.begin(); it != entryList.end(); ++it)
@@ -84,7 +83,8 @@ bool ConfigSettings::writeSizes(const QString& key, const QList<int>& value)
84 83
85 for (it = value.begin(); it != value.end(); ++it) 84 for (it = value.begin(); it != value.end(); ++it)
86 stringList.push_back(QString::number(*it)); 85 stringList.push_back(QString::number(*it));
87 return writeEntry(key, stringList); 86 setValue(key, stringList);
87 return true;
88} 88}
89 89
90ConfigLineEdit::ConfigLineEdit(ConfigView* parent) 90ConfigLineEdit::ConfigLineEdit(ConfigView* parent)
@@ -93,7 +93,7 @@ ConfigLineEdit::ConfigLineEdit(ConfigView* parent)
93 connect(this, SIGNAL(lostFocus()), SLOT(hide())); 93 connect(this, SIGNAL(lostFocus()), SLOT(hide()));
94} 94}
95 95
96void ConfigLineEdit::show(Q3ListViewItem *i) 96void ConfigLineEdit::show(QTreeWidgetItem *i)
97{ 97{
98 item = i; 98 item = i;
99 Parent::show(); 99 Parent::show();
@@ -124,12 +124,12 @@ QAction *ConfigView::showAllAction;
124QAction *ConfigView::showPromptAction; 124QAction *ConfigView::showPromptAction;
125 125
126ConfigView::ConfigView(QWidget* parent, const char *name) 126ConfigView::ConfigView(QWidget* parent, const char *name)
127 : Parent(parent, name) 127 : Parent(parent)
128{ 128{
129 QVBoxLayout *verticalLayout = new QVBoxLayout(this); 129 QVBoxLayout *verticalLayout = new QVBoxLayout(this);
130 verticalLayout->setContentsMargins(0, 0, 0, 0); 130 verticalLayout->setContentsMargins(0, 0, 0, 0);
131 131
132 list = new Q3ListView(this, name); 132 list = new QTreeWidget(this);
133 verticalLayout->addWidget(list); 133 verticalLayout->addWidget(list);
134 lineEdit = new ConfigLineEdit(this); 134 lineEdit = new ConfigLineEdit(this);
135 lineEdit->hide(); 135 lineEdit->hide();
@@ -167,7 +167,7 @@ void ConfigView::setShowData(bool b)
167{ 167{
168} 168}
169 169
170void ConfigView::updateList(Q3ListViewItem* item) 170void ConfigView::updateList(QTreeWidgetItem* item)
171{ 171{
172} 172}
173 173
@@ -176,11 +176,11 @@ void ConfigView::updateListAll(void)
176} 176}
177 177
178ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name) 178ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name)
179 : Parent(parent, name), sym(0), _menu(0) 179 : Parent(parent), sym(0), _menu(0)
180{ 180{
181 if (name) { 181 if (name) {
182 configSettings->beginGroup(name); 182 configSettings->beginGroup(name);
183 _showDebug = configSettings->readBoolEntry("/showDebug", false); 183 _showDebug = configSettings->value("/showDebug", false).toBool();
184 configSettings->endGroup(); 184 configSettings->endGroup();
185 connect(configApp, SIGNAL(aboutToQuit()), SLOT(saveSettings())); 185 connect(configApp, SIGNAL(aboutToQuit()), SLOT(saveSettings()));
186 } 186 }
@@ -188,11 +188,11 @@ ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name)
188 188
189void ConfigInfoView::saveSettings(void) 189void ConfigInfoView::saveSettings(void)
190{ 190{
191 if (name()) { 191 /*if (name()) {
192 configSettings->beginGroup(name()); 192 configSettings->beginGroup(name());
193 configSettings->writeEntry("/showDebug", showDebug()); 193 configSettings->setValue("/showDebug", showDebug());
194 configSettings->endGroup(); 194 configSettings->endGroup();
195 } 195 }*/
196} 196}
197 197
198void ConfigInfoView::setShowDebug(bool b) 198void ConfigInfoView::setShowDebug(bool b)
@@ -349,8 +349,8 @@ QString ConfigInfoView::print_filter(const QString &str)
349{ 349{
350 QRegExp re("[<>&\"\\n]"); 350 QRegExp re("[<>&\"\\n]");
351 QString res = str; 351 QString res = str;
352 for (int i = 0; (i = res.find(re, i)) >= 0;) { 352 for (int i = 0; (i = res.indexOf(re, i)) >= 0;) {
353 switch (res[i].latin1()) { 353 switch (res[i].toLatin1()) {
354 case '<': 354 case '<':
355 res.replace(i, 1, "&lt;"); 355 res.replace(i, 1, "&lt;");
356 i += 4; 356 i += 4;
@@ -393,12 +393,12 @@ QMenu* ConfigInfoView::createStandardContextMenu(const QPoint & pos)
393{ 393{
394 QMenu* popup = Parent::createStandardContextMenu(pos); 394 QMenu* popup = Parent::createStandardContextMenu(pos);
395 QAction* action = new QAction(_("Show Debug Info"), popup); 395 QAction* action = new QAction(_("Show Debug Info"), popup);
396 action->setCheckable(TRUE); 396 action->setCheckable(true);
397 connect(action, SIGNAL(toggled(bool)), SLOT(setShowDebug(bool))); 397 connect(action, SIGNAL(toggled(bool)), SLOT(setShowDebug(bool)));
398 connect(this, SIGNAL(showDebugChanged(bool)), action, SLOT(setOn(bool))); 398 connect(this, SIGNAL(showDebugChanged(bool)), action, SLOT(setOn(bool)));
399 action->setChecked(showDebug()); 399 action->setChecked(showDebug());
400 popup->addSeparator(); 400 popup->addSeparator();
401 action->addTo(popup); 401 popup->addAction(action);
402 return popup; 402 return popup;
403} 403}
404 404
@@ -408,18 +408,22 @@ void ConfigInfoView::contextMenuEvent(QContextMenuEvent *e)
408} 408}
409 409
410ConfigSearchWindow::ConfigSearchWindow(ConfigMainWindow* parent, const char *name) 410ConfigSearchWindow::ConfigSearchWindow(ConfigMainWindow* parent, const char *name)
411 : Parent(parent, name), result(NULL) 411 : Parent(parent), result(NULL)
412{ 412{
413 setCaption("Search Config"); 413 setWindowTitle("Search Config");
414 414
415 QVBoxLayout* layout1 = new QVBoxLayout(this, 11, 6); 415 QVBoxLayout* layout1 = new QVBoxLayout(this);
416 QHBoxLayout* layout2 = new QHBoxLayout(0, 0, 6); 416 layout1->setContentsMargins(11, 11, 11, 11);
417 layout1->setSpacing(6);
418 QHBoxLayout* layout2 = new QHBoxLayout(0);
419 layout2->setContentsMargins(0, 0, 0, 0);
420 layout2->setSpacing(6);
417 layout2->addWidget(new QLabel(_("Find:"), this)); 421 layout2->addWidget(new QLabel(_("Find:"), this));
418 editField = new QLineEdit(this); 422 editField = new QLineEdit(this);
419 connect(editField, SIGNAL(returnPressed()), SLOT(search())); 423 connect(editField, SIGNAL(returnPressed()), SLOT(search()));
420 layout2->addWidget(editField); 424 layout2->addWidget(editField);
421 searchButton = new QPushButton(_("Search"), this); 425 searchButton = new QPushButton(_("Search"), this);
422 searchButton->setAutoDefault(FALSE); 426 searchButton->setAutoDefault(false);
423 connect(searchButton, SIGNAL(clicked()), SLOT(search())); 427 connect(searchButton, SIGNAL(clicked()), SLOT(search()));
424 layout2->addWidget(searchButton); 428 layout2->addWidget(searchButton);
425 layout1->addLayout(layout2); 429 layout1->addLayout(layout2);
@@ -436,18 +440,18 @@ ConfigSearchWindow::ConfigSearchWindow(ConfigMainWindow* parent, const char *nam
436 layout1->addWidget(split); 440 layout1->addWidget(split);
437 441
438 if (name) { 442 if (name) {
439 int x, y, width, height; 443 QVariant x, y;
444 int width, height;
440 bool ok; 445 bool ok;
441 446
442 configSettings->beginGroup(name); 447 configSettings->beginGroup(name);
443 width = configSettings->readNumEntry("/window width", parent->width() / 2); 448 width = configSettings->value("/window width", parent->width() / 2).toInt();
444 height = configSettings->readNumEntry("/window height", parent->height() / 2); 449 height = configSettings->value("/window height", parent->height() / 2).toInt();
445 resize(width, height); 450 resize(width, height);
446 x = configSettings->readNumEntry("/window x", 0, &ok); 451 x = configSettings->value("/window x");
447 if (ok) 452 y = configSettings->value("/window y");
448 y = configSettings->readNumEntry("/window y", 0, &ok); 453 if ((x.isValid())&&(y.isValid()))
449 if (ok) 454 move(x.toInt(), y.toInt());
450 move(x, y);
451 QList<int> sizes = configSettings->readSizes("/split", &ok); 455 QList<int> sizes = configSettings->readSizes("/split", &ok);
452 if (ok) 456 if (ok)
453 split->setSizes(sizes); 457 split->setSizes(sizes);
@@ -458,15 +462,15 @@ ConfigSearchWindow::ConfigSearchWindow(ConfigMainWindow* parent, const char *nam
458 462
459void ConfigSearchWindow::saveSettings(void) 463void ConfigSearchWindow::saveSettings(void)
460{ 464{
461 if (name()) { 465 /*if (name()) {
462 configSettings->beginGroup(name()); 466 configSettings->beginGroup(name());
463 configSettings->writeEntry("/window x", pos().x()); 467 configSettings->setValue("/window x", pos().x());
464 configSettings->writeEntry("/window y", pos().y()); 468 configSettings->setValue("/window y", pos().y());
465 configSettings->writeEntry("/window width", size().width()); 469 configSettings->setValue("/window width", size().width());
466 configSettings->writeEntry("/window height", size().height()); 470 configSettings->setValue("/window height", size().height());
467 configSettings->writeSizes("/split", split->sizes()); 471 configSettings->writeSizes("/split", split->sizes());
468 configSettings->endGroup(); 472 configSettings->endGroup();
469 } 473 }*/
470} 474}
471 475
472void ConfigSearchWindow::search(void) 476void ConfigSearchWindow::search(void)
@@ -481,7 +485,8 @@ ConfigMainWindow::ConfigMainWindow(void)
481{ 485{
482 QMenuBar* menu; 486 QMenuBar* menu;
483 bool ok; 487 bool ok;
484 int x, y, width, height; 488 QVariant x, y;
489 int width, height;
485 char title[256]; 490 char title[256];
486 491
487 QDesktopWidget *d = configApp->desktop(); 492 QDesktopWidget *d = configApp->desktop();
@@ -489,16 +494,15 @@ ConfigMainWindow::ConfigMainWindow(void)
489 rootmenu.prompt->text, 494 rootmenu.prompt->text,
490 "" 495 ""
491 ); 496 );
492 setCaption(title); 497 setWindowTitle(title);
493 498
494 width = configSettings->readNumEntry("/window width", d->width() - 64); 499 width = configSettings->value("/window width", d->width() - 64).toInt();
495 height = configSettings->readNumEntry("/window height", d->height() - 64); 500 height = configSettings->value("/window height", d->height() - 64).toInt();
496 resize(width, height); 501 resize(width, height);
497 x = configSettings->readNumEntry("/window x", 0, &ok); 502 x = configSettings->value("/window x");
498 if (ok) 503 y = configSettings->value("/window y");
499 y = configSettings->readNumEntry("/window y", 0, &ok); 504 if ((x.isValid())&&(y.isValid()))
500 if (ok) 505 move(x.toInt(), y.toInt());
501 move(x, y);
502 506
503 split1 = new QSplitter(this); 507 split1 = new QSplitter(this);
504 split1->setOrientation(Qt::Horizontal); 508 split1->setOrientation(Qt::Horizontal);
@@ -515,7 +519,7 @@ ConfigMainWindow::ConfigMainWindow(void)
515 configList = configView->list; 519 configList = configView->list;
516 520
517 helpText = new ConfigInfoView(split2, "help"); 521 helpText = new ConfigInfoView(split2, "help");
518 helpText->setTextFormat(Qt::RichText); 522 //helpText->setTextFormat(Qt::RichText);
519 523
520 setTabOrder(configList, helpText); 524 setTabOrder(configList, helpText);
521 configList->setFocus(); 525 configList->setFocus();
@@ -526,7 +530,7 @@ ConfigMainWindow::ConfigMainWindow(void)
526 530
527 backAction = new QAction(QPixmap(xpm_back), _("Back"), this); 531 backAction = new QAction(QPixmap(xpm_back), _("Back"), this);
528 connect(backAction, SIGNAL(activated()), SLOT(goBack())); 532 connect(backAction, SIGNAL(activated()), SLOT(goBack()));
529 backAction->setEnabled(FALSE); 533 backAction->setEnabled(false);
530 QAction *quitAction = new QAction(_("&Quit"), this); 534 QAction *quitAction = new QAction(_("&Quit"), this);
531 quitAction->setShortcut(Qt::CTRL + Qt::Key_Q); 535 quitAction->setShortcut(Qt::CTRL + Qt::Key_Q);
532 connect(quitAction, SIGNAL(activated()), SLOT(close())); 536 connect(quitAction, SIGNAL(activated()), SLOT(close()));
@@ -545,31 +549,31 @@ ConfigMainWindow::ConfigMainWindow(void)
545 searchAction->setShortcut(Qt::CTRL + Qt::Key_F); 549 searchAction->setShortcut(Qt::CTRL + Qt::Key_F);
546 connect(searchAction, SIGNAL(activated()), SLOT(searchConfig())); 550 connect(searchAction, SIGNAL(activated()), SLOT(searchConfig()));
547 singleViewAction = new QAction(QPixmap(xpm_single_view), _("Single View"), this); 551 singleViewAction = new QAction(QPixmap(xpm_single_view), _("Single View"), this);
548 singleViewAction->setCheckable(TRUE); 552 singleViewAction->setCheckable(true);
549 connect(singleViewAction, SIGNAL(activated()), SLOT(showSingleView())); 553 connect(singleViewAction, SIGNAL(activated()), SLOT(showSingleView()));
550 splitViewAction = new QAction(QPixmap(xpm_split_view), _("Split View"), this); 554 splitViewAction = new QAction(QPixmap(xpm_split_view), _("Split View"), this);
551 splitViewAction->setCheckable(TRUE); 555 splitViewAction->setCheckable(true);
552 connect(splitViewAction, SIGNAL(activated()), SLOT(showSplitView())); 556 connect(splitViewAction, SIGNAL(activated()), SLOT(showSplitView()));
553 fullViewAction = new QAction(QPixmap(xpm_tree_view), _("Full View"), this); 557 fullViewAction = new QAction(QPixmap(xpm_tree_view), _("Full View"), this);
554 fullViewAction->setCheckable(TRUE); 558 fullViewAction->setCheckable(true);
555 connect(fullViewAction, SIGNAL(activated()), SLOT(showFullView())); 559 connect(fullViewAction, SIGNAL(activated()), SLOT(showFullView()));
556 560
557 QAction *showNameAction = new QAction(_("Show Name"), this); 561 QAction *showNameAction = new QAction(_("Show Name"), this);
558 showNameAction->setCheckable(TRUE); 562 showNameAction->setCheckable(true);
559 connect(showNameAction, SIGNAL(toggled(bool)), configView, SLOT(setShowName(bool))); 563 connect(showNameAction, SIGNAL(toggled(bool)), configView, SLOT(setShowName(bool)));
560 connect(configView, SIGNAL(showNameChanged(bool)), showNameAction, SLOT(setOn(bool))); 564 connect(configView, SIGNAL(showNameChanged(bool)), showNameAction, SLOT(setOn(bool)));
561 showNameAction->setChecked(configView->showName()); 565 showNameAction->setChecked(configView->showName());
562 QAction *showRangeAction = new QAction(_("Show Range"), this); 566 QAction *showRangeAction = new QAction(_("Show Range"), this);
563 showRangeAction->setCheckable(TRUE); 567 showRangeAction->setCheckable(true);
564 connect(showRangeAction, SIGNAL(toggled(bool)), configView, SLOT(setShowRange(bool))); 568 connect(showRangeAction, SIGNAL(toggled(bool)), configView, SLOT(setShowRange(bool)));
565 connect(configView, SIGNAL(showRangeChanged(bool)), showRangeAction, SLOT(setOn(bool))); 569 connect(configView, SIGNAL(showRangeChanged(bool)), showRangeAction, SLOT(setOn(bool)));
566 QAction *showDataAction = new QAction(_("Show Data"), this); 570 QAction *showDataAction = new QAction(_("Show Data"), this);
567 showDataAction->setCheckable(TRUE); 571 showDataAction->setCheckable(true);
568 connect(showDataAction, SIGNAL(toggled(bool)), configView, SLOT(setShowData(bool))); 572 connect(showDataAction, SIGNAL(toggled(bool)), configView, SLOT(setShowData(bool)));
569 connect(configView, SIGNAL(showDataChanged(bool)), showDataAction, SLOT(setOn(bool))); 573 connect(configView, SIGNAL(showDataChanged(bool)), showDataAction, SLOT(setOn(bool)));
570 574
571 QActionGroup *optGroup = new QActionGroup(this); 575 QActionGroup *optGroup = new QActionGroup(this);
572 optGroup->setExclusive(TRUE); 576 optGroup->setExclusive(true);
573 connect(optGroup, SIGNAL(selected(QAction *)), configView, 577 connect(optGroup, SIGNAL(selected(QAction *)), configView,
574 SLOT(setOptionMode(QAction *))); 578 SLOT(setOptionMode(QAction *)));
575 connect(optGroup, SIGNAL(selected(QAction *)), menuView, 579 connect(optGroup, SIGNAL(selected(QAction *)), menuView,
@@ -578,12 +582,12 @@ ConfigMainWindow::ConfigMainWindow(void)
578 configView->showNormalAction = new QAction(_("Show Normal Options"), optGroup); 582 configView->showNormalAction = new QAction(_("Show Normal Options"), optGroup);
579 configView->showAllAction = new QAction(_("Show All Options"), optGroup); 583 configView->showAllAction = new QAction(_("Show All Options"), optGroup);
580 configView->showPromptAction = new QAction(_("Show Prompt Options"), optGroup); 584 configView->showPromptAction = new QAction(_("Show Prompt Options"), optGroup);
581 configView->showNormalAction->setCheckable(TRUE); 585 configView->showNormalAction->setCheckable(true);
582 configView->showAllAction->setCheckable(TRUE); 586 configView->showAllAction->setCheckable(true);
583 configView->showPromptAction->setCheckable(TRUE); 587 configView->showPromptAction->setCheckable(true);
584 588
585 QAction *showDebugAction = new QAction( _("Show Debug Info"), this); 589 QAction *showDebugAction = new QAction( _("Show Debug Info"), this);
586 showDebugAction->setCheckable(TRUE); 590 showDebugAction->setCheckable(true);
587 connect(showDebugAction, SIGNAL(toggled(bool)), helpText, SLOT(setShowDebug(bool))); 591 connect(showDebugAction, SIGNAL(toggled(bool)), helpText, SLOT(setShowDebug(bool)));
588 connect(helpText, SIGNAL(showDebugChanged(bool)), showDebugAction, SLOT(setOn(bool))); 592 connect(helpText, SIGNAL(showDebugChanged(bool)), showDebugAction, SLOT(setOn(bool)));
589 showDebugAction->setChecked(helpText->showDebug()); 593 showDebugAction->setChecked(helpText->showDebug());
@@ -594,45 +598,41 @@ ConfigMainWindow::ConfigMainWindow(void)
594 connect(showAboutAction, SIGNAL(activated()), SLOT(showAbout())); 598 connect(showAboutAction, SIGNAL(activated()), SLOT(showAbout()));
595 599
596 // init tool bar 600 // init tool bar
597 backAction->addTo(toolBar); 601 toolBar->addAction(backAction);
598 toolBar->addSeparator(); 602 toolBar->addSeparator();
599 loadAction->addTo(toolBar); 603 toolBar->addAction(loadAction);
600 saveAction->addTo(toolBar); 604 toolBar->addAction(saveAction);
601 toolBar->addSeparator(); 605 toolBar->addSeparator();
602 singleViewAction->addTo(toolBar); 606 toolBar->addAction(singleViewAction);
603 splitViewAction->addTo(toolBar); 607 toolBar->addAction(splitViewAction);
604 fullViewAction->addTo(toolBar); 608 toolBar->addAction(fullViewAction);
605 609
606 // create config menu 610 // create config menu
607 QMenu* config = new QMenu(this); 611 QMenu* config = menu->addMenu(_("&File"));
608 menu->insertItem(_("&File"), config); 612 config->addAction(loadAction);
609 loadAction->addTo(config); 613 config->addAction(saveAction);
610 saveAction->addTo(config); 614 config->addAction(saveAsAction);
611 saveAsAction->addTo(config);
612 config->addSeparator(); 615 config->addSeparator();
613 quitAction->addTo(config); 616 config->addAction(quitAction);
614 617
615 // create edit menu 618 // create edit menu
616 QMenu* editMenu = new QMenu(this); 619 QMenu* editMenu = menu->addMenu(_("&Edit"));
617 menu->insertItem(_("&Edit"), editMenu); 620 editMenu->addAction(searchAction);
618 searchAction->addTo(editMenu);
619 621
620 // create options menu 622 // create options menu
621 QMenu* optionMenu = new QMenu(this); 623 QMenu* optionMenu = menu->addMenu(_("&Option"));
622 menu->insertItem(_("&Option"), optionMenu); 624 optionMenu->addAction(showNameAction);
623 showNameAction->addTo(optionMenu); 625 optionMenu->addAction(showRangeAction);
624 showRangeAction->addTo(optionMenu); 626 optionMenu->addAction(showDataAction);
625 showDataAction->addTo(optionMenu);
626 optionMenu->addSeparator(); 627 optionMenu->addSeparator();
627 optGroup->addTo(optionMenu); 628 optionMenu->addActions(optGroup->actions());
628 optionMenu->addSeparator(); 629 optionMenu->addSeparator();
629 630
630 // create help menu 631 // create help menu
631 QMenu* helpMenu = new QMenu(this);
632 menu->addSeparator(); 632 menu->addSeparator();
633 menu->insertItem(_("&Help"), helpMenu); 633 QMenu* helpMenu = menu->addMenu(_("&Help"));
634 showIntroAction->addTo(helpMenu); 634 helpMenu->addAction(showIntroAction);
635 showAboutAction->addTo(helpMenu); 635 helpMenu->addAction(showAboutAction);
636 636
637 connect(configList, SIGNAL(menuChanged(struct menu *)), 637 connect(configList, SIGNAL(menuChanged(struct menu *)),
638 helpText, SLOT(setInfo(struct menu *))); 638 helpText, SLOT(setInfo(struct menu *)));
@@ -654,7 +654,7 @@ ConfigMainWindow::ConfigMainWindow(void)
654 connect(helpText, SIGNAL(menuSelected(struct menu *)), 654 connect(helpText, SIGNAL(menuSelected(struct menu *)),
655 SLOT(setMenuLink(struct menu *))); 655 SLOT(setMenuLink(struct menu *)));
656 656
657 QString listMode = configSettings->readEntry("/listMode", "symbol"); 657 QString listMode = configSettings->value("/listMode", "symbol").toString();
658 if (listMode == "single") 658 if (listMode == "single")
659 showSingleView(); 659 showSingleView();
660 else if (listMode == "full") 660 else if (listMode == "full")
@@ -674,7 +674,7 @@ ConfigMainWindow::ConfigMainWindow(void)
674 674
675void ConfigMainWindow::loadConfig(void) 675void ConfigMainWindow::loadConfig(void)
676{ 676{
677 QString s = QFileDialog::getOpenFileName(conf_get_configname(), NULL, this); 677 QString s = QFileDialog::getOpenFileName(this, "", conf_get_configname());
678 if (s.isNull()) 678 if (s.isNull())
679 return; 679 return;
680 if (conf_read(QFile::encodeName(s))) 680 if (conf_read(QFile::encodeName(s)))
@@ -693,7 +693,7 @@ bool ConfigMainWindow::saveConfig(void)
693 693
694void ConfigMainWindow::saveConfigAs(void) 694void ConfigMainWindow::saveConfigAs(void)
695{ 695{
696 QString s = QFileDialog::getSaveFileName(conf_get_configname(), NULL, this); 696 QString s = QFileDialog::getSaveFileName(this, "", conf_get_configname());
697 if (s.isNull()) 697 if (s.isNull())
698 return; 698 return;
699 saveConfig(); 699 saveConfig();
@@ -820,14 +820,14 @@ void ConfigMainWindow::showAbout(void)
820 820
821void ConfigMainWindow::saveSettings(void) 821void ConfigMainWindow::saveSettings(void)
822{ 822{
823 configSettings->writeEntry("/window x", pos().x()); 823 configSettings->setValue("/window x", pos().x());
824 configSettings->writeEntry("/window y", pos().y()); 824 configSettings->setValue("/window y", pos().y());
825 configSettings->writeEntry("/window width", size().width()); 825 configSettings->setValue("/window width", size().width());
826 configSettings->writeEntry("/window height", size().height()); 826 configSettings->setValue("/window height", size().height());
827 827
828 QString entry; 828 QString entry;
829 829
830 configSettings->writeEntry("/listMode", entry); 830 configSettings->setValue("/listMode", entry);
831 831
832 configSettings->writeSizes("/split1", split1->sizes()); 832 configSettings->writeSizes("/split1", split1->sizes());
833 configSettings->writeSizes("/split2", split2->sizes()); 833 configSettings->writeSizes("/split2", split2->sizes());
@@ -859,7 +859,7 @@ static const char *progname;
859 859
860static void usage(void) 860static void usage(void)
861{ 861{
862 printf(_("%s [-s] <config>\n"), progname); 862 printf(_("%s [-s] <config>\n").toLatin1().constData(), progname);
863 exit(0); 863 exit(0);
864} 864}
865 865
@@ -898,7 +898,6 @@ int main(int ac, char** av)
898 v = new ConfigMainWindow(); 898 v = new ConfigMainWindow();
899 899
900 //zconfdump(stdout); 900 //zconfdump(stdout);
901 configApp->setMainWidget(v);
902 configApp->connect(configApp, SIGNAL(lastWindowClosed()), SLOT(quit())); 901 configApp->connect(configApp, SIGNAL(lastWindowClosed()), SLOT(quit()));
903 configApp->connect(configApp, SIGNAL(aboutToQuit()), v, SLOT(saveSettings())); 902 configApp->connect(configApp, SIGNAL(aboutToQuit()), v, SLOT(saveSettings()));
904 v->show(); 903 v->show();
diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h
index d025f29694c6..1cd02192f172 100644
--- a/scripts/kconfig/qconf.h
+++ b/scripts/kconfig/qconf.h
@@ -3,9 +3,18 @@
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 <q3listview.h> 6#include <QTextBrowser>
7#include <QTreeWidget>
7#include <QMainWindow> 8#include <QMainWindow>
9#include <QHeaderView>
8#include <qsettings.h> 10#include <qsettings.h>
11#include <QPushButton>
12#include <QSettings>
13#include <QLineEdit>
14#include <QSplitter>
15#include <QCheckBox>
16#include <QDialog>
17#include "expr.h"
9 18
10class ConfigView; 19class ConfigView;
11class ConfigLineEdit; 20class ConfigLineEdit;
@@ -37,11 +46,11 @@ public:
37 { 46 {
38 return (ConfigView*)Parent::parent(); 47 return (ConfigView*)Parent::parent();
39 } 48 }
40 void show(Q3ListViewItem *i); 49 void show(QTreeWidgetItem *i);
41 void keyPressEvent(QKeyEvent *e); 50 void keyPressEvent(QKeyEvent *e);
42 51
43public: 52public:
44 Q3ListViewItem *item; 53 QTreeWidgetItem *item;
45}; 54};
46 55
47class ConfigView : public QWidget { 56class ConfigView : public QWidget {
@@ -50,7 +59,7 @@ class ConfigView : public QWidget {
50public: 59public:
51 ConfigView(QWidget* parent, const char *name = 0); 60 ConfigView(QWidget* parent, const char *name = 0);
52 ~ConfigView(void); 61 ~ConfigView(void);
53 static void updateList(Q3ListViewItem* item); 62 static void updateList(QTreeWidgetItem* item);
54 static void updateListAll(void); 63 static void updateListAll(void);
55 64
56 bool showName(void) const { return false; } // TODO: Implement me. 65 bool showName(void) const { return false; } // TODO: Implement me.
@@ -66,7 +75,7 @@ signals:
66 void showRangeChanged(bool); 75 void showRangeChanged(bool);
67 void showDataChanged(bool); 76 void showDataChanged(bool);
68public: 77public:
69 Q3ListView* list; 78 QTreeWidget* list;
70 ConfigLineEdit* lineEdit; 79 ConfigLineEdit* lineEdit;
71 80
72 static ConfigView* viewList; 81 static ConfigView* viewList;
@@ -155,9 +164,9 @@ protected:
155 164
156 ConfigSearchWindow *searchWindow; 165 ConfigSearchWindow *searchWindow;
157 ConfigView *menuView; 166 ConfigView *menuView;
158 Q3ListView *menuList; 167 QTreeWidget *menuList;
159 ConfigView *configView; 168 ConfigView *configView;
160 Q3ListView *configList; 169 QTreeWidget *configList;
161 ConfigInfoView *helpText; 170 ConfigInfoView *helpText;
162 QToolBar *toolBar; 171 QToolBar *toolBar;
163 QAction *backAction; 172 QAction *backAction;