diff options
author | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2007-06-17 18:00:00 +0200 |
---|---|---|
committer | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2007-06-17 18:00:00 +0200 |
commit | b1e4da3be6552f58f3890bf2ad48879823d2e130 (patch) | |
tree | cf42a1e6b296956b82a2820948c7b90dbcddf26e /menu.c | |
parent | b9b9ace9a8d2d1c0beda1dc0a2ebc6be9b47c305 (diff) | |
download | vdr-patch-lnbsharing-vdr-1.5.4.tar.gz vdr-patch-lnbsharing-vdr-1.5.4.tar.bz2 |
Version 1.5.4vdr-1.5.4
- Increased APIVERSION (forgot to do that in 1.5.2 and 1.5.3).
- Fixed a crash in i18n character set conversion (thanks to Alexander Riedel,
Jose Alberto Reguero and Christian Wieninger for patches that cured part of
the problem).
- Adjusted the 'skincurses' plugin to UTF-8 handling.
- Using nl_langinfo(CODESET) to determine the local codeset to use (thanks to
Thomas Günther). The codeset names in 'libsi/si.c' have been changed to the
canonical spelling with '-' (thanks to Ludwig Nussel for pointing this out).
- Modified handling invalid characters in VFAT mode.
- Replaced strn0cpy() with Utf8Strn0Cpy() where necessary.
- Now using 'fontconfig' to determine which fonts to use (thanks to Anssi Hannula
for code and hints on how to do this).
- If no fonts are installed, VDR now uses a dummy font that doesn't actually draw
any text, and logs an error message.
- The new function cFont::CreateFont() can be used by plugins to create and use
fonts of their own, independent of VDR's standard fonts.
- Updated the Finnish OSD texts (thanks to Rolf Ahrenberg).
- Changed the parameter "OSD font" to "Default font" in "Setup/OSD" (suggested
by Rolf Ahrenberg).
- Fixed handling detached processes in SystemExec() (thanks to Udo Richter).
- The info.vdr file now also stores the name of the channel, and the new function
cRecordingInfo::ChannelName() returns this information if available (based on
a patch from Alexander Hans).
- The new function cOsd::SetOsdPosition() can be used to dynamically change the
position and size of the OSD (based on a request from Christoph Haubrich).
Plugins that implement skins should no longer use Setup.OSDWidth etc. directly,
but should rather use cOsd::OsdWidth() etc. instead.
Currently a change to the OSD position will only apply to newly opened OSDs.
Diffstat (limited to 'menu.c')
-rw-r--r-- | menu.c | 39 |
1 files changed, 19 insertions, 20 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: menu.c 1.451 2007/06/09 14:36:46 kls Exp $ + * $Id: menu.c 1.455 2007/06/17 12:33:01 kls Exp $ */ #include "menu.h" @@ -2160,7 +2160,7 @@ private: cThemes themes; int originalThemeIndex; int themeIndex; - cFileNameList fontNames; + cStringList fontOsdNames, fontSmlNames, fontFixNames; int fontOsdIndex, fontSmlIndex, fontFixIndex; virtual void Set(void); public: @@ -2176,12 +2176,15 @@ cMenuSetupOSD::cMenuSetupOSD(void) skinDescriptions = new const char*[numSkins]; themes.Load(Skins.Current()->Name()); themeIndex = originalThemeIndex = Skins.Current()->Theme() ? themes.GetThemeIndex(Skins.Current()->Theme()->Description()) : 0; - fontNames.Load(FONTDIR); - if (fontNames.Size()) { - fontOsdIndex = max(0, fontNames.Find(Setup.FontOsd)); - fontSmlIndex = max(0, fontNames.Find(Setup.FontSml)); - fontFixIndex = max(0, fontNames.Find(Setup.FontFix)); - } + cFont::GetAvailableFontNames(&fontOsdNames); + cFont::GetAvailableFontNames(&fontSmlNames); + cFont::GetAvailableFontNames(&fontFixNames, true); + fontOsdNames.Insert(strdup(DefaultFontOsd)); + fontSmlNames.Insert(strdup(DefaultFontSml)); + fontFixNames.Insert(strdup(DefaultFontFix)); + fontOsdIndex = max(0, fontOsdNames.Find(Setup.FontOsd)); + fontSmlIndex = max(0, fontSmlNames.Find(Setup.FontSml)); + fontFixIndex = max(0, fontFixNames.Find(Setup.FontFix)); Set(); } @@ -2211,11 +2214,9 @@ void cMenuSetupOSD::Set(void) Add(new cMenuEditIntItem( tr("Setup.OSD$Message time (s)"), &data.OSDMessageTime, 1, 60)); Add(new cMenuEditStraItem(tr("Setup.OSD$Use small font"), &data.UseSmallFont, 3, useSmallFontTexts)); Add(new cMenuEditBoolItem(tr("Setup.OSD$Anti-alias"), &data.AntiAlias)); - if (fontNames.Size()) { - Add(new cMenuEditStraItem(tr("Setup.OSD$OSD font name"), &fontOsdIndex, fontNames.Size(), &fontNames[0])); - Add(new cMenuEditStraItem(tr("Setup.OSD$Small font name"), &fontSmlIndex, fontNames.Size(), &fontNames[0])); - Add(new cMenuEditStraItem(tr("Setup.OSD$Fixed font name"), &fontFixIndex, fontNames.Size(), &fontNames[0])); - } + Add(new cMenuEditStraItem(tr("Setup.OSD$Default font"), &fontOsdIndex, fontOsdNames.Size(), &fontOsdNames[0])); + Add(new cMenuEditStraItem(tr("Setup.OSD$Small font"), &fontSmlIndex, fontSmlNames.Size(), &fontSmlNames[0])); + Add(new cMenuEditStraItem(tr("Setup.OSD$Fixed font"), &fontFixIndex, fontFixNames.Size(), &fontFixNames[0])); Add(new cMenuEditIntItem( tr("Setup.OSD$OSD font size (pixel)"), &data.FontOsdSize, 10, MAXFONTSIZE)); Add(new cMenuEditIntItem( tr("Setup.OSD$Small font size (pixel)"),&data.FontSmlSize, 10, MAXFONTSIZE)); Add(new cMenuEditIntItem( tr("Setup.OSD$Fixed font size (pixel)"),&data.FontFixSize, 10, MAXFONTSIZE)); @@ -2239,14 +2240,14 @@ eOSState cMenuSetupOSD::ProcessKey(eKeys Key) if (skinIndex != originalSkinIndex) { cSkin *Skin = Skins.Get(skinIndex); if (Skin) { - strn0cpy(data.OSDSkin, Skin->Name(), sizeof(data.OSDSkin)); + Utf8Strn0Cpy(data.OSDSkin, Skin->Name(), sizeof(data.OSDSkin)); Skins.SetCurrent(Skin->Name()); ModifiedApperance = true; } } if (themes.NumThemes() && Skins.Current()->Theme()) { Skins.Current()->Theme()->Load(themes.FileName(themeIndex)); - strn0cpy(data.OSDTheme, themes.Name(themeIndex), sizeof(data.OSDTheme)); + Utf8Strn0Cpy(data.OSDTheme, themes.Name(themeIndex), sizeof(data.OSDTheme)); ModifiedApperance |= themeIndex != originalThemeIndex; } if (data.OSDLeft != Setup.OSDLeft || data.OSDTop != Setup.OSDTop || data.OSDWidth != Setup.OSDWidth || data.OSDHeight != Setup.OSDHeight) { @@ -2255,11 +2256,9 @@ eOSState cMenuSetupOSD::ProcessKey(eKeys Key) } if (data.UseSmallFont != Setup.UseSmallFont || data.AntiAlias != Setup.AntiAlias) ModifiedApperance = true; - if (fontNames.Size()) { - strn0cpy(data.FontOsd, fontNames[fontOsdIndex], sizeof(data.FontOsd)); - strn0cpy(data.FontSml, fontNames[fontSmlIndex], sizeof(data.FontSml)); - strn0cpy(data.FontFix, fontNames[fontFixIndex], sizeof(data.FontFix)); - } + Utf8Strn0Cpy(data.FontOsd, fontOsdNames[fontOsdIndex], sizeof(data.FontOsd)); + Utf8Strn0Cpy(data.FontSml, fontSmlNames[fontSmlIndex], sizeof(data.FontSml)); + Utf8Strn0Cpy(data.FontFix, fontFixNames[fontFixIndex], sizeof(data.FontFix)); if (strcmp(data.FontOsd, Setup.FontOsd) || data.FontOsdSize != Setup.FontOsdSize) { cFont::SetFont(fontOsd, data.FontOsd, data.FontOsdSize); ModifiedApperance = true; |