from Components.Sources.List import List
from Components.Sources.StaticText import StaticText
from Tools import Notifications

try:
	from Screens.NotificationQueueViewer import NotificationQueueViewer
	print "[PowerMetrixFHD] 025 -OK-- NotificationQueueViewer"
except:
	print "[PowerMetrixFHD] 025 -NOK- NotificationQueueViewer"

#######################################################################################################################################################

def NotificationQueueViewerselectionChanged(self):
	if self["notifications"].count():
		current = self["notifications"].getCurrent()
		if isinstance(current, tuple):
			entry = current[0]
			self["statusbar"].text = _("Press OK to get further details for %s") % (Notifications.notificationQueue.domains[entry.domain]["name"] + ' ' +_("Notification"))
		else:
			self["statusbar"].text = _("No further details for the current notification")
	else:
		self["statusbar"].text = _("There are no notifications to display!")

#######################################################################################################################################################

def doNotificationQueueViewerChange():
	try:
		NotificationQueueViewer.selectionChanged = NotificationQueueViewerselectionChanged
		print "[PowerMetrixFHD] 025 -OK-- NotificationQueueViewer"
	except:
		print "[PowerMetrixFHD] 025 -NOK- NotificationQueueViewer"
