summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/base
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2020-11-21 19:33:29 +0100
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2020-11-22 14:43:01 +0100
commitc2dacf6736dfcde92a4ed947f06fd85c6b2087d4 (patch)
tree470852777cef90f4a2f1fb9a463653955261fcff /rbutil/rbutilqt/base
parentad37655687cd4861681e561b2a84fabb5c307327 (diff)
downloadrockbox-c2dacf6736dfcde92a4ed947f06fd85c6b2087d4.tar.gz
rockbox-c2dacf6736dfcde92a4ed947f06fd85c6b2087d4.zip
rbutil: Add voice installation to main widget.
Add checkbox for installing the prerendered voice file to the main install widget. Current limitations: - only english for now. The available languages are available from the build server but are not yet taken into account. - only for releases. This is the same limitations we had before. We do have voices for daily builds, but that requires adding daily builds again (those have been removed some time back.) - Old voice installation dialog still present. Change-Id: Ia6443b0f15365196df86cc1b64d5e043dff70c4c
Diffstat (limited to 'rbutil/rbutilqt/base')
-rw-r--r--rbutil/rbutilqt/base/rbsettings.cpp1
-rw-r--r--rbutil/rbutilqt/base/rbsettings.h1
-rw-r--r--rbutil/rbutilqt/base/systeminfo.cpp8
-rw-r--r--rbutil/rbutilqt/base/systeminfo.h5
4 files changed, 11 insertions, 4 deletions
diff --git a/rbutil/rbutilqt/base/rbsettings.cpp b/rbutil/rbutilqt/base/rbsettings.cpp
index 827c0f96fd..5baa53bee0 100644
--- a/rbutil/rbutilqt/base/rbsettings.cpp
+++ b/rbutil/rbutilqt/base/rbsettings.cpp
@@ -47,6 +47,7 @@ const static struct {
{ RbSettings::InstallFonts, "install_fonts", "true" },
{ RbSettings::InstallThemes, "install_themes", "false" },
{ RbSettings::InstallGamefiles, "install_gamefiles", "true" },
+ { RbSettings::InstallVoice, "install_voice", "false" },
#if defined(Q_OS_WIN32)
{ RbSettings::Tts, "tts", "sapi" },
#elif defined(Q_OS_MACX)
diff --git a/rbutil/rbutilqt/base/rbsettings.h b/rbutil/rbutilqt/base/rbsettings.h
index 7406aab1ad..a25eabbcee 100644
--- a/rbutil/rbutilqt/base/rbsettings.h
+++ b/rbutil/rbutilqt/base/rbsettings.h
@@ -46,6 +46,7 @@ class RbSettings : public QObject
InstallFonts,
InstallThemes,
InstallGamefiles,
+ InstallVoice,
Tts,
UseTtsCorrections,
TalkFolders,
diff --git a/rbutil/rbutilqt/base/systeminfo.cpp b/rbutil/rbutilqt/base/systeminfo.cpp
index 2aece49110..2ad3c7a7d4 100644
--- a/rbutil/rbutilqt/base/systeminfo.cpp
+++ b/rbutil/rbutilqt/base/systeminfo.cpp
@@ -159,7 +159,7 @@ QStringList SystemInfo::platforms(enum SystemInfo::PlatformType type, QString va
return result;
}
-QMap<QString, QStringList> SystemInfo::languages(void)
+QMap<QString, QStringList> SystemInfo::languages(bool namesOnly)
{
ensureSystemInfoExists();
@@ -168,7 +168,11 @@ QMap<QString, QStringList> SystemInfo::languages(void)
QStringList a = systemInfos->childKeys();
for(int i = 0; i < a.size(); i++)
{
- result.insert(a.at(i), systemInfos->value(a.at(i), "null").toStringList());
+ 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;
diff --git a/rbutil/rbutilqt/base/systeminfo.h b/rbutil/rbutilqt/base/systeminfo.h
index 12b9eb4bfb..9bcfe6d253 100644
--- a/rbutil/rbutilqt/base/systeminfo.h
+++ b/rbutil/rbutilqt/base/systeminfo.h
@@ -90,8 +90,9 @@ class SystemInfo : public QObject
//! return a list of all platforms (rbutil internal names)
static QStringList platforms(enum PlatformType type = PlatformAll,
QString variant="");
- //! returns a map of all languages
- static QMap<QString, QStringList> languages(void);
+ //! 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