implemented skininstaller config file

This commit is contained in:
louis 2015-05-22 13:34:23 +02:00
parent f9278c805a
commit f483aef4a8
6 changed files with 46 additions and 7 deletions

View File

@ -74,6 +74,7 @@ OBJS = $(PLUGIN).o \
libcore/imageloader.o \ libcore/imageloader.o \
libcore/recfolderinfo.o \ libcore/recfolderinfo.o \
libcore/skinsetup.o \ libcore/skinsetup.o \
libcore/skinrepo.o \
libcore/extrecinfo.o \ libcore/extrecinfo.o \
libcore/timers.o \ libcore/timers.o \
libtemplate/globals.o \ libtemplate/globals.o \

11
README
View File

@ -65,7 +65,12 @@ After installation you have to care about the paths for the XML skins and epg im
The following paths can be set at startup: The following paths can be set at startup:
-s <SKINPATH>, --skinpath=<SKINPATH> -s <SKINPATH>, --skinpath=<SKINPATH>
Path to the XML skins (Default: <ResourceDirectory>/plugins/skindesigner/skins/) Path where XML skins get installed by "make install" or by package manager
(Default: <ResourceDirectory>/plugins/skindesigner/skins/)
-i <INSTALLERPATH>, --installerpath=<INSTALLERPATH>
Path where XML skins are installed by the Skindesigner Installer
(Default: <ConfigDirectory>/plugins/skindesigner/installerskins/)
-l <LOGOPATH>, --logopath=<LOGOPATH> -l <LOGOPATH>, --logopath=<LOGOPATH>
Path to common logo set for all skins (Default: <ResourceDirectory>/plugins/skindesigner/logos/) Path to common logo set for all skins (Default: <ResourceDirectory>/plugins/skindesigner/logos/)
@ -73,11 +78,11 @@ The following paths can be set at startup:
-e path, --epgimages=path -e path, --epgimages=path
Path to the epgimages (Default: <CacheDirectory>/epgimages/) Path to the epgimages (Default: <CacheDirectory>/epgimages/)
ResourceDirectory and CacheDirectory are taken from your VDR configuration ResourceDirectory, ConfigDirectory and CacheDirectory are taken from your VDR configuration
(make.config or vdr.pc). (make.config or vdr.pc).
During a "make install" the included skins are automatically copied from During a "make install" the included skins are automatically copied from
<SkinSourceDirectory>/skins/ to the configured path. <SkinSourceDirectory>/skins/ to the configured skin path.
For S2-6400 Users: Disable High Level OSD, otherwise the plugin will not be For S2-6400 Users: Disable High Level OSD, otherwise the plugin will not be
loaded because lack of true color support loaded because lack of true color support

View File

