From bb1bc88360bd84d7e7aeb61babfb1978aee7bd0b Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 18 Aug 2016 14:07:43 -0400 Subject: Add a checkbox to the compton page for enabling/disabling compositing. --- src-qt5/core-utils/lumina-config/pages/page_compton.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src-qt5/core-utils/lumina-config/pages/page_compton.cpp') diff --git a/src-qt5/core-utils/lumina-config/pages/page_compton.cpp b/src-qt5/core-utils/lumina-config/pages/page_compton.cpp index fcbd3e41..0003c9c8 100644 --- a/src-qt5/core-utils/lumina-config/pages/page_compton.cpp +++ b/src-qt5/core-utils/lumina-config/pages/page_compton.cpp @@ -14,6 +14,7 @@ page_compton::page_compton(QWidget *parent) : PageWidget(parent), ui(new Ui::page_compton()){ ui->setupUi(this); connect(ui->text_file, SIGNAL(textChanged()), this, SLOT(settingChanged()) ); + connect(ui->check_disablecompton, SIGNAL(toggled(bool)), this, SLOT(settingChanged()) ); updateIcons(); } @@ -25,8 +26,9 @@ page_compton::~page_compton(){ // PUBLIC SLOTS //================ void page_compton::SaveSettings(){ - emit HasPendingChanges(false); + QSettings settings("lumina-desktop","sessionsettings"); + settings.setValue("enableCompositing", !ui->check_disablecompton->isChecked()); QString set = QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/compton.conf"; LUtils::writeFile(set, ui->text_file->toPlainText().split("\n"),true); } @@ -34,6 +36,8 @@ void page_compton::SaveSettings(){ void page_compton::LoadSettings(int){ emit HasPendingChanges(false); emit ChangePageTitle( tr("Compositor Settings") ); + QSettings settings("lumina-desktop","sessionsettings"); + ui->check_disablecompton->setChecked( !settings.value("enableCompositing", true).toBool() ); QString set = QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/compton.conf"; qDebug() << "Load Compton settings:" << set; ui->text_file->setPlainText( LUtils::readFile(set).join("\n") ); -- cgit