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 "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();

View file

@ -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();
@ -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)
{

View file

@ -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);

View file

@ -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();
}
}

View file

@ -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$"