diff options
author | Ken Moore <ken@ixsystems.com> | 2017-02-21 08:47:35 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-21 08:47:35 -0500 |
commit | 78f38fb726c594070a3de9a68edc13a73d48a201 (patch) | |
tree | ac8f515f88a44a0d2d1805b882adacc84833a8e2 /src-qt5/desktop-utils/lumina-fm | |
parent | Merge remote-tracking branch 'origin/master' (diff) | |
parent | Insight: Put single/dual column actions in a QActionGroup to ensure they cann... (diff) | |
download | lumina-78f38fb726c594070a3de9a68edc13a73d48a201.tar.gz lumina-78f38fb726c594070a3de9a68edc13a73d48a201.tar.bz2 lumina-78f38fb726c594070a3de9a68edc13a73d48a201.zip |
Merge pull request #380 from sjohannes/fm-fix-single-dual-column-uncheckable
Insight: Put single/dual column actions in a QActionGroup to ensure they cannot both be unchecked
Diffstat (limited to 'src-qt5/desktop-utils/lumina-fm')
-rw-r--r-- | src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp b/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp index 967e6b1a..69693c7d 100644 --- a/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp +++ b/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp @@ -7,6 +7,7 @@ #include "DirWidget2.h" #include "ui_DirWidget2.h" +#include <QActionGroup> #include <QMessageBox> #include <QCursor> #include <QClipboard> @@ -44,9 +45,12 @@ DirWidget::DirWidget(QString objID, QWidget *parent) : QWidget(parent), ui(new U line_dir = new QLineEdit(this); toolbar->addWidget(line_dir); connect(line_dir, SIGNAL(returnPressed()), this, SLOT(dir_changed()) ); - toolbar->addAction(ui->actionSingleColumn); - ui->actionSingleColumn->setChecked(true); - toolbar->addAction(ui->actionDualColumn); + QActionGroup *columnActionGroup = new QActionGroup(this); + toolbar->addAction(ui->actionSingleColumn); + ui->actionSingleColumn->setChecked(true); + columnActionGroup->addAction(ui->actionSingleColumn); + toolbar->addAction(ui->actionDualColumn); + columnActionGroup->addAction(ui->actionDualColumn); toolbar->addAction(ui->actionMenu); //Add the browser widgets RCBW = 0; //right column browser is unavailable initially @@ -400,7 +404,6 @@ void DirWidget::dir_changed(){ void DirWidget::on_actionSingleColumn_triggered(bool checked){ if(!checked){ return; } - ui->actionDualColumn->setChecked(false); if(RCBW==0){ return; } //nothing to do ui->browser_layout->removeWidget(RCBW); RCBW->deleteLater(); @@ -410,7 +413,6 @@ void DirWidget::on_actionSingleColumn_triggered(bool checked){ void DirWidget::on_actionDualColumn_triggered(bool checked){ if(!checked){ return; } - ui->actionSingleColumn->setChecked(false); if(RCBW!=0){ return; } //nothing to do RCBW = new BrowserWidget("rc", this); ui->browser_layout->addWidget(RCBW); |