Skip to content

Commit

Permalink
new converter: ChannelSelectionShortTitle Converter --> this converte…
Browse files Browse the repository at this point in the history
…r truncates the original title of ChannelSelection --> "title (MODE)" will be cut off

Usage:
<widget backgroundColor="secondBG" font="Regular;24" position="70,5" render="Label" size="850,80" source="Title" transparent="1" valign="center" zPosition="1">
	<convert type="ChannelSelectionShortTitle"/>
</widget>
  • Loading branch information
Dr.Best committed Dec 3, 2013
1 parent cebad50 commit 941b7bb
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile.am
Expand Up @@ -18,6 +18,7 @@ SUBDIRS = \
bitrateviewer \ bitrateviewer \
bonjour \ bonjour \
cdinfo \ cdinfo \
channelselectionshorttitle \
curlytx \ curlytx \
dreamexplorer \ dreamexplorer \
dreamirc \ dreamirc \
Expand Down
2 changes: 2 additions & 0 deletions channelselectionshorttitle/CONTROL/control
@@ -0,0 +1,2 @@
Description: ChannelSelectionShortTitle Converter
Depends: enigma2
1 change: 1 addition & 0 deletions channelselectionshorttitle/Makefile.am
@@ -0,0 +1 @@
SUBDIRS = src
39 changes: 39 additions & 0 deletions channelselectionshorttitle/src/ChannelSelectionShortTitle.py
@@ -0,0 +1,39 @@
#
# ChannelSelectionShortTitle - Converter
#
# Coded by Dr.Best (c) 2013
# Support: www.dreambox-tools.info
# E-Mail: dr.best@dreambox-tools.info
#
# This plugin is open source but it is NOT free software.
#
# This plugin may only be distributed to and executed on hardware which
# is licensed by Dream Multimedia GmbH.
# In other words:
# It's NOT allowed to distribute any parts of this plugin or its source code in ANY way
# to hardware which is NOT licensed by Dream Multimedia GmbH.
# It's NOT allowed to execute this plugin and its source code or even parts of it in ANY way
# on hardware which is NOT licensed by Dream Multimedia GmbH.
#
# If you want to use or modify the code or parts of it,
# you have to keep MY license and inform me about the modifications by mail.
#

from Components.Converter.Converter import Converter
from Components.Element import cached
from Components.config import config

class ChannelSelectionShortTitle(Converter, object):
def __init__(self, type):
Converter.__init__(self, type)

@cached
def getText(self):
title = self.source.text
t = " (%s) " % config.servicelist.lastmode.value.upper()
pos = title.find(t)
if pos != -1:
title = title[pos+len(t):]
return title

text = property(getText)
4 changes: 4 additions & 0 deletions channelselectionshorttitle/src/Makefile.am
@@ -0,0 +1,4 @@
installdir = $(libdir)/enigma2/python/Plugins/SkinComponents/ChannelSelectionShortTitle
converterinstalldir = $(libdir)/enigma2/python/Components/Converter
install_DATA = README
converterinstall_PYTHON = ChannelSelectionShortTitle.py
12 changes: 12 additions & 0 deletions channelselectionshorttitle/src/README
@@ -0,0 +1,12 @@
Description: ChannelSelectionShortTitle Converter
This converter truncates the original title of ChannelSelection --> "title (MODE)" will be cut off

Usage:
<widget backgroundColor="secondBG" font="Regular;24" position="70,5" render="Label" size="850,80" source="Title" transparent="1" valign="center" zPosition="1">
<convert type="ChannelSelectionShortTitle"/>
</widget>





3 changes: 3 additions & 0 deletions configure.ac
Expand Up @@ -142,6 +142,9 @@ cdinfo/Makefile
cdinfo/meta/Makefile cdinfo/meta/Makefile
cdinfo/src/Makefile cdinfo/src/Makefile
channelselectionshorttitle/Makefile
channelselectionshorttitle/src/Makefile
curlytx/Makefile curlytx/Makefile
curlytx/meta/Makefile curlytx/meta/Makefile
curlytx/po/Makefile curlytx/po/Makefile
Expand Down

0 comments on commit 941b7bb

Please sign in to comment.