quartz/config/config.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #include "config.h"
00011 #include <kglobal.h>
00012 #include <qwhatsthis.h>
00013 #include <klocale.h>
00014
00015
00016 extern "C"
00017 {
00018 KDE_EXPORT QObject* allocate_config( KConfig* conf, QWidget* parent )
00019 {
00020 return(new QuartzConfig(conf, parent));
00021 }
00022 }
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 QuartzConfig::QuartzConfig( KConfig* conf, QWidget* parent )
00034 : QObject( parent )
00035 {
00036 quartzConfig = new KConfig("kwinquartzrc");
00037 KGlobal::locale()->insertCatalogue("kwin_clients");
00038 gb = new QVBox( parent );
00039 cbColorBorder = new QCheckBox(
00040 i18n("Draw window frames using &titlebar colors"), gb );
00041 QWhatsThis::add( cbColorBorder,
00042 i18n("When selected, the window decoration borders "
00043 "are drawn using the titlebar colors; otherwise, they are "
00044 "drawn using normal border colors instead.") );
00045 cbExtraSmall = new QCheckBox( i18n("Quartz &extra slim"), gb );
00046 QWhatsThis::add( cbExtraSmall,
00047 i18n("Quartz window decorations with extra-small title bar.") );
00048
00049 load( conf );
00050
00051
00052 connect( cbColorBorder, SIGNAL(clicked()), this, SLOT(slotSelectionChanged()) );
00053 connect( cbExtraSmall, SIGNAL(clicked()), this, SLOT(slotSelectionChanged()) );
00054
00055
00056 gb->show();
00057 }
00058
00059
00060 QuartzConfig::~QuartzConfig()
00061 {
00062 delete gb;
00063 delete quartzConfig;
00064 }
00065
00066
00067 void QuartzConfig::slotSelectionChanged()
00068 {
00069 emit changed();
00070 }
00071
00072
00073
00074
00075 void QuartzConfig::load( KConfig* )
00076 {
00077 quartzConfig->setGroup("General");
00078 bool override = quartzConfig->readBoolEntry( "UseTitleBarBorderColors", true );
00079 cbColorBorder->setChecked( override );
00080 override = quartzConfig->readBoolEntry( "UseQuartzExtraSlim", false );
00081 cbExtraSmall->setChecked( override );
00082 }
00083
00084
00085
00086 void QuartzConfig::save( KConfig* )
00087 {
00088 quartzConfig->setGroup("General");
00089 quartzConfig->writeEntry( "UseTitleBarBorderColors", cbColorBorder->isChecked() );
00090 quartzConfig->writeEntry( "UseQuartzExtraSlim", cbExtraSmall->isChecked() );
00091
00092 quartzConfig->sync();
00093 }
00094
00095
00096
00097 void QuartzConfig::defaults()
00098 {
00099 cbColorBorder->setChecked( true );
00100 cbExtraSmall->setChecked( false );
00101 }
00102
00103 #include "config.moc"
00104
This file is part of the documentation for kwin Library Version 3.4.1.