summaryrefslogtreecommitdiff
blob: 93ea7d952d6fa695a32c56d87b568d22b912fb4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
Downloaded from http://www.vdr-portal.de/board/thread.php?postid=433592#post433592

diff -Naur tvonscreen-0.7.1/gfxtools.c tvonscreen-0.7.2/gfxtools.c
--- tvonscreen-0.7.1/gfxtools.c	2005-01-09 17:12:42.000000000 +0100
+++ tvonscreen-0.7.2/gfxtools.c	2006-02-26 22:27:57.000000000 +0100
@@ -24,7 +24,12 @@
 		int index = 0;
 		char *s;
 		cReadLine *FileOps= new cReadLine();	
-		while ((s = FileOps->Read(f)) != NULL) 
+ #if VDRVERSNUM >= 10318
+                cReadLine ReadLine;
+                while ( (s = ReadLine.Read(f) ) != NULL )
+ #else
+                while ((s = readline(f)) != NULL)
+ #endif
 		{
 			s = skipspace(s);
 			if (!isXpm)
diff -Naur tvonscreen-0.7.1/magazine.c tvonscreen-0.7.2/magazine.c
--- tvonscreen-0.7.1/magazine.c	2005-09-11 20:57:10.000000000 +0200
+++ tvonscreen-0.7.2/magazine.c	2006-02-26 22:22:44.000000000 +0100
@@ -476,7 +476,12 @@
 #endif
 
 	int j=0;
+#if VDRVERSNUM >= 10318
+	const char *txt;
+	cString timetxt;
+#else
 	const char *txt,*timetxt;
+#endif
 	int lh=-1;
 	int lhc=0;
 #if VDRVERSNUM >= 10307
@@ -540,7 +545,11 @@
 					col=clrYellow;
 					EDIT_curEVI=i;
 				}
+#if VDRVERSNUM >= 10318
+				timetxt=*cev->GetTimeString();
+#else
 				timetxt=cev->GetTimeString();
+#endif
 #if VDRVERSNUM >= 10300
 				txt=cev->Title();
 #else
