mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-09 21:22:39 -05:00
Check target / mountpoint selection before performing any installation.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14729 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
8620e3e864
commit
f90837f80e
2 changed files with 39 additions and 0 deletions
|
|
@ -161,6 +161,16 @@ void RbUtilQt::downloadDone(bool error)
|
||||||
bleeding->setCache(userSettings->value("cachepath", QDir::tempPath()).toString());
|
bleeding->setCache(userSettings->value("cachepath", QDir::tempPath()).toString());
|
||||||
bleeding->setFile(&bleedingInfo);
|
bleeding->setFile(&bleedingInfo);
|
||||||
bleeding->getFile(QUrl(devices->value("bleeding_info").toString()));
|
bleeding->getFile(QUrl(devices->value("bleeding_info").toString()));
|
||||||
|
|
||||||
|
if(chkConfig(false)) {
|
||||||
|
QApplication::processEvents();
|
||||||
|
QMessageBox::critical(this, tr("Configuration error"),
|
||||||
|
tr("Your configuration is invalid. This is most likely due "
|
||||||
|
"to a new installation of Rockbox Utility or a changed device "
|
||||||
|
"path. The configuation dialog will now open to allow you "
|
||||||
|
"correcting the problem."));
|
||||||
|
configDialog();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -311,6 +321,7 @@ void RbUtilQt::updateManual()
|
||||||
|
|
||||||
void RbUtilQt::completeInstall()
|
void RbUtilQt::completeInstall()
|
||||||
{
|
{
|
||||||
|
if(chkConfig(true)) return;
|
||||||
if(QMessageBox::question(this, tr("Confirm Installation"),
|
if(QMessageBox::question(this, tr("Confirm Installation"),
|
||||||
tr("Do you really want to make a complete Installation?"),
|
tr("Do you really want to make a complete Installation?"),
|
||||||
QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) return;
|
QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) return;
|
||||||
|
|
@ -362,6 +373,7 @@ void RbUtilQt::completeInstall()
|
||||||
|
|
||||||
void RbUtilQt::smallInstall()
|
void RbUtilQt::smallInstall()
|
||||||
{
|
{
|
||||||
|
if(chkConfig(true)) return;
|
||||||
if(QMessageBox::question(this, tr("Confirm Installation"),
|
if(QMessageBox::question(this, tr("Confirm Installation"),
|
||||||
tr("Do you really want to make a small Installation?"),
|
tr("Do you really want to make a small Installation?"),
|
||||||
QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) return;
|
QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) return;
|
||||||
|
|
@ -424,6 +436,7 @@ void RbUtilQt::installdone(bool error)
|
||||||
|
|
||||||
void RbUtilQt::installBtn()
|
void RbUtilQt::installBtn()
|
||||||
{
|
{
|
||||||
|
if(chkConfig(true)) return;
|
||||||
install();
|
install();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -498,6 +511,7 @@ bool RbUtilQt::installBootloaderAuto()
|
||||||
|
|
||||||
void RbUtilQt::installBootloaderBtn()
|
void RbUtilQt::installBootloaderBtn()
|
||||||
{
|
{
|
||||||
|
if(chkConfig(true)) return;
|
||||||
if(QMessageBox::question(this, tr("Confirm Installation"),
|
if(QMessageBox::question(this, tr("Confirm Installation"),
|
||||||
tr("Do you really want to install the Bootloader?"),
|
tr("Do you really want to install the Bootloader?"),
|
||||||
QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) return;
|
QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) return;
|
||||||
|
|
@ -593,6 +607,7 @@ void RbUtilQt::installBootloader()
|
||||||
|
|
||||||
void RbUtilQt::installFontsBtn()
|
void RbUtilQt::installFontsBtn()
|
||||||
{
|
{
|
||||||
|
if(chkConfig(true)) return;
|
||||||
if(QMessageBox::question(this, tr("Confirm Installation"),
|
if(QMessageBox::question(this, tr("Confirm Installation"),
|
||||||
tr("Do you really want to install the fonts package?"),
|
tr("Do you really want to install the fonts package?"),
|
||||||
QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) return;
|
QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) return;
|
||||||
|
|
@ -627,6 +642,7 @@ void RbUtilQt::installFonts()
|
||||||
|
|
||||||
void RbUtilQt::installVoice()
|
void RbUtilQt::installVoice()
|
||||||
{
|
{
|
||||||
|
if(chkConfig(true)) return;
|
||||||
if(QMessageBox::question(this, tr("Confirm Installation"),
|
if(QMessageBox::question(this, tr("Confirm Installation"),
|
||||||
tr("Do you really want to install the voice file?"),
|
tr("Do you really want to install the voice file?"),
|
||||||
QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) return;
|
QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) return;
|
||||||
|
|
@ -658,6 +674,7 @@ void RbUtilQt::installVoice()
|
||||||
|
|
||||||
void RbUtilQt::installDoomBtn()
|
void RbUtilQt::installDoomBtn()
|
||||||
{
|
{
|
||||||
|
if(chkConfig(true)) return;
|
||||||
if(!hasDoom()){
|
if(!hasDoom()){
|
||||||
QMessageBox::critical(this, tr("Error"), tr("Your device doesn't have a doom plugin. Aborting."));
|
QMessageBox::critical(this, tr("Error"), tr("Your device doesn't have a doom plugin. Aborting."));
|
||||||
return;
|
return;
|
||||||
|
|
@ -704,6 +721,7 @@ void RbUtilQt::installDoom()
|
||||||
|
|
||||||
void RbUtilQt::installThemes()
|
void RbUtilQt::installThemes()
|
||||||
{
|
{
|
||||||
|
if(chkConfig(true)) return;
|
||||||
ThemesInstallWindow* tw = new ThemesInstallWindow(this);
|
ThemesInstallWindow* tw = new ThemesInstallWindow(this);
|
||||||
tw->setDeviceSettings(devices);
|
tw->setDeviceSettings(devices);
|
||||||
tw->setUserSettings(userSettings);
|
tw->setUserSettings(userSettings);
|
||||||
|
|
@ -715,6 +733,7 @@ void RbUtilQt::installThemes()
|
||||||
|
|
||||||
void RbUtilQt::createTalkFiles(void)
|
void RbUtilQt::createTalkFiles(void)
|
||||||
{
|
{
|
||||||
|
if(chkConfig(true)) return;
|
||||||
InstallTalkWindow *installWindow = new InstallTalkWindow(this);
|
InstallTalkWindow *installWindow = new InstallTalkWindow(this);
|
||||||
installWindow->setUserSettings(userSettings);
|
installWindow->setUserSettings(userSettings);
|
||||||
installWindow->setDeviceSettings(devices);
|
installWindow->setDeviceSettings(devices);
|
||||||
|
|
@ -724,6 +743,7 @@ void RbUtilQt::createTalkFiles(void)
|
||||||
|
|
||||||
void RbUtilQt::uninstall(void)
|
void RbUtilQt::uninstall(void)
|
||||||
{
|
{
|
||||||
|
if(chkConfig(true)) return;
|
||||||
UninstallWindow *uninstallWindow = new UninstallWindow(this);
|
UninstallWindow *uninstallWindow = new UninstallWindow(this);
|
||||||
uninstallWindow->setUserSettings(userSettings);
|
uninstallWindow->setUserSettings(userSettings);
|
||||||
uninstallWindow->setDeviceSettings(devices);
|
uninstallWindow->setDeviceSettings(devices);
|
||||||
|
|
@ -732,6 +752,7 @@ void RbUtilQt::uninstall(void)
|
||||||
|
|
||||||
void RbUtilQt::uninstallBootloader(void)
|
void RbUtilQt::uninstallBootloader(void)
|
||||||
{
|
{
|
||||||
|
if(chkConfig(true)) return;
|
||||||
if(QMessageBox::question(this, tr("Confirm Uninstallation"),
|
if(QMessageBox::question(this, tr("Confirm Uninstallation"),
|
||||||
tr("Do you really want to uninstall the Bootloader?"),
|
tr("Do you really want to uninstall the Bootloader?"),
|
||||||
QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) return;
|
QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) return;
|
||||||
|
|
@ -761,6 +782,7 @@ void RbUtilQt::uninstallBootloader(void)
|
||||||
|
|
||||||
void RbUtilQt::downloadManual(void)
|
void RbUtilQt::downloadManual(void)
|
||||||
{
|
{
|
||||||
|
if(chkConfig(true)) return;
|
||||||
if(QMessageBox::question(this, tr("Confirm download"),
|
if(QMessageBox::question(this, tr("Confirm download"),
|
||||||
tr("Do you really want to download the manual? The manual will be saved "
|
tr("Do you really want to download the manual? The manual will be saved "
|
||||||
"to the root folder of your player."),
|
"to the root folder of your player."),
|
||||||
|
|
@ -921,3 +943,19 @@ QUrl RbUtilQt::proxy()
|
||||||
return QUrl("");
|
return QUrl("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool RbUtilQt::chkConfig(bool warn)
|
||||||
|
{
|
||||||
|
bool error = false;
|
||||||
|
if(userSettings->value("platform").toString().isEmpty()
|
||||||
|
|| userSettings->value("mountpoint").toString().isEmpty()
|
||||||
|
|| !QFileInfo(userSettings->value("mountpoint").toString()).isWritable()) {
|
||||||
|
error = true;
|
||||||
|
|
||||||
|
if(warn) QMessageBox::critical(this, tr("Configuration error"),
|
||||||
|
tr("You configuration is invalid. Please go to the configuration "
|
||||||
|
"dialog and make sure the selected values are correct."));
|
||||||
|
}
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,7 @@ class RbUtilQt : public QMainWindow
|
||||||
BootloaderInstaller* blinstaller;
|
BootloaderInstaller* blinstaller;
|
||||||
QUrl proxy(void);
|
QUrl proxy(void);
|
||||||
QMap<QString, QString> versmap;
|
QMap<QString, QString> versmap;
|
||||||
|
bool chkConfig(bool);
|
||||||
|
|
||||||
volatile bool m_installed;
|
volatile bool m_installed;
|
||||||
volatile bool m_error;
|
volatile bool m_error;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue