keramik/config/config.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include <kglobal.h>
00027 #include <klocale.h>
00028
00029 #include <qcheckbox.h>
00030
00031 #include "config.h"
00032 #include "config.moc"
00033
00034 extern "C"
00035 {
00036 KDE_EXPORT QObject* allocate_config( KConfig* conf, QWidget* parent )
00037 {
00038 return ( new KeramikConfig( conf, parent ) );
00039 }
00040 }
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051 KeramikConfig::KeramikConfig( KConfig* conf, QWidget* parent )
00052 : QObject( parent )
00053 {
00054 KGlobal::locale()->insertCatalogue("kwin_keramik_config");
00055 c = new KConfig( "kwinkeramikrc" );
00056
00057 ui = new KeramikConfigUI( parent );
00058 connect( ui->showAppIcons, SIGNAL(clicked()), SIGNAL(changed()) );
00059 connect( ui->smallCaptions, SIGNAL(clicked()), SIGNAL(changed()) );
00060 connect( ui->largeGrabBars, SIGNAL(clicked()), SIGNAL(changed()) );
00061 connect( ui->useShadowedText, SIGNAL(clicked()), SIGNAL(changed()) );
00062
00063 load( conf );
00064 ui->show();
00065 }
00066
00067
00068 KeramikConfig::~KeramikConfig()
00069 {
00070 delete ui;
00071 delete c;
00072 }
00073
00074
00075
00076
00077 void KeramikConfig::load( KConfig* )
00078 {
00079 c->setGroup("General");
00080 ui->showAppIcons->setChecked( c->readBoolEntry("ShowAppIcons", true) );
00081 ui->smallCaptions->setChecked( c->readBoolEntry("SmallCaptionBubbles", false) );
00082 ui->largeGrabBars->setChecked( c->readBoolEntry("LargeGrabBars", true) );
00083 ui->useShadowedText->setChecked( c->readBoolEntry("UseShadowedText", true) );
00084 }
00085
00086
00087
00088 void KeramikConfig::save( KConfig* )
00089 {
00090 c->setGroup( "General" );
00091 c->writeEntry( "ShowAppIcons", ui->showAppIcons->isChecked() );
00092 c->writeEntry( "SmallCaptionBubbles", ui->smallCaptions->isChecked() );
00093 c->writeEntry( "LargeGrabBars", ui->largeGrabBars->isChecked() );
00094 c->writeEntry( "UseShadowedText", ui->useShadowedText->isChecked() );
00095 c->sync();
00096 }
00097
00098
00099
00100 void KeramikConfig::defaults()
00101 {
00102 ui->showAppIcons->setChecked( true );
00103 ui->smallCaptions->setChecked( false );
00104 ui->largeGrabBars->setChecked( true );
00105 ui->useShadowedText->setChecked( true );
00106
00107 emit changed();
00108 }
00109
00110
This file is part of the documentation for kwin Library Version 3.3.90.