aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core-utils/lumina-config/pages/page_compton.cpp
blob: 8cdb2ea7d373aa5e8b3d7c89a8233c5f75ab9cc1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//===========================================
//  Lumina Desktop Source Code
//  Copyright (c) 2016, Ken Moore
//  Available under the 3-clause BSD license
//  See the LICENSE file for full details
//===========================================
#include "page_compton.h"
#include "ui_page_compton.h"
#include "getPage.h"

//==========
//    PUBLIC
//==========
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();
}

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());
    settings.setValue("compositingWithGpuAccelOnly", ui->check_GPUverify->isChecked());
  QString set = QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/compton.conf";
  LUtils::writeFile(set, ui->text_file->toPlainText().split("\n"),true);
}

void page_compton::LoadSettings(int){
  emit ChangePageTitle( tr("Compositor Settings") );
  QSettings settings("lumina-desktop","sessionsettings");
    ui->check_disablecompton->setChecked( !settings.value("enableCompositing", true).toBool() );
    ui->check_GPUverify->setChecked( settings.value("compositingWithGpuAccelOnly", 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") );
  emit HasPendingChanges(false);
}

void page_compton::updateIcons(){
emit HasPendingChanges(false);
}

//=================
//         PRIVATE 
//=================

//=================
//    PRIVATE SLOTS
//=================
bgstack15