diff options
| author | Sascha Volkenandt <sascha (at) akv-soft (dot) de> | 2007-01-06 23:33:34 +0000 |
|---|---|---|
| committer | Sascha Volkenandt <sascha (at) akv-soft (dot) de> | 2007-01-06 23:33:34 +0000 |
| commit | 0252d06339a3f834d86aab32845e613314e5e367 (patch) | |
| tree | c183ab25f92592cf8aa3d082e7aaabb6a47e9505 /pages/channels_widget.ecpp | |
| parent | bb35bd7595564327881f5941d7853e427827f8b9 (diff) | |
| download | vdr-plugin-live-0252d06339a3f834d86aab32845e613314e5e367.tar.gz vdr-plugin-live-0252d06339a3f834d86aab32845e613314e5e367.tar.bz2 | |
- added simple error handling and regrouped web pages
Diffstat (limited to 'pages/channels_widget.ecpp')
| -rw-r--r-- | pages/channels_widget.ecpp | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/pages/channels_widget.ecpp b/pages/channels_widget.ecpp index 5bd69b2..bdc526c 100644 --- a/pages/channels_widget.ecpp +++ b/pages/channels_widget.ecpp @@ -1,5 +1,6 @@ <%pre> #include <vdr/channels.h> +#include "exception.h" #include "setup.h" #include "tools.h" @@ -13,17 +14,19 @@ selected; onchange; bool channelId = false; </%args> - +<%cpp> +ReadLock channelsLock( Channels ); +if ( !channelsLock ) + throw HtmlError( tr("Channels"), tr("Couldn't aquire access to channels, please try again later.") ); +</%cpp> <select name="<$ name $>" <{ reply.out() << ( !onchange.empty() ? "onchange=\""+onchange+"\"" : "" ); }>> -<{ - for (cChannel *listChannel = Channels.First(); listChannel && listChannel->Number() <= lastChannel; listChannel = Channels.Next(listChannel)) { - if (!listChannel->GroupSep() && *listChannel->Name()) { - std::string listChannelId = *listChannel->GetChannelID().ToString(); -}> - <option value="<? channelId ? *listChannel->GetChannelID().ToString() ?><? !channelId ? listChannel->Number() ?>" - <{ reply.out() << ( listChannelId == selected ? "selected=\"selected\"" : "" ); }>><$ listChannel->Name() $></option> -<{ - } - } -}> +% for ( cChannel *listChannel = Channels.First(); listChannel && listChannel->Number() <= lastChannel; +% listChannel = Channels.Next( listChannel ) ) { +% if ( listChannel->GroupSep() || *listChannel->Name() == '\0' ) +% continue; +% +% std::string listChannelId = *listChannel->GetChannelID().ToString(); + <option value="<? channelId ? *listChannel->GetChannelID().ToString() ?><? !channelId ? listChannel->Number() ?>" + <{ reply.out() << ( listChannelId == selected ? "selected=\"selected\"" : "" ); }>><$ listChannel->Name() $></option> +% } </select> |