@ -6,6 +6,7 @@ cDesignerConfig::cDesignerConfig() {
tmplGlobals = NULL; tmplGlobals = NULL;
epgImagePathSet = false; epgImagePathSet = false;
skinPathSet = false; skinPathSet = false;
installerSkinPathSet = false;
logoPathSet = false; logoPathSet = false;
//Common //Common
numLogosPerSizeInitial = 30; numLogosPerSizeInitial = 30;
@ -37,12 +38,15 @@ cDesignerConfig::~cDesignerConfig() {
void cDesignerConfig::SetPathes(void) { void cDesignerConfig::SetPathes(void) {
if (!skinPathSet) if (!skinPathSet)
skinPath = cString::sprintf("%s/skins/", cPlugin::ResourceDirectory(PLUGIN_NAME_I18N)); skinPath = cString::sprintf("%s/skins/", cPlugin::ResourceDirectory(PLUGIN_NAME_I18N));
if (!installerSkinPathSet)
installerSkinPath = cString::sprintf("%s/installerskins/", cPlugin::ConfigDirectory(PLUGIN_NAME_I18N));
if (!logoPathSet) if (!logoPathSet)
logoPath = cString::sprintf("%s/logos/", cPlugin::ResourceDirectory(PLUGIN_NAME_I18N)); logoPath = cString::sprintf("%s/logos/", cPlugin::ResourceDirectory(PLUGIN_NAME_I18N));
if (!epgImagePathSet) if (!epgImagePathSet)
epgImagePath = cString::sprintf("%s/epgimages/", cPlugin::CacheDirectory(PLUGIN_NAME_I18N)); epgImagePath = cString::sprintf("%s/epgimages/", cPlugin::CacheDirectory(PLUGIN_NAME_I18N));
dsyslog("skindesigner: using Skin Directory %s", *skinPath); dsyslog("skindesigner: using Skin Directory %s", *skinPath);
dsyslog("skindesigner: using Installer Skin Directory %s", *installerSkinPath);
dsyslog("skindesigner: using common ChannelLogo Directory %s", *logoPath); dsyslog("skindesigner: using common ChannelLogo Directory %s", *logoPath);
dsyslog("skindesigner: using EPG Images Directory %s", *epgImagePath); dsyslog("skindesigner: using EPG Images Directory %s", *epgImagePath);
} }
@ -52,6 +56,11 @@ void cDesignerConfig::SetSkinPath(cString path) {
skinPathSet = true; skinPathSet = true;
} }
void cDesignerConfig::SetInstallerSkinPath(cString path) {
installerSkinPath = CheckSlashAtEnd(*path);
installerSkinPathSet = true;
}
void cDesignerConfig::SetLogoPath(cString path) { void cDesignerConfig::SetLogoPath(cString path) {
logoPath = CheckSlashAtEnd(*path); logoPath = CheckSlashAtEnd(*path);
logoPathSet = true; logoPathSet = true;
@ -141,7 +150,6 @@ cSkinSetupMenu* cDesignerConfig::GetSkinSetupMenu(string &skin, string &menu) {
cSkinSetup *skinSetup = GetSkinSetup(skin); cSkinSetup *skinSetup = GetSkinSetup(skin);
if (!skinSetup) if (!skinSetup)
return NULL; return NULL;
esyslog("skindesigner: skinsetup found");
return skinSetup->GetMenu(menu); return skinSetup->GetMenu(menu);
} }
@ -195,6 +203,19 @@ void cDesignerConfig::SetSkinSetupParameters(void) {
} }
} }
void cDesignerConfig::ReadSkinRepos(void) {
skinRepos.Read(*skinPath);
skinRepos.Debug();
/*
cSkinRepo *holo = skinRepos.GetRepo("Holo");
if (holo) {
esyslog("skindesigner: installing Holo");
holo->Install(*installerSkinPath);
}
*/
}
void cDesignerConfig::UpdateGlobals(void) { void cDesignerConfig::UpdateGlobals(void) {
string activeSkin = Setup.OSDSkin; string activeSkin = Setup.OSDSkin;
cSkinSetup *skinSetupActiveSkin = GetSkinSetup(activeSkin); cSkinSetup *skinSetupActiveSkin = GetSkinSetup(activeSkin);

View File

@ -11,6 +11,7 @@
#include "libcore/imagecache.h" #include "libcore/imagecache.h"
#include "libcore/recfolderinfo.h" #include "libcore/recfolderinfo.h"
#include "libcore/skinsetup.h" #include "libcore/skinsetup.h"
#include "libcore/skinrepo.h"
#define SCRIPTOUTPUTPATH "/tmp/skindesigner" #define SCRIPTOUTPUTPATH "/tmp/skindesigner"
@ -19,6 +20,7 @@ private:
cString CheckSlashAtEnd(string path); cString CheckSlashAtEnd(string path);
bool epgImagePathSet; bool epgImagePathSet;
bool skinPathSet; bool skinPathSet;
bool installerSkinPathSet;
bool logoPathSet; bool logoPathSet;
cRect osdSize; cRect osdSize;
string osdSkin; string osdSkin;
@ -40,12 +42,14 @@ private:
map < string, cSkinSetup* > skinSetups; map < string, cSkinSetup* > skinSetups;
map < string, cSkinSetup* >::iterator setupIt; map < string, cSkinSetup* >::iterator setupIt;
vector < pair <string, int> > skinSetupParameters; vector < pair <string, int> > skinSetupParameters;
cSkinRepos skinRepos;
public: public:
cDesignerConfig(); cDesignerConfig();
~cDesignerConfig(); ~cDesignerConfig();
bool SetupParse(const char *Name, const char *Value); bool SetupParse(const char *Name, const char *Value);
void SetPathes(void); void SetPathes(void);
void SetSkinPath(cString path); void SetSkinPath(cString path);
void SetInstallerSkinPath(cString path);
void SetLogoPath(cString path); void SetLogoPath(cString path);
void SetEpgImagePath(cString path); void SetEpgImagePath(cString path);
void ReadSkins(void); void ReadSkins(void);
@ -62,6 +66,7 @@ public:
void TranslateSetup(void); void TranslateSetup(void);
void SetSkinSetupParameters(void); void SetSkinSetupParameters(void);
void UpdateSkinSetupParameter(string name, int value); void UpdateSkinSetupParameter(string name, int value);
void ReadSkinRepos(void);
void SetGlobals(cGlobals *globals) { tmplGlobals = globals; }; void SetGlobals(cGlobals *globals) { tmplGlobals = globals; };
void UpdateGlobals(void); void UpdateGlobals(void);
void CheckDecimalPoint(void); void CheckDecimalPoint(void);
@ -84,6 +89,7 @@ public:
int GetPluginViewElementID(string pluginName, string viewElementName, int viewID); int GetPluginViewElementID(string pluginName, string viewElementName, int viewID);
int GetPluginViewGridID(string pluginName, string viewGridName, int viewID); int GetPluginViewGridID(string pluginName, string viewGridName, int viewID);
cString skinPath; cString skinPath;
cString installerSkinPath;
cString logoPath; cString logoPath;
cString epgImagePath; cString epgImagePath;
bool replaceDecPoint; bool replaceDecPoint;

View File

@ -1,6 +1,7 @@
#include <string> #include <string>
#include <sstream> #include <sstream>
#include <vector> #include <vector>
#include <stdlib.h>
#include "helpers.h" #include "helpers.h"
#include <vdr/skins.h> #include <vdr/skins.h>
@ -245,4 +246,3 @@ string GetScreenAspectString(double aspect, bool *isWideScreen) {
} }
return name; return name;
} }

