Skip to content

Commit

Permalink
Update and enhance date/time facility (#138)
Browse files Browse the repository at this point in the history
- Separate VFD dates to a new configuration option
- Add an option to disable/hide the VFD date and/or time from the display  (Good for people who use their device in a bedroom.)
- Add new front panel related ClockToText converter options
- Hide EPG based "Timeline 24 Hour" options when new time options are available
- Update DisplayText skin to use new parameter format
- Use more common strftime() %d format for day of month
- Optimise (speed up) ConfigClock editor
- Protect the parameter load from crashing and creating a boot loop.

IMPORTANT NOTE: Any display skins that user the "<parameter name="AllowUserDatesAndTimesDisplay" value="1" />" must be edited to user the newer form of the parameter "<parameter name="AllowUserDatesAndTimesDisplay" value="1,1" />".
  • Loading branch information
IanSav authored and rossi2000 committed Feb 25, 2017
1 parent efa15ac commit 0a93692
Show file tree
Hide file tree
Showing 5 changed files with 175 additions and 77 deletions.
2 changes: 1 addition & 1 deletion data/displaytext/skin_display.xml
Expand Up @@ -22,7 +22,7 @@
<font filename="nmsbd.ttf" name="FdLcD" scale="100"/>
</fonts>
<parameters>
<parameter name="AllowUserDatesAndTimesDisplay" value="1" />
<parameter name="AllowUserDatesAndTimesDisplay" value="1,1" />
</parameters>

<!-- main-->
Expand Down
7 changes: 4 additions & 3 deletions data/setup.xml
Expand Up @@ -233,7 +233,8 @@
<item level="2" text="Final scroll delay" description="Delay in miliseconds after finish scrolling text on display." requires="VFD_final_scroll_delay">config.usage.vfd_final_scroll_delay</item>
<item level="1" text="Repeat Display Message" description="If the text is too long to be displayed on the front panel, it will be repeated (number of times):" requires="VFD_scroll_repeats">config.usage.vfd_scroll_repeats</item>
<item level="1" text="Scrolling Speed" description="Set the scrolling speed of text on the front display." requires="VFD_scroll_delay">config.usage.vfd_scroll_delay</item>
<item level="0" text="Time style" description="Choose the front panel display formatting style for times. 'H' / 'HH' is the hour for a 24 hour clock, 'h' / 'hh' is the hour for a 12 hour clock, 'mm' is the minutes and 'ss' is the seconds. ('HH' and 'hh' have leading zeros for single digit values.) The front panel display will be based on your choice but can be influenced any applicable skin." requires="config.usage.time.enabled_display">config.usage.time.display</item>
<item level="0" text="Date style" description="Choose the front panel display formatting style for dates. 'D' / 'DD' is the date and 'M' / 'MM' is the month in digits. ('DD' and 'MM' have leading zeros for single digit values.) The screen display will be based on your choice but can be influenced by the skin." requires="config.usage.date.enabled_display">config.usage.date.display</item>
<item level="0" text="Time style" description="Choose the front panel display formatting style for times. 'H' / 'HH' is the hour for a 24 hour clock, 'h' / 'hh' is the hour for a 12 hour clock, 'mm' is the minutes. ('HH' and 'hh' have leading zeros for single digit values.) The front panel display will be based on your choice but can be influenced any applicable skin." requires="config.usage.time.enabled_display">config.usage.time.display</item>
<item level="1" text="Show Display Icons" description="Allows you to enable/disable displaying icons on the front panel.">config.lcd.mode</item>
<item level="1" text="Show Time Remaining/Elapsed" description="This option allows you choose how to display remaining time, or elapsed time, or both.">config.usage.swap_time_remaining_on_vfd</item>
<item level="1" text="Show Transponder Remaining/Elapsed as" description="This option allows you choose how to display the remaining/elapsed time for live TV.">config.usage.swap_time_display_on_vfd</item>
Expand Down Expand Up @@ -331,7 +332,7 @@
<item level="2" text="Picon width" description="Configure the width allocated to the picon.">config.epgselection.infobar_piconwidth</item>
<item level="2" text="Info icon width" description="Configure the minimum width before showing the 'i' icon, '0' is equal to not showing the icon at all.">config.epgselection.infobar_infowidth</item>
<item level="2" text="Timeline font size" description="Configure the font size relative to skin size, so 1 increases by 1 point size, and -1 decreases by 1 point size.">config.epgselection.infobar_timelinefs</item>
<item level="2" text="Timeline 24 Hour" description="Show time in 24 hour clock format.\nNOTE: This setting is not used if the global time format settings are available.">config.epgselection.infobar_timeline24h</item>
<item level="2" text="Timeline 24 Hour" description="Show time in 24 hour clock format." requires="config.usage.time.disabled">config.epgselection.infobar_timeline24h</item>
<item level="2" text="Time scale" description="Configure the amount of time that will be presented.">config.epgselection.infobar_prevtimeperiod</item>
</setup>
<setup key="epggraphical" title="GraphicalEPG settings">
Expand Down Expand Up @@ -362,7 +363,7 @@
<item level="2" text="Info icon width" description="Configure the minimum width before showing the 'i' icon, '0' is equal to not showing the icon at all.">config.epgselection.graph_infowidth</item>
<item level="2" text="Position of recording icons" description="Set the position of the recording icons">config.epgselection.graph_rec_icon_height</item>
<item level="2" text="Timeline font size" description="Configure the font size relative to skin size, so 1 increases by 1 point size, and -1 decreases by 1 point size.">config.epgselection.graph_timelinefs</item>
<item level="2" text="Timeline 24 Hour" description="Show time in 24 hour clock format.\nNOTE: This setting is not used if the global time format settings are available.">config.epgselection.graph_timeline24h</item>
<item level="2" text="Timeline 24 Hour" description="Show time in 24 hour clock format." requires="config.usage.time.disabled">config.epgselection.graph_timeline24h</item>
<item level="2" text="Time scale" description="Configure the amount of time that will be presented.">config.epgselection.graph_prevtimeperiod</item>
</setup>
<setup key="pluginbrowsersetup" title="Plugin browser settings">
Expand Down
10 changes: 8 additions & 2 deletions lib/python/Components/Converter/ClockToText.py
Expand Up @@ -13,10 +13,16 @@ class ClockToText(Converter, object):
"AsLengthSeconds": lambda t: "" if t < 0 else "%d:%02d:%02d" % (t / 3600, t / 60 % 60, t % 60),
# TRANSLATORS: full date representation dayname daynum monthname year in strftime() format! See 'man strftime'
"Date": lambda t: strftime(config.usage.date.dayfull.value, localtime(t)), # _("%A %e %B %Y")
# TRANSLATORS: short time representation hour:minute
# TRANSLATORS: short time representation hour:minute in strftime() format! See 'man strftime'
"Default": lambda t: strftime(config.usage.time.short.value, localtime(t)), # _("%R")
# TRANSLATORS: short time representation hour:minute
# TRANSLATORS: short time representation hour:minute in strftime() format! See 'man strftime'
"Display": lambda t: strftime(config.usage.time.display.value, localtime(t)), # _("%R")
# TRANSLATORS: short date representation daynum short monthname in strftime() format! See 'man strftime'
"DisplayDate": lambda t: strftime(config.usage.date.display.value, localtime(t)), # _("%e %b")
# TRANSLATORS: short date representation daynum short monthname in strftime() format! See 'man strftime'
"DisplayDayDate": lambda t: strftime(config.usage.date.displayday.value, localtime(t)), # _("%a %e %b")
# TRANSLATORS: short time representation hour:minute in strftime() format! See 'man strftime'
"DisplayTime": lambda t: strftime(config.usage.time.display.value, localtime(t)), # _("%R")
# TRANSLATORS: long date representation short dayname daynum short monthname hour:minute in strftime() format! See 'man strftime'
"Full": lambda t: strftime(config.usage.date.dayshort.value + " " + config.usage.time.short.value, localtime(t)), # _("%a %e %b %R")
# TRANSLATORS: full date representations short dayname daynum monthname long year in strftime() format! See 'man strftime'
Expand Down

0 comments on commit 0a93692

Please sign in to comment.