@@ -643,6 +652,9 @@
 const cEventInfo *magazine::getNext(const cSchedule *s,const cEventInfo *e)
 #endif
 {
+	if (e == NULL)
+		return NULL;
+
 #if VDRVERSNUM >= 10300
 	const cEvent *pe = NULL;
 	time_t ref = e->StartTime();
@@ -687,6 +699,9 @@
 const cEventInfo *magazine::getPrev(const cSchedule *s,const cEventInfo *e)
 #endif
 {
+	if (e == NULL)
+		return NULL;
+
 #if VDRVERSNUM >= 10300
 	const cEvent *pe = NULL;
 	time_t ref = e->StartTime();
@@ -1485,9 +1500,9 @@
 	{
 		state = cOsdObject::ProcessKey(Key);
 	
-		if (state == osUnknown)
+		if (state == osUnknown && schedArrayNum>currentFirst)
 		{
-			if (curmode==SHOW && schedArrayNum>currentFirst)
+			if (curmode==SHOW)
 			{
 				switch (Key & ~k_Repeat)
 				{
@@ -1523,6 +1538,8 @@
 						currentFirst++;
 						if (currentFirst>schedArrayNum-3)
 							currentFirst=schedArrayNum-3;
+						if (currentFirst<0)
+							currentFirst=0;
 						output();
 						break;
 					case kUp:
@@ -1557,6 +1574,8 @@
 						currentFirst+=3;
 						if (currentFirst>schedArrayNum-3)
 							currentFirst=schedArrayNum-3;
+						if (currentFirst<0)
+							currentFirst=0;
 						output();
 						break;
 					case k8: // zum aktuellen Sender
@@ -1622,18 +1641,21 @@
 				{
 					case kOk:
 						{
-							delete osd;
-							osd=NULL;
 #if VDRVERSNUM >= 10300
 							cEvent **ev=ev4ch(EDIT_curChannel);
 #else
 							cEventInfo **ev=ev4ch(EDIT_curChannel);
 #endif
-							me=new tvOcMenuEvent(ev[EDIT_curEVI]);
-							me->Display();
-							curmode=SHOW;
-							EDIT_curEvent=0;
-							return osContinue;
+							if (ev[EDIT_curEVI] != NULL)
+							{
+								delete osd;
+								osd=NULL;
+								me=new tvOcMenuEvent(ev[EDIT_curEVI]);
+								me->Display();
+								curmode=SHOW;
+								EDIT_curEvent=0;
+								return osContinue;
+							}
 						}
 						break;
             		case kBack:
@@ -1658,11 +1680,15 @@
 							EDIT_curChannel++;
 						if (EDIT_curChannel>schedArrayNum-1)
 							EDIT_curChannel=schedArrayNum-1;
+						if (EDIT_curChannel<0)
+							EDIT_curChannel=0;
 						if (EDIT_curChannel>currentFirst+2)
 						{
 							currentFirst++;
 							if (currentFirst>schedArrayNum-3)
 								currentFirst=schedArrayNum-3;
+							if (currentFirst<0)
+								currentFirst=0;
 							EDIT_curChannel=currentFirst+2;
 						}
 						outputLR();
@@ -1789,21 +1815,24 @@
 						break;			*/
 				case kRecord:
 					{
-						delete osd;
-						osd=NULL;
 #if VDRVERSNUM >= 10300
 						cEvent **ev=ev4ch(EDIT_curChannel);
 #else
 						cEventInfo **ev=ev4ch(EDIT_curChannel);
 #endif
-						cTimer *timer = new cTimer(ev[EDIT_curEVI]);
-						cTimer *t = Timers.GetTimer(timer);
-						if (t)
+						if (ev[EDIT_curEVI] != NULL)
 						{
-							delete timer;
-							timer = t;
+							delete osd;
+							osd=NULL;
+							cTimer *timer = new cTimer(ev[EDIT_curEVI]);
+							cTimer *t = Timers.GetTimer(timer);
+							if (t)
+							{
+								delete timer;
+								timer = t;
+							}
+							met=new cMenuEditTimer(timer, !t);
 						}
-						met=new cMenuEditTimer(timer, !t);
 					}
 					break;
 					default:
diff -Naur tvonscreen-0.7.1/search.c tvonscreen-0.7.2/search.c
--- tvonscreen-0.7.1/search.c	2004-11-23 23:13:37.000000000 +0100
+++ tvonscreen-0.7.2/search.c	2006-02-26 22:22:44.000000000 +0100
@@ -17,7 +17,12 @@
 #endif
 {
 	char buf[200];
+#if VDRVERSNUM >= 10318
+	const char *txt,*chan;
+	cString time1,time2,date;
+#else
 	const char *txt,*time1,*time2,*date,*chan;
+#endif
 	cChannel *channel;
 		
 	myev=ev;
@@ -26,9 +31,16 @@
 #else
 	channel = Channels.GetByChannelID(ev->GetChannelID(), true);
 #endif
+#if VDRVERSNUM >= 10318
+	time1=*ev->GetTimeString();
+	time2=*ev->GetEndTimeString();
+#else
 	time1=ev->GetTimeString();
 	time2=ev->GetEndTimeString();
-#if VDRVERSNUM >= 10308
+#endif
+#if VDRVERSNUM >= 10318
+	date=*ev->GetDateString();
+#elif VDRVERSNUM >= 10308
 	date=ev->GetDateString();
 #else
 	date=ev->GetDate();
@@ -44,7 +56,11 @@
 	txt=ev->GetTitle();
 #endif
 
+#if VDRVERSNUM >= 10318
+	snprintf(buf,sizeof(buf)-1,"%.6s %s - %s %s/%s",*date,*time1,*time2,chan,txt);
+#else
 	snprintf(buf,sizeof(buf)-1,"%.6s %s - %s %s/%s",date,time1,time2,chan,txt);
+#endif
 	SetText(buf);
 }
 
diff -Naur tvonscreen-0.7.1/timer.h tvonscreen-0.7.2/timer.h
--- tvonscreen-0.7.1/timer.h	2004-11-24 18:09:25.000000000 +0100
+++ tvonscreen-0.7.2/timer.h	2006-02-26 22:22:44.000000000 +0100
@@ -11,10 +11,12 @@
 #define TIMER_H
 
 #include <vdr/plugin.h>
+#include <vdr/menu.h>
 #include <time.h>
 #include "gfxtools.h"
 #include "config.h"
 
+#if VDRVERSNUM < 10331
 #if VDRVERSNUM >= 10300
 class cMenuEvent : public cOsdMenu {
 private:
@@ -48,6 +50,7 @@
   virtual ~cMenuEditTimer();
   virtual eOSState ProcessKey(eKeys Key);
   };
+#endif
 
 class tvOcMenuEvent : public cMenuEvent {
 public: