diff options
author | Sascha Volkenandt <sascha (at) akv-soft (dot) de> | 2007-01-05 22:17:12 +0000 |
---|---|---|
committer | Sascha Volkenandt <sascha (at) akv-soft (dot) de> | 2007-01-05 22:17:12 +0000 |
commit | 549a8ee8dc07767ca19e89ff828b35c246b36697 (patch) | |
tree | 60fef33cd40f5d286b76a41d46dc0519f0486a0e /pages | |
parent | 848f59bb2fddfc0b02b1a4b7a1ec6e8d3e82d240 (diff) | |
download | vdr-plugin-live-549a8ee8dc07767ca19e89ff828b35c246b36697.tar.gz vdr-plugin-live-549a8ee8dc07767ca19e89ff828b35c246b36697.tar.bz2 |
- added timer data to editor
- timers don't show date in case of a weekday timer
Diffstat (limited to 'pages')
-rw-r--r-- | pages/Makefile | 2 | ||||
-rw-r--r-- | pages/edit_timer.ecpp | 62 | ||||
-rw-r--r-- | pages/timers.ecpp | 4 |
3 files changed, 38 insertions, 30 deletions
diff --git a/pages/Makefile b/pages/Makefile index de2011d..246a6c5 100644 --- a/pages/Makefile +++ b/pages/Makefile @@ -17,7 +17,7 @@ VDRDIR ?= ../../../.. OBJS = menu.o event_widget.o channels.o recordings.o schedule.o \ screenshot.o timers.o whats_on_now.o whats_on_next.o \ - keypress.o remote.o channels_widget.o edit_timer.o + keypress.o remote.o channels_widget.o edit_timer.o ### Default rules: diff --git a/pages/edit_timer.ecpp b/pages/edit_timer.ecpp index aa0ec63..5995a3b 100644 --- a/pages/edit_timer.ecpp +++ b/pages/edit_timer.ecpp @@ -32,6 +32,24 @@ timerid; return DECLINED; // XXX error page } + bool active = timer ? timer->Flags() & tfActive : true; + std::string channel = timer ? *timer->Channel()->GetChannelID().ToString() : ""; + std::string title = timer ? timer->File() : ""; + int day = ( !timer || timer->Day() ) ? StringToInt( FormatDateTime( "%d", timer ? timer->Day() : time( 0 ) ) ) : 0; + bool wday_mon = timer ? timer->WeekDays() & 0x01 : false; + bool wday_tue = timer ? timer->WeekDays() & 0x02 : false; + bool wday_wed = timer ? timer->WeekDays() & 0x04 : false; + bool wday_thu = timer ? timer->WeekDays() & 0x08 : false; + bool wday_fri = timer ? timer->WeekDays() & 0x10 : false; + bool wday_sat = timer ? timer->WeekDays() & 0x20 : false; + bool wday_sun = timer ? timer->WeekDays() & 0x40 : false; + int start_h = timer ? ( timer->Start() / 100 ) % 100 : StringToInt( FormatDateTime( "%H", time( 0 ) ) ); + int start_m = timer ? timer->Start() % 100 : StringToInt( FormatDateTime( "%M", time( 0 ) ) ); + int end_h = timer ? ( timer->Stop() / 100 ) % 100 : StringToInt( FormatDateTime( "%H", time( 0 ) ) ); + int end_m = timer ? timer->Stop() % 100 : StringToInt( FormatDateTime( "%M", time( 0 ) ) ); + bool vps = timer ? timer->Flags() & tfVps : ::Setup.UseVps; + int priority = timer ? timer->Priority() : ::Setup.DefaultPriority; + int lifetime = timer ? timer->Lifetime() : ::Setup.DefaultLifetime; }> <html> <head> @@ -51,8 +69,8 @@ timerid; <tr> <td>Timer aktiv: </td> <td> - <input name="active" value="1" checked="checked" type="radio">Ja - <input name="active" value="0" type="radio">Nein + <input name="active" value="1" <{ reply.out() << ( active ? "checked=\"checked\"" : "" ); }> type="radio">Ja + <input name="active" value="0" <{ reply.out() << ( !active ? "checked=\"checked\"" : "" ); }> type="radio">Nein </td> </tr> <tr> @@ -60,67 +78,57 @@ timerid; Kanal: </td> <td> - <select name="channel"> -<{ - for (cChannel *listChannel = Channels.First(); listChannel && listChannel->Number() <= LiveSetup().GetLastChannel(); listChannel = Channels.Next(listChannel)) { - if (!listChannel->GroupSep() && *listChannel->Name()) { -}> - <option value="<$ listChannel->Number() $>"><$ listChannel->Name() $></option> -<{ - } - } -}> - </select> +<& channels_widget name=("channel") selected=(channel) &> </td> </tr> <tr> <td>Titel</td> - <td><input type="text" name="day" value="" size="80" /></td> + <td><input type="text" name="title" value="<$ title $>" size="80" /></td> </tr> <tr> <td>Tag der Aufnahme</td> - <td><input type="text" name="day" value="" size="2" maxlength="2" /></td> + <td><input type="text" name="day" value="<? day ? day ?>" size="2" maxlength="2" /></td> </tr> <tr> <td>Wochentag</td> <td> - <input type="checkbox" name="wday_mon" value="1" /> Montag - <input type="checkbox" name="wday_tue" value="1" /> Dienstag - <input type="checkbox" name="wday_wed" value="1" /> Mittwoch - <input type="checkbox" name="wday_thu" value="1" /> Donnerstag - <input type="checkbox" name="wday_fri" value="1" /> Freitag - <input type="checkbox" name="wday_sat" value="1" /> Samstag - <input type="checkbox" name="wday_sun" value="1" /> Sonntag + <input type="checkbox" name="wday_mon" value="1" <{ reply.out() << ( wday_mon ? "checked=\"checked\"" : "" ); }>/> Montag + <input type="checkbox" name="wday_tue" value="1" <{ reply.out() << ( wday_tue ? "checked=\"checked\"" : "" ); }>/> Dienstag + <input type="checkbox" name="wday_wed" value="1" <{ reply.out() << ( wday_wed ? "checked=\"checked\"" : "" ); }>/> Mittwoch + <input type="checkbox" name="wday_thu" value="1" <{ reply.out() << ( wday_thu ? "checked=\"checked\"" : "" ); }>/> Donnerstag + <input type="checkbox" name="wday_fri" value="1" <{ reply.out() << ( wday_fri ? "checked=\"checked\"" : "" ); }>/> Freitag + <input type="checkbox" name="wday_sat" value="1" <{ reply.out() << ( wday_sat ? "checked=\"checked\"" : "" ); }>/> Samstag + <input type="checkbox" name="wday_sun" value="1" <{ reply.out() << ( wday_sun ? "checked=\"checked\"" : "" ); }>/> Sonntag </td> </tr> <tr> <td>Startzeit:</td> - <td><input type="text" size="2" maxlength="2" name="start_h" value="" /> : <input type="text" size="2" maxlength="2" name="start_m" value="" /></td> + <td><input type="text" size="2" maxlength="2" name="start_h" value="<$ start_h $>" /> : <input type="text" size="2" maxlength="2" name="start_m" value="<$ start_m $>" /></td> </tr> <tr> <td>Endzeit:</td> - <td><input type="text" size="2" maxlength="2" name="end_h" value="" /> : <input type="text" size="2" maxlength="2" name="end_m" value="" /></td> + <td><input type="text" size="2" maxlength="2" name="end_h" value="<$ end_h $>" /> : <input type="text" size="2" maxlength="2" name="end_m" value="<$ end_m $>" /></td> </tr> <tr> <td>VPS verwenden</td> - <td><input type="checkbox" name="vps" value="1" /></td> + <td><input type="checkbox" name="vps" value="1" <{ reply.out() << ( vps ? "checked=\"checked\"" : "" ); }>/></td> </tr> <tr> <td>Priorität:</td> - <td><input type="text" size="2" maxlength="2" name="prio" value="99" /></td> + <td><input type="text" size="2" maxlength="2" name="prio" value="<$ priority $>" /></td> </tr> <tr> <td>Lebensdauer:</td> - <td><input type="text" size="2" maxlength="2" name="life" value="99" /></td> + <td><input type="text" size="2" maxlength="2" name="life" value="<$ lifetime $>" /></td> </tr> </table> diff --git a/pages/timers.ecpp b/pages/timers.ecpp index 8fc9e16..7c07fe6 100644 --- a/pages/timers.ecpp +++ b/pages/timers.ecpp @@ -53,9 +53,9 @@ using namespace vdrlive; }> <tr class="<$ active ? "active" : "" $>"> <td><button type="button" class="smallbutton" onclick="location.href='edit_timer.html?timerid=<$ timers.GetTimerId(*timer) $>';"><$ tr("Edit") $></button></td> - <td><img src="/<$ (timer->Flags() & 1) ? "active" : "inactive" $>.png" alt="Aktiv?" /></td> + <td><img src="/<$ (timer->Flags() & tfActive) ? "active" : "inactive" $>.png" alt="Aktiv?" /></td> <td><$ timer->Channel()->Name() $></td> - <td><$ FormatDateTime(tr("%a, %b %d"), timer->Day()) $></td> + <td><$ timer->Day() > 0 ? FormatDateTime(tr("%a, %b %d"), timer->Day()) : " " $></td> <td><$ FormatDateTime(tr("%I:%M %p"), timer->StartTime()) $></td> <td><$ FormatDateTime(tr("%I:%M %p"), timer->StopTime()) $></td> <td><{ if (timer->Flags() & 8) { }><img src="/record.png" alt="Record" /><{ } }></td> |