mirror of
				https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
				synced 2023-10-19 15:58:31 +00:00 
			
		
		
		
	implemented skininstaller config file
This commit is contained in:
		
							
								
								
									
										1
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								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 \ | ||||
|   | ||||
							
								
								
									
										11
									
								
								README
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								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 | ||||
|   | ||||
							
								
								
									
										23
									
								
								config.c
									
									
									
									
									
								
							
							
						
						
									
										23
									
								
								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); | ||||
|   | ||||
							
								
								
									
										6
									
								
								config.h
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								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; | ||||
|   | ||||
| @@ -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; | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -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!"); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user