From 3edb61da6bfc24d595dc8a4ced0bfd695137d7fc Mon Sep 17 00:00:00 2001 From: Filipe Pina Date: Mon, 12 Mar 2012 12:05:21 +0000 Subject: [PATCH] added Apple TV remote MENU key support to close dialogs --- resources/lib/gui.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/lib/gui.py b/resources/lib/gui.py index a59e066..2462d7f 100644 --- a/resources/lib/gui.py +++ b/resources/lib/gui.py @@ -15,11 +15,11 @@ __settings__ = sys.modules[ "__main__" ].__settings__ KEY_BUTTON_BACK = 275 KEY_KEYBOARD_ESC = 61467 +KEY_MENU_ID = 92 EXIT_SCRIPT = ( 6, 10, 247, 275, 61467, 216, 257, 61448, ) CANCEL_DIALOG = EXIT_SCRIPT + ( 216, 257, 61448, ) - class TransmissionGUI(xbmcgui.WindowXMLDialog): def __init__(self, strXMLname, strFallbackPath, strDefaultName, bforeFallback=0): self.list = {} @@ -191,7 +191,7 @@ class TransmissionGUI(xbmcgui.WindowXMLDialog): pass def onAction( self, action ): - if ( action.getButtonCode() in CANCEL_DIALOG ): + if ( action.getButtonCode() in CANCEL_DIALOG ) or (action.getId() == KEY_MENU_ID): self.close() def close(self): if self.repeater: @@ -245,7 +245,7 @@ class TorrentInfoGUI(xbmcgui.WindowXMLDialog): self.repeater.stop() super(TorrentInfoGUI, self).close() def onAction(self, action): - if (action.getButtonCode() in CANCEL_DIALOG): + if (action.getButtonCode() in CANCEL_DIALOG) or (action.getId() == KEY_MENU_ID): self.close() pass def onClick(self, controlID):