added Apple TV remote MENU key support to close dialogs

This commit is contained in:
Filipe Pina 2012-03-12 12:05:21 +00:00
parent 5b43cda96e
commit 3edb61da6b

View file

@ -15,11 +15,11 @@ __settings__ = sys.modules[ "__main__" ].__settings__
KEY_BUTTON_BACK = 275 KEY_BUTTON_BACK = 275
KEY_KEYBOARD_ESC = 61467 KEY_KEYBOARD_ESC = 61467
KEY_MENU_ID = 92
EXIT_SCRIPT = ( 6, 10, 247, 275, 61467, 216, 257, 61448, ) EXIT_SCRIPT = ( 6, 10, 247, 275, 61467, 216, 257, 61448, )
CANCEL_DIALOG = EXIT_SCRIPT + ( 216, 257, 61448, ) CANCEL_DIALOG = EXIT_SCRIPT + ( 216, 257, 61448, )
class TransmissionGUI(xbmcgui.WindowXMLDialog): class TransmissionGUI(xbmcgui.WindowXMLDialog):
def __init__(self, strXMLname, strFallbackPath, strDefaultName, bforeFallback=0): def __init__(self, strXMLname, strFallbackPath, strDefaultName, bforeFallback=0):
self.list = {} self.list = {}
@ -191,7 +191,7 @@ class TransmissionGUI(xbmcgui.WindowXMLDialog):
pass pass
def onAction( self, action ): def onAction( self, action ):
if ( action.getButtonCode() in CANCEL_DIALOG ): if ( action.getButtonCode() in CANCEL_DIALOG ) or (action.getId() == KEY_MENU_ID):
self.close() self.close()
def close(self): def close(self):
if self.repeater: if self.repeater:
@ -245,7 +245,7 @@ class TorrentInfoGUI(xbmcgui.WindowXMLDialog):
self.repeater.stop() self.repeater.stop()
super(TorrentInfoGUI, self).close() super(TorrentInfoGUI, self).close()
def onAction(self, action): def onAction(self, action):
if (action.getButtonCode() in CANCEL_DIALOG): if (action.getButtonCode() in CANCEL_DIALOG) or (action.getId() == KEY_MENU_ID):
self.close() self.close()
pass pass
def onClick(self, controlID): def onClick(self, controlID):