View File

@ -62,7 +62,8 @@ cPluginSkinDesigner::~cPluginSkinDesigner() {
const char *cPluginSkinDesigner::CommandLineHelp(void) { const char *cPluginSkinDesigner::CommandLineHelp(void) {
return return
" -s <SKINPATH>, --skinpath=<SKINPATH> Set directory where xml skins are stored\n" " -s <SKINPATH>, --skinpath=<SKINPATH> Set directory where xml skins are stored by Package Manager\n"
" -i <INSTALLERPATH>, --installerpath=<INSTALLERPATH> Set directory where xml skins are stored by Installer\n"
" -l <LOGOPATH>, --logopath=<LOGOPATH> Set directory where a common logo set for all skins is stored\n" " -l <LOGOPATH>, --logopath=<LOGOPATH> Set directory where a common logo set for all skins is stored\n"
" -e <EPGIMAGESPATH>, --epgimages=<IMAGESPATH> Set directory where epgimages are stored\n"; " -e <EPGIMAGESPATH>, --epgimages=<IMAGESPATH> Set directory where epgimages are stored\n";
} }
@ -73,11 +74,12 @@ bool cPluginSkinDesigner::ProcessArgs(int argc, char *argv[]) {
{ "epgimages", required_argument, NULL, 'e' }, { "epgimages", required_argument, NULL, 'e' },
{ "logopath", required_argument, NULL, 'l' }, { "logopath", required_argument, NULL, 'l' },
{ "skinpath", required_argument, NULL, 's' }, { "skinpath", required_argument, NULL, 's' },
{ "installerpath", required_argument, NULL, 'i' },
{ 0, 0, 0, 0 } { 0, 0, 0, 0 }
}; };
int c; int c;
while ((c = getopt_long(argc, argv, "e:s:l:", long_options, NULL)) != -1) { while ((c = getopt_long(argc, argv, "e:s:l:i:", long_options, NULL)) != -1) {
switch (c) { switch (c) {
case 'e': case 'e':
config.SetEpgImagePath(cString(optarg)); config.SetEpgImagePath(cString(optarg));
@ -88,6 +90,9 @@ bool cPluginSkinDesigner::ProcessArgs(int argc, char *argv[]) {
case 's': case 's':
config.SetSkinPath(cString(optarg)); config.SetSkinPath(cString(optarg));
break; break;
case 'i':
config.SetInstallerSkinPath(cString(optarg));
break;
default: default:
return false; return false;
} }
@ -128,6 +133,7 @@ bool cPluginSkinDesigner::Start(void) {
} }
config.TranslateSetup(); config.TranslateSetup();
config.SetSkinSetupParameters(); config.SetSkinSetupParameters();
config.ReadSkinRepos();
if (skins.size() == 0) { if (skins.size() == 0) {
esyslog("skindesigner: no skins found! Using default Skin LCARS!"); esyslog("skindesigner: no skins found! Using default Skin LCARS!");