Skip to content

Commit

Permalink
0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dream-alpha committed May 18, 2024
1 parent 1737e0e commit 36f1e50
Show file tree
Hide file tree
Showing 13 changed files with 231 additions and 384 deletions.
2 changes: 1 addition & 1 deletion CONTROL/control
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Description: TVMagazineCockpit
Maintainer: dream-alpha
Package: enigma2-plugin-extensions-tvmagazinecockpit
Version: 0.4.1
Version: 0.5.0
Architecture: all
Depends: enigma2-plugin-skincomponents-extMultiListSelection
68 changes: 61 additions & 7 deletions src/EasyMenu.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
from Screens.ChoiceBox import ChoiceBox
from .__init__ import _
from .Debug import logger
from .tvspielfilmsetup import TvSpielfilmstartSetup
from .tvspielfilmsetup import TvSpielfilmmainSetup
from .tvspielfilmsetup import TvSpielfilmsearchSetup
from .TvSpielfilmchannel import TvSpielfilmchannel
from .tvconfig import make_default_string, read_ServiceReference
from ._tvdict import _changed, _channelreference, _tv_config


class EasyMenu(ChoiceBox):
def __init__(self, session, title='Tv Spielfilm', alist=None, keys=None, selection=0, skin_name=None, windowTitle=_('Easy-Selection'), allow_cancel=True, titlebartext=_("Input")):
class EasyMenu():
def __init__(self, csel):
logger.info("...")
self.csel = csel

