diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 4aed2c8219774f5d797760606b8489a92ddc5163 (patch) | |
tree | 3f8c130f7d269626bf6a9447407ef6c35954426a /kwin/clients/keramik/config | |
download | tdebase-4aed2c8219774f5d797760606b8489a92ddc5163.tar.gz tdebase-4aed2c8219774f5d797760606b8489a92ddc5163.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kwin/clients/keramik/config')
-rw-r--r-- | kwin/clients/keramik/config/Makefile.am | 13 | ||||
-rw-r--r-- | kwin/clients/keramik/config/config.cpp | 110 | ||||
-rw-r--r-- | kwin/clients/keramik/config/config.h | 57 | ||||
-rw-r--r-- | kwin/clients/keramik/config/keramikconfig.ui | 76 |
4 files changed, 256 insertions, 0 deletions
diff --git a/kwin/clients/keramik/config/Makefile.am b/kwin/clients/keramik/config/Makefile.am new file mode 100644 index 000000000..3021635ca --- /dev/null +++ b/kwin/clients/keramik/config/Makefile.am @@ -0,0 +1,13 @@ +INCLUDES = $(all_includes) + +kde_module_LTLIBRARIES = kwin_keramik_config.la + +kwin_keramik_config_la_SOURCES = config.cpp keramikconfig.ui +kwin_keramik_config_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module +kwin_keramik_config_la_LIBADD = $(LIB_KDEUI) + +METASOURCES = AUTO +noinst_HEADERS = config.h keramikconfig.h + +lnkdir = $(kde_datadir)/kwin + diff --git a/kwin/clients/keramik/config/config.cpp b/kwin/clients/keramik/config/config.cpp new file mode 100644 index 000000000..c548ca184 --- /dev/null +++ b/kwin/clients/keramik/config/config.cpp @@ -0,0 +1,110 @@ +/* + * + * Keramik KWin client configuration module + * + * Copyright (C) 2002 Fredrik Höglund <fredrik@kde.org> + * + * Based on the Quartz configuration module, + * Copyright (c) 2001 Karol Szwed <gallium@kde.org> + * + * 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; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include <kglobal.h> +#include <klocale.h> + +#include <qcheckbox.h> + +#include "config.h" +#include "config.moc" + +extern "C" +{ + KDE_EXPORT QObject* allocate_config( KConfig* conf, QWidget* parent ) + { + return ( new KeramikConfig( conf, parent ) ); + } +} + + +/* NOTE: + * 'conf' is a pointer to the kwindecoration modules open kwin config, + * and is by default set to the "Style" group. + * + * 'parent' is the parent of the QObject, which is a VBox inside the + * Configure tab in kwindecoration + */ + +KeramikConfig::KeramikConfig( KConfig* conf, QWidget* parent ) + : QObject( parent ) +{ + KGlobal::locale()->insertCatalogue("kwin_clients"); + c = new KConfig( "kwinkeramikrc" ); + + ui = new KeramikConfigUI( parent ); + connect( ui->showAppIcons, SIGNAL(clicked()), SIGNAL(changed()) ); + connect( ui->smallCaptions, SIGNAL(clicked()), SIGNAL(changed()) ); + connect( ui->largeGrabBars, SIGNAL(clicked()), SIGNAL(changed()) ); + connect( ui->useShadowedText, SIGNAL(clicked()), SIGNAL(changed()) ); + + load( conf ); + ui->show(); +} + + +KeramikConfig::~KeramikConfig() +{ + delete ui; + delete c; +} + + +// Loads the configurable options from the kwinrc config file +// It is passed the open config from kwindecoration to improve efficiency +void KeramikConfig::load( KConfig* ) +{ + c->setGroup("General"); + ui->showAppIcons->setChecked( c->readBoolEntry("ShowAppIcons", true) ); + ui->smallCaptions->setChecked( c->readBoolEntry("SmallCaptionBubbles", false) ); + ui->largeGrabBars->setChecked( c->readBoolEntry("LargeGrabBars", true) ); + ui->useShadowedText->setChecked( c->readBoolEntry("UseShadowedText", true) ); +} + + +// Saves the configurable options to the kwinrc config file +void KeramikConfig::save( KConfig* ) +{ + c->setGroup( "General" ); + c->writeEntry( "ShowAppIcons", ui->showAppIcons->isChecked() ); + c->writeEntry( "SmallCaptionBubbles", ui->smallCaptions->isChecked() ); + c->writeEntry( "LargeGrabBars", ui->largeGrabBars->isChecked() ); + c->writeEntry( "UseShadowedText", ui->useShadowedText->isChecked() ); + c->sync(); +} + + +// Sets UI widget defaults which must correspond to style defaults +void KeramikConfig::defaults() +{ + ui->showAppIcons->setChecked( true ); + ui->smallCaptions->setChecked( false ); + ui->largeGrabBars->setChecked( true ); + ui->useShadowedText->setChecked( true ); + + emit changed(); +} + +// vim: set noet ts=4 sw=4: diff --git a/kwin/clients/keramik/config/config.h b/kwin/clients/keramik/config/config.h new file mode 100644 index 000000000..71090531d --- /dev/null +++ b/kwin/clients/keramik/config/config.h @@ -0,0 +1,57 @@ +/* + * Keramik KWin client configuration module + * + * Copyright (C) 2002 Fredrik Höglund <fredrik@kde.org> + * + * Based on the Quartz configuration module, + * Copyright (c) 2001 Karol Szwed <gallium@kde.org> + * + * 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; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifndef __KWIN_KERAMIK_CONFIG_H +#define __KWIN_KERAMIK_CONFIG_H + +#include <kconfig.h> + +#include "keramikconfig.h" + +class KeramikConfig: public QObject +{ + Q_OBJECT + + public: + KeramikConfig( KConfig* conf, QWidget* parent ); + ~KeramikConfig(); + + // These public signals/slots work similar to KCM modules + signals: + void changed(); + + public slots: + void load( KConfig* conf ); + void save( KConfig* conf ); + void defaults(); + + private: + KeramikConfigUI *ui; + KConfig *c; +}; + + +#endif + +// vim: set noet ts=4 sw=4: diff --git a/kwin/clients/keramik/config/keramikconfig.ui b/kwin/clients/keramik/config/keramikconfig.ui new file mode 100644 index 000000000..f074a00b8 --- /dev/null +++ b/kwin/clients/keramik/config/keramikconfig.ui @@ -0,0 +1,76 @@ +<!DOCTYPE UI><UI version="3.1" stdsetdef="1"> +<class>KeramikConfigUI</class> +<widget class="QWidget"> + <property name="name"> + <cstring>KeramikConfigUI</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>287</width> + <height>102</height> + </rect> + </property> + <property name="caption"> + <string>Keramik</string> + </property> + <vbox> + <property name="margin"> + <cstring>0</cstring> + </property> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QCheckBox"> + <property name="name"> + <cstring>showAppIcons</cstring> + </property> + <property name="text"> + <string>Display the window &icon in the caption bubble</string> + </property> + <property name="whatsThis" stdset="0"> + <string>Check this option if you want the window icon to be displayed in the caption bubble next to the titlebar text.</string> + </property> + </widget> + <widget class="QCheckBox"> + <property name="name"> + <cstring>smallCaptions</cstring> + </property> + <property name="text"> + <string>Draw &small caption bubbles on active windows</string> + </property> + <property name="whatsThis" stdset="0"> + <string>Check this option if you want the caption bubble to have the same size on active windows that it has on inactive ones. This option is useful for laptops or low resolution displays where you want maximize the amount of space available to the window contents.</string> + </property> + </widget> + <widget class="QCheckBox"> + <property name="name"> + <cstring>largeGrabBars</cstring> + </property> + <property name="text"> + <string>Draw g&rab bars below windows</string> + </property> + <property name="whatsThis" stdset="0"> + <string>Check this option if you want a grab bar to be drawn below windows. When this option is not selected only a thin border will be drawn in its place.</string> + </property> + </widget> + <widget class="QCheckBox"> + <property name="name"> + <cstring>useShadowedText</cstring> + </property> + <property name="text"> + <string>Use shadowed &text</string> + </property> + <property name="whatsThis" stdset="0"> + <string>Check this option if you want the titlebar text to have a 3D look with a shadow behind it.</string> + </property> + </widget> + </vbox> +</widget> +<includes> + <include location="global" impldecl="in implementation">kdialog.h</include> +</includes> +<layoutdefaults spacing="6" margin="11"/> +<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/> +</UI> |