summaryrefslogtreecommitdiffstats
path: root/styles/phase/config/phasestyleconfig.cpp
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit8b2aa1b5301ab60368a03e36df4ff5216726e87d (patch)
tree36163d4ee667c23b5cf232df2f3004cd0a76202a /styles/phase/config/phasestyleconfig.cpp
downloadtdeartwork-8b2aa1b5301ab60368a03e36df4ff5216726e87d.tar.gz
tdeartwork-8b2aa1b5301ab60368a03e36df4ff5216726e87d.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeartwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'styles/phase/config/phasestyleconfig.cpp')
-rw-r--r--styles/phase/config/phasestyleconfig.cpp111
1 files changed, 111 insertions, 0 deletions
diff --git a/styles/phase/config/phasestyleconfig.cpp b/styles/phase/config/phasestyleconfig.cpp
new file mode 100644
index 00000000..8543214c
--- /dev/null
+++ b/styles/phase/config/phasestyleconfig.cpp
@@ -0,0 +1,111 @@
+//////////////////////////////////////////////////////////////////////////////
+// phasestyleconfig.cpp
+// -------------------
+// Config dialog for Phase widget style
+// -------------------
+// Copyright (c) 2004 David Johnson <david@usermode.org>
+// Please see the header file for copyright and license information.
+//////////////////////////////////////////////////////////////////////////////
+
+#include <qsettings.h>
+#include <qcheckbox.h>
+#include <qgroupbox.h>
+#include <qwhatsthis.h>
+#include <klocale.h>
+#include <kglobal.h>
+
+#include "phasestyleconfig.h"
+#include "styledialog.h"
+
+//////////////////////////////////////////////////////////////////////////////
+// PhaseStyleConfig Class //
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+// PhaseStyleConfig()
+// ----------------
+// Constructor
+
+PhaseStyleConfig::PhaseStyleConfig(QWidget* parent) : StyleDialog(parent)
+{
+ KGlobal::locale()->insertCatalogue("kstyle_phase_config");
+
+ QSettings settings;
+ oldgradients =
+ settings.readBoolEntry("/phasestyle/Settings/gradients", true);
+ gradients->setChecked(oldgradients);
+ oldhighlights =
+ settings.readBoolEntry("/phasestyle/Settings/highlights", true);
+ highlights->setChecked(oldhighlights);
+
+ // connections
+ connect(gradients, SIGNAL(toggled(bool)),
+ this, SLOT(updateChanged()));
+ connect(highlights, SIGNAL(toggled(bool)),
+ this, SLOT(updateChanged()));
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// ~PhaseStyleConfig()
+// -----------------
+// Destructor
+
+PhaseStyleConfig::~PhaseStyleConfig()
+{
+ KGlobal::locale()->removeCatalogue("kstyle_phase_config");
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// selectionChanged()
+// ------------------
+// Selection has changed
+
+void PhaseStyleConfig::updateChanged()
+{
+ bool update = false;
+
+ if ((gradients->isChecked() != oldgradients) ||
+ (highlights->isChecked() != oldhighlights)) {
+ update = true;
+ }
+
+ emit changed(update);
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// save()
+// ------
+// Save the settings
+
+void PhaseStyleConfig::save()
+{
+ QSettings settings;
+ settings.writeEntry("/phasestyle/Settings/gradients",
+ gradients->isChecked());
+ settings.writeEntry("/phasestyle/Settings/highlights",
+ highlights->isChecked());
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// defaults()
+// ----------
+// Set to the defaults
+
+void PhaseStyleConfig::defaults()
+{
+ gradients->setChecked(true);
+ highlights->setChecked(true);
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// Plugin Stuff //
+//////////////////////////////////////////////////////////////////////////////
+
+extern "C"
+{
+ KDE_EXPORT QObject* allocate_kstyle_config(QWidget* parent) {
+ return(new PhaseStyleConfig(parent));
+ }
+}
+
+#include "phasestyleconfig.moc"