def openEasyMenu(self, session):
logger.info("...")
if skin_name is None:
skin_name = []
alist = []
alist.append((_("Tv Spielfilm Main"), 'main'))
alist.append((_("Tv Spielfilm Tipps"), 'tipps'))
Expand All @@ -16,8 +24,54 @@ def __init__(self, session, title='Tv Spielfilm', alist=None, keys=None, selecti
alist.append((_("Tv Spielfilm Programm Favo"), 'programmfavo'))
alist.append((_("Tv Spielfilm search"), 'search'))
alist.append(('--', '--'))
alist.append(('Tv Spielfilm Start ' + _("Setup"), 'startsetup'))
alist.append(('Tv Spielfilm Main ' + _("Setup"), 'mainsetup'))
alist.append(('Tv Spielfilm Start' + ' ' + _("Setup"), 'startsetup'))
alist.append(('Tv Spielfilm Main' + ' ' + _("Setup"), 'mainsetup'))
alist.append(('Tv Spielfilm Search' + ' ' + _("Setup"), 'searchsetup'))
alist.append((_('Favourites') + '/' + _('Bouquets') + ' ' + _("Setup"), 'tvchannel'))

ChoiceBox.__init__(self, session, title=title, list=alist, keys=keys, selection=selection, skin_name=skin_name, windowTitle=windowTitle, allow_cancel=allow_cancel, titlebartext=titlebartext)
session.openWithCallback(self.openEasyMenuCallback, ChoiceBox, title='Tv Spielfilm', list=alist, windowTitle=_('Easy-Selection'), allow_cancel=True, titlebartext=_("Input"))

def openEasyMenuCallback(self, next_screen=None):
logger.info("...")
if next_screen:
if next_screen[1] == 'main':
self.close('main')
elif next_screen[1] == 'tipps':
self.close('tipps')
elif next_screen[1] == 'programm':
self.close('programm')
elif next_screen[1] == 'programmsky':
self.close('programmsky')
elif next_screen[1] == 'programmfavo':
self.close('programmfavo')
elif next_screen[1] == 'search':
self.key_search()
elif next_screen[1] == 'tvchannel':
self.session.open(TvSpielfilmchannel)
elif next_screen[1] == 'startsetup':
self.session.open(TvSpielfilmstartSetup)
elif next_screen[1] == "mainsetup":
self.session.openWithCallback(self.key_menu_back, TvSpielfilmmainSetup)
elif next_screen[1] == "searchsetup":
self.session.open(TvSpielfilmsearchSetup)
elif next_screen[1] == "tvchannel":
self.session.openWithCallback(self.key_channel_back, TvSpielfilmchannel)

def key_menu_back(self, changed=False):
logger.info("...")
if changed:
_changed['config'] = True
self.csel["liste"].clearList()
if not _channelreference:
read_ServiceReference()
make_default_string()
if _tv_config.get('time').get('default'):
text = _tv_config.get('time').get(_tv_config.get('time').get('default')).get('disname', '')
self.csel["key_blue"].setText(text)
self.update_Title()

def key_channel_back(self, changed=False):
logger.info("...")
if changed:
_changed['config'] = True
make_default_string()
2 changes: 1 addition & 1 deletion src/TvSpielfilmView.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def makebigpixmap(self, myfile=None):
self["bigpixmap"].instance.setPixmap(gPixmapPtr())
scale = AVSwitch().getFramebufferScale()
size = self['bigpixmap'].instance.size()
self.picload.setPara((size.width(), size.height(), scale[0], scale[1], False, 1, "# 00000000"))
self.picload.setPara((size.width(), size.height(), scale[0], scale[1], False, 1, "#00000000"))
self.picload.startDecode(myfile)

def createsetup(self):
Expand Down
41 changes: 20 additions & 21 deletions src/TvSpielfilmchannel.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from .tvconfig import write_channels, channels_file_name, _premode, write_error_log
from .tvconfig import read_channel_list, is_in_fovo, write_default_channels, configdefaultchannelsuser, read_channel_list_favo
from .tvconfig import read_default_channels, read_file_tvdefault, checkvideomode, prevideodict
from ._tvdict import _tv_config, _channelcache, _tv_config_config
from ._tvdict import _tv_config, _channelcache, _tv_config_config, _changed
from .tvspielfilmsetup import TvSpielfilmservice
from .__init__ import _
from .MYList import MYList
Expand Down Expand Up @@ -73,7 +73,6 @@ def __init__(self, session):
self[myx].hide()
self["message"] = Label()
self.listtype = ''
self.change = {'fovo': False, 'default': False, 'config': False}
self.masterliste = {}
self.masterliste['favourites'] = read_channel_list_favo()
self.masterliste['defaultchannels'] = []
Expand All @@ -90,14 +89,14 @@ def keyUp(self):
self["liste"].moveSelection("moveUp")
self["liste"].list.insert(self['liste'].getIndex(), self["liste"].list.pop(currindex))
if self.listtype in 'blue':
self.change['fovo'] = True
_changed['fovo'] = True
elif self.listtype in 'yellow':
self.change['default'] = True
_changed['default'] = True
return
except Exception:
self["actionsmove"].setEnabled(False)
self.change['fovo'] = False
self.change['default'] = False
_changed['fovo'] = False
_changed['default'] = False

def keyDown(self):
logger.info("...")
Expand All @@ -108,14 +107,14 @@ def keyDown(self):
self["liste"].moveSelection("moveDown")
self["liste"].list.insert(self['liste'].getIndex(), self["liste"].list.pop(currindex))
if self.listtype in 'blue':
self.change['fovo'] = True
_changed['fovo'] = True
elif self.listtype in 'yellow':
self.change['default'] = True
_changed['default'] = True
return
except Exception:
self["actionsmove"].setEnabled(False)
self.change['fovo'] = False
self.change['default'] = False
_changed['fovo'] = False
_changed['default'] = False

def key_red(self):
logger.info("...")
Expand Down Expand Up @@ -275,13 +274,13 @@ def menuCallback(self, answer):
elif answer == "addfavo":
self.masterliste['favourites'].append([curr[0], curr[1], curr[2], curr[3]])
_channelcache['favo'] = {curr[1]: len(self.masterliste['favourites']) + 1}
self.change['fovo'] = True
_changed['fovo'] = True
self['liste'].modifyEntryVal(self['liste'].index, is_in_fovo(curr[1]), 4)
elif answer == "delfavo":
self.masterliste['favourites'].remove(curr)
if curr[1] in _channelcache['favo']:
del _channelcache['favo'][curr[1]]
self.change['fovo'] = True
_changed['fovo'] = True
self.key_blue()
elif answer == "delfavoall":
text = _('all') + ' ' + _("Favourites") + ' ' + _('Delete')
Expand All @@ -297,7 +296,7 @@ def SaveCallback(ress=None):
tmpcurr[2] = cvmode.ename
tmpcurr[3] = cvmode.eservice
self['liste'].modifyEntry(self['liste'].index, tmpcurr)
self.change['default'] = True
_changed['default'] = True
self.session.openWithCallback(SaveCallback, TvSpielfilmservice, curr[5])

elif answer == "zaptest":
Expand Down Expand Up @@ -332,7 +331,7 @@ def del_curr(self, res=False):
if pathExists(filename):
os_remove(filename)
_channelcache['bouq'].clear()
self.change['config'] = True
_changed['config'] = True
self.key_green()

def del_all_favo(self, res=False):
Expand All @@ -343,8 +342,8 @@ def del_all_favo(self, res=False):
os_remove(channels_file_name('favourites'))
del self.masterliste['favourites'][:]
_channelcache['favo'].clear()
self.change['fovo'] = True
self.change['config'] = True
_changed['fovo'] = True
_changed['config'] = True
self.key_blue()

def key_ok(self):
Expand Down Expand Up @@ -533,7 +532,7 @@ def replaceservice(service):
else:
result.sort(key=lambda x: x[5])
write_channels(filename, result)
self.change['config'] = True
_changed['config'] = True
_channelcache['bouq'].clear()

self["liste"].style = "channel_bouquet"
Expand All @@ -550,16 +549,16 @@ def cleanname(self, msg):

def close_(self):
logger.info("...")
if self.change['default'] and self.masterliste['defaultchannels']:
if _changed['default'] and self.masterliste['defaultchannels']:
write_default_channels(configdefaultchannelsuser, self.masterliste['defaultchannels'])
if self.change['fovo']:
self.change['config'] = True
if _changed['fovo']:
_changed['config'] = True
_channelcache['favo'].clear()
write_channels(channels_file_name('favourites'), self.masterliste['favourites'], 'favourites')
if self.masterliste['notfound']:
write_error_log(self.masterliste['notfound'])
self.masterliste.clear()
self.close(self.change['config'])
self.close(_changed['config'])

def createSummary(self):
logger.info("...")
Expand Down
Loading

0 comments on commit 36f1e50

Please sign in to comment.