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:
Frank Gevaerts 2008-07-07 21:40:44 +00:00
parent e6553f8218
commit ee3ed8a163
5 changed files with 32 additions and 7 deletions

View file

@ -19,6 +19,7 @@
#include <QtGui> #include <QtGui>
#include "version.h"
#include "configure.h" #include "configure.h"
#include "autodetection.h" #include "autodetection.h"
#include "ui_configurefrm.h" #include "ui_configurefrm.h"
@ -137,6 +138,8 @@ void Config::accept()
int i = ui.comboTts->currentIndex(); int i = ui.comboTts->currentIndex();
settings->setCurTTS(ui.comboTts->itemData(i).toString()); settings->setCurTTS(ui.comboTts->itemData(i).toString());
settings->setCurVersion(PUREVERSION);
// sync settings // sync settings
settings->sync(); settings->sync();
this->close(); this->close();

View file

@ -77,6 +77,11 @@ QString RbSettings::userSettingFilename()
return userSettings->fileName(); return userSettings->fileName();
} }
QString RbSettings::curVersion()
{
return userSettings->value("rbutil_version").toString();
}
bool RbSettings::cacheOffline() bool RbSettings::cacheOffline()
{ {
return userSettings->value("offline").toBool(); return userSettings->value("offline").toBool();
@ -108,7 +113,6 @@ QString RbSettings::bleedingUrl()
return devices->value("bleeding_url").toString(); return devices->value("bleeding_url").toString();
} }
QString RbSettings::lastRelease() QString RbSettings::lastRelease()
{ {
return devices->value("last_release").toString(); return devices->value("last_release").toString();
@ -327,7 +331,7 @@ bool RbSettings::encoderNarrowband(QString enc)
{ {
return userSettingsGroupGet(enc,"narrowband",false).toBool(); return userSettingsGroupGet(enc,"narrowband",false).toBool();
} }
QStringList RbSettings::allPlatforms() QStringList RbSettings::allPlatforms()
{ {
QStringList result; QStringList result;
@ -481,6 +485,10 @@ int RbSettings::curTargetId()
return deviceSettingCurGet("targetid").toInt(); return deviceSettingCurGet("targetid").toInt();
} }
void RbSettings::setCurVersion(QString version)
{
userSettings->setValue("rbutil_version",version);
}
void RbSettings::setOfPath(QString path) void RbSettings::setOfPath(QString path)
{ {

View file

@ -42,6 +42,7 @@ class RbSettings : public QObject
QString userSettingFilename(); QString userSettingFilename();
//! access functions for the settings //! access functions for the settings
QString curVersion();
bool cacheOffline(); bool cacheOffline();
bool cacheDisabled(); bool cacheDisabled();
QString mountpoint(); QString mountpoint();
@ -104,7 +105,8 @@ class RbSettings : public QObject
QString curResolution(); QString curResolution();
int curTargetId(); int curTargetId();
//! Set Fucntions //! Set Functions
void setCurVersion(QString version);
void setOfPath(QString path); void setOfPath(QString path);
void setCachePath(QString path); void setCachePath(QString path);
void setBuild(QString build); void setBuild(QString build);

View file

@ -176,13 +176,20 @@ void RbUtilQt::downloadDone(bool error)
bleeding->setFile(&bleedingInfo); bleeding->setFile(&bleedingInfo);
bleeding->getFile(QUrl(settings->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(); QApplication::processEvents();
QMessageBox::critical(this, tr("Configuration error"), QMessageBox::critical(this, tr("Configuration error"),
tr("Your configuration is invalid. This is most likely due " tr("Your configuration is invalid. This is most likely due "
"to a new installation of Rockbox Utility or a changed device " "to a changed device path. The configuration dialog will "
"path. The configuration dialog will now open to allow you to " "now open to allow you to correct the problem."));
"correct the problem."));
configDialog(); configDialog();
} }
} }

View file

@ -20,3 +20,8 @@
****************************************************************************/ ****************************************************************************/
#define VERSION "SVN $Revision$ (m1.0.6), built "__DATE__" "__TIME__ #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$"