summaryrefslogtreecommitdiffstats
path: root/quanta/parts/kafka/kafkasyncoptions.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
commite9ae80694875f869892f13f4fcaf1170a00dea41 (patch)
treeaa2f8d8a217e2d376224c8d46b7397b68d35de2d /quanta/parts/kafka/kafkasyncoptions.cpp
downloadtdewebdev-e9ae80694875f869892f13f4fcaf1170a00dea41.tar.gz
tdewebdev-e9ae80694875f869892f13f4fcaf1170a00dea41.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/kdewebdev@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'quanta/parts/kafka/kafkasyncoptions.cpp')
-rw-r--r--quanta/parts/kafka/kafkasyncoptions.cpp85
1 files changed, 85 insertions, 0 deletions
diff --git a/quanta/parts/kafka/kafkasyncoptions.cpp b/quanta/parts/kafka/kafkasyncoptions.cpp
new file mode 100644
index 00000000..a355b99a
--- /dev/null
+++ b/quanta/parts/kafka/kafkasyncoptions.cpp
@@ -0,0 +1,85 @@
+/***************************************************************************
+ kafkasyncoptions.cpp
+ -------------------
+
+ copyright : (C) 2003 - Nicolas Deschildre
+ email : ndeschildre@kdewebdev.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <qradiobutton.h>
+#include <qcheckbox.h>
+#include <qspinbox.h>
+
+#include <kconfig.h>
+#include <kdebug.h>
+
+#include "kafkasyncoptions.h"
+#include "kafkasyncoptions.moc"
+
+KafkaSyncOptions::KafkaSyncOptions( KConfig *a_config, QWidget* parent, const char* name )
+ : KafkaSyncOptionsUI( parent, name )
+{
+ config = a_config;
+
+ config->setGroup("HTML Enhancer");
+ bool showIcons = config->readBoolEntry("Show Scripts Icons", true);
+
+ config->setGroup("Kafka Synchronization options");
+ QString sourceRefresh = config->readEntry("Source refresh", "delay");
+ int sourceRefreshDelay = config->readNumEntry("Source refresh delay", 500);
+ QString kafkaRefresh = config->readEntry("Kafka refresh", "focus");
+ int kafkaRefreshDelay = config->readNumEntry("Kafka refresh delay", 4000);
+
+ if ( !name )
+ setName( "kafkaSyncOptions" );
+
+ showScriptsIcon->setChecked(showIcons);
+
+ if(sourceRefresh == "focus")
+ sourceFocusRefresh->setChecked(true);
+ else if(sourceRefresh == "delay")
+ sourceDelayRefresh->setChecked(true);
+ sourceDelay->setValue(sourceRefreshDelay);
+
+ if(kafkaRefresh == "focus")
+ kafkaFocusRefresh->setChecked(true);
+ else if(kafkaRefresh == "delay")
+ kafkaDelayRefresh->setChecked(true);
+ kafkaDelay->setValue(kafkaRefreshDelay);
+}
+
+KafkaSyncOptions::~KafkaSyncOptions()
+{
+
+}
+
+
+void KafkaSyncOptions::updateConfig()
+{
+ config->setGroup("HTML Enhancer");
+ config->writeEntry("Show Scripts Icons", showScriptsIcon->isChecked());
+
+ config->setGroup("Kafka Synchronization options");
+ if(sourceFocusRefresh->isChecked())
+ config->writeEntry("Source refresh", "focus");
+ else if(sourceDelayRefresh->isChecked())
+ config->writeEntry("Source refresh", "delay");
+ config->writeEntry("Source refresh delay", sourceDelay->value());
+
+ if(kafkaFocusRefresh->isChecked())
+ config->writeEntry("Kafka refresh", "focus");
+ else if(kafkaDelayRefresh->isChecked())
+ config->writeEntry("Kafka refresh", "delay");
+ config->writeEntry("Kafka refresh delay", kafkaDelay->value());
+
+}
+