2010-01-24 21:12:11 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
*
|
|
|
|
* Copyright (C) 2010 by Dominik Wenger
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef SYSTEMINFO_H
|
|
|
|
#define SYSTEMINFO_H
|
|
|
|
|
|
|
|
#include <QtCore>
|
|
|
|
|
|
|
|
class SystemInfo : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
//! Type of requested usb-id map
|
|
|
|
enum MapType {
|
|
|
|
MapDevice,
|
|
|
|
MapError,
|
|
|
|
MapIncompatible,
|
|
|
|
};
|
2011-02-04 23:28:34 +00:00
|
|
|
|
2020-11-13 20:53:53 +00:00
|
|
|
enum BuildType {
|
|
|
|
BuildCurrent,
|
|
|
|
BuildDaily,
|
|
|
|
BuildRelease,
|
|
|
|
BuildCandidate
|
|
|
|
};
|
|
|
|
|
2010-01-24 21:12:11 +00:00
|
|
|
//! All system settings
|
|
|
|
enum SystemInfos {
|
2020-11-13 20:53:53 +00:00
|
|
|
BuildUrl,
|
|
|
|
FontUrl,
|
|
|
|
VoiceUrl,
|
2010-01-24 21:12:11 +00:00
|
|
|
ManualUrl,
|
|
|
|
BootloaderUrl,
|
|
|
|
BootloaderInfoUrl,
|
|
|
|
DoomUrl,
|
2019-10-30 05:17:16 +00:00
|
|
|
Duke3DUrl,
|
|
|
|
QuakeUrl,
|
|
|
|
PuzzFontsUrl,
|
|
|
|
Wolf3DUrl,
|
|
|
|
XWorldUrl,
|
2010-01-24 21:12:11 +00:00
|
|
|
ReleaseUrl,
|
2012-06-02 22:50:01 +00:00
|
|
|
BuildInfoUrl,
|
2010-01-24 21:12:11 +00:00
|
|
|
GenlangUrl,
|
|
|
|
ThemesUrl,
|
2010-06-02 21:55:22 +00:00
|
|
|
ThemesInfoUrl,
|
2010-01-24 21:12:11 +00:00
|
|
|
RbutilUrl,
|
2020-11-14 15:23:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum PlatformInfo {
|
2020-11-14 15:33:48 +00:00
|
|
|
Manual,
|
|
|
|
BootloaderMethod,
|
|
|
|
BootloaderName,
|
|
|
|
BootloaderFile,
|
|
|
|
BootloaderFilter,
|
|
|
|
Encoder,
|
|
|
|
Brand,
|
|
|
|
Name,
|
|
|
|
PlayerPicture,
|
2010-01-24 21:12:11 +00:00
|
|
|
};
|
|
|
|
|
2010-01-31 21:57:45 +00:00
|
|
|
enum PlatformType {
|
|
|
|
PlatformAll,
|
2010-02-04 21:10:20 +00:00
|
|
|
PlatformAllDisabled,
|
2010-01-31 21:57:45 +00:00
|
|
|
PlatformBase,
|
2010-02-12 20:38:17 +00:00
|
|
|
PlatformBaseDisabled,
|
|
|
|
PlatformVariant,
|
|
|
|
PlatformVariantDisabled
|
2010-01-31 21:57:45 +00:00
|
|
|
};
|
|
|
|
|
2010-01-24 21:12:11 +00:00
|
|
|
//! return a list of all platforms (rbutil internal names)
|
2010-01-31 21:57:45 +00:00
|
|
|
static QStringList platforms(enum PlatformType type = PlatformAll,
|
|
|
|
QString variant="");
|
2020-11-21 18:33:29 +00:00
|
|
|
//! returns a map of all languages.
|
|
|
|
//! Maps <language code> to (<language name>, <display name>)
|
|
|
|
static QMap<QString, QStringList> languages(bool namesOnly = false);
|
2010-01-24 21:12:11 +00:00
|
|
|
//! returns a map of usb-ids and their targets
|
2012-10-06 08:44:56 +00:00
|
|
|
static QMap<int, QStringList> usbIdMap(enum MapType type);
|
2010-01-24 21:12:11 +00:00
|
|
|
//! get a value from system settings
|
2020-11-13 20:53:53 +00:00
|
|
|
static QVariant value(enum SystemInfos info, BuildType type = BuildCurrent);
|
2010-01-24 21:12:11 +00:00
|
|
|
//! get a value from system settings for a named platform.
|
2020-11-14 15:23:56 +00:00
|
|
|
static QVariant platformValue(enum PlatformInfo info, QString platform = "");
|
2010-01-24 21:12:11 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
//! you shouldnt call this, its a fully static calls
|
|
|
|
SystemInfo() {}
|
|
|
|
//! create the setting objects if neccessary
|
|
|
|
static void ensureSystemInfoExists();
|
|
|
|
//! pointers to our setting objects
|
|
|
|
static QSettings *systemInfos;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|