From 870b3221f8e85dc4170317c8acb0e4beefbe0e74 Mon Sep 17 00:00:00 2001 From: Alhaziel Date: Sat, 11 May 2019 18:44:14 +0200 Subject: [PATCH] add Remove key to open Shortcut, some translation --- platformcode/keymaptools.py | 35 ++++++++++++------- platformcode/launcher.py | 4 +++ platformcode/logger.py | 4 +-- resources/language/English/strings.po | 32 +++++++++++++++-- resources/language/Italian/strings.po | 30 ++++++++++++++-- resources/settings.xml | 5 +-- resources/skins/Default/720p/ShortCutMenu.xml | 8 ++--- 7 files changed, 93 insertions(+), 25 deletions(-) diff --git a/platformcode/keymaptools.py b/platformcode/keymaptools.py index ca6f4dfe..18d37f39 100644 --- a/platformcode/keymaptools.py +++ b/platformcode/keymaptools.py @@ -25,11 +25,11 @@ class KeyListener(xbmcgui.WindowXMLDialog): def onInit(self): try: - self.getControl(401).addLabel("Presiona la tecla a usar para abrir la ventana") - self.getControl(402).addLabel("Tienes %s segundos" % self.TIMEOUT) + self.getControl(401).addLabel(config.get_localized_string(70698)) + self.getControl(402).addLabel(config.get_localized_string(70699) % self.TIMEOUT) except AttributeError: - self.getControl(401).setLabel("Presiona la tecla a usar para abrir la ventana") - self.getControl(402).setLabel("Tienes %s segundos" % self.TIMEOUT) + self.getControl(401).setLabel(config.get_localized_string(70698)) + self.getControl(402).setLabel(config.get_localized_string(70699) % self.TIMEOUT) def onAction(self, action): code = action.getButtonCode() @@ -63,7 +63,7 @@ def set_key(): data = '' % new_key + 'runplugin(plugin://' \ 'plugin.video.kod/?ew0KICAgICJhY3Rpb24iOiAia2V5bWFwIiwNCiAgICAib3BlbiI6IHRydWUNCn0=)' filetools.write(xbmc.translatePath(file_xml), data) - platformtools.dialog_notification("Tecla guardada", "Reinicia Kodi para que se apliquen los cambios") + platformtools.dialog_notification(config.get_localized_string(70700),config.get_localized_string(70702)) config.set_setting("shortcut_key", new_key) # file_idioma = filetools.join(config.get_runtime_path(), 'resources', 'language', 'Spanish', 'strings.xml') @@ -80,15 +80,26 @@ def set_key(): return +def delete_key(): + from core import filetools + from platformcode import platformtools + import xbmc + + file_xml = "special://profile/keymaps/kod.xml" + filetools.write(xbmc.translatePath(file_xml), '') + platformtools.dialog_notification(config.get_localized_string(70701),config.get_localized_string(70702)) + + config.set_setting("shortcut_key", '') + MAIN_MENU = { - "news": {"label": "Novedades", "icon": get_thumb("news.png"), "order": 0}, - "channels": {"label": "Canales", "icon": get_thumb("channels.png"), "order": 1}, - "search": {"label": "Buscador", "icon": get_thumb("search.png"), "order": 2}, - "favorites": {"label": "Favoritos", "icon": get_thumb("favorites.png"), "order": 3}, - "videolibrary": {"label": "Videoteca", "icon": get_thumb("videolibrary.png"), "order": 4}, - "downloads": {"label": "Descargas", "icon": get_thumb("downloads.png"), "order": 5}, - "settings": {"label": "Configuración", "icon": get_thumb("setting_0.png"), "order": 6} + "news": {"label": config.get_localized_string(30130), "icon": get_thumb("news.png"), "order": 0}, + "channels": {"label": config.get_localized_string(30118), "icon": get_thumb("channels.png"), "order": 1}, + "search": {"label": config.get_localized_string(70082), "icon": get_thumb("search.png"), "order": 2}, + "favorites": {"label": config.get_localized_string(30102), "icon": get_thumb("favorites.png"), "order": 3}, + "videolibrary": {"label": config.get_localized_string(30131), "icon": get_thumb("videolibrary.png"), "order": 4}, + "downloads": {"label": config.get_localized_string(60332), "icon": get_thumb("downloads.png"), "order": 5}, + "settings": {"label": config.get_localized_string(60333), "icon": get_thumb("setting_0.png"), "order": 6} } diff --git a/platformcode/launcher.py b/platformcode/launcher.py index 009b5f69..42fc9c11 100644 --- a/platformcode/launcher.py +++ b/platformcode/launcher.py @@ -112,6 +112,10 @@ def run(item=None): else: return keymaptools.set_key() + elif item.action == "delete_key": + from platformcode import keymaptools + return keymaptools.delete_key() + elif item.action == "script": from core import tmdb if tmdb.drop_bd(): diff --git a/platformcode/logger.py b/platformcode/logger.py index 6c6c2e4f..0812c964 100644 --- a/platformcode/logger.py +++ b/platformcode/logger.py @@ -43,9 +43,9 @@ def get_caller(message=None): function = inspect.currentframe().f_back.f_back.f_code.co_name if module == "__main__": - module = "alfa" + module = "kod" else: - module = "alfa." + module + module = "kod." + module if message: if module not in message: if function == "": diff --git a/resources/language/English/strings.po b/resources/language/English/strings.po index b8491517..c495453b 100644 --- a/resources/language/English/strings.po +++ b/resources/language/English/strings.po @@ -361,6 +361,10 @@ msgctxt "#30999" msgid "Add key to open Shortcut" msgstr "" +msgctxt "#31000" +msgid "[COLOR red]Remove key to open Shortcut[\COLOR]" +msgstr "" + msgctxt "#50000" msgid "Sagas" msgstr "" @@ -1486,7 +1490,7 @@ msgid "Search Trailer" msgstr "" msgctxt "#60360" -msgid "[COLOR 0xffccff00][/COLOR]" +msgid "[B]QUICK MENU[/B]" msgstr "" msgctxt "#60361" @@ -5353,6 +5357,10 @@ msgctxt "#30999" msgid "Add key to open Shortcut" msgstr "" +msgctxt "#31000" +msgid "Remove key to open Shortcut" +msgstr "" + msgctxt "#50000" msgid "Sagas" msgstr "" @@ -6482,7 +6490,7 @@ msgid "Search Trailer" msgstr "" msgctxt "#60360" -msgid "[COLOR 0xffccff00][/COLOR]" +msgid "[COLOR 0xFF0081C2]Side Menu[/COLOR]" msgstr "" msgctxt "#60361" @@ -10470,4 +10478,24 @@ msgstr "" msgctxt "#70697" msgid " [Results of the %s channel] " +msgstr "" + +msgctxt "#70698" +msgid "Press the key to be used to open the window" +msgstr "" + +msgctxt "#70699" +msgid "You have %s seconds" +msgstr "" + +msgctxt "#70700" +msgid "The key has been saved" +msgstr "" + +msgctxt "#70701" +msgid "The key has been deleted" +msgstr "" + +msgctxt "#70702" +msgid "Restart Kodi to apply the changes" msgstr "" \ No newline at end of file diff --git a/resources/language/Italian/strings.po b/resources/language/Italian/strings.po index 565ffe63..9d29034e 100644 --- a/resources/language/Italian/strings.po +++ b/resources/language/Italian/strings.po @@ -361,6 +361,10 @@ msgctxt "#30999" msgid "Add key to open Shortcut" msgstr "Aggiungi tasto per aprire la scorciatoia" +msgctxt "#31000" +msgid "Remove key to open Shortcut" +msgstr "Rimuovi tasto per aprire la scorciatoia" + msgctxt "#50000" msgid "Sagas" msgstr "Saghe" @@ -1478,8 +1482,8 @@ msgid "Search Trailer" msgstr "Cerca Trailer" msgctxt "#60360" -msgid "[COLOR 0xffccff00][/COLOR]" -msgstr "[COLOR 0xffccff00][/COLOR]" +msgid "[B]QUICK MENU[/B]" +msgstr "[B]MENU RAPIDO[/B]" msgctxt "#60361" msgid "Super Favourites Menu" @@ -5460,4 +5464,24 @@ msgstr "Risultati" msgctxt "#70697" msgid " [Results of the %s channel] " -msgstr " [Risultati del canale %s] " \ No newline at end of file +msgstr " [Risultati del canale %s] " + +msgctxt "#70698" +msgid "Press the key to be used to open the window" +msgstr "Premere il tasto da utilizzare per aprire la finestra" + +msgctxt "#70699" +msgid "You have %s seconds" +msgstr "Hai %s secondi" + +msgctxt "#70700" +msgid "The key has been saved" +msgstr "Il tasto è stato salvato" + +msgctxt "#70701" +msgid "The key has been deleted" +msgstr "Il tasto è stato cancellato" + +msgctxt "#70702" +msgid "Restart Kodi to apply the changes" +msgstr "Riavvia Kodi per applicare le modifiche" \ No newline at end of file diff --git a/resources/settings.xml b/resources/settings.xml index f2ad2286..82537f5d 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -116,8 +116,9 @@ - - + + + diff --git a/resources/skins/Default/720p/ShortCutMenu.xml b/resources/skins/Default/720p/ShortCutMenu.xml index 1d2ff5bc..6ccd86ca 100644 --- a/resources/skins/Default/720p/ShortCutMenu.xml +++ b/resources/skins/Default/720p/ShortCutMenu.xml @@ -29,18 +29,18 @@ 70 Shortcut/white70.png - + -1920 -1080 @@ -72,7 +72,7 @@ Conditional Shortcut/close.png - Shortcut/logo.png + Shortcut/close.png Shortcut/close.png Shortcut/logo.png Action(close)