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