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 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_quartz_config");
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
00046 load( conf );
00047
00048
00049 connect( cbColorBorder, SIGNAL(clicked()), this, SLOT(slotSelectionChanged()) );
00050
00051
00052 gb->show();
00053 }
00054
00055
00056 QuartzConfig::~QuartzConfig()
00057 {
00058 delete gb;
00059 delete quartzConfig;
00060 }
00061
00062
00063 void QuartzConfig::slotSelectionChanged()
00064 {
00065 emit changed();
00066 }
00067
00068
00069
00070
00071 void QuartzConfig::load( KConfig* )
00072 {
00073 quartzConfig->setGroup("General");
00074 bool override = quartzConfig->readBoolEntry( "UseTitleBarBorderColors", true );
00075 cbColorBorder->setChecked( override );
00076 }
00077
00078
00079
00080 void QuartzConfig::save( KConfig* )
00081 {
00082 quartzConfig->setGroup("General");
00083 quartzConfig->writeEntry( "UseTitleBarBorderColors", cbColorBorder->isChecked() );
00084
00085 quartzConfig->sync();
00086 }
00087
00088
00089
00090 void QuartzConfig::defaults()
00091 {
00092 cbColorBorder->setChecked( true );
00093 }
00094
00095 #include "config.moc"
00096
This file is part of the documentation for kwin Library Version 3.3.2.