summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Gevaerts <frank@gevaerts.be>2008-07-07 21:40:44 +0000
committerFrank Gevaerts <frank@gevaerts.be>2008-07-07 21:40:44 +0000
commitee3ed8a163823c2ee7f087985b7a36e10806f5f6 (patch)
tree90ddf4bca6021f759cf3f98cacd6e207311a843b
parente6553f821881ace5f904fb077ae8a1aba7154474 (diff)
handle new installations (or upgrades) differently from invalid configurations
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17983 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--rbutil/rbutilqt/configure.cpp3
-rw-r--r--rbutil/rbutilqt/rbsettings.cpp12
-rw-r--r--rbutil/rbutilqt/rbsettings.h4
-rw-r--r--rbutil/rbutilqt/rbutilqt.cpp15
-rw-r--r--rbutil/rbutilqt/version.h5
5 files changed, 32 insertions, 7 deletions
diff --git a/rbutil/rbutilqt/configure.cpp b/rbutil/rbutilqt/configure.cpp
index 0aedf32998..364068f61a 100644
--- a/rbutil/rbutilqt/configure.cpp
+++ b/rbutil/rbutilqt/configure.cpp
@@ -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();
diff --git a/rbutil/rbutilqt/rbsettings.cpp b/rbutil/rbutilqt/rbsettings.cpp
index 99c23856ab..38ed542ee7 100644
--- a/rbutil/rbutilqt/rbsettings.cpp
+++ b/rbutil/rbutilqt/rbsettings.cpp
@@ -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)
{
diff --git a/rbutil/rbutilqt/rbsettings.h b/rbutil/rbutilqt/rbsettings.h
index 7e6d9af051..a3fcd2b00f 100644
--- a/rbutil/rbutilqt/rbsettings.h
+++ b/rbutil/rbutilqt/rbsettings.h
@@ -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);
diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp
index 7f2bf0cbed..59ce4839f7 100644
--- a/rbutil/rbutilqt/rbutilqt.cpp
+++ b/rbutil/rbutilqt/rbutilqt.cpp
@@ -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();
}
}
diff --git a/rbutil/rbutilqt/version.h b/rbutil/rbutilqt/version.h
index c3fa2e4945..c0ba2bf848 100644
--- a/rbutil/rbutilqt/version.h
+++ b/rbutil/rbutilqt/version.h
@@ -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$"