diff -ruN vdr-1.5.8/CONTRIBUTORS vdr-1.5.9/CONTRIBUTORS
--- vdr-1.5.8/CONTRIBUTORS	2007-08-19 16:26:32.000000000 +0200
+++ vdr-1.5.9/CONTRIBUTORS	2007-08-26 13:13:10.000000000 +0200
@@ -541,6 +541,7 @@
 
 Matthias Fechner <matthiasfechner@web.de>
  for pointing out a bug in parsing 'E' records in epg2html.pl
+ for suggesting to add a note about LANG having to be set to a valid locale in INSTALL
 
 Paul Lacatus <paul@campina.iiruc.ro>
  for translating OSD texts to the Romanian language
@@ -943,6 +944,8 @@
  for enabling fonts to be created with a width that overwrites the default width
  for suggesting to make cBitmap::SetXpm() checks whether the given Xpm pointer is
  not NULL
+ for making the SVDRP command LSTC list the channels with group separators if the
+ option ':groups' is given
 
 Olivier Jacques <jacquesolivier@hotmail.com>)
  for translating OSD texts to the French language
@@ -1056,9 +1059,11 @@
  for reporting a bug in handling the '.update' file in case the video directory is
  not at the default location
 
-Thomas Schmidt <thomas.schmidt@in.stud.tu-ilmenau.de>
+Thomas Schmidt <tschmidt@debian.org>
  for reporting a crash when canceling a newly created timer
  for making 'diseqc.conf' a required file only if Setup.DiSEqC is activated
+ for making VDR use the default configuration directory as defined in the CONFDIR
+ varable in the Makefile
 
 Michael Walle <michael.walle@web.de>
  for reporting a bug in channel switching after Left/Right has been pressed
@@ -1413,6 +1418,7 @@
  for reporting a missing 'P' in vdr.c's SHUTDOWNCANCELROMPT macro
  for fixing a problem with characters >0x7F in the modified version of skipspace()
  for reporting a faulty comment in Make.config.template
+ for fixing checking for ttDolbyLast in cDevice::SetCurrentAudioTrack()
 
 Jürgen Schmitz <j.schmitz@web.de>
  for reporting a bug in displaying the current channel when switching via the SVDRP
@@ -1515,6 +1521,7 @@
  for fixing handling detached processes in SystemExec()
  for fixing handling single byte characters >0x7F in Utf8ToArray()
  for fixing clearing color buttons in the 'curses' skin
+ for adding a missing error report to cCuttingThread::Action()
 
 Sven Kreiensen <svenk@kammer.uni-hannover.de>
  for his help in keeping 'channels.conf.terr' up to date
@@ -1870,6 +1877,7 @@
  for reporting a problem with a format string in recording.c on 64bit systems
  for reporting a problem with the device selection in case of timer conflicts
  for a patch that fixed part of a crash in i18n character set conversion
+ for reporting a bug in stripping the context in I18nTranslate()
 
 Thiemo Gehrke <tgehrke@reel-multimedia.com>
  for suggesting to add a setup option to turn off the automatic timeout of the
@@ -2062,6 +2070,10 @@
  for suggesting to make the "Setup/OSD/Language" menu only show those languages
  that actually have a locale
  for suggesting to use setenv() instead of setlocale() to set the language for gettext()
+ for fixing handling locale directories with a large number of entries
+ for suggesting to change the default for LOCDIR in Makefile and Make.config.template
+ to "./locale", so that internationalization works by default when running VDR
+ from within its source directory
 
 Antti Hartikainen <ami+vdr@ah.fi>
  for updating 'S13E' in 'sources.conf'
@@ -2098,6 +2110,8 @@
  for suggesting to move the "all" target in plugin Makefiles before the
  "Implicit rules", so that a plain "make" will compile everything
  for adding DESTDIR and PREFIX handling to the Makefile
+ for fixing some compiler warnings with gcc-4.2.0
+ for fixing setting the locale file name in i18n-to-gettext.pl
 
 Martin Ostermann <martin@familie-ostermann.de>
  for fixing processing the PDCDescriptor in 'libsi' on big endian systems
@@ -2151,3 +2165,7 @@
 
 Bruno Roussel <bruno.roussel@free.fr>
  for translating OSD texts to the French language
+
+Matthias Becker <becker.matthias@gmail.com>
+ for suggesting to add a new i18n macro that can be used by plugins to mark
+ texts they want to reuse from VDR's core translations
diff -ruN vdr-1.5.8/HISTORY vdr-1.5.9/HISTORY
--- vdr-1.5.8/HISTORY	2007-08-19 16:34:44.000000000 +0200
+++ vdr-1.5.9/HISTORY	2007-08-26 13:12:48.000000000 +0200
@@ -5379,3 +5379,40 @@
   vdr.mo. Text files for plugins are now named "vdr-name.mo", when "name" is the
   name of the plugin. The "newplugin" script has been changed accordingly, and
   plugin authors should change their Makefiles, too.
+
+2007-08-26: Version 1.5.9
+
+- Fixed handling locale directories with a large number of entries (thanks to
+  Anssi Hannula).
+- Updated Turkish language texts (thanks to Oktay Yolgeçen).
+- Fixed stripping the context in I18nTranslate() (reported by Christian
+  Wieninger).
+- Fixed detecting whether a particular locale is actually supported.
+- Added a note about LANG having to be set to a valid locale in INSTALL
+  (suggested by Matthias Fechner).
+- Fixed some compiler warnings with gcc-4.2.0 (thanks to Matthias Schwarzott).
+- Fixed setting the locale file name in i18n-to-gettext.pl (thanks to Matthias
+  Schwarzott).
+- Changed the default for LOCDIR in Makefile and Make.config.template to
+  "./locale", so that internationalization works by default when running VDR
+  from within its source directory (suggested by Anssi Hannula).
+- Added the new i18n macro trVDR(), which can be used by plugins to mark
+  texts they want to reuse from VDR's core translations (suggested by Matthias
+  Becker).
+- VDR now uses the default configuration directory as defined in the CONFDIR
+  varable in the Makefile (thanks to Thomas Schmidt).
+- The SVDRP command LSTC can now list the channels with group separators if the
+  option ':groups' is given (thanks to Andreas Mair).
+- Added a missing error report to cCuttingThread::Action() (thanks to Udo
+  Richter).
+- There can now be more than one OSD at the same time. At any given time,
+  however, only one of them can be active (and thus visible). This is to
+  allow displaying things like subtitles in an easy way. A cOsd therefore
+  now has a "Level", and only the OSD with the smallest level will be
+  displayed. The level 0 OSD is special, and there can only be one with
+  this level. If there is more than one OSD with a particular level, only
+  the one that was created first will be displayed.
+  Plugins that provide an OSD need to adjust their cOsdProvider::CreateOsd()
+  function to hand through the Level.
+- Fixed checking for ttDolbyLast in cDevice::SetCurrentAudioTrack() (thanks
+  to Marco Schlüßler).
diff -ruN vdr-1.5.8/INSTALL vdr-1.5.9/INSTALL
--- vdr-1.5.8/INSTALL	2007-08-10 15:32:08.000000000 +0200
+++ vdr-1.5.9/INSTALL	2007-08-24 15:11:58.000000000 +0200
@@ -113,6 +113,9 @@
 which only influences the way strings are sorted and leaves error messages
 in English.
 
