diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 84da08d7b7fcda12c85caeb5a10b4903770a6f69 (patch) | |
tree | 2a6aea76f2dfffb4cc04bb907c4725af94f70e72 /kicker-applets/mediacontrol/configfrontend.cpp | |
download | tdeaddons-84da08d7b7fcda12c85caeb5a10b4903770a6f69.tar.gz tdeaddons-84da08d7b7fcda12c85caeb5a10b4903770a6f69.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/kdeaddons@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kicker-applets/mediacontrol/configfrontend.cpp')
-rw-r--r-- | kicker-applets/mediacontrol/configfrontend.cpp | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/kicker-applets/mediacontrol/configfrontend.cpp b/kicker-applets/mediacontrol/configfrontend.cpp new file mode 100644 index 0000000..ba206c8 --- /dev/null +++ b/kicker-applets/mediacontrol/configfrontend.cpp @@ -0,0 +1,99 @@ +/*************************************************************************** + provides access to mediacontrol configuration file + ------------------- + begin : forgot :/ + copyright : (C) 2000-2002 by Stefan Gehn + email : metz {AT} gehn {DOT} net + + code-skeleton taken from knewsticker which is + Copyright (c) Frerich Raabe <raabe@kde.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 "configfrontend.h" +// #include <kdebug.h> + +ConfigFrontend::ConfigFrontend() : QObject(0, 0) +{ + _config = new KConfig(QString::null, true, false); + _ownConfig = true; +} + +ConfigFrontend::~ConfigFrontend() +{ + if (_ownConfig) + { + delete _config; + } +} + +ConfigFrontend::ConfigFrontend(KConfig *config) : QObject(0, 0) +{ + _config = config; + _config->setGroup("MediaControl"); + _ownConfig = false; +} + +// ==================================================================================== + +uint ConfigFrontend::mouseWheelSpeed() const +{ + return _config->readNumEntry("Mouse wheel speed", 5); +} + +void ConfigFrontend::setMouseWheelSpeed(const uint mouseWheelSpeed) +{ + _config->writeEntry("Mouse wheel speed", mouseWheelSpeed); + _config->sync(); +} + +// ==================================================================================== + +QString ConfigFrontend::player() const +{ + return _config->readPathEntry("Player", "Noatun"); +} + +void ConfigFrontend::setPlayer(const QString &player) +{ + _config->writePathEntry("Player", player); + _config->sync(); +} + +// ==================================================================================== + +QString ConfigFrontend::theme() const +{ + return _config->readEntry("Theme", "default"); +} + +void ConfigFrontend::setTheme(const QString &theme) +{ + _config->writeEntry("Theme", theme); + _config->sync(); +} + +// ==================================================================================== + +bool ConfigFrontend::useCustomTheme() const +{ + return _config->readBoolEntry("UseCustomTheme", false); +} + +void ConfigFrontend::setUseCustomTheme(const bool use) +{ + _config->writeEntry("UseCustomTheme", use); + _config->sync(); +} + +// ==================================================================================== + +#include "configfrontend.moc" |