Skip to content

Commit

Permalink
Merge pull request #3872 from DimitarCC/two-line-mode-patch1
Browse files Browse the repository at this point in the history
[Added] Two lines and Next event mode
  • Loading branch information
littlesat authored Dec 15, 2023
2 parents 386316d + c9be99c commit 6444e50
Show file tree
Hide file tree
Showing 5 changed files with 160 additions and 86 deletions.
11 changes: 7 additions & 4 deletions data/setup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,17 @@
<item level="2" text="Show channel numbers in channel selection" description="When enabled, show channel numbers in the channel selection screen.">config.usage.show_channel_numbers_in_servicelist</item>
<item level="2" text="Hide number markers" conditional="config.usage.show_channel_numbers_in_servicelist.value" description="When enabled, number markers will be hidden.">config.usage.hide_number_markers</item>
<item level="2" text="Show two lines per entry" description="Show the service information on two lines in the channel selection screen. You can choose between the current event description below the channel name, or the current event description next to the channel name, and the next event description on the second line.">config.usage.servicelist_twolines</item>
<item level="1" text="Show event-progress in channel selection" description="Set the type of the progress indication in the channel selection screen.">config.usage.show_event_progress_in_servicelist</item>
<item level="2" text="Show service type icons" description="Configure if and how service type icons will be shown in the channel selection list.">config.usage.servicetype_icon_mode</item>
<item level="2" text="Show crypto icons" description="Configure if and how crypto icons will be shown in the channel selection list.">config.usage.crypto_icon_mode</item>
<item level="1" text="Show record indicator" description="Configure if and how the record indicator will be shown in the channel selection list.">config.usage.record_indicator_mode</item>
<item level="1" text="Show event-progress in channel selection" description="Set the type of the progress indication in the channel selection screen (right alignment only available in single line mode).">config.usage.show_event_progress_in_servicelist</item>
<item level="2" text="Show service type icons" description="Configure if and how service type icons will be shown in the channel selection list (left alignment only available in single line mode).">config.usage.servicetype_icon_mode</item>
<item level="2" text="Show crypto icons" description="Configure if and how crypto icons will be shown in the channel selection list (left alignment only available in single line mode).">config.usage.crypto_icon_mode</item>
<item level="1" text="Show record indicator" description="Configure if and how the record indicator will be shown in the channel selection list (left alignment only available in single line mode).">config.usage.record_indicator_mode</item>
<item level="2" text="Show columns" conditional="config.usage.servicelist_twolines.value == '0'" description="Configure if and how wide columns will be shown in the channel selection list.">config.usage.servicelist_column</item>
<item level="1" text="Show picons in channel selection list" description="Configure if service picons will be shown in the channel selection list.">config.usage.service_icon_enable</item>
<item level="2" text="Customize channel list cursor behavior" description="Configure the cursor behaviour in the channel selection list. When opening the channel selection list you can keep on the current service or already select up/down and you are able to revert the B+/B- buttons.">config.usage.servicelist_cursor_behavior</item>
<item level="1" text="Number of channels shown in channel selection list" description="Configure how many channels are shown in the selection list.">config.usage.servicelist_number_of_services</item>
<item level="1" text="Service number font size" description="This allows you to change the font size relative to skin size, so 1 increases by 1 point size, and -1 decreases by 1 point size">config.usage.servicenum_fontsize</item>
<item level="1" text="Service name font size" description="This allows you to change the font size relative to skin size, so 1 increases by 1 point size, and -1 decreases by 1 point size">config.usage.servicename_fontsize</item>
<item level="1" text="Service info font size" description="This allows you to change the font size relative to skin size, so 1 increases by 1 point size, and -1 decreases by 1 point size">config.usage.serviceinfo_fontsize</item>
<item level="2" text="Enable 'neutrino' style zap controlling" description="When enabled the arrow buttons around the OK button will follow the 'neutrino' style zap controls instead of the enigma2 style.">config.usage.oldstyle_zap_controls</item>
<item level="2" text="Enable 'neutrino' style channel select controlling" description="When enabled the left, right, CH+/-, B+/-, P+/- buttons will follow the 'neutrino' style zap controls instead of the enigma2 style.">config.usage.oldstyle_channel_select_controls</item>
<item level="2" text="Enable zapping with CH+/-, B+/-, P+/-" description="When enabled you can zap channels with the CH+/-, B+/-, P+/- buttons instead of opening the channel selection list.">config.usage.zap_with_ch_buttons</item>
Expand Down
14 changes: 14 additions & 0 deletions lib/python/Components/ServiceList.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ def setFontsize(self):
self.l.setElementFont(self.l.celServiceName, self.ServiceNameFont)
self.l.setElementFont(self.l.celServiceNumber, self.ServiceNumberFont)
self.l.setElementFont(self.l.celServiceInfo, self.ServiceInfoFont)
self.l.setElementFont(self.l.celServiceNextInfo, self.ServiceNextInfoFont)

