add Remove key to open Shortcut, some translation

This commit is contained in:
Alhaziel
2019-05-11 18:44:14 +02:00
parent e6bcc38e04
commit 870b3221f8
7 changed files with 93 additions and 25 deletions

View File

@@ -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 = '<keymap><global><keyboard><key id="%s">' % new_key + 'runplugin(plugin://' \
'plugin.video.kod/?ew0KICAgICJhY3Rpb24iOiAia2V5bWFwIiwNCiAgICAib3BlbiI6IHRydWUNCn0=)</key></keyboard></global></keymap>'
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}
}

View File

@@ -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():

View File

@@ -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 == "<module>":

View File

@@ -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]<Quick Menu>[/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]<Quick Menu>[/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 ""

View File

@@ -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]<Quick Menu>[/COLOR]"
msgstr "[COLOR 0xffccff00]<Menu Rapido>[/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] "
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"

View File

@@ -116,8 +116,9 @@
<setting id="infoplus" type="bool" label="70151" default="true"/>
<setting id="extended_info" type="bool" label="70152" default="false"/>
<setting label="70153" type="lsep"/>
<setting id="shortcut_key" type="action" label="30999" action="RunPlugin(plugin://plugin.video.kod/?ew0KICAgICJhY3Rpb24iOiAia2V5bWFwIg0KfQ==)" />
<setting label="70153" type="lsep"/>
<setting id="shortcut_key" type="action" label="30999" action="RunPlugin(plugin://plugin.video.kod/?ew0KICAgICJhY3Rpb24iOiAia2V5bWFwIg0KfQ==)"/>
<setting id="delete_key" type="action" label="31000" action="RunPlugin(plugin://plugin.video.kod/?ewogICAgImFjdGlvbiI6ICJkZWxldGVfa2V5Igp9==)"/>
<setting type="sep"/>
<setting label="70154" type="lsep"/>

View File

@@ -29,18 +29,18 @@
<height>70</height>
<texture colordiffuse="FF12B2E7" border="2">Shortcut/white70.png</texture>
</control>
<control type="label" id="30000">
<!-- <control type="label" id="30000">
<textoffsetx>70</textoffsetx>
<left>-30</left>
<top>0</top>
<width>969</width>
<height>70</height>
<font>font20_title</font>
<label>Alfa - $ADDON[plugin.video.kod 30998]</label>
<label>Kodi on Demand - $ADDON[plugin.video.kod 30998]</label>
<align>left</align>
<aligny>center</aligny>
<shadowcolor>black</shadowcolor>
</control>
</control> -->
<control type="button">
<left>-1920</left>
<top>-1080</top>
@@ -72,7 +72,7 @@
<label></label>
<animation effect="slide" end="-70,0" time="0" condition="true">Conditional</animation>
<textureradioofffocus colordiffuse="EEFFFFFF">Shortcut/close.png</textureradioofffocus>
<textureradiooffnofocus colordiffuse="EEFFFFFF">Shortcut/logo.png</textureradiooffnofocus>
<textureradiooffnofocus colordiffuse="EEFFFFFF">Shortcut/close.png</textureradiooffnofocus>
<textureradioonfocus colordiffuse="EEFFFFFF">Shortcut/close.png</textureradioonfocus>
<textureradioonnofocus colordiffuse="EEFFFFFF">Shortcut/logo.png</textureradioonnofocus>
<onclick>Action(close)</onclick>