summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/base
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/rbutilqt/base')
-rw-r--r--rbutil/rbutilqt/base/playerbuildinfo.cpp25
-rw-r--r--rbutil/rbutilqt/base/playerbuildinfo.h2
-rw-r--r--rbutil/rbutilqt/base/systeminfo.cpp20
-rw-r--r--rbutil/rbutilqt/base/systeminfo.h3
-rw-r--r--rbutil/rbutilqt/base/ttssapi.cpp11
5 files changed, 29 insertions, 32 deletions
diff --git a/rbutil/rbutilqt/base/playerbuildinfo.cpp b/rbutil/rbutilqt/base/playerbuildinfo.cpp
index f49917cfef..4310991f40 100644
--- a/rbutil/rbutilqt/base/playerbuildinfo.cpp
+++ b/rbutil/rbutilqt/base/playerbuildinfo.cpp
@@ -66,8 +66,10 @@ const static struct {
{ PlayerBuildInfo::Encoder, ":target:/encoder" },
{ PlayerBuildInfo::Brand, ":target:/brand" },
{ PlayerBuildInfo::PlayerPicture, ":target:/playerpic" },
- { PlayerBuildInfo::TargetNamesAll, "" },
- { PlayerBuildInfo::TargetNamesEnabled, "" },
+ { PlayerBuildInfo::TargetNamesAll, "_targets/all" },
+ { PlayerBuildInfo::TargetNamesEnabled, "_targets/enabled" },
+ { PlayerBuildInfo::LanguageInfo, "languages/:target:" },
+ { PlayerBuildInfo::LanguageList, "_languages/list" },
};
const static struct {
@@ -227,6 +229,25 @@ QVariant PlayerBuildInfo::value(DeviceInfo item, QString target)
result = targetNames(false);
break;
+ case LanguageList:
+ // Return a map (language, display string).
+ {
+ // need to use (QString, QVariant) here, so we can put the map into
+ // a QVariant by itself.
+ QMap<QString, QVariant> m;
+
+ playerInfo.beginGroup("languages");
+ QStringList a = playerInfo.childKeys();
+
+ for(int i = 0; i < a.size(); i++) {
+ QStringList v = playerInfo.value(a.at(i)).toStringList();
+ m[v.at(0)] = v.at(1);
+ }
+ playerInfo.endGroup();
+ result = m;
+ }
+ break;
+
default:
result = playerInfo.value(s);
break;
diff --git a/rbutil/rbutilqt/base/playerbuildinfo.h b/rbutil/rbutilqt/base/playerbuildinfo.h
index 5307148ff5..52654312a0 100644
--- a/rbutil/rbutilqt/base/playerbuildinfo.h
+++ b/rbutil/rbutilqt/base/playerbuildinfo.h
@@ -69,6 +69,8 @@ public:
TargetNamesAll,
TargetNamesEnabled,
+ LanguageInfo,
+ LanguageList,
};
enum SystemUrl {
diff --git a/rbutil/rbutilqt/base/systeminfo.cpp b/rbutil/rbutilqt/base/systeminfo.cpp
index 6717b120cc..2b39300930 100644
--- a/rbutil/rbutilqt/base/systeminfo.cpp
+++ b/rbutil/rbutilqt/base/systeminfo.cpp
@@ -38,26 +38,6 @@ void SystemInfo::ensureSystemInfoExists()
}
-QMap<QString, QStringList> SystemInfo::languages(bool namesOnly)
-{
- ensureSystemInfoExists();
-
- QMap<QString, QStringList> result;
- systemInfos->beginGroup("languages");
- QStringList a = systemInfos->childKeys();
- for(int i = 0; i < a.size(); i++)
- {
- QStringList data = systemInfos->value(a.at(i), "null").toStringList();
- if(namesOnly)
- result.insert(data.at(0), QStringList(data.at(1)));
- else
- result.insert(a.at(i), data);
- }
- systemInfos->endGroup();
- return result;
-}
-
-
QMap<int, QStringList> SystemInfo::usbIdMap(enum MapType type)
{
ensureSystemInfoExists();
diff --git a/rbutil/rbutilqt/base/systeminfo.h b/rbutil/rbutilqt/base/systeminfo.h
index d5a99082aa..5ca5b35885 100644
--- a/rbutil/rbutilqt/base/systeminfo.h
+++ b/rbutil/rbutilqt/base/systeminfo.h
@@ -34,9 +34,6 @@ class SystemInfo : public QObject
MapIncompatible,
};
- //! returns a map of all languages.
- //! Maps <language code> to (<language name>, <display name>)
- static QMap<QString, QStringList> languages(bool namesOnly = false);
//! returns a map of usb-ids and their targets
static QMap<int, QStringList> usbIdMap(enum MapType type);
//! get a value from system settings
diff --git a/rbutil/rbutilqt/base/ttssapi.cpp b/rbutil/rbutilqt/base/ttssapi.cpp
index f754f1a19b..ab972445f3 100644
--- a/rbutil/rbutilqt/base/ttssapi.cpp
+++ b/rbutil/rbutilqt/base/ttssapi.cpp
@@ -19,7 +19,7 @@
#include "ttssapi.h"
#include "utils.h"
#include "rbsettings.h"
-#include "systeminfo.h"
+#include "playerbuildinfo.h"
#include "Logger.h"
TTSSapi::TTSSapi(QObject* parent) : TTSBase(parent)
@@ -40,15 +40,12 @@ TTSBase::Capabilities TTSSapi::capabilities()
void TTSSapi::generateSettings()
{
// language
- QMap<QString, QStringList> languages = SystemInfo::languages();
- QStringList langs;
- for(int i = 0; i < languages.size(); ++i) {
- langs.append(languages.values().at(i).at(0));
- }
+ QMap<QString, QVariant> langmap = PlayerBuildInfo::instance()->value(
+ PlayerBuildInfo::LanguageList).toMap();
EncTtsSetting* setting = new EncTtsSetting(this,
EncTtsSetting::eSTRINGLIST, tr("Language:"),
RbSettings::subValue(m_TTSType, RbSettings::TtsLanguage),
- langs);
+ langmap.keys());
connect(setting,SIGNAL(dataChanged()),this,SLOT(updateVoiceList()));
insertSetting(eLANGUAGE,setting);
// voice