from re import *
from os import remove
+FLAG_SERVICE_NEW_FOUND = 64 #define in lib/dvb/idvb.h as dxNewFound = 64
+
import xml.dom.minidom
class BouquetSelector(Screen):
menu = [ ]
current_root = csel.getRoot()
+ current_sel_path = csel.getCurrentSelection().getPath()
+ current_sel_flags = csel.getCurrentSelection().flags
inBouquetRootList = current_root and current_root.getPath().find('FROM BOUQUET "bouquets.') != -1 #FIXME HACK
inBouquet = csel.getMutableList() is not None
haveBouquets = csel.bouquet_root.getPath().find('FROM BOUQUET "bouquets.') != -1
menu.append((_("add service to bouquet"), self.addServiceToBouquetSelected))
else:
menu.append((_("add service to favourites"), self.addServiceToBouquetSelected))
- elif haveBouquets:
- if not inBouquet and csel.getCurrentSelection().getPath().find("PROVIDERS") == -1:
- menu.append((_("copy to favourites"), self.copyCurrentToBouquetList))
+ else:
+ if haveBouquets:
+ if not inBouquet and current_sel_path.find("PROVIDERS") == -1:
+ menu.append((_("copy to favourites"), self.copyCurrentToBouquetList))
+ if current_sel_path.find("flags == %d" %(FLAG_SERVICE_NEW_FOUND)) != -1:
+ menu.append((_("remove all new found flags"), self.removeAllNewFoundFlags))
if inBouquet:
menu.append((_("remove service"), self.removeCurrentService))
+ if current_root.getPath().find("flags == %d" %(FLAG_SERVICE_NEW_FOUND)) != -1:
+ menu.append((_("remove new found flag"), self.removeNewFoundFlag))
elif haveBouquets:
menu.append((_("remove bouquet"), self.removeBouquet))
def bouquetInputCallback(self, bouquet):
if bouquet is not None:
- self.csel.addBouquet(bouquet, True)
+ self.csel.addBouquet(bouquet, None, True)
def addServiceToBouquetSelected(self):
bouquets = self.csel.getBouquetList()
self.csel.endMarkedEdit(abort=True)
self.close()
+ def removeNewFoundFlag(self):
+ eDVBDB.getInstance().removeFlag(self.csel.getCurrentSelection(), FLAG_SERVICE_NEW_FOUND)
+ self.close()
+
+ def removeAllNewFoundFlags(self):
+ curpath = self.csel.getCurrentSelection().getPath()
+ idx = curpath.find("satellitePosition == ")
+ if idx != -1:
+ tmp = curpath[idx+21:]
+ idx = tmp.find(')')
+ if idx != -1:
+ satpos = int(tmp[:idx])
+ eDVBDB.getInstance().removeFlags(FLAG_SERVICE_NEW_FOUND, -1, -1, -1, satpos)
+ self.close()
+
class ChannelSelectionEPG:
def __init__(self):
self["ChannelSelectEPGActions"] = ActionMap(["ChannelSelectEPGActions"],
Screen.__init__(self, session)
# this makes it much simple to implement a selectable radio or tv mode :)
- self.service_types_tv = '1:7:1:0:0:0:0:0:0:0:(type == 1) || (type == 17) || (type == 195)'
+ self.service_types_tv = '1:7:1:0:0:0:0:0:0:0:(type == 1) || (type == 17) || (type == 195) || (type == 25)'
self.service_types_radio = '1:7:2:0:0:0:0:0:0:0:(type == 2)'
self["key_red"] = Button(_("All"))
orbpos = service.getUnsignedData(4) >> 16
if service.getPath().find("FROM PROVIDER") != -1:
service_name = _("Providers")
+ elif service.getPath().find("flags == %d" %(FLAG_SERVICE_NEW_FOUND)) != -1:
+ service_name = _("New")
else:
service_name = _("Services")
try:
self.session.nav.playService(nref)
self.saveRoot()
self.saveChannel()
+ self.addToHistory(nref)
+
+ def addToHistory(self, ref):
if self.servicePath is not None:
tmp=self.servicePath[:]
- tmp.append(nref)
+ tmp.append(ref)
try:
del self.history[self.history_pos+1:]
except: