diff options
-rw-r--r-- | HISTORY | 11 | ||||
-rw-r--r-- | Makefile | 117 | ||||
-rw-r--r-- | README | 21 | ||||
-rw-r--r-- | po/de.po | 4 | ||||
-rw-r--r-- | po/fr.po | 4 | ||||
-rw-r--r-- | po/it.po | 4 | ||||
-rw-r--r-- | po/sk.po | 4 | ||||
-rw-r--r-- | src/MenuOrgPlugin.cpp | 1 | ||||
-rw-r--r-- | src/Version.h | 2 | ||||
-rw-r--r-- | vdr-patch/vdr-menuorg-0.5.0.diff | 275 |
10 files changed, 354 insertions, 89 deletions
@@ -62,3 +62,14 @@ VDR Plugin 'menuorg' Revision History - When entering root menu, always select the first menu entry (Closes #792) - Dropped debian packaging directory - Added missing #include <cstddef> + +2013-03-16: Version 0.5.0 + +- Makefile for VDR >= 1.7.33 +- Dropped migration tool and documentation for submenu plugin +- Updated patch for VDR 1.7.40 + +2013-03-17: Version 0.5.1 + +- Minor fix in member initialization (thx to by Lars Hanisch) +- Correctly link shared libs (thx to by Lars Hanisch) @@ -1,57 +1,54 @@ # # vdr-menuorg - A plugin for the Linux Video Disk Recorder # -# $Id$ -# -# The official name of this plugin. -# This name will be used in the '-P...' option of VDR to load the plugin. -# PLUGIN = menuorg -SVNROOT ?= svn+e-tobi://e-tobi.net/menuorg - ### The version number of this plugin (taken from the main source file): -VERSION = $(shell grep 'static const char VERSION\[\] =' src/Version.h | \ - awk '{ print $$6 }' | sed -e 's/[";]//g') +VERSION = $(shell grep 'static const char VERSION\[\] =' src/Version.h | awk '{ print $$6 }' | sed -e 's/[";]//g') -### The C++ compiler and options: +### The directory environment: -CXX ?= g++ -CXXFLAGS ?= -fPIC -O2 -Wall -Woverloaded-virtual +# Use package data if installed...otherwise assume we're under the VDR source directory: +PKGCFG = $(if $(VDRDIR),$(shell pkg-config --variable=$(1) $(VDRDIR)/vdr.pc),$(shell pkg-config --variable=$(1) vdr || pkg-config --variable=$(1) ../../../vdr.pc)) +LIBDIR = $(call PKGCFG,libdir) +LOCDIR = $(call PKGCFG,locdir) +PLGCFG = $(call PKGCFG,plgcfg) +# +TMPDIR ?= /tmp -### The directory environment: +### The compiler options: -DVBDIR = ../../../../DVB -VDRDIR = ../../.. -LIBDIR = ../../lib -TMPDIR = /tmp +export CFLAGS = $(call PKGCFG,cflags) +export CXXFLAGS = $(call PKGCFG,cxxflags) -### Allow user defined options to overwrite defaults: +### The version number of VDR's plugin API: --include $(VDRDIR)/Make.config +APIVERSION = $(call PKGCFG,apiversion) -### The version number of VDR's plugin API (taken from VDR's "config.h"): +### Allow user defined options to overwrite defaults: -APIVERSION = $(shell sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' \ - $(VDRDIR)/config.h) +-include $(PLGCFG) ### The name of the distribution archive: ARCHIVE = $(PLUGIN)-$(VERSION) PACKAGE = vdr-$(ARCHIVE) -### Includes, Libs and Defines (add further entries here): +### The name of the shared object file: + +SOFILE = libvdr-$(PLUGIN).so + +### Includes and Defines (add further entries here): -INCLUDES += -I. -I$(VDRDIR)/include -I$(DVBDIR)/include -INCLUDES += `pkg-config libxml++-2.6 --cflags` -INCLUDES += `pkg-config glibmm-2.4 --cflags` +INCLUDES += `pkg-config libxml++-2.6 --cflags` +INCLUDES += `pkg-config glibmm-2.4 --cflags` LIBS += `pkg-config libxml++-2.6 --libs` LIBS += `pkg-config glibmm-2.4 --libs` -DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"' +DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"' ### The source files (add further files here): @@ -61,70 +58,68 @@ DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"' OBJS := $(addsuffix .o,$(basename ${SRCS})) -### Implicit rules: +### The main target: -%.o: %.cpp - $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $< -o $@ +all: $(SOFILE) i18n -%.o: %.cc - $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $< -o $@ +### Implicit rules: -# Dependencies: +%.o: %.cpp + $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $< -MAKEDEP = $(CXX) -MM -BUILD_DEPFILE = .dependencies +### Dependencies: -$(BUILD_DEPFILE): Makefile - @$(MAKEDEP) $(DEFINES) $(INCLUDES) $(SRCS) \ - | sed "s/.*: \([^ ]*\/\).*/\1\0/" > $@ +MAKEDEP = $(CXX) -MM -MG +DEPFILE = .dependencies +$(DEPFILE): Makefile + @$(MAKEDEP) $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@ --include $(BUILD_DEPFILE) +-include $(DEPFILE) ### Internationalization (I18N): PODIR = po -LOCALEDIR = $(VDRDIR)/locale I18Npo = $(wildcard $(PODIR)/*.po) -I18Nmsgs = $(addprefix $(LOCALEDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file)))))) +I18Nmo = $(addsuffix .mo, $(foreach file, $(I18Npo), $(basename $(file)))) +I18Nmsgs = $(addprefix $(DESTDIR)$(LOCDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file)))))) I18Npot = $(PODIR)/$(PLUGIN).pot %.mo: %.po msgfmt -c -o $@ $< +$(I18Npot): $(wildcard src/*.cpp) + xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --package-name=vdr-$(PLUGIN) --package-version=$(VERSION) --msgid-bugs-address='<see README>' -o $@ `ls $^` + %.po: $(I18Npot) - msgmerge -U --no-wrap --no-location --backup=none -q $@ $< + msgmerge -U --no-wrap --no-location --backup=none -q -N $@ $< @touch $@ -$(I18Npot): $(SRCS) $(SRCS_TESTABLE) - xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --msgid-bugs-address='<vdr@e-tobi.net>' -o $@ $^ - -$(I18Nmsgs): $(LOCALEDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo - @mkdir -p $(dir $@) - mv $< $@ - -update-po: $(I18Npo) +$(I18Nmsgs): $(DESTDIR)$(LOCDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo + install -D -m644 $< $@ .PHONY: i18n -i18n: $(I18Nmsgs) +i18n: $(I18Nmo) $(I18Npot) + +install-i18n: $(I18Nmsgs) ### Targets: -all: libvdr-$(PLUGIN).so i18n +$(SOFILE): $(OBJS) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) $(LIBS) -o $@ + +install-lib: $(SOFILE) + install -D $^ $(DESTDIR)$(LIBDIR)/$^.$(APIVERSION) -libvdr-$(PLUGIN).so: $(OBJS) - $(CXX) $(CXXFLAGS) -shared $(OBJS) -L. $(LIBS) -o $@ - @cp $@ $(LIBDIR)/$@.$(APIVERSION) +install: install-lib install-i18n -dist: clean +dist: $(I18Npo) clean @-rm -rf $(TMPDIR)/$(ARCHIVE) @mkdir $(TMPDIR)/$(ARCHIVE) @cp -a * $(TMPDIR)/$(ARCHIVE) - @tar czf $(PACKAGE).tar.gz -C $(TMPDIR) --exclude .git \ - --exclude tools --exclude .cproject --exclude .project \ - $(ARCHIVE) + @tar czf $(PACKAGE).tar.gz -C $(TMPDIR) --exclude .gitignore --exclude debian --exclude .git $(ARCHIVE) @-rm -rf $(TMPDIR)/$(ARCHIVE) @echo Distribution package created as $(PACKAGE).tar.gz clean: - @-rm -f $(BUILD_DEPFILE) *.so* *.tar.gz core* *~ - @-find . -name \*.\o -exec rm -f {} \; + @-rm -f $(PODIR)/*.mo $(PODIR)/*.pot + @-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~ @@ -24,13 +24,13 @@ License: You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. See the file COPYING for the full license information Copyright: - (C) 2007 - 2008 Tobias Grimm + (C) 2007 - 2013 Tobias Grimm (C) 2007 Thomas Creutz @@ -61,23 +61,6 @@ The following parameters are available: (default: ConfigDir/plugins/menuorg.xml) -Upgrading from vdr-submenu plugin ---------------------------------- - -There is a convert script in this package, that allows you to convert your old -MainMenu.conf from the submenu plug-in to the XML file which is needed by -menuorg. - -Example usage: - - vdr-submenu2menuorg /var/lib/vdr/plugins/MainMenu.conf /var/lib/vdr/plugins/menuorg.xml - -Attention: Your destination file will be overwritten without any warning! - -When your VDR runs not as root, than you should verify that the target file is -readable for the which ever user runs VDR. - - Menu file format ---------------- @@ -1,8 +1,8 @@ msgid "" msgstr "" "Project-Id-Version: vdr-menuorg\n" -"Report-Msgid-Bugs-To: <vdr@e-tobi.net>\n" -"POT-Creation-Date: 2012-02-05 19:39+0100\n" +"Report-Msgid-Bugs-To: <see README>\n" +"POT-Creation-Date: 2013-03-16 18:02+0100\n" "PO-Revision-Date: 2008-03-22 16:44+0100\n" "Last-Translator: Tobias Grimm <vdr@e-tobi.net>\n" "Language-Team: <vdr@e-tobi.net>\n" @@ -1,8 +1,8 @@ msgid "" msgstr "" "Project-Id-Version: vdr-menuorg\n" -"Report-Msgid-Bugs-To: <vdr@e-tobi.net>\n" -"POT-Creation-Date: 2012-02-05 19:39+0100\n" +"Report-Msgid-Bugs-To: <see README>\n" +"POT-Creation-Date: 2013-03-16 18:02+0100\n" "PO-Revision-Date: 2008-03-25 08:37+0100\n" "Last-Translator: NIVAL Michaƫl <mnival@club-internet.fr>\n" "Language-Team: <vdr@e-tobi.net>\n" @@ -1,8 +1,8 @@ msgid "" msgstr "" "Project-Id-Version: vdr-menuorg\n" -"Report-Msgid-Bugs-To: <vdr@e-tobi.net>\n" -"POT-Creation-Date: 2012-02-05 19:39+0100\n" +"Report-Msgid-Bugs-To: <see README>\n" +"POT-Creation-Date: 2013-03-16 18:02+0100\n" "PO-Revision-Date: 2008-03-26 01:01+0100\n" "Last-Translator: Gringo <vdr-italian@tiscali.it>\n" "Language-Team: Gringo <vdr-italian@tiscali.it>\n" @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: menuorg\n" -"Report-Msgid-Bugs-To: <vdr@e-tobi.net>\n" -"POT-Creation-Date: 2012-02-05 19:39+0100\n" +"Report-Msgid-Bugs-To: <see README>\n" +"POT-Creation-Date: 2013-03-16 18:02+0100\n" "PO-Revision-Date: 2011-02-16 14:25+0100\n" "Last-Translator: Milan Hrala <hrala.milan@gmail.com>\n" "Language-Team: Slovak <hrala.milan@gmail.com>\n" diff --git a/src/MenuOrgPlugin.cpp b/src/MenuOrgPlugin.cpp index f2d182a..6c85e5d 100644 --- a/src/MenuOrgPlugin.cpp +++ b/src/MenuOrgPlugin.cpp @@ -45,6 +45,7 @@ MenuOrgPlugin::MenuOrgPlugin(void) // VDR OBJECTS TO EXIST OR PRODUCE ANY OUTPUT! _subMenuProvider = NULL; + _menuConfigurationRepository = NULL; } MenuOrgPlugin::~MenuOrgPlugin() diff --git a/src/Version.h b/src/Version.h index e9bb6bf..e8c5eaf 100644 --- a/src/Version.h +++ b/src/Version.h @@ -24,6 +24,6 @@ #ifndef ___VERSION_H #define ___VERSION_H -static const char VERSION[] = "0.4.5"; +static const char VERSION[] = "0.5.1"; #endif diff --git a/vdr-patch/vdr-menuorg-0.5.0.diff b/vdr-patch/vdr-menuorg-0.5.0.diff new file mode 100644 index 0000000..953e739 --- /dev/null +++ b/vdr-patch/vdr-menuorg-0.5.0.diff @@ -0,0 +1,275 @@ +diff --git a/mainmenuitemsprovider.h b/mainmenuitemsprovider.h +new file mode 100644 +index 0000000..aaba5e9 +--- /dev/null ++++ b/mainmenuitemsprovider.h +@@ -0,0 +1,60 @@ ++/* ++ * vdr-menuorg - A plugin for the Linux Video Disk Recorder ++ * Copyright (c) 2007 - 2008 Tobias Grimm <vdr@e-tobi.net> ++ * ++ * This program is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License as published by the ++ * Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more ++ * details. ++ * ++ * You should have received a copy of the GNU General Public License along with ++ * this program; if not, write to the Free Software Foundation, Inc., ++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ * $Id$ ++ * ++ */ ++ ++#ifndef __MAINMENUITEMSPROVIDER_H ++#define __MAINMENUITEMSPROVIDER_H ++ ++#include <vector> ++ ++class cOsdItem; ++class cOsdMenu; ++ ++class IMenuItemDefinition ++{ ++ public: ++ virtual ~IMenuItemDefinition() {}; ++ virtual bool IsCustomOsdItem() = 0; ++ virtual bool IsPluginItem() = 0; ++ virtual bool IsSeparatorItem() = 0; ++ virtual cOsdItem* CustomOsdItem() = 0; ++ virtual const char* PluginMenuEntry() = 0; ++ virtual bool IsSelected() = 0; ++ virtual int PluginIndex() = 0; ++}; ++ ++typedef std::vector<IMenuItemDefinition*> MenuItemDefinitions; ++ ++#define MENU_ITEMS_PROVIDER_SERVICE_ID "MenuOrgPatch-v0.4.2::MainMenuItemsProvider" ++ ++class IMainMenuItemsProvider ++{ ++ public: ++ virtual ~IMainMenuItemsProvider() {}; ++ virtual bool IsCustomMenuAvailable() = 0; ++ virtual MenuItemDefinitions* MainMenuItems() = 0; ++ virtual void EnterRootMenu() = 0; ++ virtual void EnterSubMenu(cOsdItem* item) = 0; ++ virtual bool LeaveSubMenu() = 0; ++ virtual cOsdMenu* Execute(cOsdItem* item) = 0; ++}; ++ ++#endif //__MAINMENUITEMSPROVIDER_H +diff --git a/menu.c b/menu.c +index 7732697..3f1453a 100644 +--- a/menu.c ++++ b/menu.c +@@ -31,6 +31,7 @@ + #include "timers.h" + #include "transfer.h" + #include "videodir.h" ++#include "menuorgpatch.h" + + #define MAXWAIT4EPGINFO 3 // seconds + #define MODETIMEOUT 3 // seconds +@@ -3375,6 +3376,9 @@ cMenuMain::cMenuMain(eOSState State) + cancelEditingItem = NULL; + stopRecordingItem = NULL; + recordControlsState = 0; ++ ++ MenuOrgPatch::EnterRootMenu(); ++ + Set(); + + // Initial submenus: +@@ -3403,6 +3407,29 @@ void cMenuMain::Set(void) + SetTitle("VDR"); + SetHasHotkeys(); + ++ if (MenuOrgPatch::IsCustomMenuAvailable()) { ++ MenuItemDefinitions* menuItems = MenuOrgPatch::MainMenuItems(); ++ for (MenuItemDefinitions::iterator i = menuItems->begin(); i != menuItems->end(); i++) { ++ cOsdItem* osdItem = NULL; ++ if ((*i)->IsCustomOsdItem()) { ++ osdItem = (*i)->CustomOsdItem(); ++ if (osdItem && !(*i)->IsSeparatorItem()) ++ osdItem->SetText(hk(osdItem->Text())); ++ } ++ else if ((*i)->IsPluginItem()) { ++ const char *item = (*i)->PluginMenuEntry(); ++ if (item) ++ osdItem = new cMenuPluginItem(hk(item), (*i)->PluginIndex()); ++ } ++ if (osdItem) { ++ Add(osdItem); ++ if ((*i)->IsSelected()) ++ SetCurrent(osdItem); ++ } ++ } ++ } ++ else { ++ + // Basic menu items: + + Add(new cOsdItem(hk(tr("Schedule")), osSchedule)); +@@ -3429,6 +3456,8 @@ void cMenuMain::Set(void) + if (Commands.Count()) + Add(new cOsdItem(hk(tr("Commands")), osCommands)); + ++ } ++ + Update(true); + + Display(); +@@ -3534,6 +3563,41 @@ eOSState cMenuMain::ProcessKey(eKeys Key) + state = osEnd; + } + break; ++ case osBack: { ++ if (MenuOrgPatch::IsCustomMenuAvailable()) ++ { ++ bool leavingMenuSucceeded = MenuOrgPatch::LeaveSubMenu(); ++ Set(); ++ stopReplayItem = NULL; ++ cancelEditingItem = NULL; ++ stopRecordingItem = NULL; ++ recordControlsState = 0; ++ Update(true); ++ Display(); ++ if (leavingMenuSucceeded) ++ return osContinue; ++ else ++ return osEnd; ++ } ++ } ++ break; ++ case osUser1: { ++ if (MenuOrgPatch::IsCustomMenuAvailable()) { ++ MenuOrgPatch::EnterSubMenu(Get(Current())); ++ Set(); ++ return osContinue; ++ } ++ } ++ break; ++ case osUser2: { ++ if (MenuOrgPatch::IsCustomMenuAvailable()) { ++ cOsdMenu* osdMenu = MenuOrgPatch::Execute(Get(Current())); ++ if (osdMenu) ++ return AddSubMenu(osdMenu); ++ return osEnd; ++ } ++ } ++ break; + default: switch (Key) { + case kRecord: + case kRed: if (!HadSubMenu) +diff --git a/menuorgpatch.h b/menuorgpatch.h +new file mode 100644 +index 0000000..37fa0a7 +--- /dev/null ++++ b/menuorgpatch.h +@@ -0,0 +1,100 @@ ++/* ++ * vdr-menuorg - A plugin for the Linux Video Disk Recorder ++ * Copyright (c) 2007 - 2008 Tobias Grimm <vdr@e-tobi.net> ++ * ++ * This program is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License as published by the ++ * Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more ++ * details. ++ * ++ * You should have received a copy of the GNU General Public License along with ++ * this program; if not, write to the Free Software Foundation, Inc., ++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ * $Id$ ++ * ++ */ ++ ++#ifndef __MENUORGPATCH_H ++#define __MENUORGPATCH_H ++ ++#include "mainmenuitemsprovider.h" ++ ++class MenuOrgPatch ++{ ++ private: ++ static IMainMenuItemsProvider* _mainMenuItemsProvider; ++ ++ private: ++ static IMainMenuItemsProvider* MainMenuItemsProvider() ++ { ++ if (!_mainMenuItemsProvider) ++ { ++ IMainMenuItemsProvider* mainMenuItemsProvider; ++ ++ if (cPluginManager::CallFirstService(MENU_ITEMS_PROVIDER_SERVICE_ID, &mainMenuItemsProvider)) ++ { ++ _mainMenuItemsProvider = mainMenuItemsProvider; ++ } ++ } ++ return _mainMenuItemsProvider; ++ } ++ ++ public: ++ static bool IsCustomMenuAvailable() ++ { ++ return (MainMenuItemsProvider() != NULL) && (MainMenuItemsProvider()->IsCustomMenuAvailable()); ++ } ++ ++ static void EnterRootMenu() ++ { ++ if (MainMenuItemsProvider()) ++ { ++ MainMenuItemsProvider()->EnterRootMenu(); ++ } ++ } ++ ++ static bool LeaveSubMenu() ++ { ++ if (MainMenuItemsProvider()) ++ { ++ return MainMenuItemsProvider()->LeaveSubMenu(); ++ } ++ return false; ++ } ++ ++ static void EnterSubMenu(cOsdItem* item) ++ { ++ if (MainMenuItemsProvider()) ++ { ++ MainMenuItemsProvider()->EnterSubMenu(item); ++ } ++ } ++ ++ static MenuItemDefinitions* MainMenuItems() ++ { ++ if (MainMenuItemsProvider()) ++ { ++ return MainMenuItemsProvider()->MainMenuItems(); ++ } ++ return NULL; ++ } ++ ++ static cOsdMenu* Execute(cOsdItem* item) ++ { ++ if (MainMenuItemsProvider()) ++ { ++ return MainMenuItemsProvider()->Execute(item); ++ } ++ return NULL; ++ } ++}; ++ ++IMainMenuItemsProvider* MenuOrgPatch::_mainMenuItemsProvider = NULL; ++ ++#endif //__MENUORGPATCH_H |