• Skip to content
  • Skip to link menu
KDE 4.2 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 <QtGui/QColor>
00036 #include <KGlobal>
00037 #include <KLocale>
00038 #include <KColorButton>
00039 #include <KComponentData>
00040 #include <KConfigGroup>
00041 #include <kdemacros.h>
00042 
00043 extern "C"
00044 {
00045     KDE_EXPORT QWidget* allocate_kstyle_config(QWidget* parent)
00046     {
00047         KGlobal::locale()->insertCatalog("kstyle_config");
00048         return new OxygenStyleConfig(parent);
00049     }
00050 }
00051 
00052 OxygenStyleConfig::OxygenStyleConfig(QWidget* parent): QWidget(parent)
00053 {
00054     config = KComponentData("oxygen").config();
00055     //Should have no margins here, the dialog provides them
00056     QVBoxLayout* layout = new QVBoxLayout(this);
00057     layout->setMargin(0);
00058     layout->setSpacing(0);
00059 
00060     KGlobal::locale()->insertCatalog("kstyle_config");
00061 
00062     //animateProgressBar = new QCheckBox(i18n("Animate progress bars"), this);
00063     drawToolBarItemSeparator = new QCheckBox(i18n("Draw toolbar item separators"), this);
00064     drawTriangularExpander = new QCheckBox(i18n("Triangular tree expander"), this);
00065 
00066     //layout->addWidget(animateProgressBar);
00067     layout->addWidget(drawToolBarItemSeparator);
00068     layout->addWidget(drawTriangularExpander);
00069     layout->addStretch(1);
00070 
00071     KConfigGroup cfg(config, "Style");
00072     //origAnimProgressBar = cfg.readEntry("AnimateProgressBar", false);
00073     //animateProgressBar->setChecked(origAnimProgressBar);
00074     origDrawToolBarItemSeparator = cfg.readEntry("DrawToolBarItemSeparator", true);
00075     drawToolBarItemSeparator->setChecked(origDrawToolBarItemSeparator);
00076     origDrawTriangularExpander = cfg.readEntry("DrawTriangularExpander", false);
00077     drawTriangularExpander->setChecked(origDrawTriangularExpander);
00078 
00079     //connect(animateProgressBar, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) );
00080     connect(drawToolBarItemSeparator, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) );
00081     connect(drawTriangularExpander, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) );
00082 }
00083 
00084 OxygenStyleConfig::~OxygenStyleConfig()
00085 {
00086 }
00087 
00088 
00089 void OxygenStyleConfig::save()
00090 {
00091     KConfigGroup cfg(config, "Style");
00092     //s.writeEntry("AnimateProgressBar", animateProgressBar->isChecked() ? true : false);
00093     cfg.writeEntry("DrawToolBarItemSeparator", drawToolBarItemSeparator->isChecked() ? true : false);
00094     cfg.writeEntry("DrawTriangularExpander", drawTriangularExpander->isChecked() ? true : false);
00095 }
00096 
00097 void OxygenStyleConfig::defaults()
00098 {
00099 //    animateProgressBar->setChecked(true);
00100     drawToolBarItemSeparator->setChecked(true);
00101     drawTriangularExpander->setChecked(false);
00102     //updateChanged would be done by setChecked already
00103 }
00104 
00105 void OxygenStyleConfig::updateChanged()
00106 {
00107     if (
00108         //(animateProgressBar->isChecked() == origAnimProgressBar) &&
00109         (drawToolBarItemSeparator->isChecked() == origDrawToolBarItemSeparator) &&
00110         (drawTriangularExpander->isChecked() == origDrawTriangularExpander)
00111         )
00112         emit changed(false);
00113     else
00114         emit changed(true);
00115 }
00116 
00117 #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.7
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