vdr/vdr/debian/patches 03_cmdsubmenu.dpatch
Tobias Grimm
pkg-vdr-dvb-changes@lists.alioth.debian.org
Fri, 28 May 2004 07:22:19 +0000
Update of /cvsroot/pkg-vdr-dvb/vdr/vdr/debian/patches
In directory haydn:/tmp/cvs-serv22869/debian/patches
Modified Files:
03_cmdsubmenu.dpatch
Log Message:
improvement of submenu patch by Thomas Günther (Thx!)
Index: 03_cmdsubmenu.dpatch
===================================================================
RCS file: /cvsroot/pkg-vdr-dvb/vdr/vdr/debian/patches/03_cmdsubmenu.dpatch,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- 03_cmdsubmenu.dpatch 26 May 2004 21:52:49 -0000 1.3
+++ 03_cmdsubmenu.dpatch 28 May 2004 07:22:17 -0000 1.4
@@ -2,7 +2,8 @@
## submenu patch
##
## All lines beginning with `## DP:' are a description of the patch.
-## DP: adds submenus within the commands and recording commnnds menu
+## DP: Adds submenus within the commands and recording commands menu.
+## DP: To create a submenu entry, prefix the name by one ore more "-".
if [ $# -ne 1 ]; then
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
@@ -23,9 +24,20 @@
exit 0
@DPATCH@
-diff -Nur vdr.orig/config.c vdr/config.c
---- vdr.orig/config.c 2004-05-27 00:09:53.000000000 +0200
-+++ vdr/config.c 2004-05-27 01:15:23.000000000 +0200
+diff -urNad vdr-1.2.6.orig/Makefile vdr-1.2.6/Makefile
+--- vdr-1.2.6.orig/Makefile Fri May 28 00:36:59 2004
++++ vdr-1.2.6/Makefile Fri May 28 00:37:16 2004
+@@ -48,6 +48,7 @@
+
+ DEFINES += -DREMOTE_$(REMOTE)
+
++DEFINES += -DCMD_SUBMENUS
+ DEFINES += -D_GNU_SOURCE
+
+ DEFINES += -DVIDEODIR=\"$(VIDEODIR)\"
+diff -urNad vdr-1.2.6.orig/config.c vdr-1.2.6/config.c
+--- vdr-1.2.6.orig/config.c Fri May 28 00:36:59 2004
++++ vdr-1.2.6/config.c Fri May 28 00:38:14 2004
@@ -27,18 +27,29 @@
{
title = command = NULL;
@@ -56,10 +68,12 @@
int l = p - s;
if (l > 0) {
title = MALLOC(char, l + 1);
-@@ -85,6 +96,76 @@
+@@ -83,6 +94,76 @@
+ esyslog("ERROR: can't open pipe for command '%s'", cmd);
+ free(cmdbuf);
return result;
- }
-
++}
++
+int cCommand::getIndent ()
+{
+ return nIndent;
@@ -105,7 +119,7 @@
+
+// --- cCommands -------------------------------------------------------
+
-+void cCommands::Add(cListObject *Object, cListObject *After)
++void cCommands::AddConfig(cCommand *Object)
+{
+ cCommand *c = (cCommand *) Object;
+ cCommand *cParent;
@@ -127,15 +141,13 @@
+ return;
+ }
+ }
-+ cConfig<cCommand>::Add (Object, After);
-+}
-+
- // -- cSVDRPhost -------------------------------------------------------------
++ cConfig<cCommand>::Add(Object);
+ }
- cSVDRPhost::cSVDRPhost(void)
-diff -Nur vdr.orig/config.h vdr/config.h
---- vdr.orig/config.h 2004-05-27 00:09:53.000000000 +0200
-+++ vdr/config.h 2004-05-27 01:15:23.000000000 +0200
+ // -- cSVDRPhost -------------------------------------------------------------
+diff -urNad vdr-1.2.6.orig/config.h vdr-1.2.6/config.h
+--- vdr-1.2.6.orig/config.h Fri May 28 00:36:59 2004
++++ vdr-1.2.6/config.h Fri May 28 00:37:16 2004
@@ -32,11 +32,15 @@
#define MaxFileName 256
@@ -165,102 +177,51 @@
};
typedef uint32_t in_addr_t; //XXX from /usr/include/netinet/in.h (apparently this is not defined on systems with glibc < 2.2)
-@@ -156,7 +166,11 @@
+@@ -87,6 +97,10 @@
+ cConfig(void) { fileName = NULL; }
+ virtual ~cConfig() { free(fileName); }
+ const char *FileName(void) { return fileName; }
++ virtual void AddConfig(T *Object)
++ {
++ cList<T>::Add(Object);
++ }
+ bool Load(const char *FileName = NULL, bool AllowComments = false, bool MustExist = false)
+ {
+ Clear();
+@@ -114,7 +128,7 @@
+ if (!isempty(buffer)) {
+ T *l = new T;
+ if (l->Parse(buffer))
+- Add(l);
++ AddConfig(l);
+ else {
+ esyslog("ERROR: error in %s, line %d\n", fileName, line);
+ delete l;
+@@ -156,7 +170,10 @@
}
};
-class cCommands : public cConfig<cCommand> {};
-+class cCommands : public cConfig<cCommand>
-+{
-+ public:
-+ virtual void Add(cListObject *Object, cListObject *After = NULL);
-+};
++class cCommands : public cConfig<cCommand> {
++public:
++ virtual void AddConfig(cCommand *Object);
++ };
class cSVDRPhosts : public cConfig<cSVDRPhost> {
public:
-diff -Nur vdr.orig/Makefile vdr/Makefile
---- vdr.orig/Makefile 2004-05-27 00:09:52.000000000 +0200
-+++ vdr/Makefile 2004-05-27 01:15:23.000000000 +0200
-@@ -48,6 +48,7 @@
-
- DEFINES += -DREMOTE_$(REMOTE)
-
-+DEFINES += -DCMD_SUBMENUS
- DEFINES += -D_GNU_SOURCE
-
- DEFINES += -DVIDEODIR=\"$(VIDEODIR)\"
-diff -Nur vdr.orig/menu.c vdr/menu.c
---- vdr.orig/menu.c 2004-05-27 00:09:56.000000000 +0200
-+++ vdr/menu.c 2004-05-27 01:16:41.000000000 +0200
-@@ -28,6 +28,8 @@
- #include "transfer.h"
- #include "videodir.h"
-
-+/* #include "dvbsub.h" */
-+
- #define MENUTIMEOUT 120 // seconds
- #define MAXWAIT4EPGINFO 3 // seconds
- #define MODETIMEOUT 3 // seconds
-@@ -1518,6 +1520,16 @@
+diff -urNad vdr-1.2.6.orig/menu.c vdr-1.2.6/menu.c
+--- vdr-1.2.6.orig/menu.c Fri May 28 00:36:59 2004
++++ vdr-1.2.6/menu.c Fri May 28 00:37:16 2004
+@@ -1518,6 +1518,12 @@
if (command) {
char *buffer = NULL;
bool confirmed = true;
+#ifdef CMD_SUBMENUS
-+ if (command->hasChilds ())
-+ {
-+ cMenuCommands *menu;
-+ AddSubMenu(menu = new cMenuCommands(command->Title (), command->getChilds (), parameters));
-+ return osContinue;
-+ }
-+ else
-+ {
++ if (command->hasChilds()) {
++ AddSubMenu(new cMenuCommands(command->Title(), command->getChilds(), parameters));
++ return osContinue;
++ }
+#endif // CMD_SUBMENUS
if (command->Confirm()) {
asprintf(&buffer, "%s?", command->Title());
confirmed = Interface->Confirm(buffer);
-@@ -1533,7 +1545,11 @@
- return AddSubMenu(new cMenuText(command->Title(), Result, fontFix));
- return osEnd;
- }
-+#ifdef CMD_SUBMENUS
- }
-+#endif // CMD_SUBMENUS
-+
-+ }
- return osContinue;
- }
-
-diff -Nur vdr.orig/osd.h vdr/osd.h
---- vdr.orig/osd.h 2004-05-27 00:09:56.000000000 +0200
-+++ vdr/osd.h 2004-05-27 01:15:51.000000000 +0200
-@@ -163,6 +163,7 @@
- cOsdMenu(const char *Title, int c0 = 0, int c1 = 0, int c2 = 0, int c3 = 0, int c4 = 0);
- virtual ~cOsdMenu();
- int Current(void) { return current; }
-+ using cListBase::Add;
- void Add(cOsdItem *Item, bool Current = false, cOsdItem *After = NULL);
- void Ins(cOsdItem *Item, bool Current = false, cOsdItem *Before = NULL);
- virtual void Display(void);
-diff -Nur vdr.orig/recording.h vdr/recording.h
---- vdr.orig/recording.h 2004-05-27 00:09:56.000000000 +0200
-+++ vdr/recording.h 2004-05-27 01:16:08.000000000 +0200
-@@ -91,6 +91,7 @@
- public:
- bool Load(const char *RecordingFileName);
- void Sort(void);
-+ using cListBase::Add;
- cMark *Add(int Position);
- cMark *Get(int Position);
- cMark *GetPrev(int Position);
-diff -Nur vdr.orig/tools.h vdr/tools.h
---- vdr.orig/tools.h 2004-05-27 00:09:57.000000000 +0200
-+++ vdr/tools.h 2004-05-27 01:15:23.000000000 +0200
-@@ -158,7 +158,7 @@
- cListBase(void);
- public:
- virtual ~cListBase();
-- void Add(cListObject *Object, cListObject *After = NULL);
-+ virtual void Add(cListObject *Object, cListObject *After = NULL);
- void Ins(cListObject *Object, cListObject *Before = NULL);
- void Del(cListObject *Object, bool DeleteObject = true);
- virtual void Move(int From, int To);