rbutil: Add MIDI patchset to plugin data installation.

Add installing the MIDI patchset, and subsequently rename from Game
Files to Plugin Data Files.

Change-Id: Ib71ce4c8992ffc9185d961a60296c9671ebc9709
This commit is contained in:
Dominik Riebeling 2020-12-04 21:26:19 +01:00
parent 7739bb31b3
commit c51c6c1eb3
5 changed files with 29 additions and 28 deletions

View file

@ -46,7 +46,7 @@ const static struct {
{ RbSettings::InstallRockbox, "install_rockbox", "true" },
{ RbSettings::InstallFonts, "install_fonts", "true" },
{ RbSettings::InstallThemes, "install_themes", "false" },
{ RbSettings::InstallGamefiles, "install_gamefiles", "true" },
{ RbSettings::InstallPluginData, "install_plugin_data", "true" },
{ RbSettings::InstallVoice, "install_voice", "false" },
{ RbSettings::InstallManual, "install_manual", "false" },
#if defined(Q_OS_WIN32)

View file

@ -45,7 +45,7 @@ class RbSettings : public QObject
InstallRockbox,
InstallFonts,
InstallThemes,
InstallGamefiles,
InstallPluginData,
InstallVoice,
InstallManual,
Tts,

View file

@ -38,7 +38,7 @@ SelectiveInstallWidget::SelectiveInstallWidget(QWidget* parent) : QWidget(parent
ui.rockboxCheckbox->setChecked(RbSettings::value(RbSettings::InstallRockbox).toBool());
ui.fontsCheckbox->setChecked(RbSettings::value(RbSettings::InstallFonts).toBool());
ui.themesCheckbox->setChecked(RbSettings::value(RbSettings::InstallThemes).toBool());
ui.gamefileCheckbox->setChecked(RbSettings::value(RbSettings::InstallGamefiles).toBool());
ui.pluginDataCheckbox->setChecked(RbSettings::value(RbSettings::InstallPluginData).toBool());
ui.voiceCheckbox->setChecked(RbSettings::value(RbSettings::InstallVoice).toBool());
ui.manualCheckbox->setChecked(RbSettings::value(RbSettings::InstallManual).toBool());
@ -194,7 +194,7 @@ void SelectiveInstallWidget::saveSettings(void)
RbSettings::setValue(RbSettings::InstallRockbox, ui.rockboxCheckbox->isChecked());
RbSettings::setValue(RbSettings::InstallFonts, ui.fontsCheckbox->isChecked());
RbSettings::setValue(RbSettings::InstallThemes, ui.themesCheckbox->isChecked());
RbSettings::setValue(RbSettings::InstallGamefiles, ui.gamefileCheckbox->isChecked());
RbSettings::setValue(RbSettings::InstallPluginData, ui.pluginDataCheckbox->isChecked());
RbSettings::setValue(RbSettings::InstallVoice, ui.voiceCheckbox->isChecked());
RbSettings::setValue(RbSettings::InstallManual, ui.manualCheckbox->isChecked());
RbSettings::setValue(RbSettings::VoiceLanguage, ui.voiceCombobox->currentData().toString());
@ -249,7 +249,7 @@ void SelectiveInstallWidget::continueInstall(bool error)
case 2: installRockbox(); break;
case 3: installFonts(); break;
case 4: installThemes(); break;
case 5: installGamefiles(); break;
case 5: installPluginData(); break;
case 6: installVoicefile(); break;
case 7: installManual(); break;
case 8: installBootloaderPost(); break;
@ -612,39 +612,40 @@ void SelectiveInstallWidget::installThemes(void)
}
static const struct {
const char *name;
const char *rockfile;
PlayerBuildInfo::BuildInfo zipurl; // add new games to PlayerBuildInfo
} GamesList[] = {
const char *name; // display name
const char *rockfile; // rock file to look for
PlayerBuildInfo::BuildInfo zipurl; // download url
} PluginDataFiles[] = {
{ "Doom", "games/doom.rock", PlayerBuildInfo::DoomUrl },
{ "Duke3D", "games/duke3d.rock", PlayerBuildInfo::Duke3DUrl },
{ "Quake", "games/quake.rock", PlayerBuildInfo::QuakeUrl },
{ "Puzzles fonts", "games/sgt-blackbox.rock", PlayerBuildInfo::PuzzFontsUrl },
{ "Wolf3D", "games/wolf3d.rock", PlayerBuildInfo::Wolf3DUrl },
{ "XWorld", "games/xworld.rock", PlayerBuildInfo::XWorldUrl },
{ "MIDI Patchset", "viewers/midi.rock", PlayerBuildInfo::MidiPatchsetUrl },
};
void SelectiveInstallWidget::installGamefiles(void)
void SelectiveInstallWidget::installPluginData(void)
{
if(ui.gamefileCheckbox->isChecked()) {
if(ui.pluginDataCheckbox->isChecked()) {
// build a list of zip urls that we need, then install
QStringList gameUrls;
QStringList gameNames;
QStringList dataUrls;
QStringList dataName;
for(unsigned int i = 0; i < sizeof(GamesList) / sizeof(GamesList[0]); i++)
for(size_t i = 0; i < sizeof(PluginDataFiles) / sizeof(PluginDataFiles[0]); i++)
{
// check if installed Rockbox has this plugin.
if(QFileInfo(m_mountpoint + "/.rockbox/rocks/" + GamesList[i].rockfile).exists()) {
gameNames.append(GamesList[i].name);
if(QFileInfo(m_mountpoint + "/.rockbox/rocks/" + PluginDataFiles[i].rockfile).exists()) {
dataName.append(PluginDataFiles[i].name);
// game URLs do not depend on the actual build type, but we need
// to pass it (simplifies the API, and will allow to make them
// type specific later if needed)
gameUrls.append(PlayerBuildInfo::instance()->value(
GamesList[i].zipurl, m_buildtype).toString());
dataUrls.append(PlayerBuildInfo::instance()->value(
PluginDataFiles[i].zipurl, m_buildtype).toString());
}
}
if(gameUrls.size() == 0)
if(dataUrls.size() == 0)
{
m_logger->addItem(tr("Your installation doesn't require any game files, skipping."), LOGINFO);
emit installSkipped(false);
@ -657,8 +658,8 @@ void SelectiveInstallWidget::installGamefiles(void)
if(m_zipinstaller != nullptr) m_zipinstaller->deleteLater();
m_zipinstaller = new ZipInstaller(this);
m_zipinstaller->setUrl(gameUrls);
m_zipinstaller->setLogSection(gameNames);
m_zipinstaller->setUrl(dataUrls);
m_zipinstaller->setLogSection(dataName);
m_zipinstaller->setLogVersion();
m_zipinstaller->setMountPoint(m_mountpoint);
if(!RbSettings::value(RbSettings::CacheDisabled).toBool())

View file

@ -50,7 +50,7 @@ class SelectiveInstallWidget : public QWidget
void installVoicefile(void);
void installManual(void);
void installThemes(void);
void installGamefiles(void);
void installPluginData(void);
void installBootloaderPost(void);
signals:

View file

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>663</width>
<height>409</height>
<height>440</height>
</rect>
</property>
<property name="sizePolicy">
@ -140,7 +140,7 @@
</widget>
</item>
<item row="6" column="2">
<widget class="QLabel" name="gameLabel">
<widget class="QLabel" name="pluginDataLabe">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
@ -148,7 +148,7 @@
</sizepolicy>
</property>
<property name="text">
<string>Some game plugins require additional files.</string>
<string>Some plugins require additional data files.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
@ -190,9 +190,9 @@
</widget>
</item>
<item row="6" column="0">
<widget class="QCheckBox" name="gamefileCheckbox">
<widget class="QCheckBox" name="pluginDataCheckbox">
<property name="text">
<string>Game Files</string>
<string>Plugin Data</string>
</property>
<property name="icon">
<iconset resource="../rbutilqt.qrc">
@ -306,7 +306,7 @@
<tabstop>fontsCheckbox</tabstop>
<tabstop>themesCheckbox</tabstop>
<tabstop>themesCustomize</tabstop>
<tabstop>gamefileCheckbox</tabstop>
<tabstop>pluginDataCheckbox</tabstop>
<tabstop>installButton</tabstop>
</tabstops>
<resources>