summaryrefslogtreecommitdiffstats
path: root/noatun/modules/voiceprint/prefs.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
commite2de64d6f1beb9e492daf5b886e19933c1fa41dd (patch)
tree9047cf9e6b5c43878d5bf82660adae77ceee097a /noatun/modules/voiceprint/prefs.cpp
downloadtdemultimedia-e2de64d6f1beb9e492daf5b886e19933c1fa41dd.tar.gz
tdemultimedia-e2de64d6f1beb9e492daf5b886e19933c1fa41dd.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/kdemultimedia@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'noatun/modules/voiceprint/prefs.cpp')
-rw-r--r--noatun/modules/voiceprint/prefs.cpp67
1 files changed, 67 insertions, 0 deletions
diff --git a/noatun/modules/voiceprint/prefs.cpp b/noatun/modules/voiceprint/prefs.cpp
new file mode 100644
index 00000000..48998680
--- /dev/null
+++ b/noatun/modules/voiceprint/prefs.cpp
@@ -0,0 +1,67 @@
+#include "prefs.h"
+#include "voiceprint.h"
+
+#include <klocale.h>
+#include <kglobal.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <kcolorbutton.h>
+#include <kconfig.h>
+
+Prefs::Prefs(QObject* parent)
+ : CModule(i18n("Voiceprint"), i18n("Options for the Voiceprint Visualization"), "xapp", parent)
+{
+ QVBoxLayout *king=new QVBoxLayout(this);
+ QHBoxLayout *minor;
+
+ QLabel *label;
+ mForeground=new KColorButton(this);
+ label=new QLabel(mForeground, i18n("&Foreground color:"), this);
+ minor=new QHBoxLayout(king);
+ minor->addWidget(label);
+ minor->addWidget(mForeground);
+
+ mBackground=new KColorButton(this);
+ label=new QLabel(mBackground, i18n("&Background color:"), this);
+ minor=new QHBoxLayout(king);
+ minor->addWidget(label);
+ minor->addWidget(mBackground);
+
+ mLine=new KColorButton(this);
+ label=new QLabel(mForeground, i18n("&Sweep color:"), this);
+ minor=new QHBoxLayout(king);
+ minor->addWidget(label);
+ minor->addWidget(mLine);
+
+ king->addStretch();
+}
+
+void Prefs::reopen()
+{
+ KConfig *config=KGlobal::config();
+ config->setGroup("VoicePrint");
+ QColor black(0, 0, 0);
+ QColor blue(0, 0, 222);
+ mBackground->setColor(config->readColorEntry("Background", &black));
+ mForeground->setColor(config->readColorEntry("Foreground", &blue));
+ mLine->setColor(config->readColorEntry("Line", &black));
+}
+
+void Prefs::save()
+{
+ KConfig *config=KGlobal::config();
+ config->setGroup("VoicePrint");
+ config->writeEntry("Background", mBackground->color());
+ config->writeEntry("Foreground", mForeground->color());
+ config->writeEntry("Line", mLine->color());
+
+ config->sync();
+
+ VoicePrint *l=VoicePrint::voicePrint;
+ if (l)
+ l->setColors(mBackground->color(), mForeground->color(), mLine->color());
+
+}
+
+#include "prefs.moc"
+