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