Port xconfig to Qt5 - Make single/split/full actions checkable.
authorBoris Barbulovski <bbarbulovski@gmail.com>
Tue, 22 Sep 2015 18:36:13 +0000 (11:36 -0700)
committerMichal Marek <mmarek@suse.com>
Wed, 14 Oct 2015 12:59:01 +0000 (14:59 +0200)
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>
scripts/kconfig/qconf.cc
scripts/kconfig/qconf.h

index c2f9767514deb154d167962f50306028482d591d..f439f355dddcd1edc6cb77ea9d4bc4874219aacf 100644 (file)
@@ -1329,11 +1329,14 @@ ConfigMainWindow::ConfigMainWindow(void)
        QAction *searchAction = new QAction(_("&Find"), this);
        searchAction->setShortcut(Qt::CTRL + Qt::Key_F);
          connect(searchAction, SIGNAL(activated()), SLOT(searchConfig()));
-       QAction *singleViewAction = new QAction(QPixmap(xpm_single_view), _("Single View"), this);
+       singleViewAction = new QAction(QPixmap(xpm_single_view), _("Single View"), this);
+       singleViewAction->setCheckable(TRUE);
          connect(singleViewAction, SIGNAL(activated()), SLOT(showSingleView()));
-       QAction *splitViewAction = new QAction(QPixmap(xpm_split_view), _("Split View"), this);
+       splitViewAction = new QAction(QPixmap(xpm_split_view), _("Split View"), this);
+       splitViewAction->setCheckable(TRUE);
          connect(splitViewAction, SIGNAL(activated()), SLOT(showSplitView()));
-       QAction *fullViewAction = new QAction(QPixmap(xpm_tree_view), _("Full View"), this);
+       fullViewAction = new QAction(QPixmap(xpm_tree_view), _("Full View"), this);
+       fullViewAction->setCheckable(TRUE);
          connect(fullViewAction, SIGNAL(activated()), SLOT(showFullView()));
 
        QAction *showNameAction = new QAction(_("Show Name"), this);
@@ -1579,6 +1582,13 @@ void ConfigMainWindow::goBack(void)
 
 void ConfigMainWindow::showSingleView(void)
 {
+       singleViewAction->setEnabled(false);
+       singleViewAction->setChecked(true);
+       splitViewAction->setEnabled(true);
+       splitViewAction->setChecked(false);
+       fullViewAction->setEnabled(true);
+       fullViewAction->setChecked(false);
+
        menuView->hide();
        menuList->setRootMenu(0);
        configList->mode = singleMode;
@@ -1592,6 +1602,13 @@ void ConfigMainWindow::showSingleView(void)
 
 void ConfigMainWindow::showSplitView(void)
 {
+       singleViewAction->setEnabled(true);
+       singleViewAction->setChecked(false);
+       splitViewAction->setEnabled(false);
+       splitViewAction->setChecked(true);
+       fullViewAction->setEnabled(true);
+       fullViewAction->setChecked(false);
+
        configList->mode = symbolMode;
        if (configList->rootEntry == &rootmenu)
                configList->updateListAll();
@@ -1608,6 +1625,13 @@ void ConfigMainWindow::showSplitView(void)
 
 void ConfigMainWindow::showFullView(void)
 {
+       singleViewAction->setEnabled(true);
+       singleViewAction->setChecked(false);
+       splitViewAction->setEnabled(true);
+       splitViewAction->setChecked(false);
+       fullViewAction->setEnabled(false);
+       fullViewAction->setChecked(true);
+
        menuView->hide();
        menuList->setRootMenu(0);
        configList->mode = fullMode;
index 8c7d95105e3c770e49ad33bbe1d172bf08d5c4c8..213990129e51970ca339d9f93b34d3ae306210ce 100644 (file)
@@ -316,6 +316,9 @@ protected:
        ConfigInfoView *helpText;
        QToolBar *toolBar;
        QAction *backAction;
+       QAction *singleViewAction;
+       QAction *splitViewAction;
+       QAction *fullViewAction;
        QSplitter* split1;
        QSplitter* split2;
 };