1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

When the 'skincurses' plugin is loaded, it automatically sets the 'curses' skin as the current one

This commit is contained in:
Klaus Schmidinger 2006-06-03 14:46:36 +02:00
parent 56744b1f4e
commit 0d4cf40b79
5 changed files with 26 additions and 7 deletions

View File

@ -4766,3 +4766,10 @@ Video Disk Recorder Revision History
- Fixed handling tabbed item display in 'skincurses'. - Fixed handling tabbed item display in 'skincurses'.
- Increased the column spacing in the "Recordings" menu (was too small for the - Increased the column spacing in the "Recordings" menu (was too small for the
'skincurses' plugin). 'skincurses' plugin).
- When the 'skincurses' plugin is loaded, it automatically sets the 'curses'
skin as the current one. This doesn't modify the Setup.OSDSkin parameter, so
that after using 'skincurses' (for instance for debugging) the previously
selected skin will be used again.
- Added some log messages when setting the current skin.
- Only making a second attempt to set the current skin at startup if the first
attempt has failed.

View File

@ -33,3 +33,5 @@ VDR Plugin 'skincurses' Revision History
2006-06-03: Version 0.0.7 2006-06-03: Version 0.0.7
- Fixed handling tabbed item display. - Fixed handling tabbed item display.
- When the 'skincurses' plugin is loaded, it automatically sets the 'curses'
skin as the current one.

View File

@ -3,7 +3,7 @@
* *
* See the README file for copyright information and how to reach the author. * See the README file for copyright information and how to reach the author.
* *
* $Id: skincurses.c 1.9 2006/06/03 13:21:33 kls Exp $ * $Id: skincurses.c 1.10 2006/06/03 14:20:39 kls Exp $
*/ */
#include <ncurses.h> #include <ncurses.h>
@ -787,7 +787,9 @@ bool cPluginSkinCurses::Initialize(void)
bool cPluginSkinCurses::Start(void) bool cPluginSkinCurses::Start(void)
{ {
// Start any background activities the plugin shall perform. // Start any background activities the plugin shall perform.
new cSkinCurses; cSkin *Skin = new cSkinCurses;
// This skin is normally used for debugging, so let's make it the current one:
Skins.SetCurrent(Skin->Name());
return true; return true;
} }

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: skins.c 1.10 2006/06/03 10:18:07 kls Exp $ * $Id: skins.c 1.11 2006/06/03 14:39:14 kls Exp $
*/ */
#include "skins.h" #include "skins.h"
@ -176,7 +176,6 @@ cSkin::cSkin(const char *Name, cTheme *Theme)
if (theme) if (theme)
cThemes::Save(name, theme); cThemes::Save(name, theme);
Skins.Add(this); Skins.Add(this);
Skins.SetCurrent(Name);
} }
cSkin::~cSkin() cSkin::~cSkin()
@ -203,12 +202,17 @@ bool cSkins::SetCurrent(const char *Name)
if (Name) { if (Name) {
for (cSkin *Skin = First(); Skin; Skin = Next(Skin)) { for (cSkin *Skin = First(); Skin; Skin = Next(Skin)) {
if (strcmp(Skin->Name(), Name) == 0) { if (strcmp(Skin->Name(), Name) == 0) {
isyslog("setting current skin to \"%s\"", Name);
current = Skin; current = Skin;
return true; return true;
} }
} }
} }
current = First(); current = First();
if (current)
isyslog("skin \"%s\" not available - using \"%s\" instead", Name, current->Name());
else
esyslog("ERROR: no skin available");
return current != NULL; return current != NULL;
} }

10
vdr.c
View File

@ -22,7 +22,7 @@
* *
* The project's page is at http://www.cadsoft.de/vdr * The project's page is at http://www.cadsoft.de/vdr
* *
* $Id: vdr.c 1.272 2006/05/14 09:23:46 kls Exp $ * $Id: vdr.c 1.273 2006/06/03 14:46:36 kls Exp $
*/ */
#include <getopt.h> #include <getopt.h>
@ -504,6 +504,7 @@ int main(int argc, char *argv[])
bool UserShutdown = false; bool UserShutdown = false;
bool TimerInVpsMargin = false; bool TimerInVpsMargin = false;
bool IsInfoMenu = false; bool IsInfoMenu = false;
cSkin *CurrentSkin = NULL;
// Load plugins: // Load plugins:
@ -605,6 +606,7 @@ int main(int argc, char *argv[])
new cSkinSTTNG; new cSkinSTTNG;
Skins.SetCurrent(Setup.OSDSkin); Skins.SetCurrent(Setup.OSDSkin);
cThemes::Load(Skins.Current()->Name(), Setup.OSDTheme, Skins.Current()->Theme()); cThemes::Load(Skins.Current()->Name(), Setup.OSDTheme, Skins.Current()->Theme());
CurrentSkin = Skins.Current();
// Start plugins: // Start plugins:
@ -613,8 +615,10 @@ int main(int argc, char *argv[])
// Set skin and theme in case they're implemented by a plugin: // Set skin and theme in case they're implemented by a plugin:
Skins.SetCurrent(Setup.OSDSkin); if (!CurrentSkin || CurrentSkin == Skins.Current() && strcmp(Skins.Current()->Name(), Setup.OSDSkin) != 0) {
cThemes::Load(Skins.Current()->Name(), Setup.OSDTheme, Skins.Current()->Theme()); Skins.SetCurrent(Setup.OSDSkin);
cThemes::Load(Skins.Current()->Name(), Setup.OSDTheme, Skins.Current()->Theme());
}
// Remote Controls: // Remote Controls:
if (RcuDevice) if (RcuDevice)