From e7a3ecfd8216b8adfd2e9eca7d40714709c58e19 Mon Sep 17 00:00:00 2001 From: Karol Szwed Date: Tue, 29 May 2001 07:10:17 +0000 Subject: [PATCH] Added patch by Melchior to move the [ModernSystem] section in the kwinrc file into kwinmodernsysrc svn path=/trunk/kdebase/kwin/; revision=99266 --- clients/modernsystem/Makefile.am | 7 ++----- clients/modernsystem/config/Makefile.am | 2 ++ clients/modernsystem/config/config.cpp | 28 +++++++++++++++---------- clients/modernsystem/config/config.h | 5 +++-- clients/modernsystem/modernsys.cpp | 10 ++++----- 5 files changed, 29 insertions(+), 23 deletions(-) diff --git a/clients/modernsystem/Makefile.am b/clients/modernsystem/Makefile.am index 42503afb37..e2a68e57da 100644 --- a/clients/modernsystem/Makefile.am +++ b/clients/modernsystem/Makefile.am @@ -1,7 +1,8 @@ +# $Id$ INCLUDES = $(all_includes) -SUBDIRS = . config +SUBDIRS = config kde_module_LTLIBRARIES = libkwinmodernsys.la @@ -17,7 +18,3 @@ lnk_DATA = modernsystem.desktop EXTRA_DIST = $(lnk_DATA) - -###KMAKE-start (don't edit or delete this block) - -###KMAKE-end diff --git a/clients/modernsystem/config/Makefile.am b/clients/modernsystem/config/Makefile.am index 58d7290cbe..a4c8a609ec 100644 --- a/clients/modernsystem/config/Makefile.am +++ b/clients/modernsystem/config/Makefile.am @@ -1,3 +1,5 @@ +# $Id$ + INCLUDES = $(all_includes) kde_module_LTLIBRARIES = libkwinmodernsys_config.la diff --git a/clients/modernsystem/config/config.cpp b/clients/modernsystem/config/config.cpp index 4488ab3276..ee76d17461 100644 --- a/clients/modernsystem/config/config.cpp +++ b/clients/modernsystem/config/config.cpp @@ -2,8 +2,9 @@ // Melchior FRANZ -- 2001-04-22 #include "config.h" +#include #include -#include +#include extern "C" @@ -23,8 +24,11 @@ extern "C" ModernSysConfig::ModernSysConfig(KConfig* conf, QWidget* parent) : QObject(parent) { + clientrc = new KConfig("kwinmodernsysrc"); gb = new QGroupBox(1, Qt::Horizontal, i18n("Modern System Decoration Settings"), parent); cbShowHandle = new QCheckBox(i18n("&Show resize handle"), gb); + QWhatsThis::add(cbShowHandle, i18n("When selected, all windows are drawn with a resize " + "handle at the lower right corner.")); connect(cbShowHandle, SIGNAL(clicked()), this, SLOT(slotSelectionChanged())); load(conf); gb->show(); @@ -35,6 +39,7 @@ ModernSysConfig::~ModernSysConfig() { delete cbShowHandle; delete gb; + delete clientrc; } @@ -44,22 +49,23 @@ void ModernSysConfig::slotSelectionChanged() } -void ModernSysConfig::load(KConfig* conf) +void ModernSysConfig::load(KConfig* /*conf*/) { - conf->setGroup("ModernSystem"); - bool i = conf->readBoolEntry("ShowHandle", true ); + clientrc->setGroup("General"); + bool i = clientrc->readBoolEntry("ShowHandle", true ); cbShowHandle->setChecked(i); - handle_width = conf->readUnsignedNumEntry("HandleWidth", 6); - handle_size = conf->readUnsignedNumEntry("HandleSize", 30); + handle_width = clientrc->readUnsignedNumEntry("HandleWidth", 6); + handle_size = clientrc->readUnsignedNumEntry("HandleSize", 30); } -void ModernSysConfig::save(KConfig* conf) +void ModernSysConfig::save(KConfig* /*conf*/) { - conf->setGroup("ModernSystem"); - conf->writeEntry("ShowHandle", cbShowHandle->isChecked()); - conf->writeEntry("HandleWidth", handle_width); - conf->writeEntry("HandleSize", handle_size); + clientrc->setGroup("General"); + clientrc->writeEntry("ShowHandle", cbShowHandle->isChecked()); + clientrc->writeEntry("HandleWidth", handle_width); + clientrc->writeEntry("HandleSize", handle_size); + clientrc->sync(); } diff --git a/clients/modernsystem/config/config.h b/clients/modernsystem/config/config.h index 29054fabeb..4c79ce6d08 100644 --- a/clients/modernsystem/config/config.h +++ b/clients/modernsystem/config/config.h @@ -27,10 +27,11 @@ class ModernSysConfig : public QObject void slotSelectionChanged(); // Internal use private: + KConfig *clientrc; QGroupBox *gb; QCheckBox *cbShowHandle; - unsigned handle_width; - unsigned handle_size; + unsigned handle_width; + unsigned handle_size; }; diff --git a/clients/modernsystem/modernsys.cpp b/clients/modernsystem/modernsys.cpp index 352eee5867..d2da9c98c0 100644 --- a/clients/modernsystem/modernsys.cpp +++ b/clients/modernsystem/modernsys.cpp @@ -196,12 +196,12 @@ static bool read_config() int hsize, hwidth; QString bpatt; - KConfig* conf = KGlobal::config(); - conf->setGroup("ModernSystem"); - showh = conf->readBoolEntry("ShowHandle", true); + KConfig c("kwinmodernsysrc"); + c.setGroup("General"); + showh = c.readBoolEntry("ShowHandle", true); - hwidth = conf->readUnsignedNumEntry("HandleWidth", 6); - hsize = conf->readUnsignedNumEntry("HandleSize", 30); + hwidth = c.readUnsignedNumEntry("HandleWidth", 6); + hsize = c.readUnsignedNumEntry("HandleSize", 30); if (!(showh && hsize && hwidth)) { showh = false; hwidth = hsize = 0;