fixed bug in checking skin version

This commit is contained in:
louis 2015-07-29 18:32:03 +02:00
parent 6e0f56e56c
commit 2efe2314e2
3 changed files with 41 additions and 26 deletions

View File

@ -399,4 +399,6 @@ Version 0.6.1
Version 0.6.2
- added progressmodeonly viewelement in displayreplay
- fixed bug in checking skin version

View File

@ -359,14 +359,17 @@ bool cDesignerConfig::CheckVersion(string name, string &neededVersion) {
int verMinor = atoi(tokensVer[1].c_str());
int verMikro = atoi(tokensVer[2].c_str());
if (minVerMajor > verMajor) {
if (minVerMajor < verMajor)
return true;
if (minVerMajor > verMajor)
return false;
} else if (minVerMinor > verMinor) {
if (minVerMinor < verMinor)
return true;
if (minVerMinor > verMinor)
return false;
} else if (minVerMikro > verMikro) {
return false;
}
return true;
if (minVerMikro <= verMikro)
return true;
return false;
}
bool cDesignerConfig::SkinInstalled(string name) {

50
setup.c
View File

@ -201,22 +201,32 @@ eOSState cSkinDesignerSetup::ProcessKey(eKeys Key) {
if (Key == kRed) {
string versionNeeded = "";
bool versionOk = config.CheckVersion(currentSkin, versionNeeded);
if (!versionOk) {
cString error = cString::sprintf("%s %s %s %s %s",
tr("Skin Designer"),
tr("version"),
versionNeeded.c_str(),
tr("or higher"),
tr("needed"));
Skins.Message(mtError, *error);
return state;
}
if (type == itSkinRepo) {
if (!versionOk) {
cString error = cString::sprintf("%s %s %s %s %s",
tr("Skin Designer"),
tr("version"),
versionNeeded.c_str(),
tr("or higher"),
tr("needed"));
Skins.Message(mtError, *error);
return state;
}
Skins.Message(mtStatus, *cString::sprintf("%s ...", tr("Installing Skin")));
StartInstallation(currentSkin);
} else if (type == itSkinSetup || type == itNoSkinSetup) {
bool gitAvailable = StartUpdate(currentSkin);
if (gitAvailable) {
if (!versionOk) {
cString error = cString::sprintf("%s %s %s %s %s",
tr("Skin Designer"),
tr("version"),
versionNeeded.c_str(),
tr("or higher"),
tr("needed"));
Skins.Message(mtError, *error);
return state;
}
Skins.Message(mtStatus, *cString::sprintf("%s ...", tr("Updating Skin from Git")));
} else {
Skins.Message(mtStatus, tr("No Git Repsoitory available"));
@ -402,18 +412,18 @@ eOSState cSkindesignerSkinSetup::ProcessKey(eKeys Key) {
case kRed: {
string versionNeeded = "";
bool versionOk = config.CheckVersion(skin, versionNeeded);
if (!versionOk) {
cString error = cString::sprintf("%s %s %s %s %s",
tr("Skin Designer"),
tr("version"),
versionNeeded.c_str(),
tr("or higher"),
tr("needed"));
Skins.Message(mtError, *error);
break;
}
bool gitAvailable = StartUpdate(skin);
if (gitAvailable) {
if (!versionOk) {
cString error = cString::sprintf("%s %s %s %s %s",
tr("Skin Designer"),
tr("version"),
versionNeeded.c_str(),
tr("or higher"),
tr("needed"));
Skins.Message(mtError, *error);
break;
}
Skins.Message(mtStatus, *cString::sprintf("%s ...", tr("Updating Skin from Git")));
} else {
Skins.Message(mtStatus, tr("No Git Repsoitory available"));