+Note that for VDR's internationalized texts to work, the LANG environment
+variable must be set to a valid locale!
+
 Automatic restart in case of hangups:
 -------------------------------------
 
diff -ruN vdr-1.5.8/Make.config.template vdr-1.5.9/Make.config.template
--- vdr-1.5.8/Make.config.template	2007-08-12 22:43:46.000000000 +0200
+++ vdr-1.5.9/Make.config.template	2007-08-25 10:53:45.000000000 +0200
@@ -6,7 +6,7 @@
 # See the main source file 'vdr.c' for copyright information and
 # how to reach the author.
 #
-# $Id: Make.config.template 1.13 2007/08/12 20:43:46 kls Exp $
+# $Id: Make.config.template 1.15 2007/08/25 08:53:45 kls Exp $
 
 ### The C compiler and options:
 
@@ -26,12 +26,12 @@
 #DVBDIR   = /usr/src/v4l-dvb/linux
 MANDIR   = /usr/local/man
 BINDIR   = /usr/local/bin
-# set to ./locale to run VDR from within its source directory:
-LOCDIR   = /usr/share/vdr/locale
 
+LOCDIR   = ./locale
 PLUGINDIR= ./PLUGINS
 PLUGINLIBDIR= $(PLUGINDIR)/lib
 VIDEODIR = /video
+CONFDIR  = $(VIDEODIR)
 
 ### The remote control:
 
diff -ruN vdr-1.5.8/Makefile vdr-1.5.9/Makefile
--- vdr-1.5.8/Makefile	2007-08-15 15:47:16.000000000 +0200
+++ vdr-1.5.9/Makefile	2007-08-25 10:52:17.000000000 +0200
@@ -4,7 +4,7 @@
 # See the main source file 'vdr.c' for copyright information and
 # how to reach the author.
 #
-# $Id: Makefile 1.104 2007/08/15 13:47:16 kls Exp $
+# $Id: Makefile 1.106 2007/08/25 08:52:17 kls Exp $
 
 .DELETE_ON_ERROR:
 
@@ -19,7 +19,7 @@
 PREFIX  ?= /usr/local
 MANDIR   = $(PREFIX)/share/man
 BINDIR   = $(PREFIX)/bin
-LOCDIR   = $(PREFIX)/share/vdr/locale
+LOCDIR   = ./locale
 LIBS     = -ljpeg -lpthread -ldl -lcap -lfreetype -lfontconfig
 INCLUDES = -I/usr/include/freetype2
 
@@ -61,6 +61,7 @@
 DEFINES += -D_GNU_SOURCE
 
 DEFINES += -DVIDEODIR=\"$(VIDEODIR)\"
+DEFINES += -DCONFDIR=\"$(CONFDIR)\"
 DEFINES += -DPLUGINDIR=\"$(PLUGINLIBDIR)\"
 DEFINES += -DLOCDIR=\"$(LOCDIR)\"
 
diff -ruN vdr-1.5.8/PLUGINS.html vdr-1.5.9/PLUGINS.html
--- vdr-1.5.8/PLUGINS.html	2007-08-10 15:52:45.000000000 +0200
+++ vdr-1.5.9/PLUGINS.html	2007-08-24 15:45:02.000000000 +0200
@@ -6,7 +6,7 @@
 
 <center><h1>The VDR Plugin System</h1></center>
 
-<center><b>Version 1.5.3</b></center>
+<center><b>Version 1.5.8</b></center>
 <p>
 <center>
 Copyright &copy; 2006 Klaus Schmidinger<br>
@@ -14,18 +14,18 @@
 <a href="http://www.cadsoft.de/vdr">www.cadsoft.de/vdr</a>
 </center>
 <p>
-<!--X1.5.0--><table width=100%><tr><td bgcolor=#0000AA>&nbsp;</td><td width=100%>
-Important modifications introduced in version 1.5.0 are marked like this.
-<!--X1.5.0--></td></tr></table>
-<!--X1.5.1--><table width=100%><tr><td bgcolor=#00AA00>&nbsp;</td><td width=100%>
+<!--X1.5.1--><table width=100%><tr><td bgcolor=#0000AA>&nbsp;</td><td width=100%>
 Important modifications introduced in version 1.5.1 are marked like this.
 <!--X1.5.1--></td></tr></table>
-<!--X1.5.3--><table width=100%><tr><td bgcolor=#AA0000>&nbsp;</td><td width=100%>
+<!--X1.5.3--><table width=100%><tr><td bgcolor=#00AA00>&nbsp;</td><td width=100%>
 Important modifications introduced in version 1.5.3 are marked like this.
 <!--X1.5.3--></td></tr></table>
-<!--X1.5.7--><table width=100%><tr><td bgcolor=#FF0000>&nbsp;</td><td width=100%>
+<!--X1.5.7--><table width=100%><tr><td bgcolor=#AA0000>&nbsp;</td><td width=100%>
 Important modifications introduced in version 1.5.7 are marked like this.
 <!--X1.5.7--></td></tr></table>
+<!--X1.5.8--><table width=100%><tr><td bgcolor=#FF0000>&nbsp;</td><td width=100%>
+Important modifications introduced in version 1.5.8 are marked like this.
+<!--X1.5.8--></td></tr></table>
 <p>
 VDR provides an easy to use plugin interface that allows additional functionality
 to be added to the program by implementing a dynamically loadable library file.
@@ -64,7 +64,7 @@
 <li><a href="#Housekeeping">Housekeeping</a>
 <li><a href="#Main thread hook">Main thread hook</a>
 <li><a href="#Activity">Activity</a>
-<!--X1.5.1--><table width=100%><tr><td bgcolor=#00AA00>&nbsp;</td><td width=100%>
+<!--X1.5.1--><table width=100%><tr><td bgcolor=#0000AA>&nbsp;</td><td width=100%>
 <li><a href="#Wakeup">Wakeup</a>
 <!--X1.5.1--></td></tr></table>
 <li><a href="#Setup parameters">Setup parameters</a>
@@ -88,9 +88,7 @@
 <li><a href="#Devices">Devices</a>
 <li><a href="#Audio">Audio</a>
 <li><a href="#Remote Control">Remote Control</a>
-<!--X1.5.0--><table width=100%><tr><td bgcolor=#0000AA>&nbsp;</td><td width=100%>
 <li><a href="#Conditional Access">Conditional Access</a>
-<!--X1.5.0--></td></tr></table>
 </ul>
 </ul>
 
@@ -687,7 +685,7 @@
 the shutdown will take place. As soon as one prompt is not confirmed, no
 further plugins will be queried and no shutdown will be done.
 
-<!--X1.5.1--><table width=100%><tr><td bgcolor=#00AA00>&nbsp;</td><td width=100%>
+<!--X1.5.1--><table width=100%><tr><td bgcolor=#0000AA>&nbsp;</td><td width=100%>
 <a name="Wakeup"><hr><h2>Wakeup</h2>
 
 <center><i><b>Wake me up before you go-go</b></i></center><p>
