Commit 856f5895 authored by Furkan Tokac's avatar Furkan Tokac 💬
Browse files

Rewrite workspace KCM in QtQuick

Summary:
This patch renews the System Settings -> Desktop Behaviour -> Workspace.

Basically it is rewritten in QML, ConfigModule. Also, its naming has been
changed. It was called as kcm_workspaceoptions and workspaceoptions before
but now, it is kcm_workspace like other renewed KCMs' names.

Currently, ToolTip and VisualFeedback working fine. All the functionalities
are tested. "Default", "Reset" buttons works like a charm.

{F5852481}

Reviewers: romangg, ngraham, #plasma

Reviewed By: romangg, #plasma

Subscribers: zzag, davidedmundson, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D12936
parent 81137680
# KI18N Translation Domain for this library
add_definitions(-DTRANSLATION_DOMAIN=\"kcmworkspaceoptions\")
########### next target ###############
add_definitions(-DTRANSLATION_DOMAIN=\"kcm_workspace\")
set(kcm_workspaceoptions_PART_SRCS workspaceoptions.cpp )
ki18n_wrap_ui(kcm_workspaceoptions_PART_SRCS mainpage.ui)
########### next target ###############
set(kcm_workspace_SRCS
workspaceoptions.cpp
)
add_library(kcm_workspaceoptions MODULE ${kcm_workspaceoptions_PART_SRCS})
add_library(kcm_workspace MODULE ${kcm_workspace_SRCS})
target_link_libraries(kcm_workspaceoptions KF5::KIOCore KF5::ConfigWidgets KF5::I18n)
target_link_libraries(kcm_workspace
KF5::QuickAddons
KF5::I18n
KF5::ConfigWidgets
KF5::Declarative
)
install(TARGETS kcm_workspaceoptions DESTINATION ${KDE_INSTALL_PLUGINDIR} )
kcoreaddons_desktop_to_json(kcm_workspace "kcm_workspace.desktop" SERVICE_TYPES kcmodule.desktop)
########### install files ###############
install( FILES kcm_workspace.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR})
install(TARGETS kcm_workspace DESTINATION ${KDE_INSTALL_PLUGINDIR}/kcms)
install( FILES workspaceoptions.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR} )
kpackage_install_package(package kcm_workspace kcms)
#! /usr/bin/env bash
$EXTRACTRC *.ui >> rc.cpp
$XGETTEXT *.cpp -o $podir/kcmworkspaceoptions.pot
$XGETTEXT `find . -name "*.cpp" -o -name "*.qml"` -o $podir/kcm_workspaceoptions.pot
[Desktop Entry]
Icon=plasma
Exec=kcmshell5 kcm_workspace
Type=Service
X-KDE-ServiceTypes=KCModule
X-KDE-Library=kcm_workspace
X-KDE-ParentApp=kcontrol
X-KDE-System-Settings-Parent-Category=desktopbehavior
X-KDE-Weight=40
Name=Workspace
Comment=Workspace Behavior
X-KDE-Keywords=plasma,workspace,shell,formfactor,dashboard,tooltips,informational tips,tooltips
Categories=Qt;KDE;X-KDE-settings-system;
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainPage</class>
<widget class="QWidget" name="MainPage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>415</width>
<height>110</height>
</rect>
</property>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
<item row="0" column="1">
<widget class="QCheckBox" name="showToolTips">
<property name="text">
<string>Display informational tooltips on mouse hover</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>214</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="showOsd">
<property name="text">
<string>Display visual feedback for status changes</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
/*
* Copyright 2018 Furkan Tokac <furkantokac34@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import QtQuick 2.7
import QtQuick.Controls 1.4 as Controls
import QtQuick.Layouts 1.3 as Layouts
import QtQuick.Controls.Styles 1.4 as Styles
import org.kde.kcm 1.1 as KCM
import org.kde.plasma.core 2.0 as PlasmaCore
Item {
id: root
Controls.ScrollView {
anchors.fill: parent
Layouts.ColumnLayout {
id: maincol
spacing: units.largeSpacing
// General Settings
Column {
spacing: units.smallSpacing
leftPadding: units.smallSpacing
Controls.Label {
id: generalSettings
text: i18n("General Settings")
}
Controls.CheckBox {
id: showToolTips
text: i18n("Display informational tooltips on mouse hover")
checked: kcm.toolTip
onCheckedChanged: kcm.toolTip = checked
}
Controls.CheckBox {
id: showVisualFeedback
text: i18n("Display visual feedback for status changes")
checked: kcm.visualFeedback
onCheckedChanged: kcm.visualFeedback = checked
}
Connections {
target: kcm
onToolTipChanged: showToolTips.checked = kcm.toolTip
onVisualFeedbackChanged: showVisualFeedback.checked = kcm.visualFeedback
}
}
} // END Layouts.ColumnLayout
} // END Controls.ScrollView
} // END Item
[Desktop Entry]
Name=Workspace
Comment=Workspace Behavior
Icon=plasma
Keywords=
Type=Service
X-KDE-ParentApp=
X-KDE-PluginInfo-Author=Furkan Tokac
X-KDE-PluginInfo-Email=furkantokac34@gmail.com
X-KDE-PluginInfo-License=GPL
X-KDE-PluginInfo-Name=kcm_workspace
X-KDE-PluginInfo-Version=
X-KDE-PluginInfo-Website=
X-KDE-ServiceTypes=Plasma/Generic
/*
* Copyright (C) 2009 Marco Martin <notmart@gmail.com>
* Copyright (C) 2018 <furkantokac34@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -14,90 +14,135 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#include "workspaceoptions.h"
#include "ui_mainpage.h"
#include <KAboutData>
#include <KPluginFactory>
#include <KAboutData>
#include <KLocalizedString>
#include <KConfigGroup>
using namespace KAuth;
K_PLUGIN_FACTORY(WorkspaceOptionsModuleFactory, registerPlugin<WorkspaceOptionsModule>();)
K_EXPORT_PLUGIN(WorkspaceOptionsModuleFactory("kcmworkspaceoptions"))
#include <ksharedconfig.h>
static const QString s_osdKey = QStringLiteral("OSD");
K_PLUGIN_FACTORY_WITH_JSON(KCMWorkspaceOptionsFactory, "kcm_workspace.json", registerPlugin<KCMWorkspaceOptions>();)
WorkspaceOptionsModule::WorkspaceOptionsModule(QWidget *parent, const QVariantList &args)
: KCModule(parent, args),
m_kwinConfig( KSharedConfig::openConfig(QStringLiteral("kwinrc"))),
m_ownConfig( KSharedConfig::openConfig(QStringLiteral("workspaceoptionsrc"))),
m_plasmaShellAutostart(QStringLiteral("plasmashell")),
m_krunnerAutostart(QStringLiteral("krunner")),
m_ui(new Ui::MainPage)
KCMWorkspaceOptions::KCMWorkspaceOptions(QObject *parent, const QVariantList& args)
: KQuickAddons::ConfigModule(parent, args),
m_stateToolTip(true),
m_stateVisualFeedback(true)
{
KAboutData *about =
new KAboutData(QStringLiteral("kcmworkspaceoptions"), i18n("Global options for the Plasma Workspace"),
QStringLiteral("1.0"), QString(), KAboutLicense::GPL,
i18n("(c) 2009 Marco Martin"));
about->addAuthor(i18n("Marco Martin"), i18n("Maintainer"), QStringLiteral("notmart@gmail.com"));
KAboutData* about = new KAboutData(QStringLiteral("kcm_workspace"),
i18n("Plasma Workspace global options"),
QStringLiteral("1.1"),
i18n("System Settings module for managing global options for the Plasma Workspace."),
KAboutLicense::GPL);
about->addAuthor(i18n("Furkan Tokac"), QString(), QStringLiteral("furkantokac34@gmail.com"));
setAboutData(about);
setButtons(Apply);
m_ui->setupUi(this);
connect(m_ui->showToolTips, SIGNAL(toggled(bool)), this, SLOT(changed()));
connect(m_ui->showOsd, &QCheckBox::toggled, this, static_cast<void(WorkspaceOptionsModule::*)()>(&WorkspaceOptionsModule::changed));
setButtons( Default | Apply );
}
WorkspaceOptionsModule::~WorkspaceOptionsModule()
/*ConfigModule functions*/
void KCMWorkspaceOptions::load()
{
delete m_ui;
}
bool state = false;
KSharedConfig::Ptr config = KSharedConfig::openConfig(QStringLiteral("plasmarc"));
// Load toolTip
{
const KConfigGroup cg(config, QStringLiteral("PlasmaToolTips"));
state = cg.readEntry("Delay", 0.7) > 0;
setToolTip(state);
m_ostateToolTip = getToolTip();
}
void WorkspaceOptionsModule::save()
// Load visualFeedback
{
const KConfigGroup cg(config, QStringLiteral("OSD"));
state = cg.readEntry(QStringLiteral("Enabled"), true);
setVisualFeedback(state);
m_ostateVisualFeedback = getVisualFeedback();
}
setNeedsSave(false);
}
void KCMWorkspaceOptions::save()
{
KSharedConfig::Ptr config = KSharedConfig::openConfig(QStringLiteral("plasmarc"));
// Save toolTip
{
KConfigGroup cg(config, "PlasmaToolTips");
cg.writeEntry("Delay", m_ui->showToolTips->isChecked() ? 0.7 : -1);
KConfigGroup cg(config, QStringLiteral("PlasmaToolTips"));
cg.writeEntry("Delay", getToolTip() ? 0.7 : -1);
m_ostateToolTip = getToolTip();
}
// Save visualFeedback
{
KConfigGroup cg(config, QStringLiteral("OSD"));
cg.writeEntry("Enabled", m_ui->showOsd->isChecked());
cg.writeEntry("Enabled", getVisualFeedback());
m_ostateVisualFeedback = getVisualFeedback();
}
config->sync();
setNeedsSave(false);
}
void WorkspaceOptionsModule::load()
void KCMWorkspaceOptions::defaults()
{
KSharedConfig::Ptr config = KSharedConfig::openConfig(QStringLiteral("plasmarc"));
setToolTip(true);
setVisualFeedback(true);
{
const KConfigGroup cg(config, "PlasmaToolTips");
m_ui->showToolTips->setChecked(cg.readEntry("Delay", 0.7) > 0);
handleNeedsSave();
}
/*ToolTip functions*/
bool KCMWorkspaceOptions::getToolTip() const
{
return m_stateToolTip;
}
void KCMWorkspaceOptions::setToolTip(bool state)
{
// Prevent from binding loop
if( m_stateToolTip == state ) {
return;
}
{
const KConfigGroup cg(config, s_osdKey);
m_ui->showOsd->setChecked(cg.readEntry(QStringLiteral("Enabled"), true));
m_stateToolTip = state;
emit toolTipChanged();
handleNeedsSave();
}
/*VisualFeedback functions*/
bool KCMWorkspaceOptions::getVisualFeedback() const
{
return m_stateVisualFeedback;
}
void KCMWorkspaceOptions::setVisualFeedback(bool state)
{
// Prevent from binding loop
if( m_stateVisualFeedback == state ) {
return;
}
m_stateVisualFeedback = state;
emit visualFeedbackChanged();
handleNeedsSave();
}
void WorkspaceOptionsModule::defaults()
/*Other functions*/
// Checks if the current states are different than the first states.
// If yes, setNeedsSave(true).
void KCMWorkspaceOptions::handleNeedsSave()
{
m_ui->showToolTips->setChecked(true);
m_ui->showOsd->setChecked(true);
setNeedsSave(m_ostateToolTip != getToolTip() ||
m_ostateVisualFeedback != getVisualFeedback());
}
#include "workspaceoptions.moc"
[Desktop Entry]
Exec=kcmshell5 workspaceoptions
Icon=plasma
Type=Service
X-KDE-ServiceTypes=KCModule
X-KDE-Library=kcm_workspaceoptions
X-KDE-ParentApp=kcontrol
X-KDE-System-Settings-Parent-Category=desktopbehavior
X-KDE-Weight=40
Name=Workspace
Name[ar]=مساحة العمل
Name[bs]=Radna površina
Name[ca]=Espai de treball
Name[ca@valencia]=Espai de treball
Name[cs]=Pracovní plocha
Name[da]=Arbejdsområde
Name[de]=Arbeitsbereich
Name[el]=Χώρος εργασίας
Name[en_GB]=Workspace
Name[es]=Espacio de trabajo
Name[et]=Töötsoon
Name[eu]=Langunea
Name[fi]=Työtila
Name[fr]=Espace de travail
Name[gl]=Espazo de traballo
Name[he]=סביבת עבודה
Name[hu]=Munkaterület
Name[ia]=Spatio de labor
Name[id]=Ruang Kerja
Name[is]=Vinnurýmd
Name[it]=Spazio di lavoro
Name[ja]=ワークスペース
Name[ko]=작업 공간
Name[lt]=Darbo erdvė
Name[nb]=Arbeidsområde
Name[nds]=Arbeitrebeet
Name[nl]=Werkruimte
Name[nn]=Arbeids­område
Name[pa]=ਵਰਕਸਪੇਸ
Name[pl]=Przestrzeń robocza
Name[pt]=Área de Trabalho
Name[pt_BR]=Espaço de trabalho
Name[ru]=Рабочая среда
Name[sk]=Pracovná plocha
Name[sl]=Delovni prostor
Name[sr]=Радни простор
Name[sr@ijekavian]=Радни простор
Name[sr@ijekavianlatin]=Radni prostor
Name[sr@latin]=Radni prostor
Name[sv]=Arbetsyta
Name[tr]=Çalışma Alanı
Name[uk]=Робочий простір
Name[x-test]=xxWorkspacexx
Name[zh_CN]=工作空间
Name[zh_TW]=工作空間
Comment=Workspace Behavior
Comment[ar]=سلوك مساحة العمل
Comment[bs]=Ponašanje radnog prostora
Comment[ca]=Comportament de l'espai de treball
Comment[ca@valencia]=Comportament de l'espai de treball
Comment[cs]=Chování pracovní plochy
Comment[da]=Arbejdsområdets opførsel
Comment[de]=Verhalten der Arbeitsfläche
Comment[el]=Συμπεριφορά χώρου εργασίας
Comment[en_GB]=Workspace Behaviour
Comment[es]=Comportamiento del espacio de trabajo
Comment[et]=Töötsooni käitumine
Comment[eu]=Langunearen portaera
Comment[fi]=Työtilan toiminta
Comment[fr]=Comportement de l'espace de travail
Comment[gl]=Comportamento do espazo de traballo
Comment[he]=התנהגות סביבת העבודה
Comment[hu]=Működés
Comment[id]=Perilaku Ruang Kerja
Comment[is]=Hegðun vinnurýmis
Comment[it]=Comportamento dello spazio di lavoro
Comment[ja]=ワークスペースの挙動
Comment[ko]=작업 공간 행동
Comment[lt]=Darbo erdvės elgsena
Comment[nb]=Oppførsel for arbeidsområdet
Comment[nds]=Arbeitrebeet-Bedregen
Comment[nl]=Gedrag van werkruimte
Comment[nn]=Åtferd til arbeids­område
Comment[pa]=ਵਰਕਸਪੇਸ ਰਵੱਈਆ
Comment[pl]=Zachowanie przestrzeni roboczej
Comment[pt]=Comportamento da Área de Trabalho
Comment[pt_BR]=Comportamento do espaço de trabalho
Comment[ru]=Настройка поведения рабочей среды
Comment[sk]=Správanie pracovnej plochy
Comment[sl]=Obnašanje delovnega prostora
Comment[sr]=Понашање радног простора
Comment[sr@ijekavian]=Понашање радног простора
Comment[sr@ijekavianlatin]=Ponašanje radnog prostora
Comment[sr@latin]=Ponašanje radnog prostora
Comment[sv]=Arbetsytans beteende
Comment[tr]=Çalışma Alanı Davranışı
Comment[uk]=Поведінка робочого простору
Comment[x-test]=xxWorkspace Behaviorxx
Comment[zh_CN]=工作空间行为
Comment[zh_TW]=工作空間行為
X-KDE-Keywords=plasma,workspace,shell,formfactor,dashboard,tooltips,informational tips,tooltips
X-KDE-Keywords[bs]=plazma,radna površina,ljuska,faktor forme,kontrolna ploča,savjeti za alat,informacioni savjeti,savjeti za alat
X-KDE-Keywords[ca]=plasma,espai de treball,shell,factor de format,tauler,consells d'eines,consells informatius,consells d'eines
X-KDE-Keywords[ca@valencia]=plasma,espai de treball,shell,factor de format,tauler,consells d'eines,consells informatius,consells d'eines
X-KDE-Keywords[da]=plasma,arbejdsområde,skal,formfaktor,dashboard,instrumentbræt,værktøjstips,informationstip
X-KDE-Keywords[de]=Plasma,Arbeitsbereich,Shell,Formfaktor,Format,Dashboard,Übersichtsseite,Kurzinfo,Tipps
X-KDE-Keywords[el]=plasma,χώρος εργασίας,κέλυφος,formfactor,πίνακας,υποδείξεις,ενημερωτικές υποδείξεις,υποδείξεις
X-KDE-Keywords[en_GB]=plasma,workspace,shell,formfactor,dashboard,tooltips,informational tips,tooltips
X-KDE-Keywords[es]=plasma,espacio de trabajo,consola,factor de forma,tablero de mandos,ayudas emergentes,ayudas informativas
X-KDE-Keywords[et]=plasma,töötsoon,shell,dashboard,vidinavaade,konteiner,kohtspikrid,
X-KDE-Keywords[eu]=plasma,langunea,shell,formfactor,forma,dashboard,aginte-mahaia,tooltips,tresnen argibidek,informational tips,informatzeko argibideak
X-KDE-Keywords[fi]=plasma,työtila,ympäristö,kuori,kokoluokka,kojelauta,työkaluvihjeet
X-KDE-Keywords[fr]=plasma, espace de travail, environnement, facteur de forme, tableau de bord, astuces d'informations, infobulles
X-KDE-Keywords[gl]=plasma,espazo de traballo,intérprete de ordes,shell,cadro de control,axudiñas,forma,consellos
X-KDE-Keywords[hu]=plasma,munkaterület,formfactor,áttekintő nézet,buboréksúgók,információs súgók, buboréksúgók
X-KDE-Keywords[id]=plasma,ruang kerja,shell,formfactor,dasbor,tip alat,tip informasi,tip alat
X-KDE-Keywords[it]=plasma,spazio di lavoro,shell,fattore di forma,cruscotto,suggerimenti,consigli informativi
X-KDE-Keywords[ko]=plasma,workspace,shell,formfactor,dashboard,tooltips,informational tips,작업 공간,셸,대시보드,풍선 도움말
X-KDE-Keywords[nb]=plasma,arbeidsområde,skall,formfaktor,kontrollpult,hjelpebobler,informasjonsbobler
X-KDE-Keywords[nds]=Plasma,Arbeitrebeet,Konsool,Form,Klockpaneel,Kortinfos,Intressante Tipps
X-KDE-Keywords[nl]=plasma,werkruimte,shell,vormfactor,dashboard,tekstballonnen,informatieve tips,tekstballonnen
X-KDE-Keywords[nn]=plasma,arbeidsområde,skal,formfaktor,kontrollpult,hjelpebobler,informasjonsbobler
X-KDE-Keywords[pa]=ਪਲਾਜ਼ਮਾ,ਵਰਕਸਪੇਸ,ਸ਼ੈੱਲ,ਫਾਰਮਫੈਕਟਰ,ਡੈਸ਼ਬੋਰਡ,ਟੂਲ-ਟਿੱਪ,ਜਾਣਕਾਰੀ ਵਾਲੇ ਟਿੱਪ,ਇਸ਼ਾਰੇ,ਗੁਰ
X-KDE-Keywords[pl]=plazma,przestrzeń robocza,powłoka,współczynnik kształtu,tablica,podpowiedzi,informacyjne wskazówki
X-KDE-Keywords[pt]=plasma,área de trabalho,consola,formato de ecrã,painel,dicas,dicas informativas
X-KDE-Keywords[pt_BR]=plasma,área de trabalho,shell,formato de tela,painel,dicas,dicas informativas
X-KDE-Keywords[ru]=plasma,workspace,shell,formfactor,dashboard,tooltips,informational tips,tooltips,плазма,рабочий стол,рабочая среда,рабочее окружение,окружение рабочего стола,среда рабочего стола,приборная доска,подсказки,всплывающие подсказки,информационные подсказки,оболочка рабочего стола
X-KDE-Keywords[sk]=plasma,pracovná plocha,shell,formfactor,nástenka,nástrojové tipy,informačné tipy
X-KDE-Keywords[sl]=plasma,delovni prostor,lupina,velikost in oblika,nadzorna plošča,orodni namigi,obvestilni namigi
X-KDE-Keywords[sr]=plasma,workspace,shell,formfactor,dashboard,tooltips,informational tips,Плазма,радни простор,шкољка,фактор облика,инструмент-табла,облачић,савети
X-KDE-Keywords[sr@ijekavian]=plasma,workspace,shell,formfactor,dashboard,tooltips,informational tips,Плазма,радни простор,шкољка,фактор облика,инструмент-табла,облачић,савети
X-KDE-Keywords[sr@ijekavianlatin]=plasma,workspace,shell,formfactor,dashboard,tooltips,informational tips,Plasma,radni prostor,školjka,faktor oblika,instrument-tabla,oblačić,saveti
X-KDE-Keywords[sr@latin]=plasma,workspace,shell,formfactor,dashboard,tooltips,informational tips,Plasma,radni prostor,školjka,faktor oblika,instrument-tabla,oblačić,saveti
X-KDE-Keywords[sv]=plasma,arbetsyta,skal,formfaktor,instrumentpanel,verktygstips,informationstips
X-KDE-Keywords[tr]=plasma,çalışma alanı,kabuk,form oranı,pano,araç ipuçları,bilgi ipuçları,püf noktaları
X-KDE-Keywords[uk]=plasma,workspace,shell,formfactor,dashboard,tooltips,informational tips,плазма,робочий простір,оболонка,форм-фактор,панель,підказки,інформація,відомості
X-KDE-Keywords[x-test]=xxplasmaxx,xxworkspacexx,xxshellxx,xxformfactorxx,xxdashboardxx,xxtooltipsxx,xxinformational tipsxx,xxtooltipsxx
X-KDE-Keywords[zh_CN]=plasma,workspace,shell,formfactor,dashboard,tooltips,informational tips,tooltips,工作空间,外壳,部件版,工具提示,提示,信息提示
X-KDE-Keywords[zh_TW]=plasma,workspace,shell,formfactor,dashboard,tooltips,informational tips,tooltips
Categories=Qt;KDE;X-KDE-settings-system;
/*
* Copyright (C) 2009 Marco Martin <notmart@gmail.com>
* Copyright (C) 2018 <furkantokac34@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -14,39 +14,47 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef WORKSPACEOPTIONS_H
#define WORKSPACEOPTIONS_H
#include <kcmodule.h>
#include <ksharedconfig.h>
#include <kautostart.h>
#ifndef _KCM_WORKSPACEOPTIONS_H
#define _KCM_WORKSPACEOPTIONS_H
namespace Ui {
class MainPage;
}
#include <KQuickAddons/ConfigModule>
class WorkspaceOptionsModule : public KCModule
class KCMWorkspaceOptions : public KQuickAddons::ConfigModule
{
Q_OBJECT
Q_PROPERTY(bool toolTip READ getToolTip WRITE setToolTip NOTIFY toolTipChanged)
Q_PROPERTY(bool visualFeedback READ getVisualFeedback WRITE setVisualFeedback NOTIFY visualFeedbackChanged)
public:
WorkspaceOptionsModule(QWidget *parent, const QVariantList &);
~WorkspaceOptionsModule();
void save() override;
void load() override;
void defaults() override;
KCMWorkspaceOptions(QObject* parent, const QVariantList& args);
~KCMWorkspaceOptions() {}
// QML Properties
bool getToolTip() const;
void setToolTip(bool state);
bool getVisualFeedback() const;
void setVisualFeedback(bool state);
public Q_SLOTS:
void load();
void save();
void defaults();
Q_SIGNALS:
void toolTipChanged();
void visualFeedbackChanged();
private:
KSharedConfigPtr m_kwinConfig;
KSharedConfigPtr m_ownConfig;
KAutostart m_plasmaShellAutostart;
KAutostart m_krunnerAutostart;
bool m_currentlyIsDesktop;
bool m_currentlyFixedDashboard;
Ui::MainPage *m_ui;
void handleNeedsSave();
// QML variables
bool m_ostateToolTip; // Original state
bool m_stateToolTip; // Current state
bool m_ostateVisualFeedback;
bool m_stateVisualFeedback;
};
#endif // WORKSPACEOPTIONS_H
#endif // _KCM_WORKSPACEOPTIONS_H
Supports Markdown
0%