summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2015-05-22 13:34:23 +0200
committerlouis <louis.braun@gmx.de>2015-05-22 13:34:23 +0200
commitf483aef4a85e9451e2e348541d981b31b5af51d3 (patch)
tree5461b80a8209b285066de0ead30c1e81bdfd6f58
parentf9278c805a8d9ff911673b6e635b80e3374db63d (diff)
downloadvdr-plugin-skindesigner-f483aef4a85e9451e2e348541d981b31b5af51d3.tar.gz
vdr-plugin-skindesigner-f483aef4a85e9451e2e348541d981b31b5af51d3.tar.bz2
implemented skininstaller config file
-rw-r--r--Makefile1
-rw-r--r--README11
-rw-r--r--config.c23
-rw-r--r--config.h6
-rw-r--r--libcore/helpers.c2
-rw-r--r--skindesigner.c10
6 files changed, 46 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index cc1c790..a99944f 100644
--- a/Makefile
+++ b/Makefile
@@ -74,6 +74,7 @@ OBJS = $(PLUGIN).o \
libcore/imageloader.o \
libcore/recfolderinfo.o \
libcore/skinsetup.o \
+ libcore/skinrepo.o \
libcore/extrecinfo.o \
libcore/timers.o \
libtemplate/globals.o \
diff --git a/README b/README
index 3d886c8..dcd850b 100644
--- a/README
+++ b/README
@@ -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:
-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>
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
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).
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
loaded because lack of true color support
diff --git a/config.c b/config.c
index b870cec..92feb46 100644
--- a/config.c
+++ b/config.c
@@ -6,6 +6,7 @@ cDesignerConfig::cDesignerConfig() {
tmplGlobals = NULL;
epgImagePathSet = false;
skinPathSet = false;
+ installerSkinPathSet = false;
logoPathSet = false;
//Common
numLogosPerSizeInitial = 30;
@@ -37,12 +38,15 @@ cDesignerConfig::~cDesignerConfig() {
void cDesignerConfig::SetPathes(void) {
if (!skinPathSet)
skinPath = cString::sprintf("%s/skins/", cPlugin::ResourceDirectory(PLUGIN_NAME_I18N));
+ if (!installerSkinPathSet)
+ installerSkinPath = cString::sprintf("%s/installerskins/", cPlugin::ConfigDirectory(PLUGIN_NAME_I18N));
if (!logoPathSet)
logoPath = cString::sprintf("%s/logos/", cPlugin::ResourceDirectory(PLUGIN_NAME_I18N));
if (!epgImagePathSet)
epgImagePath = cString::sprintf("%s/epgimages/", cPlugin::CacheDirectory(PLUGIN_NAME_I18N));
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 EPG Images Directory %s", *epgImagePath);
}
@@ -52,6 +56,11 @@ void cDesignerConfig::SetSkinPath(cString path) {
skinPathSet = true;
}
+void cDesignerConfig::SetInstallerSkinPath(cString path) {
+ installerSkinPath = CheckSlashAtEnd(*path);
+ installerSkinPathSet = true;
+}
+
void cDesignerConfig::SetLogoPath(cString path) {
logoPath = CheckSlashAtEnd(*path);
logoPathSet = true;
@@ -141,7 +150,6 @@ cSkinSetupMenu* cDesignerConfig::GetSkinSetupMenu(string &skin, string &menu) {
cSkinSetup *skinSetup = GetSkinSetup(skin);
if (!skinSetup)
return NULL;
- esyslog("skindesigner: skinsetup found");
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) {
string activeSkin = Setup.OSDSkin;
cSkinSetup *skinSetupActiveSkin = GetSkinSetup(activeSkin);
diff --git a/config.h b/config.h
index 6b3a037..d3c6066 100644
--- a/config.h
+++ b/config.h
@@ -11,6 +11,7 @@
#include "libcore/imagecache.h"
#include "libcore/recfolderinfo.h"
#include "libcore/skinsetup.h"
+#include "libcore/skinrepo.h"
#define SCRIPTOUTPUTPATH "/tmp/skindesigner"
@@ -19,6 +20,7 @@ private:
cString CheckSlashAtEnd(string path);
bool epgImagePathSet;
bool skinPathSet;
+ bool installerSkinPathSet;
bool logoPathSet;
cRect osdSize;
string osdSkin;
@@ -40,12 +42,14 @@ private:
map < string, cSkinSetup* > skinSetups;
map < string, cSkinSetup* >::iterator setupIt;
vector < pair <string, int> > skinSetupParameters;
+ cSkinRepos skinRepos;
public:
cDesignerConfig();
~cDesignerConfig();
bool SetupParse(const char *Name, const char *Value);
void SetPathes(void);
void SetSkinPath(cString path);
+ void SetInstallerSkinPath(cString path);
void SetLogoPath(cString path);
void SetEpgImagePath(cString path);
void ReadSkins(void);
@@ -62,6 +66,7 @@ public:
void TranslateSetup(void);
void SetSkinSetupParameters(void);
void UpdateSkinSetupParameter(string name, int value);
+ void ReadSkinRepos(void);
void SetGlobals(cGlobals *globals) { tmplGlobals = globals; };
void UpdateGlobals(void);
void CheckDecimalPoint(void);
@@ -84,6 +89,7 @@ public:
int GetPluginViewElementID(string pluginName, string viewElementName, int viewID);
int GetPluginViewGridID(string pluginName, string viewGridName, int viewID);
cString skinPath;
+ cString installerSkinPath;
cString logoPath;
cString epgImagePath;
bool replaceDecPoint;
diff --git a/libcore/helpers.c b/libcore/helpers.c
index add1f7a..6aef313 100644
--- a/libcore/helpers.c
+++ b/libcore/helpers.c
@@ -1,6 +1,7 @@
#include <string>
#include <sstream>
#include <vector>
+#include <stdlib.h>
#include "helpers.h"
#include <vdr/skins.h>
@@ -245,4 +246,3 @@ string GetScreenAspectString(double aspect, bool *isWideScreen) {
}
return name;
}
-
diff --git a/skindesigner.c b/skindesigner.c
index 619210a..0a05143 100644
--- a/skindesigner.c
+++ b/skindesigner.c
@@ -62,7 +62,8 @@ cPluginSkinDesigner::~cPluginSkinDesigner() {
const char *cPluginSkinDesigner::CommandLineHelp(void) {
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"
" -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' },
{ "logopath", required_argument, NULL, 'l' },
{ "skinpath", required_argument, NULL, 's' },
+ { "installerpath", required_argument, NULL, 'i' },
{ 0, 0, 0, 0 }
};
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) {
case 'e':
config.SetEpgImagePath(cString(optarg));
@@ -88,6 +90,9 @@ bool cPluginSkinDesigner::ProcessArgs(int argc, char *argv[]) {
case 's':
config.SetSkinPath(cString(optarg));
break;
+ case 'i':
+ config.SetInstallerSkinPath(cString(optarg));
+ break;
default:
return false;
}
@@ -128,6 +133,7 @@ bool cPluginSkinDesigner::Start(void) {
}
config.TranslateSetup();
config.SetSkinSetupParameters();
+ config.ReadSkinRepos();
if (skins.size() == 0) {
esyslog("skindesigner: no skins found! Using default Skin LCARS!");