@@ -912,7 +910,7 @@
 
 <center><i><b>Welcome to Babylon!</b></i></center><p>
 
-<!--X1.5.7--><table width=100%><tr><td bgcolor=#FF0000>&nbsp;</td><td width=100%>
+<!--X1.5.7--><table width=100%><tr><td bgcolor=#AA0000>&nbsp;</td><td width=100%>
 If a plugin displays texts to the user, it should prepare for internationalization
 of these texts. All that is necessary for this is to mark every text that is
 presented to the user as translatable, as in
@@ -923,9 +921,12 @@
 
 The text given here must be the English version, and the returned pointer is either
 a translated version (if available) or the original string.
-Texts are first searched for in the domain registered for this plugin (if any)
-and then in the global VDR texts. So a plugin can make use of texts defined by the
-core VDR code.
+<!--X1.5.8--><table width=100%><tr><td bgcolor=#FF0000>&nbsp;</td><td width=100%>
+Texts are searched for in the domain registered for this plugin.
+If a plugin wants to make use of texts defined by the core VDR code, it can use
+the special <tt>trVDR()</tt> macro to mark these texts without having them
+appear in its own translation file.
+<!--X1.5.8--></td></tr></table>
 <p>
 Sometimes texts are stored in an array, in which case they need to be marked
 differently, using the trNOOP() macro. The actual translation is then done
@@ -943,7 +944,7 @@
 </pre></td></tr></table><p>
 
 <p>
-<!--X1.5.3--><table width=100%><tr><td bgcolor=#AA0000>&nbsp;</td><td width=100%>
+<!--X1.5.3--><table width=100%><tr><td bgcolor=#00AA00>&nbsp;</td><td width=100%>
 The system VDR is running on may use a character encoding where a single character
 (or <i>symbol</i>) consists of more than one byte (UTF-8, as opposed to, for instance,
 ISO8859-1, where every character is represented by a single byte in memory).
@@ -1605,7 +1606,7 @@
 areas. Drawing areas are always rectangular and may not overlap (but do not need
 to be adjacent).
 <p>
-<!--X1.5.3--><table width=100%><tr><td bgcolor=#AA0000>&nbsp;</td><td width=100%>
+<!--X1.5.3--><table width=100%><tr><td bgcolor=#00AA00>&nbsp;</td><td width=100%>
 Special consideration may have to be given to color usage if the OSD provides
 8bpp (256 colors). In that case, fonts may be drawn using <i>anti-aliasing</i>,
 which requires several blended color values between the foreground and background
@@ -2088,7 +2089,6 @@
 
 The other parameters have the same meaning as in the first version of this function.
 
-<!--X1.5.0--><table width=100%><tr><td bgcolor=#0000AA>&nbsp;</td><td width=100%>
 <a name="Conditional Access"><hr><h2>Conditional Access</h2>
 
 <center><i><b>Members only!</b></i></center><p>
@@ -2123,7 +2123,6 @@
 </pre></td></tr></table><p>
 
 See the description of this function in <tt>ci.h</tt> for details.
-<!--X1.5.0--></td></tr></table>
 
 </body>
 </html>
diff -ruN vdr-1.5.8/config.h vdr-1.5.9/config.h
--- vdr-1.5.8/config.h	2007-08-12 22:38:10.000000000 +0200
+++ vdr-1.5.9/config.h	2007-08-19 18:02:50.000000000 +0200
@@ -4,7 +4,7 @@
  * See the main source file 'vdr.c' for copyright information and
  * how to reach the author.
  *
- * $Id: config.h 1.297 2007/08/12 20:38:10 kls Exp $
+ * $Id: config.h 1.298 2007/08/19 16:02:50 kls Exp $
  */
 
 #ifndef __CONFIG_H
@@ -22,13 +22,13 @@
 
 // VDR's own version number:
 
-#define VDRVERSION  "1.5.8"
-#define VDRVERSNUM   10508  // Version * 10000 + Major * 100 + Minor
+#define VDRVERSION  "1.5.9"
+#define VDRVERSNUM   10509  // Version * 10000 + Major * 100 + Minor
 
 // The plugin API's version number:
 
-#define APIVERSION  "1.5.8"
-#define APIVERSNUM   10508  // Version * 10000 + Major * 100 + Minor
+#define APIVERSION  "1.5.9"
+#define APIVERSNUM   10509  // Version * 10000 + Major * 100 + Minor
 
 // When loading plugins, VDR searches them by their APIVERSION, which
 // may be smaller than VDRVERSION in case there have been no changes to
diff -ruN vdr-1.5.8/cutter.c vdr-1.5.9/cutter.c
--- vdr-1.5.8/cutter.c	2006-07-30 12:22:08.000000000 +0200
+++ vdr-1.5.9/cutter.c	2007-08-25 12:33:18.000000000 +0200
@@ -4,7 +4,7 @@
  * See the main source file 'vdr.c' for copyright information and
  * how to reach the author.
  *
- * $Id: cutter.c 1.16 2006/07/30 10:22:08 kls Exp $
+ * $Id: cutter.c 1.17 2007/08/25 10:33:18 kls Exp $
  */
 
 #include "cutter.h"
@@ -110,8 +110,10 @@
                  break;
                  }
               }
-           else
+           else {
+              error = "index";
               break;
+              }
 
            // Write one frame:
 
diff -ruN vdr-1.5.8/device.c vdr-1.5.9/device.c
--- vdr-1.5.8/device.c	2007-06-16 11:31:32.000000000 +0200
+++ vdr-1.5.9/device.c	2007-08-26 13:11:42.000000000 +0200
@@ -4,7 +4,7 @@
  * See the main source file 'vdr.c' for copyright information and
  * how to reach the author.
  *
- * $Id: device.c 1.141 2007/06/16 09:31:32 kls Exp $
+ * $Id: device.c 1.142 2007/08/26 11:11:42 kls Exp $
  */
 
 #include "device.h"
