aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig/qconf.cc
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/kconfig/qconf.cc')
-rw-r--r--scripts/kconfig/qconf.cc48
1 files changed, 27 insertions, 21 deletions
diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
index 5d0fd38b089..ce7d508c752 100644
--- a/scripts/kconfig/qconf.cc
+++ b/scripts/kconfig/qconf.cc
@@ -5,6 +5,7 @@
5 5
6#include <qapplication.h> 6#include <qapplication.h>
7#include <qmainwindow.h> 7#include <qmainwindow.h>
8#include <qdesktopwidget.h>
8#include <qtoolbar.h> 9#include <qtoolbar.h>
9#include <qlayout.h> 10#include <qlayout.h>
10#include <qvbox.h> 11#include <qvbox.h>
@@ -297,10 +298,10 @@ void ConfigLineEdit::show(ConfigItem* i)
297void ConfigLineEdit::keyPressEvent(QKeyEvent* e) 298void ConfigLineEdit::keyPressEvent(QKeyEvent* e)
298{ 299{
299 switch (e->key()) { 300 switch (e->key()) {
300 case Key_Escape: 301 case Qt::Key_Escape:
301 break; 302 break;
302 case Key_Return: 303 case Qt::Key_Return:
303 case Key_Enter: 304 case Qt::Key_Enter:
304 sym_set_string_value(item->menu->sym, text().latin1()); 305 sym_set_string_value(item->menu->sym, text().latin1());
305 parent()->updateList(item); 306 parent()->updateList(item);
306 break; 307 break;
@@ -639,7 +640,7 @@ void ConfigList::keyPressEvent(QKeyEvent* ev)
639 struct menu *menu; 640 struct menu *menu;
640 enum prop_type type; 641 enum prop_type type;
641 642
642 if (ev->key() == Key_Escape && mode != fullMode && mode != listMode) { 643 if (ev->key() == Qt::Key_Escape && mode != fullMode && mode != listMode) {
643 emit parentSelected(); 644 emit parentSelected();
644 ev->accept(); 645 ev->accept();
645 return; 646 return;
@@ -652,8 +653,8 @@ void ConfigList::keyPressEvent(QKeyEvent* ev)
652 item = (ConfigItem*)i; 653 item = (ConfigItem*)i;
653 654
654 switch (ev->key()) { 655 switch (ev->key()) {
655 case Key_Return: 656 case Qt::Key_Return:
656 case Key_Enter: 657 case Qt::Key_Enter:
657 if (item->goParent) { 658 if (item->goParent) {
658 emit parentSelected(); 659 emit parentSelected();
659 break; 660 break;
@@ -667,16 +668,16 @@ void ConfigList::keyPressEvent(QKeyEvent* ev)
667 emit menuSelected(menu); 668 emit menuSelected(menu);
668 break; 669 break;
669 } 670 }
670 case Key_Space: 671 case Qt::Key_Space:
671 changeValue(item); 672 changeValue(item);
672 break; 673 break;
673 case Key_N: 674 case Qt::Key_N:
674 setValue(item, no); 675 setValue(item, no);
675 break; 676 break;
676 case Key_M: 677 case Qt::Key_M:
677 setValue(item, mod); 678 setValue(item, mod);
678 break; 679 break;
679 case Key_Y: 680 case Qt::Key_Y:
680 setValue(item, yes); 681 setValue(item, yes);
681 break; 682 break;
682 default: 683 default:
@@ -920,7 +921,7 @@ void ConfigView::updateListAll(void)
920} 921}
921 922
922ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name) 923ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name)
923 : Parent(parent, name), menu(0), sym(0) 924 : Parent(parent, name), sym(0), menu(0)
924{ 925{
925 if (name) { 926 if (name) {
926 configSettings->beginGroup(name); 927 configSettings->beginGroup(name);
@@ -1199,7 +1200,7 @@ ConfigSearchWindow::ConfigSearchWindow(ConfigMainWindow* parent, const char *nam
1199 layout1->addLayout(layout2); 1200 layout1->addLayout(layout2);
1200 1201
1201 split = new QSplitter(this); 1202 split = new QSplitter(this);
1202 split->setOrientation(QSplitter::Vertical); 1203 split->setOrientation(Qt::Vertical);
1203 list = new ConfigView(split, name); 1204 list = new ConfigView(split, name);
1204 list->list->mode = listMode; 1205 list->list->mode = listMode;
1205 info = new ConfigInfoView(split, name); 1206 info = new ConfigInfoView(split, name);
@@ -1275,7 +1276,7 @@ ConfigMainWindow::ConfigMainWindow(void)
1275 int x, y, width, height; 1276 int x, y, width, height;
1276 char title[256]; 1277 char title[256];
1277 1278
1278 QWidget *d = configApp->desktop(); 1279 QDesktopWidget *d = configApp->desktop();
1279 snprintf(title, sizeof(title), _("Linux Kernel v%s Configuration"), 1280 snprintf(title, sizeof(title), _("Linux Kernel v%s Configuration"),
1280 getenv("KERNELVERSION")); 1281 getenv("KERNELVERSION"));
1281 setCaption(title); 1282 setCaption(title);
@@ -1290,14 +1291,14 @@ ConfigMainWindow::ConfigMainWindow(void)
1290 move(x, y); 1291 move(x, y);
1291 1292
1292 split1 = new QSplitter(this); 1293 split1 = new QSplitter(this);
1293 split1->setOrientation(QSplitter::Horizontal); 1294 split1->setOrientation(Qt::Horizontal);
1294 setCentralWidget(split1); 1295 setCentralWidget(split1);
1295 1296
1296 menuView = new ConfigView(split1, "menu"); 1297 menuView = new ConfigView(split1, "menu");
1297 menuList = menuView->list; 1298 menuList = menuView->list;
1298 1299
1299 split2 = new QSplitter(split1); 1300 split2 = new QSplitter(split1);
1300 split2->setOrientation(QSplitter::Vertical); 1301 split2->setOrientation(Qt::Vertical);
1301 1302
1302 // create config tree 1303 // create config tree
1303 configView = new ConfigView(split2, "config"); 1304 configView = new ConfigView(split2, "config");
@@ -1315,18 +1316,18 @@ ConfigMainWindow::ConfigMainWindow(void)
1315 backAction = new QAction("Back", QPixmap(xpm_back), _("Back"), 0, this); 1316 backAction = new QAction("Back", QPixmap(xpm_back), _("Back"), 0, this);
1316 connect(backAction, SIGNAL(activated()), SLOT(goBack())); 1317 connect(backAction, SIGNAL(activated()), SLOT(goBack()));
1317 backAction->setEnabled(FALSE); 1318 backAction->setEnabled(FALSE);
1318 QAction *quitAction = new QAction("Quit", _("&Quit"), CTRL+Key_Q, this); 1319 QAction *quitAction = new QAction("Quit", _("&Quit"), Qt::CTRL + Qt::Key_Q, this);
1319 connect(quitAction, SIGNAL(activated()), SLOT(close())); 1320 connect(quitAction, SIGNAL(activated()), SLOT(close()));
1320 QAction *loadAction = new QAction("Load", QPixmap(xpm_load), _("&Load"), CTRL+Key_L, this); 1321 QAction *loadAction = new QAction("Load", QPixmap(xpm_load), _("&Load"), Qt::CTRL + Qt::Key_L, this);
1321 connect(loadAction, SIGNAL(activated()), SLOT(loadConfig())); 1322 connect(loadAction, SIGNAL(activated()), SLOT(loadConfig()));
1322 saveAction = new QAction("Save", QPixmap(xpm_save), _("&Save"), CTRL+Key_S, this); 1323 saveAction = new QAction("Save", QPixmap(xpm_save), _("&Save"), Qt::CTRL + Qt::Key_S, this);
1323 connect(saveAction, SIGNAL(activated()), SLOT(saveConfig())); 1324 connect(saveAction, SIGNAL(activated()), SLOT(saveConfig()));
1324 conf_set_changed_callback(conf_changed); 1325 conf_set_changed_callback(conf_changed);
1325 // Set saveAction's initial state 1326 // Set saveAction's initial state
1326 conf_changed(); 1327 conf_changed();
1327 QAction *saveAsAction = new QAction("Save As...", _("Save &As..."), 0, this); 1328 QAction *saveAsAction = new QAction("Save As...", _("Save &As..."), 0, this);
1328 connect(saveAsAction, SIGNAL(activated()), SLOT(saveConfigAs())); 1329 connect(saveAsAction, SIGNAL(activated()), SLOT(saveConfigAs()));
1329 QAction *searchAction = new QAction("Find", _("&Find"), CTRL+Key_F, this); 1330 QAction *searchAction = new QAction("Find", _("&Find"), Qt::CTRL + Qt::Key_F, this);
1330 connect(searchAction, SIGNAL(activated()), SLOT(searchConfig())); 1331 connect(searchAction, SIGNAL(activated()), SLOT(searchConfig()));
1331 QAction *singleViewAction = new QAction("Single View", QPixmap(xpm_single_view), _("Single View"), 0, this); 1332 QAction *singleViewAction = new QAction("Single View", QPixmap(xpm_single_view), _("Single View"), 0, this);
1332 connect(singleViewAction, SIGNAL(activated()), SLOT(showSingleView())); 1333 connect(singleViewAction, SIGNAL(activated()), SLOT(showSingleView()));
@@ -1447,7 +1448,7 @@ ConfigMainWindow::ConfigMainWindow(void)
1447 1448
1448void ConfigMainWindow::loadConfig(void) 1449void ConfigMainWindow::loadConfig(void)
1449{ 1450{
1450 QString s = QFileDialog::getOpenFileName(".config", NULL, this); 1451 QString s = QFileDialog::getOpenFileName(conf_get_configname(), NULL, this);
1451 if (s.isNull()) 1452 if (s.isNull())
1452 return; 1453 return;
1453 if (conf_read(QFile::encodeName(s))) 1454 if (conf_read(QFile::encodeName(s)))
@@ -1463,7 +1464,7 @@ void ConfigMainWindow::saveConfig(void)
1463 1464
1464void ConfigMainWindow::saveConfigAs(void) 1465void ConfigMainWindow::saveConfigAs(void)
1465{ 1466{
1466 QString s = QFileDialog::getSaveFileName(".config", NULL, this); 1467 QString s = QFileDialog::getSaveFileName(conf_get_configname(), NULL, this);
1467 if (s.isNull()) 1468 if (s.isNull())
1468 return; 1469 return;
1469 if (conf_write(QFile::encodeName(s))) 1470 if (conf_write(QFile::encodeName(s)))
@@ -1524,6 +1525,8 @@ void ConfigMainWindow::setMenuLink(struct menu *menu)
1524 case fullMode: 1525 case fullMode:
1525 list = configList; 1526 list = configList;
1526 break; 1527 break;
1528 default:
1529 break;
1527 } 1530 }
1528 1531
1529 if (list) { 1532 if (list) {
@@ -1673,6 +1676,9 @@ void ConfigMainWindow::saveSettings(void)
1673 case fullMode : 1676 case fullMode :
1674 entry = "full"; 1677 entry = "full";
1675 break; 1678 break;
1679
1680 default:
1681 break;
1676 } 1682 }
1677 configSettings->writeEntry("/listMode", entry); 1683 configSettings->writeEntry("/listMode", entry);
1678 1684