mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-10 21:55:10 -05:00
handle new installations (or upgrades) differently from invalid configurations
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17983 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
e6553f8218
commit
ee3ed8a163
5 changed files with 32 additions and 7 deletions
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
#include <QtGui>
|
||||
|
||||
#include "version.h"
|
||||
#include "configure.h"
|
||||
#include "autodetection.h"
|
||||
#include "ui_configurefrm.h"
|
||||
|
|
@ -137,6 +138,8 @@ void Config::accept()
|
|||
int i = ui.comboTts->currentIndex();
|
||||
settings->setCurTTS(ui.comboTts->itemData(i).toString());
|
||||
|
||||
settings->setCurVersion(PUREVERSION);
|
||||
|
||||
// sync settings
|
||||
settings->sync();
|
||||
this->close();
|
||||
|
|
|
|||
|
|
@ -77,6 +77,11 @@ QString RbSettings::userSettingFilename()
|
|||
return userSettings->fileName();
|
||||
}
|
||||
|
||||
QString RbSettings::curVersion()
|
||||
{
|
||||
return userSettings->value("rbutil_version").toString();
|
||||
}
|
||||
|
||||
bool RbSettings::cacheOffline()
|
||||
{
|
||||
return userSettings->value("offline").toBool();
|
||||
|
|
@ -108,7 +113,6 @@ QString RbSettings::bleedingUrl()
|
|||
return devices->value("bleeding_url").toString();
|
||||
}
|
||||
|
||||
|
||||
QString RbSettings::lastRelease()
|
||||
{
|
||||
return devices->value("last_release").toString();
|
||||
|
|
@ -327,7 +331,7 @@ bool RbSettings::encoderNarrowband(QString enc)
|
|||
{
|
||||
return userSettingsGroupGet(enc,"narrowband",false).toBool();
|
||||
}
|
||||
|
||||
|
||||
QStringList RbSettings::allPlatforms()
|
||||
{
|
||||
QStringList result;
|
||||
|
|
@ -481,6 +485,10 @@ int RbSettings::curTargetId()
|
|||
return deviceSettingCurGet("targetid").toInt();
|
||||
}
|
||||
|
||||
void RbSettings::setCurVersion(QString version)
|
||||
{
|
||||
userSettings->setValue("rbutil_version",version);
|
||||
}
|
||||
|
||||
void RbSettings::setOfPath(QString path)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ class RbSettings : public QObject
|
|||
QString userSettingFilename();
|
||||
|
||||
//! access functions for the settings
|
||||
QString curVersion();
|
||||
bool cacheOffline();
|
||||
bool cacheDisabled();
|
||||
QString mountpoint();
|
||||
|
|
@ -104,7 +105,8 @@ class RbSettings : public QObject
|
|||
QString curResolution();
|
||||
int curTargetId();
|
||||
|
||||
//! Set Fucntions
|
||||
//! Set Functions
|
||||
void setCurVersion(QString version);
|
||||
void setOfPath(QString path);
|
||||
void setCachePath(QString path);
|
||||
void setBuild(QString build);
|
||||
|
|
|
|||
|
|
@ -176,13 +176,20 @@ void RbUtilQt::downloadDone(bool error)
|
|||
bleeding->setFile(&bleedingInfo);
|
||||
bleeding->getFile(QUrl(settings->bleedingInfo()));
|
||||
|
||||
if(chkConfig(false)) {
|
||||
if(settings->curVersion() != PUREVERSION) {
|
||||
QApplication::processEvents();
|
||||
QMessageBox::information(this, tr("New installation"),
|
||||
tr("This is a new installation of Rockbox Utility, or a new version. "
|
||||
"The configuration dialog will now open to allow you to setup the program, "
|
||||
" or review your settings."));
|
||||
configDialog();
|
||||
}
|
||||
else 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 configuration dialog will now open to allow you to "
|
||||
"correct the problem."));
|
||||
"to a changed device path. The configuration dialog will "
|
||||
"now open to allow you to correct the problem."));
|
||||
configDialog();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,3 +20,8 @@
|
|||
****************************************************************************/
|
||||
|
||||
#define VERSION "SVN $Revision$ (m1.0.6), built "__DATE__" "__TIME__
|
||||
|
||||
// PUREVERSION is needed to be able to just compare versions. It does not
|
||||
// contain a build timestamp because it needs to be the same in different
|
||||
// files
|
||||
#define PUREVERSION "SVN $Revision$"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue