summaryrefslogtreecommitdiff
path: root/PLUGINS/src/skincurses
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2008-02-17 18:00:00 +0100
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2008-02-17 18:00:00 +0100
commit9279cb21cd311cbb141d506ba9d17c3a057b4d3c (patch)
tree670ab22e83d5abd18c2e15e85504c58d09651b87 /PLUGINS/src/skincurses
parente3887083391d10f8cfcd1d8ac65a99d9978f05f2 (diff)
downloadvdr-patch-lnbsharing-9279cb21cd311cbb141d506ba9d17c3a057b4d3c.tar.gz
vdr-patch-lnbsharing-9279cb21cd311cbb141d506ba9d17c3a057b4d3c.tar.bz2
Version 1.5.15vdr-1.5.15
- Updated the Italian OSD texts (thanks to Diego Pierotto). - Added option -i to the pictures plugin's pic2mpg to ignore unknown file types. - Revoked the switch to the "multiproto" driver in order to make a new stable version before making this big switch and forcing all users to install a driver that is not yet in the kernel source. The removed code will reappear in version 1.7.0. Note that you may need to switch back to an older version of your channels.conf file if you have already used version 1.5.14, because it introduced new parameters. - Added the new command line option --userdump to enable core dumps in case VDR is run as root with option -u (thanks to Hans-Werner Hilse). - Speeded up anti-aliased font rendering by caching the blend indexes (based on a suggestion by Martin Wache). - Fixed setting the OSD area in the pictures plugin. - Ignoring "repeat" and "release" keys in the time search entry mode during replay, to avoid inadvertently leaving it in case a key is pressed too long (suggested by Andreas Brugger). - Improved sending all frames to devices that can handle them in fast forward trick speeds, including subtitles (thanks to Timo Eskola). - The section handler is now stopped before the device is destroyed, to avoid accessing file handles after they have become invalid (thanks to Reinhard Nissl for reporting an invalid access when ending VDR, and to Deti Fliegl for a patch that was used to implement StopSectionHandler()). - Fixed setting the date in the channel display of the classic and sttng skins, to avoid unnecessary OSD access (thanks to Marco Schlüßler). - The free disk space is now also displayed in the title of the "Recordings" menu (suggested by Walter Koch). - Changed the message "Upcoming VPS recording!" to "Upcoming recording!" because it applies to non-VPS recordings as well. - Fixed a loss of a timer's 'recording' flag after modifying it via MODT. - Fixed detecting directories in cFileNameList::Load(). - Running the thread that removes deleted recordings at a low priority to (maybe) avoid stuttering replay in case the thread is run during replay. - Limiting the length of the recording name in timers in case VDR is run with --vfat, in order to avoid names that are too long for Windows (suggested by Rolf Ahrenberg). - Using cString::sprintf() instead of asprintf() (thanks to Wolfgang Rohdewald for pointing out a possible problem if the return value is not checked). Plugin authors may want to consider doing the same. For convenience there is now an additional version of cString::sprintf() that accepts a va_list parameter. - When deleting the recording that is currently replayed, the replay is now stopped immediately (thanks to Mikko Matilainen for reporting a possible crash if the Info key is pressed after deleting the currently replayed recording). - Updated the Russian OSD texts (thanks to Oleg Roitburd). - When determining the amount of free disk space, any deleted (but not yet removed) recordings on different file systems (that are mounted under the video directory) are no longer taken into account. - When running out of disk space during a recording, only such deleted or old recordings are removed, that actually are on the video directory file system(s). This prevents VDR from accidentally deleting recordings on other file systems, which would not add any free space to the video directory. - Implemented the cStatus, cDevice and cPlayer functions for setting subtitle tracks in plugins (thanks to Petri Hintukainen). - Added cStatus::TimerChange() to inform plugins about changes to the list of timers (based on a patch from Benedikt Elser). - Added new cStatus functions to the 'status' plugin. - Added missing #include <limits.h> to epg.c and menuitems.h (thanks to Ville Skyttä). - The new function cSkin::SetScrollbar() can be implemented by skins to display a scrollbar in every list menu. The 'classic' and 'sttng' skins have been changed accordingly, as well as the 'skincurses' plugin. - Introduced 'operator const void * ()' in cString to catch cases where operator*() should be used. - Fixed calculating the scrollbar sizes in the skins.
Diffstat (limited to 'PLUGINS/src/skincurses')
-rw-r--r--PLUGINS/src/skincurses/HISTORY5
-rwxr-xr-xPLUGINS/src/skincurses/po/it_IT.po28
-rw-r--r--PLUGINS/src/skincurses/skincurses.c53
3 files changed, 65 insertions, 21 deletions
diff --git a/PLUGINS/src/skincurses/HISTORY b/PLUGINS/src/skincurses/HISTORY
index e5bfa49..45b79bb 100644
--- a/PLUGINS/src/skincurses/HISTORY
+++ b/PLUGINS/src/skincurses/HISTORY
@@ -65,3 +65,8 @@ VDR Plugin 'skincurses' Revision History
2008-01-19:
- Updated the Makefile of the skincurses plugin (thanks to Rolf Ahrenberg).
+
+2008-02-15: Version 0.1.5
+
+- Using cString::sprintf() instead of asprintf().
+- Implemented cSkinCursesDisplayMenu::SetScrollbar().
diff --git a/PLUGINS/src/skincurses/po/it_IT.po b/PLUGINS/src/skincurses/po/it_IT.po
new file mode 100755
index 0000000..8dc4556
--- /dev/null
+++ b/PLUGINS/src/skincurses/po/it_IT.po
@@ -0,0 +1,28 @@
+# VDR plugin language source file.
+# Copyright (C) 2007 Klaus Schmidinger <kls@cadsoft.de>
+# This file is distributed under the same license as the VDR package.
+# Diego Pierotto <vdr-italian@tiscali.it>, 2008
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: VDR 1.5.7\n"
+"Report-Msgid-Bugs-To: <vdr-bugs@cadsoft.de>\n"
+"POT-Creation-Date: 2007-08-15 16:04+0200\n"
+"PO-Revision-Date: 2008-01-27 20:35+0100\n"
+"Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n"
+"Language-Team: <vdr@linuxtv.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-15\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "A text only skin"
+msgstr "Una interfaccia solo testo"
+
+msgid "Key$Mute"
+msgstr "Muto"
+
+msgid "Volume "
+msgstr "Volume "
+
+msgid "Text mode"
+msgstr "Modalità testo"
diff --git a/PLUGINS/src/skincurses/skincurses.c b/PLUGINS/src/skincurses/skincurses.c
index b9a4fc0..2f0bea9 100644
--- a/PLUGINS/src/skincurses/skincurses.c
+++ b/PLUGINS/src/skincurses/skincurses.c
@@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
- * $Id: skincurses.c 1.18 2007/08/26 20:16:59 kls Exp $
+ * $Id: skincurses.c 1.20 2008/02/17 14:28:19 kls Exp $
*/
#include <ncurses.h>
@@ -11,7 +11,7 @@
#include <vdr/plugin.h>
#include <vdr/skins.h>
-static const char *VERSION = "0.1.4";
+static const char *VERSION = "0.1.5";
static const char *DESCRIPTION = trNOOP("A text only skin");
static const char *MAINMENUENTRY = NULL;
@@ -166,7 +166,7 @@ void cCursesOsd::DrawText(int x, int y, const char *s, tColor ColorFg, tColor Co
}
SetColor(ColorFg, ColorBg);
wmove(window, y, x); // ncurses wants 'y' before 'x'!
- waddnstr(window, s, ScOsdWidth - x);
+ waddnstr(window, s, Width ? Width : ScOsdWidth - x);
}
void cCursesOsd::DrawRectangle(int x1, int y1, int x2, int y2, tColor Color)
@@ -261,7 +261,8 @@ void cSkinCursesDisplayChannel::Flush(void)
class cSkinCursesDisplayMenu : public cSkinDisplayMenu {
private:
cOsd *osd;
- void SetScrollbar(void);
+ void DrawScrollbar(int Total, int Offset, int Shown, int Top, int Height, bool CanScrollUp, bool CanScrollDown);
+ void SetTextScrollbar(void);
public:
cSkinCursesDisplayMenu(void);
virtual ~cSkinCursesDisplayMenu();
@@ -272,6 +273,7 @@ public:
virtual void SetButtons(const char *Red, const char *Green = NULL, const char *Yellow = NULL, const char *Blue = NULL);
virtual void SetMessage(eMessageType Type, const char *Text);
virtual void SetItem(const char *Text, int Index, bool Current, bool Selectable);
+ virtual void SetScrollbar(int Total, int Offset);
virtual void SetEvent(const cEvent *Event);
virtual void SetRecording(const cRecording *Recording);
virtual void SetText(const char *Text, bool FixedFont);
@@ -290,25 +292,31 @@ cSkinCursesDisplayMenu::~cSkinCursesDisplayMenu()
delete osd;
}
-void cSkinCursesDisplayMenu::SetScrollbar(void)
+void cSkinCursesDisplayMenu::DrawScrollbar(int Total, int Offset, int Shown, int Top, int Height, bool CanScrollUp, bool CanScrollDown)
{
- if (textScroller.CanScroll()) {
- int yt = textScroller.Top();
- int yb = yt + textScroller.Height() - 1;
+ if (Total > 0 && Total > Shown) {
+ int yt = Top;
+ int yb = yt + Height - 1;
int st = yt;
int sb = yb;
- int tt = st + (sb - st) * textScroller.Offset() / textScroller.Total();
- int tb = tt + (sb - st) * textScroller.Shown() / textScroller.Total();
+ int tt = st + (sb - st + 1) * Offset / Total;
+ int tb = tt + (sb - st + 1) * Shown / Total;
int xl = ScOsdWidth - 1;
- osd->DrawRectangle(xl, st, xl, sb, clrCyan);
- osd->DrawRectangle(xl, tt, xl, tb, clrWhite);
+ osd->DrawRectangle(xl, st, xl, sb, clrWhite);
+ osd->DrawRectangle(xl, tt, xl, tb, clrCyan);
}
}
+void cSkinCursesDisplayMenu::SetTextScrollbar(void)
+{
+ if (textScroller.CanScroll())
+ DrawScrollbar(textScroller.Total(), textScroller.Offset(), textScroller.Shown(), textScroller.Top(), textScroller.Height(), textScroller.CanScrollUp(), textScroller.CanScrollDown());
+}
+
void cSkinCursesDisplayMenu::Scroll(bool Up, bool Page)
{
cSkinDisplayMenu::Scroll(Up, Page);
- SetScrollbar();
+ SetTextScrollbar();
}
int cSkinCursesDisplayMenu::MaxItems(void)
@@ -366,12 +374,17 @@ void cSkinCursesDisplayMenu::SetItem(const char *Text, int Index, bool Current,
const char *s = GetTabbedText(Text, i);
if (s) {
int xt = Tab(i) / 12;// Tab() is in "pixel" - see also skins.c!!!
- osd->DrawText(xt, y, s, ColorFg, ColorBg, &Font, ScOsdWidth - xt);
+ osd->DrawText(xt, y, s, ColorFg, ColorBg, &Font, ScOsdWidth - 2 - xt);
}
if (!Tab(i + 1))
break;
}
- SetEditableWidth(ScOsdWidth - Tab(1) / 12); // Tab() is in "pixel" - see also skins.c!!!
+ SetEditableWidth(ScOsdWidth - 2 - Tab(1) / 12); // Tab() is in "pixel" - see also skins.c!!!
+}
+
+void cSkinCursesDisplayMenu::SetScrollbar(int Total, int Offset)
+{
+ DrawScrollbar(Total, Offset, MaxItems(), 2, MaxItems(), Offset > 0, Offset + MaxItems() < Total);
}
void cSkinCursesDisplayMenu::SetEvent(const cEvent *Event)
@@ -384,10 +397,8 @@ void cSkinCursesDisplayMenu::SetEvent(const cEvent *Event)
snprintf(t, sizeof(t), "%s %s - %s", *Event->GetDateString(), *Event->GetTimeString(), *Event->GetEndTimeString());
ts.Set(osd, 0, y, ScOsdWidth, ScOsdHeight - y - 2, t, &Font, clrYellow, clrBackground);
if (Event->Vps() && Event->Vps() != Event->StartTime()) {
- char *buffer;
- asprintf(&buffer, " VPS: %s", *Event->GetVpsString());
+ cString buffer = cString::sprintf(" VPS: %s", *Event->GetVpsString());
osd->DrawText(ScOsdWidth - Utf8StrLen(buffer), y, buffer, clrBlack, clrYellow, &Font);
- free(buffer);
}
y += ts.Height();
y += 1;
@@ -400,7 +411,7 @@ void cSkinCursesDisplayMenu::SetEvent(const cEvent *Event)
y += 1;
if (!isempty(Event->Description())) {
textScroller.Set(osd, 0, y, ScOsdWidth - 2, ScOsdHeight - y - 2, Event->Description(), &Font, clrCyan, clrBackground);
- SetScrollbar();
+ SetTextScrollbar();
}
}
@@ -428,14 +439,14 @@ void cSkinCursesDisplayMenu::SetRecording(const cRecording *Recording)
y += 1;
if (!isempty(Info->Description())) {
textScroller.Set(osd, 0, y, ScOsdWidth - 2, ScOsdHeight - y - 2, Info->Description(), &Font, clrCyan, clrBackground);
- SetScrollbar();
+ SetTextScrollbar();
}
}
void cSkinCursesDisplayMenu::SetText(const char *Text, bool FixedFont)
{
textScroller.Set(osd, 0, 2, ScOsdWidth - 2, ScOsdHeight - 4, Text, &Font, clrWhite, clrBackground);
- SetScrollbar();
+ SetTextScrollbar();
}
void cSkinCursesDisplayMenu::Flush(void)