def postWidgetCreate(self, instance):
instance.setWrapAround(True)
Expand Down Expand Up @@ -481,6 +482,16 @@ def setMode(self, mode):
self.l.setItemHeight(self.ItemHeight if two_lines_val == 0 else self.ItemHeightTwoLine)
self.l.setVisualMode(eListboxServiceContent.visModeComplex if two_lines_val == 0 else eListboxServiceContent.visSkinDefined)

if two_lines_val:
timeText = _("%d min")
self.l.setTextTime(timeText.replace("%d ", ""))

if two_lines_val > 1:
nextTitle = _("NEXT") + ": "
self.l.setNextTitle(nextTitle)

self.l.setHasNextEvent(two_lines_val > 1)

if config.usage.service_icon_enable.value:
self.l.setGetPiconNameFunc(getPiconName)
else:
Expand All @@ -506,8 +517,11 @@ def setMode(self, mode):
self.l.setElementFont(self.l.celServiceName, self.ServiceNameFont)
self.l.setElementFont(self.l.celServiceNumber, self.ServiceNumberFont)
self.l.setElementFont(self.l.celServiceInfo, self.ServiceInfoFont)
self.l.setElementFont(self.l.celServiceNextInfo, self.ServiceNextInfoFont)

if "perc" in config.usage.show_event_progress_in_servicelist.value:
self.l.setElementFont(self.l.celServiceEventProgressbar, self.ServiceInfoFont)

self.l.setHideNumberMarker(config.usage.hide_number_markers.value)
self.l.setServiceTypeIconMode(int(config.usage.servicetype_icon_mode.value))
self.l.setCryptoIconMode(int(config.usage.crypto_icon_mode.value))
Expand Down
7 changes: 3 additions & 4 deletions lib/python/Components/UsageConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ def alternativeNumberModeChange(configElement):
refreshServiceList()
config.usage.alternative_number_mode.addNotifier(alternativeNumberModeChange)

config.usage.servicelist_twolines = ConfigSelection(default="0", choices=[("0", _("None")), ("1", _("two lines"))])
if config.usage.servicelist_twolines.value not in ("0", "1"):
config.usage.servicelist_twolines.value = "1"
config.usage.servicelist_twolines = ConfigSelection(default="0", choices=[("0", _("None")), ("1", _("two lines")), ("2", _("two lines+next event"))])
config.usage.servicelist_twolines.addNotifier(refreshServiceList)

config.usage.hide_number_markers = ConfigYesNo(default=True)
Expand All @@ -46,6 +44,7 @@ def alternativeNumberModeChange(configElement):
config.usage.crypto_icon_mode = ConfigSelection(default="0", choices=[("0", _("None")), ("1", _("Left from servicename")), ("2", _("Right from servicename"))])
config.usage.crypto_icon_mode.addNotifier(refreshServiceList)
config.usage.record_indicator_mode = ConfigSelection(default="0", choices=[("0", _("None")), ("1", _("Left from servicename")), ("2", _("Right from servicename")), ("3", _("Red colored"))])
config.usage.record_indicator_mode = ConfigSelection(default="3", choices=[("0", _("None")), ("1", _("Left from servicename")), ("2", _("Right from servicename")), ("3", _("Red colored"))])
config.usage.record_indicator_mode.addNotifier(refreshServiceList)

choicelist = [("-1", _("Disable"))]
Expand Down Expand Up @@ -293,7 +292,7 @@ def remote_fallback_changed(configElement):
('barright', _("Progress bar right")),
('percleft', _("Percentage left")),
('percright', _("Percentage right")),
('no', _("no"))])
('no', _("No"))])
config.usage.show_channel_numbers_in_servicelist = ConfigYesNo(default=True)
config.usage.show_event_progress_in_servicelist.addNotifier(refreshServiceList)
config.usage.show_channel_numbers_in_servicelist.addNotifier(refreshServiceList)
Expand Down
Loading

0 comments on commit 6444e50

Please sign in to comment.