3 * Keramik KWin client configuration module
5 * Copyright (C) 2002 Fredrik Höglund <fredrik@kde.org>
7 * Based on the Quartz configuration module,
8 * Copyright (c) 2001 Karol Szwed <gallium@kde.org>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the license, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; see the file COPYING. If not, write to
22 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 * Boston, MA 02110-1301, USA.
37 KDE_EXPORT QObject
* allocate_config( KConfig
* conf
, QWidget
* parent
)
39 return ( new KeramikConfig( conf
, parent
) );
45 * 'conf' is a pointer to the kwindecoration modules open kwin config,
46 * and is by default set to the "Style" group.
48 * 'parent' is the parent of the QObject, which is a VBox inside the
49 * Configure tab in kwindecoration
52 KeramikConfig::KeramikConfig( KConfig
* conf
, QWidget
* parent
)
55 KGlobal::locale()->insertCatalog("kwin_clients");
56 c
= new KConfig( "kwinkeramikrc" );
57 KConfigGroup
cg(c
, "General");
58 ui
= new KeramikConfigUI( parent
);
59 connect( ui
->showAppIcons
, SIGNAL(clicked()), SIGNAL(changed()) );
60 connect( ui
->smallCaptions
, SIGNAL(clicked()), SIGNAL(changed()) );
61 connect( ui
->largeGrabBars
, SIGNAL(clicked()), SIGNAL(changed()) );
62 connect( ui
->useShadowedText
, SIGNAL(clicked()), SIGNAL(changed()) );
69 KeramikConfig::~KeramikConfig()
76 // Loads the configurable options from the kwinrc config file
77 // It is passed the open config from kwindecoration to improve efficiency
78 void KeramikConfig::load( const KConfigGroup
& )
80 KConfigGroup
cg(c
, "General");
81 ui
->showAppIcons
->setChecked( cg
.readEntry("ShowAppIcons", true) );
82 ui
->smallCaptions
->setChecked( cg
.readEntry("SmallCaptionBubbles", false) );
83 ui
->largeGrabBars
->setChecked( cg
.readEntry("LargeGrabBars", true) );
84 ui
->useShadowedText
->setChecked( cg
.readEntry("UseShadowedText", true) );
88 // Saves the configurable options to the kwinrc config file
89 void KeramikConfig::save( KConfigGroup
& )
91 KConfigGroup
cg(c
, "General");
92 cg
.writeEntry( "ShowAppIcons", ui
->showAppIcons
->isChecked() );
93 cg
.writeEntry( "SmallCaptionBubbles", ui
->smallCaptions
->isChecked() );
94 cg
.writeEntry( "LargeGrabBars", ui
->largeGrabBars
->isChecked() );
95 cg
.writeEntry( "UseShadowedText", ui
->useShadowedText
->isChecked() );
100 // Sets UI widget defaults which must correspond to style defaults
101 void KeramikConfig::defaults()
103 ui
->showAppIcons
->setChecked( true );
104 ui
->smallCaptions
->setChecked( false );
105 ui
->largeGrabBars
->setChecked( true );
106 ui
->useShadowedText
->setChecked( true );
111 // vim: set noet ts=4 sw=4: