diff options
author | Boris Barbulovski <bbarbulovski@gmail.com> | 2015-09-22 14:36:03 -0400 |
---|---|---|
committer | Michal Marek <mmarek@suse.com> | 2015-10-14 08:59:00 -0400 |
commit | 85eaf28a2683b11227fbcd77341339fe3642f795 (patch) | |
tree | 2c40c58b9acc32a5b20b040d971db093d078be4b /scripts/kconfig/qconf.cc | |
parent | b1f8a45bfee563f6aa9969c6b01f6c831a85e39a (diff) |
Port xconfig to Qt5 - Use QAction
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>
Diffstat (limited to 'scripts/kconfig/qconf.cc')
-rw-r--r-- | scripts/kconfig/qconf.cc | 48 |
1 files changed, 26 insertions, 22 deletions
diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc index 199934c5cdbf..601c8689a2cf 100644 --- a/scripts/kconfig/qconf.cc +++ b/scripts/kconfig/qconf.cc | |||
@@ -9,7 +9,7 @@ | |||
9 | #include <q3vbox.h> | 9 | #include <q3vbox.h> |
10 | #include <q3valuelist.h> | 10 | #include <q3valuelist.h> |
11 | #include <q3textbrowser.h> | 11 | #include <q3textbrowser.h> |
12 | #include <q3action.h> | 12 | #include <QAction> |
13 | #include <q3header.h> | 13 | #include <q3header.h> |
14 | #include <q3filedialog.h> | 14 | #include <q3filedialog.h> |
15 | #include <q3dragobject.h> | 15 | #include <q3dragobject.h> |
@@ -44,7 +44,7 @@ | |||
44 | static QApplication *configApp; | 44 | static QApplication *configApp; |
45 | static ConfigSettings *configSettings; | 45 | static ConfigSettings *configSettings; |
46 | 46 | ||
47 | Q3Action *ConfigMainWindow::saveAction; | 47 | QAction *ConfigMainWindow::saveAction; |
48 | 48 | ||
49 | static inline QString qgettext(const char* str) | 49 | static inline QString qgettext(const char* str) |
50 | { | 50 | { |
@@ -815,10 +815,10 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e) | |||
815 | { | 815 | { |
816 | if (e->y() <= header()->geometry().bottom()) { | 816 | if (e->y() <= header()->geometry().bottom()) { |
817 | if (!headerPopup) { | 817 | if (!headerPopup) { |
818 | Q3Action *action; | 818 | QAction *action; |
819 | 819 | ||
820 | headerPopup = new Q3PopupMenu(this); | 820 | headerPopup = new Q3PopupMenu(this); |
821 | action = new Q3Action(NULL, _("Show Name"), 0, this); | 821 | action = new QAction(_("Show Name"), this); |
822 | action->setToggleAction(TRUE); | 822 | action->setToggleAction(TRUE); |
823 | connect(action, SIGNAL(toggled(bool)), | 823 | connect(action, SIGNAL(toggled(bool)), |
824 | parent(), SLOT(setShowName(bool))); | 824 | parent(), SLOT(setShowName(bool))); |
@@ -826,7 +826,7 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e) | |||
826 | action, SLOT(setOn(bool))); | 826 | action, SLOT(setOn(bool))); |
827 | action->setOn(showName); | 827 | action->setOn(showName); |
828 | action->addTo(headerPopup); | 828 | action->addTo(headerPopup); |
829 | action = new Q3Action(NULL, _("Show Range"), 0, this); | 829 | action = new QAction(_("Show Range"), this); |
830 | action->setToggleAction(TRUE); | 830 | action->setToggleAction(TRUE); |
831 | connect(action, SIGNAL(toggled(bool)), | 831 | connect(action, SIGNAL(toggled(bool)), |
832 | parent(), SLOT(setShowRange(bool))); | 832 | parent(), SLOT(setShowRange(bool))); |
@@ -834,7 +834,7 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e) | |||
834 | action, SLOT(setOn(bool))); | 834 | action, SLOT(setOn(bool))); |
835 | action->setOn(showRange); | 835 | action->setOn(showRange); |
836 | action->addTo(headerPopup); | 836 | action->addTo(headerPopup); |
837 | action = new Q3Action(NULL, _("Show Data"), 0, this); | 837 | action = new QAction( _("Show Data"), this); |
838 | action->setToggleAction(TRUE); | 838 | action->setToggleAction(TRUE); |
839 | connect(action, SIGNAL(toggled(bool)), | 839 | connect(action, SIGNAL(toggled(bool)), |
840 | parent(), SLOT(setShowData(bool))); | 840 | parent(), SLOT(setShowData(bool))); |
@@ -1157,7 +1157,7 @@ void ConfigInfoView::expr_print_help(void *data, struct symbol *sym, const char | |||
1157 | Q3PopupMenu* ConfigInfoView::createPopupMenu(const QPoint& pos) | 1157 | Q3PopupMenu* ConfigInfoView::createPopupMenu(const QPoint& pos) |
1158 | { | 1158 | { |
1159 | Q3PopupMenu* popup = Parent::createPopupMenu(pos); | 1159 | Q3PopupMenu* popup = Parent::createPopupMenu(pos); |
1160 | Q3Action* action = new Q3Action(NULL, _("Show Debug Info"), 0, popup); | 1160 | QAction* action = new QAction(_("Show Debug Info"), popup); |
1161 | action->setToggleAction(TRUE); | 1161 | action->setToggleAction(TRUE); |
1162 | connect(action, SIGNAL(toggled(bool)), SLOT(setShowDebug(bool))); | 1162 | connect(action, SIGNAL(toggled(bool)), SLOT(setShowDebug(bool))); |
1163 | connect(this, SIGNAL(showDebugChanged(bool)), action, SLOT(setOn(bool))); | 1163 | connect(this, SIGNAL(showDebugChanged(bool)), action, SLOT(setOn(bool))); |
@@ -1305,40 +1305,44 @@ ConfigMainWindow::ConfigMainWindow(void) | |||
1305 | menu = menuBar(); | 1305 | menu = menuBar(); |
1306 | toolBar = new QToolBar("Tools", this); | 1306 | toolBar = new QToolBar("Tools", this); |
1307 | 1307 | ||
1308 | backAction = new Q3Action("Back", QPixmap(xpm_back), _("Back"), 0, this); | 1308 | backAction = new QAction(QPixmap(xpm_back), _("Back"), this); |
1309 | connect(backAction, SIGNAL(activated()), SLOT(goBack())); | 1309 | connect(backAction, SIGNAL(activated()), SLOT(goBack())); |
1310 | backAction->setEnabled(FALSE); | 1310 | backAction->setEnabled(FALSE); |
1311 | Q3Action *quitAction = new Q3Action("Quit", _("&Quit"), Qt::CTRL + Qt::Key_Q, this); | 1311 | QAction *quitAction = new QAction(_("&Quit"), this); |
1312 | quitAction->setShortcut(Qt::CTRL + Qt::Key_Q); | ||
1312 | connect(quitAction, SIGNAL(activated()), SLOT(close())); | 1313 | connect(quitAction, SIGNAL(activated()), SLOT(close())); |
1313 | Q3Action *loadAction = new Q3Action("Load", QPixmap(xpm_load), _("&Load"), Qt::CTRL + Qt::Key_L, this); | 1314 | QAction *loadAction = new QAction(QPixmap(xpm_load), _("&Load"), this); |
1315 | loadAction->setShortcut(Qt::CTRL + Qt::Key_L); | ||
1314 | connect(loadAction, SIGNAL(activated()), SLOT(loadConfig())); | 1316 | connect(loadAction, SIGNAL(activated()), SLOT(loadConfig())); |
1315 | saveAction = new Q3Action("Save", QPixmap(xpm_save), _("&Save"), Qt::CTRL + Qt::Key_S, this); | 1317 | saveAction = new QAction(QPixmap(xpm_save), _("&Save"), this); |
1318 | saveAction->setShortcut(Qt::CTRL + Qt::Key_S); | ||
1316 | connect(saveAction, SIGNAL(activated()), SLOT(saveConfig())); | 1319 | connect(saveAction, SIGNAL(activated()), SLOT(saveConfig())); |
1317 | conf_set_changed_callback(conf_changed); | 1320 | conf_set_changed_callback(conf_changed); |
1318 | // Set saveAction's initial state | 1321 | // Set saveAction's initial state |
1319 | conf_changed(); | 1322 | conf_changed(); |
1320 | Q3Action *saveAsAction = new Q3Action("Save As...", _("Save &As..."), 0, this); | 1323 | QAction *saveAsAction = new QAction(_("Save &As..."), this); |
1321 | connect(saveAsAction, SIGNAL(activated()), SLOT(saveConfigAs())); | 1324 | connect(saveAsAction, SIGNAL(activated()), SLOT(saveConfigAs())); |
1322 | Q3Action *searchAction = new Q3Action("Find", _("&Find"), Qt::CTRL + Qt::Key_F, this); | 1325 | QAction *searchAction = new QAction(_("&Find"), this); |
1326 | searchAction->setShortcut(Qt::CTRL + Qt::Key_F); | ||
1323 | connect(searchAction, SIGNAL(activated()), SLOT(searchConfig())); | 1327 | connect(searchAction, SIGNAL(activated()), SLOT(searchConfig())); |
1324 | Q3Action *singleViewAction = new Q3Action("Single View", QPixmap(xpm_single_view), _("Single View"), 0, this); | 1328 | QAction *singleViewAction = new QAction(QPixmap(xpm_single_view), _("Single View"), this); |
1325 | connect(singleViewAction, SIGNAL(activated()), SLOT(showSingleView())); | 1329 | connect(singleViewAction, SIGNAL(activated()), SLOT(showSingleView())); |
1326 | Q3Action *splitViewAction = new Q3Action("Split View", QPixmap(xpm_split_view), _("Split View"), 0, this); | 1330 | QAction *splitViewAction = new QAction(QPixmap(xpm_split_view), _("Split View"), this); |
1327 | connect(splitViewAction, SIGNAL(activated()), SLOT(showSplitView())); | 1331 | connect(splitViewAction, SIGNAL(activated()), SLOT(showSplitView())); |
1328 | Q3Action *fullViewAction = new Q3Action("Full View", QPixmap(xpm_tree_view), _("Full View"), 0, this); | 1332 | QAction *fullViewAction = new QAction(QPixmap(xpm_tree_view), _("Full View"), this); |
1329 | connect(fullViewAction, SIGNAL(activated()), SLOT(showFullView())); | 1333 | connect(fullViewAction, SIGNAL(activated()), SLOT(showFullView())); |
1330 | 1334 | ||
1331 | Q3Action *showNameAction = new Q3Action(NULL, _("Show Name"), 0, this); | 1335 | QAction *showNameAction = new QAction(_("Show Name"), this); |
1332 | showNameAction->setToggleAction(TRUE); | 1336 | showNameAction->setToggleAction(TRUE); |
1333 | connect(showNameAction, SIGNAL(toggled(bool)), configView, SLOT(setShowName(bool))); | 1337 | connect(showNameAction, SIGNAL(toggled(bool)), configView, SLOT(setShowName(bool))); |
1334 | connect(configView, SIGNAL(showNameChanged(bool)), showNameAction, SLOT(setOn(bool))); | 1338 | connect(configView, SIGNAL(showNameChanged(bool)), showNameAction, SLOT(setOn(bool))); |
1335 | showNameAction->setOn(configView->showName()); | 1339 | showNameAction->setOn(configView->showName()); |
1336 | Q3Action *showRangeAction = new Q3Action(NULL, _("Show Range"), 0, this); | 1340 | QAction *showRangeAction = new QAction(_("Show Range"), this); |
1337 | showRangeAction->setToggleAction(TRUE); | 1341 | showRangeAction->setToggleAction(TRUE); |
1338 | connect(showRangeAction, SIGNAL(toggled(bool)), configView, SLOT(setShowRange(bool))); | 1342 | connect(showRangeAction, SIGNAL(toggled(bool)), configView, SLOT(setShowRange(bool))); |
1339 | connect(configView, SIGNAL(showRangeChanged(bool)), showRangeAction, SLOT(setOn(bool))); | 1343 | connect(configView, SIGNAL(showRangeChanged(bool)), showRangeAction, SLOT(setOn(bool))); |
1340 | showRangeAction->setOn(configList->showRange); | 1344 | showRangeAction->setOn(configList->showRange); |
1341 | Q3Action *showDataAction = new Q3Action(NULL, _("Show Data"), 0, this); | 1345 | QAction *showDataAction = new QAction(_("Show Data"), this); |
1342 | showDataAction->setToggleAction(TRUE); | 1346 | showDataAction->setToggleAction(TRUE); |
1343 | connect(showDataAction, SIGNAL(toggled(bool)), configView, SLOT(setShowData(bool))); | 1347 | connect(showDataAction, SIGNAL(toggled(bool)), configView, SLOT(setShowData(bool))); |
1344 | connect(configView, SIGNAL(showDataChanged(bool)), showDataAction, SLOT(setOn(bool))); | 1348 | connect(configView, SIGNAL(showDataChanged(bool)), showDataAction, SLOT(setOn(bool))); |
@@ -1361,15 +1365,15 @@ ConfigMainWindow::ConfigMainWindow(void) | |||
1361 | configView->showPromptAction->setToggleAction(TRUE); | 1365 | configView->showPromptAction->setToggleAction(TRUE); |
1362 | configView->showPromptAction->setOn(configList->optMode == promptOpt); | 1366 | configView->showPromptAction->setOn(configList->optMode == promptOpt); |
1363 | 1367 | ||
1364 | Q3Action *showDebugAction = new Q3Action(NULL, _("Show Debug Info"), 0, this); | 1368 | QAction *showDebugAction = new QAction( _("Show Debug Info"), this); |
1365 | showDebugAction->setToggleAction(TRUE); | 1369 | showDebugAction->setToggleAction(TRUE); |
1366 | connect(showDebugAction, SIGNAL(toggled(bool)), helpText, SLOT(setShowDebug(bool))); | 1370 | connect(showDebugAction, SIGNAL(toggled(bool)), helpText, SLOT(setShowDebug(bool))); |
1367 | connect(helpText, SIGNAL(showDebugChanged(bool)), showDebugAction, SLOT(setOn(bool))); | 1371 | connect(helpText, SIGNAL(showDebugChanged(bool)), showDebugAction, SLOT(setOn(bool))); |
1368 | showDebugAction->setOn(helpText->showDebug()); | 1372 | showDebugAction->setOn(helpText->showDebug()); |
1369 | 1373 | ||
1370 | Q3Action *showIntroAction = new Q3Action(NULL, _("Introduction"), 0, this); | 1374 | QAction *showIntroAction = new QAction( _("Introduction"), this); |
1371 | connect(showIntroAction, SIGNAL(activated()), SLOT(showIntro())); | 1375 | connect(showIntroAction, SIGNAL(activated()), SLOT(showIntro())); |
1372 | Q3Action *showAboutAction = new Q3Action(NULL, _("About"), 0, this); | 1376 | QAction *showAboutAction = new QAction( _("About"), this); |
1373 | connect(showAboutAction, SIGNAL(activated()), SLOT(showAbout())); | 1377 | connect(showAboutAction, SIGNAL(activated()), SLOT(showAbout())); |
1374 | 1378 | ||
1375 | // init tool bar | 1379 | // init tool bar |