mirror of
https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
synced 2023-10-19 17:58:31 +02:00
fixed bug in checking skin version
This commit is contained in:
parent
6e0f56e56c
commit
2efe2314e2
2
HISTORY
2
HISTORY
@ -399,4 +399,6 @@ Version 0.6.1
|
||||
Version 0.6.2
|
||||
|
||||
- added progressmodeonly viewelement in displayreplay
|
||||
- fixed bug in checking skin version
|
||||
|
||||
|
||||
|
15
config.c
15
config.c
@ -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
50
setup.c
@ -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"));
|
||||
|
Loading…
Reference in New Issue
Block a user