• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

KStyles

oxygenconf.cpp

Go to the documentation of this file.
00001 /*
00002 Copyright (C) 2003 Sandro Giessl <ceebx@users.sourceforge.net>
00003 
00004 based on the Keramik configuration dialog:
00005 Copyright (c) 2003 Maksim Orlovich <maksim.orlovich@kdemail.net>
00006 
00007 Permission is hereby granted, free of charge, to any person obtaining a
00008 copy of this software and associated documentation files (the "Software"),
00009 to deal in the Software without restriction, including without limitation
00010 the rights to use, copy, modify, merge, publish, distribute, sublicense,
00011 and/or sell copies of the Software, and to permit persons to whom the
00012 Software is furnished to do so, subject to the following conditions:
00013 
00014 The above copyright notice and this permission notice shall be included in
00015 all copies or substantial portions of the Software.
00016 
00017 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00018 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00019 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
00020 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00021 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
00022 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
00023 DEALINGS IN THE SOFTWARE.
00024 
00025 */
00026 
00027 #include "oxygenconf.h"
00028 
00029 #ifndef QT3_SUPPORT
00030 #define QT3_SUPPORT
00031 #endif
00032 #include <QtGui/QCheckBox>
00033 #include <QtGui/QLayout>
00034 #include <khbox.h>
00035 #include <QtCore/QSettings>
00036 #include <QtGui/QColor>
00037 #include <KGlobal>
00038 #include <KLocale>
00039 #include <KColorButton>
00040 #include <KComponentData>
00041 #include <KConfigGroup>
00042 #include <kdemacros.h>
00043 
00044 extern "C"
00045 {
00046     KDE_EXPORT QWidget* allocate_kstyle_config(QWidget* parent)
00047     {
00048         KGlobal::locale()->insertCatalog("kstyle_config");
00049         return new OxygenStyleConfig(parent);
00050     }
00051 }
00052 
00053 OxygenStyleConfig::OxygenStyleConfig(QWidget* parent): QWidget(parent)
00054 {
00055     config = KComponentData("oxygen").config();
00056     //Should have no margins here, the dialog provides them
00057     QVBoxLayout* layout = new QVBoxLayout(this);
00058     layout->setMargin(0);
00059     layout->setSpacing(0);
00060 
00061     KGlobal::locale()->insertCatalog("kstyle_config");
00062 
00063     //animateProgressBar = new QCheckBox(i18n("Animate progress bars"), this);
00064     drawToolBarItemSeparator = new QCheckBox(i18n("Draw toolbar item separators"), this);
00065     drawTriangularExpander = new QCheckBox(i18n("Triangular tree expander"), this);
00066 
00067     //layout->addWidget(animateProgressBar);
00068     layout->addWidget(drawToolBarItemSeparator);
00069     layout->addWidget(drawTriangularExpander);
00070     layout->addStretch(1);
00071 
00072     KConfigGroup cfg(config, "Style");
00073     //origAnimProgressBar = cfg.readEntry("AnimateProgressBar", false);
00074     //animateProgressBar->setChecked(origAnimProgressBar);
00075     origDrawToolBarItemSeparator = cfg.readEntry("DrawToolBarItemSeparator", true);
00076     drawToolBarItemSeparator->setChecked(origDrawToolBarItemSeparator);
00077     origDrawTriangularExpander = cfg.readEntry("DrawTriangularExpander", false);
00078     drawTriangularExpander->setChecked(origDrawTriangularExpander);
00079 
00080     //connect(animateProgressBar, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) );
00081     connect(drawToolBarItemSeparator, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) );
00082     connect(drawTriangularExpander, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) );
00083 }
00084 
00085 OxygenStyleConfig::~OxygenStyleConfig()
00086 {
00087 }
00088 
00089 
00090 void OxygenStyleConfig::save()
00091 {
00092     KConfigGroup cfg(config, "Style");
00093     //s.writeEntry("AnimateProgressBar", animateProgressBar->isChecked() ? true : false);
00094     cfg.writeEntry("DrawToolBarItemSeparator", drawToolBarItemSeparator->isChecked() ? true : false);
00095     cfg.writeEntry("DrawTriangularExpander", drawTriangularExpander->isChecked() ? true : false);
00096 }
00097 
00098 void OxygenStyleConfig::defaults()
00099 {
00100 //    animateProgressBar->setChecked(true);
00101     drawToolBarItemSeparator->setChecked(true);
00102     drawTriangularExpander->setChecked(false);
00103     //updateChanged would be done by setChecked already
00104 }
00105 
00106 void OxygenStyleConfig::updateChanged()
00107 {
00108     if (
00109         //(animateProgressBar->isChecked() == origAnimProgressBar) &&
00110         (drawToolBarItemSeparator->isChecked() == origDrawToolBarItemSeparator) &&
00111         (drawTriangularExpander->isChecked() == origDrawTriangularExpander)
00112         )
00113         emit changed(false);
00114     else
00115         emit changed(true);
00116 }
00117 
00118 #include "oxygenconf.moc"

KStyles

Skip menu "KStyles"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

API Reference

Skip menu "API Reference"
  • KCMShell
  • KNotify
  • KStyles
  • Nepomuk Daemons
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal