You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tdeaddons/kicker-applets/mediacontrol/configfrontend.cpp

100 lines
2.9 KiB

/***************************************************************************
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() : TQObject(0, 0)
{
_config = new TDEConfig(TQString(), true, false);
_ownConfig = true;
}
ConfigFrontend::~ConfigFrontend()
{
if (_ownConfig)
{
delete _config;
}
}
ConfigFrontend::ConfigFrontend(TDEConfig *config) : TQObject(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();
}
// ====================================================================================
TQString ConfigFrontend::player() const
{
return _config->readPathEntry("Player", "Noatun");
}
void ConfigFrontend::setPlayer(const TQString &player)
{
_config->writePathEntry("Player", player);
_config->sync();
}
// ====================================================================================
TQString ConfigFrontend::theme() const
{
return _config->readEntry("Theme", "default");
}
void ConfigFrontend::setTheme(const TQString &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"