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::InstallRockbox, "install_rockbox", "true" },
{ RbSettings::InstallFonts, "install_fonts", "true" }, { RbSettings::InstallFonts, "install_fonts", "true" },
{ RbSettings::InstallThemes, "install_themes", "false" }, { RbSettings::InstallThemes, "install_themes", "false" },
{ RbSettings::InstallGamefiles, "install_gamefiles", "true" }, { RbSettings::InstallPluginData, "install_plugin_data", "true" },
{ RbSettings::InstallVoice, "install_voice", "false" }, { RbSettings::InstallVoice, "install_voice", "false" },
{ RbSettings::InstallManual, "install_manual", "false" }, { RbSettings::InstallManual, "install_manual", "false" },
#if defined(Q_OS_WIN32) #if defined(Q_OS_WIN32)

View file

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

View file

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

View file

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

View file

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