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 <kdialog.h>
00015 #include <klocale.h>
00016 #include <qpixmap.h>
00017 #include <qvbox.h>
00018
00019 extern "C"
00020 {
00021 QObject* allocate_config( KConfig* conf, QWidget* parent )
00022 {
00023 return(new KDEDefaultConfig(conf, parent));
00024 }
00025 }
00026
00027
00028
00029
00030
00031
00032
00033 KDEDefaultConfig::KDEDefaultConfig( KConfig* conf, QWidget* parent )
00034 : QObject( parent )
00035 {
00036 KGlobal::locale()->insertCatalogue("kwin_default_config");
00037 highcolor = QPixmap::defaultDepth() > 8;
00038 gb = new QVBox( parent );
00039 gb->setSpacing( KDialog::spacingHint() );
00040
00041 cbShowStipple = new QCheckBox( i18n("Draw titlebar &stipple effect"), gb );
00042 QWhatsThis::add( cbShowStipple,
00043 i18n("When selected, active titlebars are drawn "
00044 "with a stipple (dotted) effect. Otherwise, they are "
00045 "drawn without the stipple."));
00046
00047 cbShowGrabBar = new QCheckBox( i18n("Draw g&rab bar below windows"), gb );
00048 QWhatsThis::add( cbShowGrabBar,
00049 i18n("When selected, decorations are drawn with a \"grab bar\" "
00050 "below windows. Otherwise, no grab bar is drawn."));
00051
00052
00053 if (highcolor)
00054 {
00055 cbUseGradients = new QCheckBox( i18n("Draw &gradients"), gb );
00056 QWhatsThis::add( cbUseGradients,
00057 i18n("When selected, decorations are drawn with gradients "
00058 "for highcolor displays, otherwise no gradients are drawn.") );
00059 }
00060
00061
00062 load( conf );
00063
00064
00065 connect( cbShowStipple, SIGNAL(clicked()),
00066 this, SLOT(slotSelectionChanged()) );
00067 connect( cbShowGrabBar, SIGNAL(clicked()),
00068 this, SLOT(slotSelectionChanged()) );
00069 if (highcolor)
00070 connect( cbUseGradients, SIGNAL(clicked()),
00071 this, SLOT(slotSelectionChanged()) );
00072
00073
00074 gb->show();
00075 }
00076
00077
00078 KDEDefaultConfig::~KDEDefaultConfig()
00079 {
00080 delete gb;
00081 }
00082
00083
00084 void KDEDefaultConfig::slotSelectionChanged()
00085 {
00086 emit changed();
00087 }
00088
00089
00090
00091
00092 void KDEDefaultConfig::load( KConfig* conf )
00093 {
00094 conf->setGroup("KDEDefault");
00095 bool override = conf->readBoolEntry( "ShowTitleBarStipple", true );
00096 cbShowStipple->setChecked( override );
00097
00098 override = conf->readBoolEntry( "ShowGrabBar", true );
00099 cbShowGrabBar->setChecked( override );
00100
00101 if (highcolor) {
00102 override = conf->readBoolEntry( "UseGradients", true );
00103 cbUseGradients->setChecked( override );
00104 }
00105 }
00106
00107
00108
00109 void KDEDefaultConfig::save( KConfig* conf )
00110 {
00111 conf->setGroup("KDEDefault");
00112 conf->writeEntry( "ShowTitleBarStipple", cbShowStipple->isChecked() );
00113 conf->writeEntry( "ShowGrabBar", cbShowGrabBar->isChecked() );
00114
00115 if (highcolor)
00116 conf->writeEntry( "UseGradients", cbUseGradients->isChecked() );
00117
00118 }
00119
00120
00121
00122 void KDEDefaultConfig::defaults()
00123 {
00124 cbShowStipple->setChecked( true );
00125 cbShowGrabBar->setChecked( true );
00126
00127 if (highcolor)
00128 cbUseGradients->setChecked( true );
00129 }
00130
00131 #include "config.moc"
00132
This file is part of the documentation for kwin Library Version 3.2.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Mar 5 04:41:13 2004 by
doxygen 1.3.6-20040222 written by
Dimitri van Heesch, © 1997-2003