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