mirror of
https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
synced 2023-10-19 17:58:31 +02:00
Merge branch 'pbiering/skindesigner-fix-busy-svdrpresult'
This commit is contained in:
commit
6aeaf41467
2
HISTORY
2
HISTORY
@ -471,3 +471,5 @@ Version 1.2.10
|
|||||||
|
|
||||||
Version 1.2.10+
|
Version 1.2.10+
|
||||||
- [pbiering] align displayed tuner number (0,1,2 -> 1,2,3)
|
- [pbiering] align displayed tuner number (0,1,2 -> 1,2,3)
|
||||||
|
- [pbiering] SVDRP: do not reload in case plugin is not fully initialized (results in VDR crash)
|
||||||
|
- [pbiering] SVDRP: respond with proper error message in case of OSD is active or parsing error
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
cSkinDesigner::cSkinDesigner(string skin, cTheme *theme) : cSkin(skin.c_str(), theme) {
|
cSkinDesigner::cSkinDesigner(string skin, cTheme *theme) : cSkin(skin.c_str(), theme) {
|
||||||
init = true;
|
init = true;
|
||||||
|
initialized = false;
|
||||||
this->skin = skin;
|
this->skin = skin;
|
||||||
|
|
||||||
backupSkin = NULL;
|
backupSkin = NULL;
|
||||||
@ -106,11 +107,11 @@ cSkinDisplayMessage *cSkinDesigner::DisplayMessage(void) {
|
|||||||
return displayMessage;
|
return displayMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cSkinDesigner::Reload(void) {
|
int cSkinDesigner::Reload(void) {
|
||||||
dsyslog("skindesigner: forcing full reload of templates");
|
dsyslog("skindesigner: forcing full reload of templates");
|
||||||
if (cOsd::IsOpen()) {
|
if (cOsd::IsOpen()) {
|
||||||
esyslog("skindesigner: OSD is open, close first!");
|
esyslog("skindesigner: OSD is open, close first!");
|
||||||
return;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
cStopWatch watch;
|
cStopWatch watch;
|
||||||
@ -120,11 +121,13 @@ void cSkinDesigner::Reload(void) {
|
|||||||
if (!backupSkin)
|
if (!backupSkin)
|
||||||
backupSkin = new cSkinLCARS();
|
backupSkin = new cSkinLCARS();
|
||||||
useBackupSkin = true;
|
useBackupSkin = true;
|
||||||
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
CacheViews();
|
CacheViews();
|
||||||
useBackupSkin = false;
|
useBackupSkin = false;
|
||||||
watch.Stop("templates reloaded and cache created");
|
watch.Stop("templates reloaded and cache created");
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cSkinDesigner::ListAvailableFonts(void) {
|
void cSkinDesigner::ListAvailableFonts(void) {
|
||||||
@ -213,11 +216,13 @@ void cSkinDesigner::Init(void) {
|
|||||||
esyslog("skindesigner: error during loading of templates - using LCARS as backup");
|
esyslog("skindesigner: error during loading of templates - using LCARS as backup");
|
||||||
backupSkin = new cSkinLCARS();
|
backupSkin = new cSkinLCARS();
|
||||||
useBackupSkin = true;
|
useBackupSkin = true;
|
||||||
|
initialized = true;
|
||||||
} else {
|
} else {
|
||||||
CacheViews();
|
CacheViews();
|
||||||
watch.Stop("templates loaded and caches created");
|
watch.Stop("templates loaded and caches created");
|
||||||
}
|
}
|
||||||
init = false;
|
init = false;
|
||||||
|
initialized = true;
|
||||||
}
|
}
|
||||||
else if (config.OsdFontsChanged())
|
else if (config.OsdFontsChanged())
|
||||||
{
|
{
|
||||||
|
@ -22,6 +22,7 @@ class cSkinDesigner;
|
|||||||
class cSkinDesigner : public cSkin {
|
class cSkinDesigner : public cSkin {
|
||||||
private:
|
private:
|
||||||
bool init;
|
bool init;
|
||||||
|
bool initialized;
|
||||||
string skin;
|
string skin;
|
||||||
cSkinLCARS *backupSkin;
|
cSkinLCARS *backupSkin;
|
||||||
bool useBackupSkin;
|
bool useBackupSkin;
|
||||||
@ -51,7 +52,8 @@ public:
|
|||||||
virtual cSkinDisplayTracks *DisplayTracks(const char *Title, int NumTracks, const char * const *Tracks);
|
virtual cSkinDisplayTracks *DisplayTracks(const char *Title, int NumTracks, const char * const *Tracks);
|
||||||
virtual cSkinDisplayMessage *DisplayMessage(void);
|
virtual cSkinDisplayMessage *DisplayMessage(void);
|
||||||
void ActivateBackupSkin(void) { useBackupSkin = true; };
|
void ActivateBackupSkin(void) { useBackupSkin = true; };
|
||||||
void Reload(void);
|
int Reload(void);
|
||||||
|
bool Initialized(void) { return initialized; };
|
||||||
void ListAvailableFonts(void);
|
void ListAvailableFonts(void);
|
||||||
bool SetCustomIntToken(string option);
|
bool SetCustomIntToken(string option);
|
||||||
bool SetCustomStringToken(string option);
|
bool SetCustomStringToken(string option);
|
||||||
|
@ -178,14 +178,14 @@ cImageImporterSVG::cImageImporterSVG() {
|
|||||||
|
|
||||||
cImageImporterSVG::~cImageImporterSVG() {
|
cImageImporterSVG::~cImageImporterSVG() {
|
||||||
if (handle) {
|
if (handle) {
|
||||||
rsvg_handle_close(handle, NULL);
|
rsvg_handle_close(handle, NULL); // deprecated since version 2.46
|
||||||
g_object_unref(handle);
|
g_object_unref(handle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cImageImporterSVG::LoadImage(const char *path) {
|
bool cImageImporterSVG::LoadImage(const char *path) {
|
||||||
if (handle) {
|
if (handle) {
|
||||||
rsvg_handle_close(handle, NULL);
|
rsvg_handle_close(handle, NULL); // deprecated since version 2.46
|
||||||
g_object_unref(handle);
|
g_object_unref(handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -241,6 +241,7 @@ cString cPluginSkinDesigner::SVDRPCommand(const char *Command, const char *Optio
|
|||||||
cSkinDesigner *activeSkin = NULL;
|
cSkinDesigner *activeSkin = NULL;
|
||||||
cSkinDesigner *availableSkin = NULL;
|
cSkinDesigner *availableSkin = NULL;
|
||||||
config.InitSkinRefsIterator();
|
config.InitSkinRefsIterator();
|
||||||
|
int result = 0;
|
||||||
while (availableSkin = config.GetNextSkinRef()) {
|
while (availableSkin = config.GetNextSkinRef()) {
|
||||||
string activeSkinName = Setup.OSDSkin;
|
string activeSkinName = Setup.OSDSkin;
|
||||||
string currentSkinName = availableSkin->Description();
|
string currentSkinName = availableSkin->Description();
|
||||||
@ -256,6 +257,10 @@ cString cPluginSkinDesigner::SVDRPCommand(const char *Command, const char *Optio
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (strcasecmp(Command, "RELD") == 0) {
|
if (strcasecmp(Command, "RELD") == 0) {
|
||||||
|
if (!activeSkin->Initialized()) {
|
||||||
|
ReplyCode = 503;
|
||||||
|
return "SKINDESIGNER reload of templates and caches failed: initialization not finished.";
|
||||||
|
}
|
||||||
config.ClearSkinSetups();
|
config.ClearSkinSetups();
|
||||||
config.InitSkinIterator();
|
config.InitSkinIterator();
|
||||||
string skin = "";
|
string skin = "";
|
||||||
@ -264,9 +269,21 @@ cString cPluginSkinDesigner::SVDRPCommand(const char *Command, const char *Optio
|
|||||||
}
|
}
|
||||||
config.TranslateSetup();
|
config.TranslateSetup();
|
||||||
config.SetSkinSetupParameters();
|
config.SetSkinSetupParameters();
|
||||||
activeSkin->Reload();
|
result = activeSkin->Reload();
|
||||||
|
switch (result) {
|
||||||
|
case 0:
|
||||||
ReplyCode = 250;
|
ReplyCode = 250;
|
||||||
return "SKINDESIGNER reload of templates and caches forced.";
|
return "SKINDESIGNER reload of templates and caches forced.";
|
||||||
|
case 1:
|
||||||
|
ReplyCode = 501;
|
||||||
|
return "SKINDESIGNER reload of templates and caches failed: error during loading - using LCARS as backup.";
|
||||||
|
case 2:
|
||||||
|
ReplyCode = 503;
|
||||||
|
return "SKINDESIGNER reload of templates and caches failed: OSD is open, close first.";
|
||||||
|
default:
|
||||||
|
ReplyCode = 500;
|
||||||
|
return "SKINDESIGNER reload of templates and caches failed: unknown reason (check code).";
|
||||||
|
};
|
||||||
} else if (strcasecmp(Command, "DLIC") == 0) {
|
} else if (strcasecmp(Command, "DLIC") == 0) {
|
||||||
if (imgCache)
|
if (imgCache)
|
||||||
delete imgCache;
|
delete imgCache;
|
||||||
|
Loading…
Reference in New Issue
Block a user