@@ -892,7 +892,7 @@
 
 bool cDevice::SetCurrentAudioTrack(eTrackType Type)
 {
-  if (ttNone < Type && Type < ttDolbyLast) {
+  if (ttNone < Type && Type <= ttDolbyLast) {
      cMutexLock MutexLock(&mutexCurrentAudioTrack);
      if (IS_DOLBY_TRACK(Type))
         SetDigitalAudioDevice(true);
diff -ruN vdr-1.5.8/dvbosd.c vdr-1.5.9/dvbosd.c
--- vdr-1.5.8/dvbosd.c	2006-01-28 15:24:04.000000000 +0100
+++ vdr-1.5.9/dvbosd.c	2007-08-26 11:39:20.000000000 +0200
@@ -4,7 +4,7 @@
  * See the main source file 'vdr.c' for copyright information and
  * how to reach the author.
  *
- * $Id: dvbosd.c 1.30 2006/01/28 14:24:04 kls Exp $
+ * $Id: dvbosd.c 1.31 2007/08/26 09:39:20 kls Exp $
  */
 
 #include "dvbosd.h"
@@ -26,15 +26,17 @@
   int osdMem;
   bool shown;
   void Cmd(OSD_Command cmd, int color = 0, int x0 = 0, int y0 = 0, int x1 = 0, int y1 = 0, const void *data = NULL);
+protected:
+  virtual void SetActive(bool On);
 public:
-  cDvbOsd(int Left, int Top, int OsdDev);
+  cDvbOsd(int Left, int Top, int OsdDev, uint Level);
   virtual ~cDvbOsd();
   virtual eOsdError CanHandleAreas(const tArea *Areas, int NumAreas);
   virtual void Flush(void);
   };
 
-cDvbOsd::cDvbOsd(int Left, int Top, int OsdDev)
-:cOsd(Left, Top)
+cDvbOsd::cDvbOsd(int Left, int Top, int OsdDev, uint Level)
+:cOsd(Left, Top, Level)
 {
   osdDev = OsdDev;
   shown = false;
@@ -49,23 +51,36 @@
      if (ioctl(osdDev, OSD_GET_CAPABILITY, &cap) == 0)
         osdMem = cap.val;
 #endif
-     // must clear all windows here to avoid flashing effects - doesn't work if done
-     // in Flush() only for the windows that are actually used...
-     for (int i = 0; i < MAXNUMWINDOWS; i++) {
-         Cmd(OSD_SetWindow, 0, i + 1);
-         Cmd(OSD_Clear);
-         }
      }
 }
 
 cDvbOsd::~cDvbOsd()
 {
-  if (shown) {
-     cBitmap *Bitmap;
-     for (int i = 0; (Bitmap = GetBitmap(i)) != NULL; i++) {
-         Cmd(OSD_SetWindow, 0, i + 1);
-         Cmd(OSD_Close);
-         }
+  SetActive(false);
+}
+
+void cDvbOsd::SetActive(bool On)
+{
+  if (On != Active()) {
+     cOsd::SetActive(On);
+     if (On) {
+        // must clear all windows here to avoid flashing effects - doesn't work if done
+        // in Flush() only for the windows that are actually used...
+        for (int i = 0; i < MAXNUMWINDOWS; i++) {
+            Cmd(OSD_SetWindow, 0, i + 1);
+            Cmd(OSD_Clear);
+            }
+        if (GetBitmap(0)) // only flush here if there are already bitmaps
+           Flush();
+        }
+     else if (shown) {
+        cBitmap *Bitmap;
+        for (int i = 0; (Bitmap = GetBitmap(i)) != NULL; i++) {
+            Cmd(OSD_SetWindow, 0, i + 1);
+            Cmd(OSD_Close);
+            }
+        shown = false;
+        }
      }
 }
 
@@ -108,13 +123,20 @@
 
 void cDvbOsd::Flush(void)
 {
+  if (!Active())
+     return;
   cBitmap *Bitmap;
   for (int i = 0; (Bitmap = GetBitmap(i)) != NULL; i++) {
       Cmd(OSD_SetWindow, 0, i + 1);
       if (!shown)
          Cmd(OSD_Open, Bitmap->Bpp(), Left() + Bitmap->X0(), Top() + Bitmap->Y0(), Left() + Bitmap->X0() + Bitmap->Width() - 1, Top() + Bitmap->Y0() + Bitmap->Height() - 1, (void *)1); // initially hidden!
       int x1 = 0, y1 = 0, x2 = 0, y2 = 0;
-      if (Bitmap->Dirty(x1, y1, x2, y2)) {
+      if (!shown || Bitmap->Dirty(x1, y1, x2, y2)) {
+         if (!shown) {
+            x1 = y1 = 0;
+            x2 = Bitmap->Width() - 1;
+            y2 = Bitmap->Height() - 1;
+            }
          //TODO Workaround: apparently the bitmap sent to the driver always has to be a multiple
          //TODO of 8 bits wide, and (dx * dy) also has to be a multiple of 8.
          //TODO Fix driver (should be able to handle any size bitmaps!)
@@ -173,7 +195,7 @@
   osdDev = OsdDev;
 }
 
-cOsd *cDvbOsdProvider::CreateOsd(int Left, int Top)
+cOsd *cDvbOsdProvider::CreateOsd(int Left, int Top, uint Level)
 {
-  return new cDvbOsd(Left, Top, osdDev);
+  return new cDvbOsd(Left, Top, osdDev, Level);
 }
diff -ruN vdr-1.5.8/dvbosd.h vdr-1.5.9/dvbosd.h
--- vdr-1.5.8/dvbosd.h	2004-06-12 15:09:52.000000000 +0200
+++ vdr-1.5.9/dvbosd.h	2007-08-25 15:49:34.000000000 +0200
@@ -4,7 +4,7 @@
  * See the main source file 'vdr.c' for copyright information and
  * how to reach the author.
  *
- * $Id: dvbosd.h 1.18 2004/06/12 13:09:52 kls Exp $
+ * $Id: dvbosd.h 1.19 2007/08/25 13:49:34 kls Exp $
  */
 
 #ifndef __DVBOSD_H
@@ -17,7 +17,7 @@
   int osdDev;
 public:
   cDvbOsdProvider(int OsdDev);
-  virtual cOsd *CreateOsd(int Left, int Top);
+  virtual cOsd *CreateOsd(int Left, int Top, uint Level);
   };
 
 #endif //__DVBOSD_H
diff -ruN vdr-1.5.8/i18n-to-gettext.pl vdr-1.5.9/i18n-to-gettext.pl
--- vdr-1.5.8/i18n-to-gettext.pl	2007-08-15 14:52:00.000000000 +0200
+++ vdr-1.5.9/i18n-to-gettext.pl	2007-08-24 15:19:34.000000000 +0200
@@ -10,7 +10,7 @@
 # See the main source file 'vdr.c' for copyright information and
 # how to reach the author.
 #
-# $Id: i18n-to-gettext.pl 1.3 2007/08/15 12:52:00 kls Exp $
+# $Id: i18n-to-gettext.pl 1.4 2007/08/24 13:19:34 kls Exp $
 
 # How to convert an actual plugin:
 #
@@ -323,7 +323,7 @@
 	@mkdir -p $(LOCALEDIR)
 	for i in $(I18Ndirs); do\
 	    mkdir -p $(LOCALEDIR)/$$i/LC_MESSAGES;\
-	    cp $(PODIR)/$$i.mo $(LOCALEDIR)/$$i/LC_MESSAGES/$(PLUGIN).mo;\
+	    cp $(PODIR)/$$i.mo $(LOCALEDIR)/$$i/LC_MESSAGES/vdr-$(PLUGIN).mo;\
 	    done
 
 };
diff -ruN vdr-1.5.8/i18n.c vdr-1.5.9/i18n.c
--- vdr-1.5.8/i18n.c	2007-08-19 16:10:46.000000000 +0200
+++ vdr-1.5.9/i18n.c	2007-08-24 16:03:47.000000000 +0200
@@ -4,7 +4,7 @@
  * See the main source file 'vdr.c' for copyright information and
  * how to reach the author.
  *
- * $Id: i18n.c 1.312 2007/08/19 14:10:46 kls Exp $
+ * $Id: i18n.c 1.317 2007/08/24 14:03:47 kls Exp $
  *
  *
  */
@@ -62,7 +62,7 @@
   NULL
   };
 
-static char *I18nLocaleDir = LOCDIR;
+static const char *I18nLocaleDir = LOCDIR;
 
 static cStringList LanguageLocales;
 static cStringList LanguageNames;
@@ -112,21 +112,24 @@
      for (int i = 0; i < Locales.Size(); i++) {
          cString FileName = cString::sprintf("%s/%s/LC_MESSAGES/vdr.mo", I18nLocaleDir, Locales[i]);
          if (access(FileName, F_OK) == 0) { // found a locale with VDR texts
-            if (i < I18N_MAX_LANGUAGES - 1) {
+            if (NumLocales < I18N_MAX_LANGUAGES - 1) {
                SetEnvLanguage(Locales[i]);
-               NumLocales++;
-               if (strstr(OldLocale, Locales[i]) == OldLocale)
-                  CurrentLanguage = LanguageLocales.Size();
-               LanguageLocales.Append(strdup(Locales[i]));
-               LanguageNames.Append(strdup(gettext(LanguageName)));
-               const char *Code = gettext(LanguageCode);
-               for (const char **lc = LanguageCodeList; *lc; lc++) {
-                   if (ContainsCode(*lc, Code)) {
-                      Code = *lc;
-                      break;
+               const char *TranslatedLanguageName = gettext(LanguageName);
+               if (TranslatedLanguageName != LanguageName) {
+                  NumLocales++;
+                  if (strstr(OldLocale, Locales[i]) == OldLocale)
+                     CurrentLanguage = LanguageLocales.Size();
+                  LanguageLocales.Append(strdup(Locales[i]));
+                  LanguageNames.Append(strdup(TranslatedLanguageName));
+                  const char *Code = gettext(LanguageCode);
+                  for (const char **lc = LanguageCodeList; *lc; lc++) {
+                      if (ContainsCode(*lc, Code)) {
+                         Code = *lc;
+                         break;
+                         }
                       }
-                   }
-               LanguageCodes.Append(strdup(Code));
+                  LanguageCodes.Append(strdup(Code));
+                  }
                }
             else {
                esyslog("ERROR: too many locales - increase I18N_MAX_LANGUAGES!");
@@ -203,15 +206,11 @@
   if (!s)
      return s;
   if (CurrentLanguage) {
-     const char *t = s;
-     if (Plugin)
-        t = dgettext(Plugin, s);
-     if (t == s)
-        t = gettext(s);
-     s = t;
+     const char *t = Plugin ? dgettext(Plugin, s) : gettext(s);
+     if (t != s)
+        return t;
      }
-  const char *p = strchr(s, '$');
-  return p ? p + 1 : s;
+  return SkipContext(s);
 }
 
 const char *I18nLocale(int Language)
diff -ruN vdr-1.5.8/i18n.h vdr-1.5.9/i18n.h
--- vdr-1.5.8/i18n.h	2007-08-19 16:07:17.000000000 +0200
+++ vdr-1.5.9/i18n.h	2007-08-24 15:35:18.000000000 +0200
@@ -4,7 +4,7 @@
  * See the main source file 'vdr.c' for copyright information and
  * how to reach the author.
  *
- * $Id: i18n.h 1.23 2007/08/19 14:07:17 kls Exp $
+ * $Id: i18n.h 1.24 2007/08/24 13:35:18 kls Exp $
  */
 
 #ifndef __I18N_H
@@ -80,6 +80,7 @@
 
 #ifdef PLUGIN_NAME_I18N
 #define tr(s)  I18nTranslate(s, "vdr-" PLUGIN_NAME_I18N)
+#define trVDR(s) I18nTranslate(s)  // to use a text that's in the VDR core's translation file
 #else
 #define tr(s)  I18nTranslate(s)
 #endif
diff -ruN vdr-1.5.8/keys.h vdr-1.5.9/keys.h
--- vdr-1.5.8/keys.h	2007-08-04 16:40:23.000000000 +0200
+++ vdr-1.5.9/keys.h	2007-08-24 15:15:48.000000000 +0200
@@ -4,7 +4,7 @@
  * See the main source file 'vdr.c' for copyright information and
  * how to reach the author.
  *
- * $Id: keys.h 1.12 2007/08/04 14:40:23 kls Exp $
+ * $Id: keys.h 1.13 2007/08/24 13:15:48 kls Exp $
  */
 
 #ifndef __KEYS_H
@@ -82,7 +82,7 @@
 
 struct tKey {
   eKeys type;
-  char *name;
+  const char *name;
   };
 
 class cKey : public cListObject {
diff -ruN vdr-1.5.8/menu.c vdr-1.5.9/menu.c
--- vdr-1.5.8/menu.c	2007-08-18 11:03:05.000000000 +0200
+++ vdr-1.5.9/menu.c	2007-08-24 15:15:48.000000000 +0200
@@ -4,7 +4,7 @@
  * See the main source file 'vdr.c' for copyright information and
  * how to reach the author.
  *
- * $Id: menu.c 1.460 2007/08/18 09:03:05 kls Exp $
+ * $Id: menu.c 1.461 2007/08/24 13:15:48 kls Exp $
  */
 
 #include "menu.h"
@@ -1040,7 +1040,7 @@
   return r;
 }
 
-static char *TimerMatchChars = " tT";
+static const char *TimerMatchChars = " tT";
 
 bool cMenuScheduleItem::Update(bool Force)
 {
diff -ruN vdr-1.5.8/osd.c vdr-1.5.9/osd.c
--- vdr-1.5.8/osd.c	2007-08-17 17:23:50.000000000 +0200
+++ vdr-1.5.9/osd.c	2007-08-26 11:44:50.000000000 +0200
@@ -4,7 +4,7 @@
  * See the main source file 'vdr.c' for copyright information and
  * how to reach the author.
  *
- * $Id: osd.c 1.73 2007/08/17 15:23:50 kls Exp $
+ * $Id: osd.c 1.74 2007/08/26 09:44:50 kls Exp $
  */
 
 #include "osd.h"
@@ -646,18 +646,24 @@
 int cOsd::osdTop = 0;
 int cOsd::osdWidth = 0;
 int cOsd::osdHeight = 0;
-int cOsd::isOpen = 0;
+cVector<cOsd *> cOsd::Osds;
 
-cOsd::cOsd(int Left, int Top)
+cOsd::cOsd(int Left, int Top, uint Level)
 {
-  if (isOpen)
-     esyslog("ERROR: OSD opened without closing previous OSD!");
   savedRegion = NULL;
   numBitmaps = 0;
   left = Left;
   top = Top;
   width = height = 0;
-  isOpen++;
+  level = Level;
+  active = false;
+  for (int i = 0; i < Osds.Size(); i++) {
+      if (Osds[i]->level > level) {
+         Osds.Insert(this, i);
+         return;
+         }
+      }
+  Osds.Append(this);
 }
 
 cOsd::~cOsd()
@@ -665,7 +671,14 @@
   for (int i = 0; i < numBitmaps; i++)
       delete bitmaps[i];
   delete savedRegion;
-  isOpen--;
+  for (int i = 0; i < Osds.Size(); i++) {
+      if (Osds[i] == this) {
+         Osds.Remove(i);
+         if (Osds.Size())
+            Osds[0]->SetActive(true);
+         break;
+         }
+      }
 }
 
 void cOsd::SetOsdPosition(int Left, int Top, int Width, int Height)
@@ -803,15 +816,23 @@
   osdProvider = NULL;
 }
 
-cOsd *cOsdProvider::NewOsd(int Left, int Top)
+cOsd *cOsdProvider::NewOsd(int Left, int Top, uint Level)
 {
-  if (cOsd::IsOpen())
+  if (Level == 0 && cOsd::IsOpen())
      esyslog("ERROR: attempt to open OSD while it is already open - using dummy OSD!");
-  else if (osdProvider)
-     return osdProvider->CreateOsd(Left, Top);
+  else if (osdProvider) {
+     cOsd *ActiveOsd = cOsd::Osds.Size() ? cOsd::Osds[0] : NULL;
+     cOsd *Osd = osdProvider->CreateOsd(Left, Top, Level);
+     if (Osd == cOsd::Osds[0]) {
+        if (ActiveOsd)
+           ActiveOsd->SetActive(false);
+        Osd->SetActive(true);
+        }
+     return Osd;
+     }
   else
      esyslog("ERROR: no OSD provider available - using dummy OSD!");
-  return new cOsd(Left, Top); // create a dummy cOsd, so that access won't result in a segfault
+  return new cOsd(Left, Top, 999); // create a dummy cOsd, so that access won't result in a segfault
 }
 
 void cOsdProvider::Shutdown(void)
diff -ruN vdr-1.5.8/osd.h vdr-1.5.9/osd.h
--- vdr-1.5.8/osd.h	2007-07-20 16:50:17.000000000 +0200
+++ vdr-1.5.9/osd.h	2007-08-26 11:45:38.000000000 +0200
@@ -4,7 +4,7 @@
  * See the main source file 'vdr.c' for copyright information and
  * how to reach the author.
  *
- * $Id: osd.h 1.56 2007/07/20 14:50:17 kls Exp $
+ * $Id: osd.h 1.57 2007/08/26 09:45:38 kls Exp $
  */
 
 #ifndef __OSD_H
@@ -15,6 +15,7 @@
 #include <stdint.h>
 #include "config.h"
 #include "font.h"
+#include "tools.h"
 
 #define MAXNUMCOLORS 256
 
@@ -247,13 +248,15 @@
   friend class cOsdProvider;
 private:
   static int osdLeft, osdTop, osdWidth, osdHeight;
-  static int isOpen;
+  static cVector<cOsd *> Osds;
   cBitmap *savedRegion;
   cBitmap *bitmaps[MAXOSDAREAS];
   int numBitmaps;
   int left, top, width, height;
+  uint level;
+  bool active;
 protected:
-  cOsd(int Left, int Top);
+  cOsd(int Left, int Top, uint Level);
        ///< Initializes the OSD with the given coordinates.
        ///< By default it is assumed that the full area will be able to display
        ///< full 32 bit graphics (ARGB with eight bit for each color and the alpha
@@ -269,6 +272,14 @@
        ///< and should require only the minimum necessary color depth. This is
        ///< because a derived cOsd class may or may not be able to handle more
        ///< than one area.
+       ///< There can be any number of cOsd objects at the same time, but only
+       ///< one of them will be active at any given time. The active OSD is the
+       ///< one with the lowest value of Level. If there are several cOsd objects
+       ///< with the same Level, the one that was created first will be active.
+  bool Active(void) { return active; }
+  virtual void SetActive(bool On) { active = On; }
+       ///< Sets this OSD to be the active one.
+       ///< A derived class must call cOsd::SetActive(On).
 public:
   virtual ~cOsd();
        ///< Shuts down the OSD.
@@ -281,7 +292,8 @@
        ///< This may be useful for plugins that determine the scaling of the
        ///< video image and need to scale the OSD accordingly to fit on the
        ///< screen.
-  static int IsOpen(void) { return isOpen; }
+  static int IsOpen(void) { return Osds.Size() && Osds[0]->level == 0; }
+       ///< Returns true if there is currently a level 0 OSD open.
   int Left(void) { return left; }
   int Top(void) { return top; }
   int Width(void) { return width; }
@@ -379,14 +391,14 @@
 private:
   static cOsdProvider *osdProvider;
 protected:
-  virtual cOsd *CreateOsd(int Left, int Top) = 0;
+  virtual cOsd *CreateOsd(int Left, int Top, uint Level) = 0;
       ///< Returns a pointer to a newly created cOsd object, which will be located
       ///< at the given coordinates.
 public:
   cOsdProvider(void);
       //XXX maybe parameter to make this one "sticky"??? (frame-buffer etc.)
   virtual ~cOsdProvider();
-  static cOsd *NewOsd(int Left, int Top);
+  static cOsd *NewOsd(int Left, int Top, uint Level = 0);
       ///< Returns a pointer to a newly created cOsd object, which will be located
       ///< at the given coordinates. When the cOsd object is no longer needed, the
       ///< caller must delete it. If the OSD is already in use, or there is no OSD
diff -ruN vdr-1.5.8/po/tr_TR.po vdr-1.5.9/po/tr_TR.po
--- vdr-1.5.8/po/tr_TR.po	2007-08-19 13:53:30.000000000 +0200
+++ vdr-1.5.9/po/tr_TR.po	2007-08-24 14:37:49.000000000 +0200
@@ -8,7 +8,7 @@
 "Project-Id-Version: VDR 1.5.7\n"
 "Report-Msgid-Bugs-To: <vdr-bugs@cadsoft.de>\n"
 "POT-Creation-Date: 2007-08-19 13:53+0200\n"
-"PO-Revision-Date: 2007-08-12 14:17+0200\n"
+"PO-Revision-Date: 2007-08-24 14:37+0200\n"
 "Last-Translator: Oktay Yolgeçen <oktay_73@yahoo.de>\n"
 "Language-Team: <vdr@linuxtv.org>\n"
 "MIME-Version: 1.0\n"
@@ -25,7 +25,7 @@
 
 #: device.c:636
 msgid "Can't start Transfer Mode!"
-msgstr "Transfer mode baþlatýlamýyor!"
+msgstr "Transfer modu baþlatýlamýyor!"
 
 #: eitscan.c:159
 msgid "Starting EPG scan"
@@ -59,7 +59,7 @@
 
 #: interface.c:80
 msgid "Do not press any key..."
-msgstr "Tuþlara basmayýnýz..."
+msgstr "Tuþlara basma..."
 
 #: interface.c:86
 msgid "Phase 2: Learning specific key codes"
@@ -68,7 +68,7 @@
 #: interface.c:90
 #, c-format
 msgid "Press key for '%s'"
-msgstr "'%s' için tuþ seçiniz"
+msgstr "'%s' için tuþ seç"
 
 #: interface.c:106
 msgid "Press 'Up' to confirm"
@@ -84,7 +84,7 @@
 
 #: interface.c:142
 msgid "(press 'Down' to end key definition)"
-msgstr "(Sona erdirmek için 'Aþaðý' bas)"
+msgstr "(Bitirmek için 'Aþaðý' bas)"
 
 #: interface.c:146
 msgid "(press 'Menu' to skip this key)"
@@ -200,11 +200,11 @@
 
 #: keys.c:48
 msgid "Key$Volume+"
-msgstr "Ses+"
+msgstr "Volüm+"
 
 #: keys.c:49
 msgid "Key$Volume-"
-msgstr "Ses-"
+msgstr "Volüm-"
 
 #: keys.c:50 skinclassic.c:549
 msgid "Key$Mute"
@@ -240,39 +240,39 @@
 
 #: keys.c:58
 msgid "Key$User1"
-msgstr ""
+msgstr "Kullanýcý1"
 
 #: keys.c:59
 msgid "Key$User2"
-msgstr ""
+msgstr "Kullanýcý2"
 
 #: keys.c:60
 msgid "Key$User3"
-msgstr ""
+msgstr "Kullanýcý3"
 
 #: keys.c:61
 msgid "Key$User4"
-msgstr ""
+msgstr "Kullanýcý4"
 
 #: keys.c:62
 msgid "Key$User5"
-msgstr ""
+msgstr "Kullanýcý5"
 
 #: keys.c:63
 msgid "Key$User6"
-msgstr ""
+msgstr "Kullanýcý6"
 
 #: keys.c:64
 msgid "Key$User7"
-msgstr ""
+msgstr "Kullanýcý7"
 
 #: keys.c:65
 msgid "Key$User8"
-msgstr ""
+msgstr "Kullanýcý8"
 
 #: keys.c:66
 msgid "Key$User9"
-msgstr ""
+msgstr "Kullanýcý9"
 
 #: menu.c:69
 msgid "Free To Air"
@@ -547,7 +547,7 @@
 
 #: menu.c:1754
 msgid "CAM not responding!"
-msgstr ""
+msgstr "CAM yanýt vermiyor!"
 
 #: menu.c:1784
 msgid "Recording info"
@@ -639,35 +639,35 @@
 
 #: menu.c:2217
 msgid "Setup.OSD$Use small font"
-msgstr "Küçük harf kullan"
+msgstr "Küçük font kullan"
 
 #: menu.c:2218
 msgid "Setup.OSD$Anti-alias"
-msgstr ""
+msgstr "Anti-alias"
 
 #: menu.c:2219
 msgid "Setup.OSD$Default font"
-msgstr ""
+msgstr "Olaðan font"
 
 #: menu.c:2220
 msgid "Setup.OSD$Small font"
-msgstr ""
+msgstr "Küçük font"
 
 #: menu.c:2221
 msgid "Setup.OSD$Fixed font"
-msgstr ""
+msgstr "Çakýlý font"
 
 #: menu.c:2222
 msgid "Setup.OSD$Default font size (pixel)"
-msgstr ""
+msgstr "Olaðan font boyutu (pixel)"
 
 #: menu.c:2223
 msgid "Setup.OSD$Small font size (pixel)"
-msgstr ""
+msgstr "Küçük font boyutu (pixel)"
 
 #: menu.c:2224
 msgid "Setup.OSD$Fixed font size (pixel)"
-msgstr ""
+msgstr "Çakýlý font boyutu (pixel)"
 
 #: menu.c:2225
 msgid "Setup.OSD$Channel info position"
@@ -837,15 +837,15 @@
 
 #: menu.c:2560
 msgid "CAM reset"
-msgstr ""
+msgstr "CAM sýfýrlandý"
 
 #: menu.c:2561
 msgid "CAM present"
-msgstr ""
+msgstr "CAM mevcut"
 
 #: menu.c:2562
 msgid "CAM ready"
-msgstr ""
+msgstr "CAM hazýr"
 
 #: menu.c:2585 menu.c:2815
 msgid "CAM"
@@ -869,7 +869,7 @@
 
 #: menu.c:2624
 msgid "CAM is in use - really reset?"
-msgstr ""
+msgstr "CAM kullanýlýyor - gerçekden sýfýrla?"
 
 #: menu.c:2626
 msgid "Can't reset CAM!"
@@ -901,7 +901,7 @@
 
 #: menu.c:2666
 msgid "Setup.Recording$Pause priority"
-msgstr "Olaðan duraklama prioritesi"
+msgstr "Duraklama prioritesi"
 
 #: menu.c:2667
 msgid "Setup.Recording$Pause lifetime (d)"
@@ -973,11 +973,11 @@
 
 #: menu.c:2715
 msgid "Setup.Miscellaneous$Zap timeout (s)"
-msgstr "Kanal deðiþtirme zaman aþýmý (sn)"
+msgstr "Zaping zaman aþýmý (sn)"
 
 #: menu.c:2716
 msgid "Setup.Miscellaneous$Channel entry timeout (ms)"
-msgstr ""
+msgstr "Kanal giriþ zaman aþýmý (ms)"
 
 #: menu.c:2717
 msgid "Setup.Miscellaneous$Initial channel"
@@ -1149,7 +1149,7 @@
 
 #: shutdown.c:152
 msgid "Editing - shut down anyway?"
-msgstr ""
+msgstr "Kesim aktif - buna raðmen kapat?"
 
 #: shutdown.c:162
 msgid "Recording - shut down anyway?"
@@ -1167,11 +1167,11 @@
 #: shutdown.c:184
 #, c-format
 msgid "Plugin %s wakes up in %ld min, continue?"
-msgstr ""
+msgstr "Eklenti %s %ld dakikada açýlýyor, devam et?"
 
 #: shutdown.c:195
 msgid "Editing - restart anyway?"
-msgstr ""
+msgstr "Kesim aktif - buna raðmen yeniden baþlat?"
 
 #: shutdown.c:205
 msgid "Recording - restart anyway?"
@@ -1184,7 +1184,7 @@
 #. TRANSLATORS: note the trailing blank!
 #: skinclassic.c:553
 msgid "Volume "
-msgstr "Ses "
+msgstr "Volüm "
 
 #: skinclassic.c:702
 msgid "Classic VDR"
@@ -1242,7 +1242,7 @@
 
 #: vdr.c:1034
 msgid "VDR will shut down later - press Power to force"
-msgstr ""
+msgstr "VDR daha sonra kapanacak - zorlamak için Kapat'a bas"
 
 #: vdr.c:1046
 msgid "Press any key to cancel shutdown"
@@ -1262,9 +1262,9 @@
 
 #: vdr.c:1175
 msgid "Press any key to cancel restart"
-msgstr ""
+msgstr "Yeniden baþlatmayý iptal etmek için herhangi bir tuþa bas"
 
 #: vdr.c:1195
 #, c-format
 msgid "VDR will shut down in %s minutes"
-msgstr ""
+msgstr "VDR %s dakikada kapanacak"
diff -ruN vdr-1.5.8/rcu.c vdr-1.5.9/rcu.c
--- vdr-1.5.8/rcu.c	2006-12-02 12:12:28.000000000 +0100
+++ vdr-1.5.9/rcu.c	2007-08-24 15:15:48.000000000 +0200
@@ -4,7 +4,7 @@
  * See the main source file 'vdr.c' for copyright information and
  * how to reach the author.
  *
- * $Id: rcu.c 1.15 2006/12/02 11:12:28 kls Exp $
+ * $Id: rcu.c 1.16 2007/08/24 13:15:48 kls Exp $
  */
 
 #include "rcu.h"
@@ -257,7 +257,7 @@
   data = m;
 }
 
-void cRcuRemote::SetString(char *s)
+void cRcuRemote::SetString(const char *s)
 {
   const char *chars = mode == modeH ? "0123456789ABCDEF" : "0123456789-EHLP ";
   int n = 0;
diff -ruN vdr-1.5.8/rcu.h vdr-1.5.9/rcu.h
--- vdr-1.5.8/rcu.h	2005-12-31 16:09:25.000000000 +0100
+++ vdr-1.5.9/rcu.h	2007-08-24 15:15:48.000000000 +0200
@@ -4,7 +4,7 @@
  * See the main source file 'vdr.c' for copyright information and
  * how to reach the author.
  *
- * $Id: rcu.h 1.6 2005/12/31 15:09:25 kls Exp $
+ * $Id: rcu.h 1.7 2007/08/24 13:15:48 kls Exp $
  */
 
 #ifndef __RCU_H
@@ -31,7 +31,7 @@
   void SetMode(unsigned char Mode);
   void SetNumber(int n, bool Hex = false);
   void SetPoints(unsigned char Dp, bool On);
-  void SetString(char *s);
+  void SetString(const char *s);
   bool DetectCode(unsigned char *Code);
   virtual void Action(void);
   virtual void ChannelSwitch(const cDevice *Device, int ChannelNumber);
diff -ruN vdr-1.5.8/svdrp.c vdr-1.5.9/svdrp.c
--- vdr-1.5.8/svdrp.c	2007-06-23 15:14:59.000000000 +0200
+++ vdr-1.5.9/svdrp.c	2007-08-25 11:28:26.000000000 +0200
@@ -10,7 +10,7 @@
  * and interact with the Video Disk Recorder - or write a full featured
  * graphical interface that sits on top of an SVDRP connection.
  *
- * $Id: svdrp.c 1.102 2007/06/23 13:14:59 kls Exp $
+ * $Id: svdrp.c 1.103 2007/08/25 09:28:26 kls Exp $
  */
 
 #include "svdrp.h"
@@ -216,10 +216,12 @@
   "HITK [ <key> ]\n"
   "    Hit the given remote control key. Without option a list of all\n"
   "    valid key names is given.",
-  "LSTC [ <number> | <name> ]\n"
+  "LSTC [ :groups | <number> | <name> ]\n"
   "    List channels. Without option, all channels are listed. Otherwise\n"
   "    only the given channel is listed. If a name is given, all channels\n"
-  "    containing the given string as part of their name are listed.",
+  "    containing the given string as part of their name are listed.\n"
+  "    If ':groups' is given, all channels are listed including group\n"
+  "    separators. The channel number of a group separator is always 0.",
   "LSTE [ <channel> ] [ now | next | at <time> ]\n"
   "    List EPG data. Without any parameters all data of all channels is\n"
   "    listed. If a channel is given (either by number or by channel ID),\n"
@@ -862,7 +864,8 @@
 
 void cSVDRP::CmdLSTC(const char *Option)
 {
-  if (*Option) {
+  bool WithGroupSeps = strcasecmp(Option, ":groups") == 0;
+  if (*Option && !WithGroupSeps) {
      if (isnumber(Option)) {
         cChannel *channel = Channels.GetByNumber(strtol(Option, NULL, 10));
         if (channel)
@@ -889,7 +892,9 @@
      }
   else if (Channels.MaxNumber() >= 1) {
      for (cChannel *channel = Channels.First(); channel; channel = Channels.Next(channel)) {
-         if (!channel->GroupSep())
+         if (WithGroupSeps)
+            Reply(channel->Next() ? -250: 250, "%d %s", channel->GroupSep() ? 0 : channel->Number(), *channel->ToText());
+         else if (!channel->GroupSep())
             Reply(channel->Number() < Channels.MaxNumber() ? -250 : 250, "%d %s", channel->Number(), *channel->ToText());
          }
      }
diff -ruN vdr-1.5.8/thread.c vdr-1.5.9/thread.c
--- vdr-1.5.8/thread.c	2007-06-17 14:43:40.000000000 +0200
+++ vdr-1.5.9/thread.c	2007-08-24 15:15:48.000000000 +0200
@@ -4,7 +4,7 @@
  * See the main source file 'vdr.c' for copyright information and
  * how to reach the author.
  *
- * $Id: thread.c 1.61 2007/06/17 12:43:40 kls Exp $
+ * $Id: thread.c 1.62 2007/08/24 13:15:48 kls Exp $
  */
 
 #include "thread.h"
@@ -416,7 +416,7 @@
      return false;
      }
 
-  char *mode = "w";
+  const char *mode = "w";
   int iopipe = 0;
 
   if (pid > 0) { // parent process
diff -ruN vdr-1.5.8/tools.h vdr-1.5.9/tools.h
--- vdr-1.5.8/tools.h	2007-08-05 14:11:52.000000000 +0200
+++ vdr-1.5.9/tools.h	2007-08-25 16:16:39.000000000 +0200
@@ -4,7 +4,7 @@
  * See the main source file 'vdr.c' for copyright information and
  * how to reach the author.
  *
- * $Id: tools.h 1.107 2007/08/05 12:11:52 kls Exp $
+ * $Id: tools.h 1.108 2007/08/25 14:16:39 kls Exp $
  */
 
 #ifndef __TOOLS_H
@@ -464,6 +464,12 @@
        Realloc(allocated * 4 / 2); // increase size by 50%
     data[size++] = Data;
   }
+  virtual void Remove(int Index)
+  {
+    if (Index < size - 1)
+       memmove(&data[Index], &data[Index + 1], (size - Index) * sizeof(T));
+    size--;
+  }
   virtual void Clear(void) {}
   void Sort(__compar_fn_t Compare)
   {
diff -ruN vdr-1.5.8/vdr.c vdr-1.5.9/vdr.c
--- vdr-1.5.8/vdr.c	2007-08-18 15:03:46.000000000 +0200
+++ vdr-1.5.9/vdr.c	2007-08-25 10:51:13.000000000 +0200
@@ -22,7 +22,7 @@
  *
  * The project's page is at http://www.cadsoft.de/vdr
  *
- * $Id: vdr.c 1.298 2007/08/18 13:03:46 kls Exp $
+ * $Id: vdr.c 1.299 2007/08/25 08:51:13 kls Exp $
  */
 
 #include <getopt.h>
@@ -536,7 +536,7 @@
   // Configuration data:
 
   if (!ConfigDirectory)
-     ConfigDirectory = VideoDirectory;
+     ConfigDirectory = CONFDIR;
 
   cPlugin::SetConfigDirectory(ConfigDirectory);
   cThemes::SetThemesDirectory(AddDirectory(ConfigDirectory, "themes"));
