1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
9 * Copyright (C) 2007 by Dominik Wenger
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
29 class RbSettings
: public QObject
33 //! Type of requested usb-id map
72 //! All system settings
99 //! call this to flush the user Settings
101 //! returns the filename of the usersettings file
102 static QString
userSettingFilename();
103 //! return a list of all platforms (rbutil internal names)
104 static QStringList
platforms(void);
105 //! returns a list of all languages
106 static QStringList
languages(void);
107 //! maps a platform to its name
108 static QString
name(QString plattform
);
109 //! maps a platform to its brand
110 static QString
brand(QString plattform
);
111 //! returns a map of usb-ids and their targets
112 static QMap
<int, QString
> usbIdMap(enum MapType
);
113 //! get a value from system settings
114 static QVariant
value(enum SystemSettings setting
);
115 //! get a value from user settings
116 static QVariant
value(enum UserSettings setting
);
117 //! set a user setting value
118 static void setValue(enum UserSettings setting
, QVariant value
);
119 //! get a user setting from a subvalue (ie for encoders and tts engines)
120 static QVariant
subValue(QString sub
, enum UserSettings setting
);
121 //! set a user setting from a subvalue (ie for encoders and tts engines)
122 static void setSubValue(QString sub
, enum UserSettings setting
, QVariant value
);
123 //! get a value from system settings for a named platform.
124 static QVariant
platformValue(QString platform
, enum SystemSettings setting
);
127 //! you shouldnt call this, its a fully static calls
129 //! create the setting objects if neccessary
130 static void ensureRbSettingsExists();
131 //! create a settings path, substitute platform, tts and encoder
132 static QString
constructSettingPath(QString path
, QString substitute
= QString());
134 //! pointers to our setting objects
135 static QSettings
*systemSettings
;
136 static QSettings
*userSettings
;