Added patch by Melchior to move the [ModernSystem] section in the kwinrc
file into kwinmodernsysrc svn path=/trunk/kdebase/kwin/; revision=99266
This commit is contained in:
parent
869ac89c8f
commit
e7a3ecfd82
5 changed files with 29 additions and 23 deletions
|
@ -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
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# $Id$
|
||||
|
||||
INCLUDES = $(all_includes)
|
||||
|
||||
kde_module_LTLIBRARIES = libkwinmodernsys_config.la
|
||||
|
|
|
@ -2,8 +2,9 @@
|
|||
// Melchior FRANZ <a8603365@unet.univie.ac.at> -- 2001-04-22
|
||||
|
||||
#include "config.h"
|
||||
#include <kconfig.h>
|
||||
#include <klocale.h>
|
||||
#include <qlayout.h>
|
||||
#include <qwhatsthis.h>
|
||||
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue