aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Screens
diff options
context:
space:
mode:
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>2006-05-08 20:08:22 +0000
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>2006-05-08 20:08:22 +0000
commitca7d92c97764d916bb8dd6731efa1ccff693b944 (patch)
treed5883fbc6b73cd2ce8bf4e85f64e26d26a605ac7 /lib/python/Screens
parent4bbe1d7e132ead361bf179b8ee618bdaba2335dc (diff)
downloadenigma2-ca7d92c97764d916bb8dd6731efa1ccff693b944.tar.gz
enigma2-ca7d92c97764d916bb8dd6731efa1ccff693b944.zip
fix "Clearall before scan" handling
add ability to reset the newfound flag from single service via channellist context menu add ability to the newfound flags for all services from a "orbital position" via channellist context menu
Diffstat (limited to 'lib/python/Screens')
-rw-r--r--lib/python/Screens/ChannelSelection.py32
1 files changed, 28 insertions, 4 deletions
diff --git a/lib/python/Screens/ChannelSelection.py b/lib/python/Screens/ChannelSelection.py
index 02963dce..47a9d9e6 100644
--- a/lib/python/Screens/ChannelSelection.py
+++ b/lib/python/Screens/ChannelSelection.py
@@ -18,6 +18,8 @@ from ServiceReference import ServiceReference
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):
@@ -66,6 +68,8 @@ class ChannelContextMenu(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
@@ -77,11 +81,16 @@ class ChannelContextMenu(Screen):
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))
@@ -174,6 +183,21 @@ class ChannelContextMenu(Screen):
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"],
@@ -670,7 +694,7 @@ class ChannelSelectionBase(Screen):
orbpos = service.getUnsignedData(4) >> 16
if service.getPath().find("FROM PROVIDER") != -1:
service_name = _("Providers")
- elif service.getPath().find("flags ==") != -1:
+ elif service.getPath().find("flags == %d" %(FLAG_SERVICE_NEW_FOUND)) != -1:
service_name = _("New")
else:
service_name = _("Services")