Personalizzazione Menu contestuale e piccoli fix

This commit is contained in:
Alhaziel
2020-03-05 15:28:55 +01:00
parent f7903b42c0
commit 4446bd852a
9 changed files with 115 additions and 52 deletions
+23 -14
View File
@@ -2,6 +2,7 @@
import glob import glob
import os import os
import sys
from core import channeltools from core import channeltools
from core.item import Item from core.item import Item
@@ -11,6 +12,8 @@ import xbmcaddon
addon = xbmcaddon.Addon('plugin.video.kod') addon = xbmcaddon.Addon('plugin.video.kod')
downloadenabled = addon.getSetting('downloadenabled') downloadenabled = addon.getSetting('downloadenabled')
from specials import shortcuts
CONTEXT = shortcuts.context()
def getmainlist(view="thumb_"): def getmainlist(view="thumb_"):
logger.info() logger.info()
@@ -19,49 +22,55 @@ def getmainlist(view="thumb_"):
if config.dev_mode(): if config.dev_mode():
itemlist.append(Item(title="Redirect", channel="checkhost", action="check_channels", itemlist.append(Item(title="Redirect", channel="checkhost", action="check_channels",
thumbnail='', thumbnail='',
category=config.get_localized_string(30119), viewmode="thumbnails")) category=config.get_localized_string(30119), viewmode="thumbnails",
context = CONTEXT))
# Añade los canales que forman el menú principal # Añade los canales que forman el menú principal
if addon.getSetting('enable_news_menu') == "true": if addon.getSetting('enable_news_menu') == "true":
itemlist.append(Item(title=config.get_localized_string(30130), channel="news", action="mainlist", itemlist.append(Item(title=config.get_localized_string(30130), channel="news", action="mainlist",
thumbnail=get_thumb("news.png", view), thumbnail=get_thumb("news.png", view),
category=config.get_localized_string(30119), viewmode="thumbnails", category=config.get_localized_string(30119), viewmode="thumbnails",
context=[{"title": config.get_localized_string(70285), "channel": "news", "action": "menu_opciones", context=CONTEXT + [{"title": config.get_localized_string(70285), "channel": "news", "action": "menu_opciones","goto": True}]))
"goto": True}]))
if addon.getSetting('enable_channels_menu') == "true": if addon.getSetting('enable_channels_menu') == "true":
itemlist.append(Item(title=config.get_localized_string(30118), channel="channelselector", action="getchanneltypes", itemlist.append(Item(title=config.get_localized_string(30118), channel="channelselector", action="getchanneltypes",
thumbnail=get_thumb("channels.png", view), view=view, thumbnail=get_thumb("channels.png", view), view=view,
category=config.get_localized_string(30119), viewmode="thumbnails")) category=config.get_localized_string(30119), viewmode="thumbnails",
context = CONTEXT))
if addon.getSetting('enable_search_menu') == "true": if addon.getSetting('enable_search_menu') == "true":
itemlist.append(Item(title=config.get_localized_string(30103), channel="search", path='special', action="mainlist", itemlist.append(Item(title=config.get_localized_string(30103), channel="search", path='special', action="mainlist",
thumbnail=get_thumb("search.png", view), thumbnail=get_thumb("search.png", view),
category=config.get_localized_string(30119), viewmode="list")) category=config.get_localized_string(30119), viewmode="list",
context = CONTEXT + [{"title": config.get_localized_string(60412), "action": "setting_channel_new", "channel": "search"},
{"title": config.get_localized_string(70286), "action": "settings", "channel": "search"}]))
if addon.getSetting('enable_onair_menu') == "true": if addon.getSetting('enable_onair_menu') == "true":
itemlist.append(Item(channel="filmontv", action="mainlist", title=config.get_localized_string(50001), itemlist.append(Item(channel="filmontv", action="mainlist", title=config.get_localized_string(50001),
thumbnail=get_thumb("on_the_air.png"), viewmode="thumbnails")) thumbnail=get_thumb("on_the_air.png"), viewmode="thumbnails",
context = CONTEXT))
if addon.getSetting('enable_link_menu') == "true": if addon.getSetting('enable_link_menu') == "true":
itemlist.append(Item(title=config.get_localized_string(70527), channel="kodfavorites", action="mainlist", itemlist.append(Item(title=config.get_localized_string(70527), channel="kodfavorites", action="mainlist",
thumbnail=get_thumb("mylink.png", view), view=view, thumbnail=get_thumb("mylink.png", view), view=view,
category=config.get_localized_string(70527), viewmode="thumbnails")) category=config.get_localized_string(70527), viewmode="thumbnails",
context = CONTEXT))
if addon.getSetting('enable_fav_menu') == "true": if addon.getSetting('enable_fav_menu') == "true":
itemlist.append(Item(title=config.get_localized_string(30102), channel="favorites", action="mainlist", itemlist.append(Item(title=config.get_localized_string(30102), channel="favorites", action="mainlist",
thumbnail=get_thumb("favorites.png", view), thumbnail=get_thumb("favorites.png", view),
category=config.get_localized_string(30102), viewmode="thumbnails")) category=config.get_localized_string(30102), viewmode="thumbnails",
context = CONTEXT))
if config.get_videolibrary_support() and addon.getSetting('enable_library_menu') == "true": if config.get_videolibrary_support() and addon.getSetting('enable_library_menu') == "true":
itemlist.append(Item(title=config.get_localized_string(30131), channel="videolibrary", action="mainlist", itemlist.append(Item(title=config.get_localized_string(30131), channel="videolibrary", action="mainlist",
thumbnail=get_thumb("videolibrary.png", view), thumbnail=get_thumb("videolibrary.png", view),
category=config.get_localized_string(30119), viewmode="thumbnails", category=config.get_localized_string(30119), viewmode="thumbnails",
context=[{"title": config.get_localized_string(70287), "channel": "videolibrary", context=CONTEXT + [{"title": config.get_localized_string(70287), "channel": "videolibrary",
"action": "channel_config"}])) "action": "channel_config"}]))
if downloadenabled != "false": if downloadenabled != "false":
itemlist.append(Item(title=config.get_localized_string(30101), channel="downloads", action="mainlist", itemlist.append(Item(title=config.get_localized_string(30101), channel="downloads", action="mainlist",
thumbnail=get_thumb("downloads.png", view), viewmode="list", thumbnail=get_thumb("downloads.png", view), viewmode="list",
context=[{"title": config.get_localized_string(70288), "channel": "setting", "config": "downloads", context=CONTEXT + [{"title": config.get_localized_string(70288), "channel": "setting", "config": "downloads",
"action": "channel_config"}])) "action": "channel_config"}]))
thumb_setting = "setting_%s.png" % 0 # config.get_setting("plugin_updates_available") thumb_setting = "setting_%s.png" % 0 # config.get_setting("plugin_updates_available")
@@ -93,13 +102,13 @@ def getchanneltypes(view="thumb_"):
title = config.get_localized_string(30121) title = config.get_localized_string(30121)
itemlist.append(Item(title=title, channel="channelselector", action="filterchannels", view=view, itemlist.append(Item(title=title, channel="channelselector", action="filterchannels", view=view,
category=title, channel_type="all", thumbnail=get_thumb("channels_all.png", view), category=title, channel_type="all", thumbnail=get_thumb("channels_all.png", view),
viewmode="thumbnails")) viewmode="thumbnails", context = CONTEXT))
for channel_type in channel_types: for channel_type in channel_types:
title = config.get_localized_category(channel_type) title = config.get_localized_category(channel_type)
itemlist.append(Item(title=title, channel="channelselector", action="filterchannels", category=title, itemlist.append(Item(title=title, channel="channelselector", action="filterchannels", category=title,
channel_type=channel_type, viewmode="thumbnails", channel_type=channel_type, viewmode="thumbnails",
thumbnail=get_thumb("channels_%s.png" % channel_type, view))) thumbnail=get_thumb("channels_%s.png" % channel_type, view), context = CONTEXT))
# itemlist.append(Item(title='Oggi in TV', channel="filmontv", action="mainlist", view=view, # itemlist.append(Item(title='Oggi in TV', channel="filmontv", action="mainlist", view=view,
# category=title, channel_type="all", thumbnail=get_thumb("on_the_air.png", view), # category=title, channel_type="all", thumbnail=get_thumb("on_the_air.png", view),
@@ -109,7 +118,7 @@ def getchanneltypes(view="thumb_"):
itemlist.append(Item(title=config.get_localized_string(70685), channel="community", action="mainlist", view=view, itemlist.append(Item(title=config.get_localized_string(70685), channel="community", action="mainlist", view=view,
category=config.get_localized_string(70685), channel_type="all", thumbnail=get_thumb("channels_community.png", view), category=config.get_localized_string(70685), channel_type="all", thumbnail=get_thumb("channels_community.png", view),
viewmode="thumbnails")) viewmode="thumbnails", context = CONTEXT))
return itemlist return itemlist
@@ -215,7 +224,7 @@ def filterchannels(category, view="thumb_"):
channelslist.append(Item(title=channel_parameters["title"], channel=channel_parameters["channel"], channelslist.append(Item(title=channel_parameters["title"], channel=channel_parameters["channel"],
action="mainlist", thumbnail=channel_parameters["thumbnail"], action="mainlist", thumbnail=channel_parameters["thumbnail"],
fanart=channel_parameters["fanart"], plot=channel_info, category=channel_parameters["title"], fanart=channel_parameters["fanart"], plot=channel_info, category=channel_parameters["title"],
language=channel_parameters["language"], viewmode="list", context=context)) language=channel_parameters["language"], viewmode="list", context=CONTEXT + context))
except: except:
logger.error("Se ha producido un error al leer los datos del canal '%s'" % channel) logger.error("Se ha producido un error al leer los datos del canal '%s'" % channel)
+15 -5
View File
@@ -24,7 +24,9 @@ from core import httptools, scrapertools, servertools, tmdb, channeltools
from core.item import Item from core.item import Item
from lib import unshortenit from lib import unshortenit
from platformcode import logger, config from platformcode import logger, config
from specials import autoplay from specials import autoplay, shortcuts
CONTEXT =shortcuts.context()
def hdpass_get_servers(item): def hdpass_get_servers(item):
def get_hosts(url, quality): def get_hosts(url, quality):
@@ -299,7 +301,8 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t
contentLanguage = lang1, contentLanguage = lang1,
contentEpisodeNumber=episode if episode else '', contentEpisodeNumber=episode if episode else '',
news= item.news if item.news else '', news= item.news if item.news else '',
other = scraped['other'] if scraped['other'] else '' other = scraped['other'] if scraped['other'] else '',
context = CONTEXT
) )
# for lg in list(set(listGroups).difference(known_keys)): # for lg in list(set(listGroups).difference(known_keys)):
@@ -620,7 +623,8 @@ def menuItem(itemlist, filename, title='', action='', url='', contentType='movie
url = url, url = url,
extra = extra, extra = extra,
args = args, args = args,
contentType = contentType contentType = contentType,
context = CONTEXT
)) ))
# Apply auto Thumbnails at the menus # Apply auto Thumbnails at the menus
@@ -668,7 +672,7 @@ def menu(func):
url = host + var[0] if len(var) > 0 else '', url = host + var[0] if len(var) > 0 else '',
action = var[1] if len(var) > 1 else 'peliculas', action = var[1] if len(var) > 1 else 'peliculas',
args=var[2] if len(var) > 2 else '', args=var[2] if len(var) > 2 else '',
contentType= var[3] if len(var) > 3 else 'movie',) contentType= var[3] if len(var) > 3 else 'movie')
# Make MAIN MENU # Make MAIN MENU
elif dictUrl[name] is not None: elif dictUrl[name] is not None:
@@ -687,7 +691,7 @@ def menu(func):
url = host + var[0] if len(var) > 0 else '', url = host + var[0] if len(var) > 0 else '',
action = var[1] if len(var) > 1 else 'peliculas', action = var[1] if len(var) > 1 else 'peliculas',
args=var[2] if len(var) > 2 else '', args=var[2] if len(var) > 2 else '',
contentType= var[3] if len(var) > 3 else 'movie' if name == 'film' else 'tvshow',) contentType= var[3] if len(var) > 3 else 'movie' if name == 'film' else 'tvshow')
# add search menu for category # add search menu for category
if 'search' not in args: menuItem(itemlist, filename, config.get_localized_string(70741) % title + ' … submenu bold', 'search', host + url, contentType='movie' if name == 'film' else 'tvshow') if 'search' not in args: menuItem(itemlist, filename, config.get_localized_string(70741) % title + ' … submenu bold', 'search', host + url, contentType='movie' if name == 'film' else 'tvshow')
@@ -768,6 +772,12 @@ def typo(string, typography=''):
string = ' - ' + re.sub(r'\s--','',string) string = ' - ' + re.sub(r'\s--','',string)
if 'bullet' in string: if 'bullet' in string:
string = '[B]' + "" + '[/B] ' + re.sub(r'\sbullet','',string) string = '[B]' + "" + '[/B] ' + re.sub(r'\sbullet','',string)
if 'capitalize' in string.lower():
string = re.sub(r'\scapitalize','',string).capitalize()
if 'uppercase' in string.lower():
string = re.sub(r'\suppercase','',string).upper()
if 'lowercase' in string.lower():
string = re.sub(r'\slowercase','',string).lower()
return string return string
+7 -7
View File
@@ -584,9 +584,9 @@ def set_context_commands(item, parent_item):
# Ir al Menu Principal (channel.mainlist) # Ir al Menu Principal (channel.mainlist)
if parent_item.channel not in ["news", "channelselector"] and item.action != "mainlist" \ if parent_item.channel not in ["news", "channelselector"] and item.action != "mainlist" \
and parent_item.action != "mainlist": and parent_item.action != "mainlist":
context_commands.append((config.get_localized_string(60349), "XBMC.Container.Refresh (%s?%s)" % context_commands.insert(0, (config.get_localized_string(60349), "XBMC.Container.Refresh (%s?%s)" %
(sys.argv[0], Item(channel=item.channel, action="mainlist").tourl()))) (sys.argv[0], Item(channel=item.channel, action="mainlist").tourl())))
context_commands.insert(2, (config.get_localized_string(70739), context_commands.insert(1, (config.get_localized_string(70739),
"XBMC.Container.Update (%s?%s)" % (sys.argv[0], Item(action="open_browser", "XBMC.Container.Update (%s?%s)" % (sys.argv[0], Item(action="open_browser",
url=item.url).tourl()))) url=item.url).tourl())))
@@ -598,11 +598,11 @@ def set_context_commands(item, parent_item):
(sys.argv[0], item.clone(channel="favorites", action="addFavourite", (sys.argv[0], item.clone(channel="favorites", action="addFavourite",
from_channel=item.channel, from_channel=item.channel,
from_action=item.action).tourl()))) from_action=item.action).tourl())))
# Añadir a Alfavoritos (Mis enlaces) # Añadir a Alfavoritos (Mis enlaces)
if item.channel not in ["favorites", "videolibrary", "help", ""] and parent_item.channel != "favorites": if item.channel not in ["favorites", "videolibrary", "help", ""] and parent_item.channel != "favorites":
context_commands.append( context_commands.append(
('[COLOR blue]%s[/COLOR]' % config.get_localized_string(70557), "XBMC.RunPlugin(%s?%s)" % (config.get_localized_string(70557), "XBMC.RunPlugin(%s?%s)" %
(sys.argv[0], item.clone(channel="kodfavourites", action="addFavourite", (sys.argv[0], item.clone(channel="kodfavourites", action="addFavourite",
from_channel=item.channel, from_channel=item.channel,
from_action=item.action).tourl()))) from_action=item.action).tourl())))
@@ -630,7 +630,7 @@ def set_context_commands(item, parent_item):
text=item.wanted).tourl()))) text=item.wanted).tourl())))
context_commands.append( context_commands.append(
("[COLOR yellow]%s[/COLOR]" % config.get_localized_string(70561), "XBMC.Container.Update (%s?%s)" % ( (config.get_localized_string(70561), "XBMC.Container.Update (%s?%s)" % (
sys.argv[0], item.clone(channel='search', action='from_context', search_type='list', page='1', sys.argv[0], item.clone(channel='search', action='from_context', search_type='list', page='1',
list_type='%s/%s/similar' % ( list_type='%s/%s/similar' % (
mediatype, item.infoLabels['tmdb_id'])).tourl()))) mediatype, item.infoLabels['tmdb_id'])).tourl())))
@@ -703,7 +703,7 @@ def set_context_commands(item, parent_item):
context_commands.append((config.get_localized_string(60361), context_commands.append((config.get_localized_string(60361),
"XBMC.RunScript(special://home/addons/plugin.program.super.favourites/LaunchSFMenu.py)")) "XBMC.RunScript(special://home/addons/plugin.program.super.favourites/LaunchSFMenu.py)"))
context_commands = sorted(context_commands, key=lambda comand: comand[0]) # context_commands = sorted(context_commands, key=lambda comand: comand[0])
# Menu Rapido # Menu Rapido
# context_commands.insert(0, (config.get_localized_string(60360), # context_commands.insert(0, (config.get_localized_string(60360),
@@ -712,7 +712,7 @@ def set_context_commands(item, parent_item):
# parent=parent_item.tourl()).tourl( # parent=parent_item.tourl()).tourl(
# )))) # ))))
if config.dev_mode(): if config.dev_mode():
context_commands.insert(2, ("item info", context_commands.insert(0, ("item info",
"XBMC.Container.Update (%s?%s)" % (sys.argv[0], Item(action="itemInfo", parent=item.tojson()).tourl()))) "XBMC.Container.Update (%s?%s)" % (sys.argv[0], Item(action="itemInfo", parent=item.tojson()).tourl())))
return context_commands return context_commands
+10 -2
View File
@@ -105,6 +105,14 @@ msgctxt "#30023"
msgid "NO" msgid "NO"
msgstr "" msgstr ""
msgctxt "#30024"
msgid "Contextual Menu"
msgstr ""
msgctxt "#30025"
msgid "KoD Preferences"
msgstr "Preferenze KoD"
msgctxt "#30043" msgctxt "#30043"
msgid "Force view mode:" msgid "Force view mode:"
msgstr "" msgstr ""
@@ -1539,7 +1547,7 @@ msgid "Search Trailer"
msgstr "" msgstr ""
msgctxt "#60360" msgctxt "#60360"
msgid "[B]QUICK MENU[/B]" msgid "Quick Menu"
msgstr "" msgstr ""
msgctxt "#60361" msgctxt "#60361"
@@ -5670,7 +5678,7 @@ msgid "%s Special Episode Number"
msgstr "" msgstr ""
msgctxt "#70737" msgctxt "#70737"
msgid "[B]SIDE MENU[/B]" msgid "Side Menu"
msgstr "" msgstr ""
msgctxt "#70738" msgctxt "#70738"
+12 -4
View File
@@ -105,6 +105,14 @@ msgctxt "#30023"
msgid "NO" msgid "NO"
msgstr "NO" msgstr "NO"
msgctxt "#30024"
msgid "Contextual Menu"
msgstr "Menu Contestuale"
msgctxt "#30025"
msgid "KoD Preferences"
msgstr "Preferenze KoD"
msgctxt "#30043" msgctxt "#30043"
msgid "Force view mode:" msgid "Force view mode:"
msgstr "Forza modalità di visualizzazione:" msgstr "Forza modalità di visualizzazione:"
@@ -1538,8 +1546,8 @@ msgid "Search Trailer"
msgstr "Cerca Trailer" msgstr "Cerca Trailer"
msgctxt "#60360" msgctxt "#60360"
msgid "[B]QUICK MENU[/B]" msgid "Qiuick Menu"
msgstr "[B]MENU RAPIDO[/B]" msgstr "Menu Rapido"
msgctxt "#60361" msgctxt "#60361"
msgid "Super Favourites Menu" msgid "Super Favourites Menu"
@@ -5674,8 +5682,8 @@ msgid "Completed Serie"
msgstr "Serie Completa" msgstr "Serie Completa"
msgctxt "#70737" msgctxt "#70737"
msgid "[B]SIDE MENU[/B]" msgid "Side Menu"
msgstr "[B]MENU LATERALE[/B]" msgstr "Menu Laterale"
msgctxt "#70738" msgctxt "#70738"
msgid "Ready channels %d/%d" msgid "Ready channels %d/%d"
+5
View File
@@ -79,6 +79,11 @@
<setting id="custom_theme" type="folder" label="70565" default="" visible="eq(-1,true)"/> <setting id="custom_theme" type="folder" label="70565" default="" visible="eq(-1,true)"/>
<setting id="infoplus_set" type="labelenum" label="70128" lvalues="70129|70130" default="70129"/> <setting id="infoplus_set" type="labelenum" label="70128" lvalues="70129|70130" default="70129"/>
<setting id="video_thumbnail_type" type="enum" label="70131" lvalues="70132|70133" default="0"/> <setting id="video_thumbnail_type" type="enum" label="70131" lvalues="70132|70133" default="0"/>
<!-- Contextual -->
<setting label="30024" type="lsep"/>
<setting id="quick_menu" type="bool" label="60360" default="false"/>
<setting id="side_menu" type="bool" label="70737" default="false"/>
<setting id="kod_menu" type="bool" label="30025" default="false"/>
</category> </category>
<!-- Other --> <!-- Other -->
+2 -2
View File
@@ -42,7 +42,7 @@ def mainlist(item):
if config.is_xbmc(): if config.is_xbmc():
itemlist.append(Item(title=config.get_localized_string(707429), channel="setting", action="report_menu", itemlist.append(Item(title=config.get_localized_string(707429), channel="setting", action="report_menu",
thumbnail=get_thumb("error.png"), viewmode="list")) thumbnail=get_thumb("error.png"), viewmode="list",folder=True))
itemlist.append(Item(channel=item.channel, action="", title=config.get_localized_string(60447), itemlist.append(Item(channel=item.channel, action="", title=config.get_localized_string(60447),
thumbnail=get_thumb("help.png"), thumbnail=get_thumb("help.png"),
@@ -78,7 +78,7 @@ def mainlist(item):
itemlist.append(Item(channel=item.channel, action="faq", itemlist.append(Item(channel=item.channel, action="faq",
title=config.get_localized_string(60455), title=config.get_localized_string(60455),
thumbnail=get_thumb("help.png"), thumbnail=get_thumb("help.png"),
folder=True, extra="prob_bib")) folder=False, extra="prob_bib"))
itemlist.append(Item(channel=item.channel, action="faq", itemlist.append(Item(channel=item.channel, action="faq",
title=config.get_localized_string(60456), title=config.get_localized_string(60456),
thumbnail=get_thumb("help.png"), thumbnail=get_thumb("help.png"),
+18 -18
View File
@@ -129,7 +129,7 @@ class KodfavouritesData(object):
def addFavourite(item): def addFavourite(item):
logger.info() logger.info()
alfav = kodfavoritesData() alfav = KodfavouritesData()
# Si se llega aquí mediante el menú contextual, hay que recuperar los parámetros action y channel # Si se llega aquí mediante el menú contextual, hay que recuperar los parámetros action y channel
if item.from_action: if item.from_action:
@@ -182,7 +182,7 @@ def addFavourite(item):
def mainlist(item): def mainlist(item):
logger.info() logger.info()
alfav = kodfavoritesData() alfav = KodfavouritesData()
item.category = get_name_from_filename(os.path.basename(alfav.user_favorites_file)) item.category = get_name_from_filename(os.path.basename(alfav.user_favorites_file))
itemlist = [] itemlist = []
@@ -219,7 +219,7 @@ def mainlist(item):
def mostrar_perfil(item): def mostrar_perfil(item):
logger.info() logger.info()
alfav = kodfavoritesData() alfav = KodfavouritesData()
itemlist = [] itemlist = []
@@ -294,7 +294,7 @@ def _crea_perfil(alfav):
def crear_perfil(item): def crear_perfil(item):
logger.info() logger.info()
alfav = kodfavoritesData() alfav = KodfavouritesData()
if not _crea_perfil(alfav): return False if not _crea_perfil(alfav): return False
@@ -304,7 +304,7 @@ def crear_perfil(item):
def editar_perfil_titulo(item): def editar_perfil_titulo(item):
logger.info() logger.info()
alfav = kodfavoritesData() alfav = KodfavouritesData()
if not alfav.user_favorites[item.i_perfil]: return False if not alfav.user_favorites[item.i_perfil]: return False
@@ -321,7 +321,7 @@ def editar_perfil_titulo(item):
def eliminar_perfil(item): def eliminar_perfil(item):
logger.info() logger.info()
alfav = kodfavoritesData() alfav = KodfavouritesData()
if not alfav.user_favorites[item.i_perfil]: return False if not alfav.user_favorites[item.i_perfil]: return False
@@ -369,7 +369,7 @@ def acciones_enlace(item):
def editar_enlace_titulo(item): def editar_enlace_titulo(item):
logger.info() logger.info()
alfav = kodfavoritesData() alfav = KodfavouritesData()
if not alfav.user_favorites[item.i_perfil]: return False if not alfav.user_favorites[item.i_perfil]: return False
if not alfav.user_favorites[item.i_perfil]['items'][item.i_enlace]: return False if not alfav.user_favorites[item.i_perfil]['items'][item.i_enlace]: return False
@@ -391,7 +391,7 @@ def editar_enlace_titulo(item):
def editar_enlace_color(item): def editar_enlace_color(item):
logger.info() logger.info()
alfav = kodfavoritesData() alfav = KodfavouritesData()
if not alfav.user_favorites[item.i_perfil]: return False if not alfav.user_favorites[item.i_perfil]: return False
if not alfav.user_favorites[item.i_perfil]['items'][item.i_enlace]: return False if not alfav.user_favorites[item.i_perfil]['items'][item.i_enlace]: return False
@@ -415,7 +415,7 @@ def editar_enlace_color(item):
def editar_enlace_thumbnail(item): def editar_enlace_thumbnail(item):
logger.info() logger.info()
alfav = kodfavoritesData() alfav = KodfavouritesData()
if not alfav.user_favorites[item.i_perfil]: return False if not alfav.user_favorites[item.i_perfil]: return False
if not alfav.user_favorites[item.i_perfil]['items'][item.i_enlace]: return False if not alfav.user_favorites[item.i_perfil]['items'][item.i_enlace]: return False
@@ -475,7 +475,7 @@ def editar_enlace_thumbnail(item):
def editar_enlace_carpeta(item): def editar_enlace_carpeta(item):
logger.info() logger.info()
alfav = kodfavoritesData() alfav = KodfavouritesData()
if not alfav.user_favorites[item.i_perfil]: return False if not alfav.user_favorites[item.i_perfil]: return False
if not alfav.user_favorites[item.i_perfil]['items'][item.i_enlace]: return False if not alfav.user_favorites[item.i_perfil]['items'][item.i_enlace]: return False
@@ -494,7 +494,7 @@ def editar_enlace_carpeta(item):
def editar_enlace_lista(item): def editar_enlace_lista(item):
logger.info() logger.info()
alfav = kodfavoritesData() alfav = KodfavouritesData()
if not alfav.user_favorites[item.i_perfil]: return False if not alfav.user_favorites[item.i_perfil]: return False
if not alfav.user_favorites[item.i_perfil]['items'][item.i_enlace]: return False if not alfav.user_favorites[item.i_perfil]['items'][item.i_enlace]: return False
@@ -515,7 +515,7 @@ def editar_enlace_lista(item):
if ret == -1: if ret == -1:
return False # pedido cancel return False # pedido cancel
alfav_destino = kodfavoritesData(opciones[ret]) alfav_destino = KodfavouritesData(opciones[ret])
# Diálogo para escoger/crear carpeta en la lista de destino # Diálogo para escoger/crear carpeta en la lista de destino
i_perfil = _selecciona_perfil(alfav_destino, 'Seleccionar carpeta destino', -1) i_perfil = _selecciona_perfil(alfav_destino, 'Seleccionar carpeta destino', -1)
@@ -532,7 +532,7 @@ def editar_enlace_lista(item):
def eliminar_enlace(item): def eliminar_enlace(item):
logger.info() logger.info()
alfav = kodfavoritesData() alfav = KodfavouritesData()
if not alfav.user_favorites[item.i_perfil]: return False if not alfav.user_favorites[item.i_perfil]: return False
if not alfav.user_favorites[item.i_perfil]['items'][item.i_enlace]: return False if not alfav.user_favorites[item.i_perfil]['items'][item.i_enlace]: return False
@@ -548,7 +548,7 @@ def eliminar_enlace(item):
# ------------------------ # ------------------------
def mover_perfil(item): def mover_perfil(item):
logger.info() logger.info()
alfav = kodfavoritesData() alfav = KodfavouritesData()
alfav.user_favorites = _mover_item(alfav.user_favorites, item.i_perfil, item.direccion) alfav.user_favorites = _mover_item(alfav.user_favorites, item.i_perfil, item.direccion)
alfav.save() alfav.save()
@@ -558,7 +558,7 @@ def mover_perfil(item):
def mover_enlace(item): def mover_enlace(item):
logger.info() logger.info()
alfav = kodfavoritesData() alfav = KodfavouritesData()
if not alfav.user_favorites[item.i_perfil]: return False if not alfav.user_favorites[item.i_perfil]: return False
alfav.user_favorites[item.i_perfil]['items'] = _mover_item(alfav.user_favorites[item.i_perfil]['items'], item.i_enlace, item.direccion) alfav.user_favorites[item.i_perfil]['items'] = _mover_item(alfav.user_favorites[item.i_perfil]['items'], item.i_enlace, item.direccion)
@@ -726,7 +726,7 @@ def informacion_lista(item):
platformtools.dialog_ok('Alfa', config.get_localized_string(70630), item.lista) platformtools.dialog_ok('Alfa', config.get_localized_string(70630), item.lista)
return False return False
alfav = kodfavoritesData(item.lista) alfav = KodfavouritesData(item.lista)
txt = 'Lista: [COLOR gold]%s[/COLOR]' % item.lista txt = 'Lista: [COLOR gold]%s[/COLOR]' % item.lista
txt += '[CR]' + config.get_localized_string(70634) + ' ' + alfav.info_lista['created'] + ' ' + config.get_localized_string(70635) + ' ' + alfav.info_lista['updated'] txt += '[CR]' + config.get_localized_string(70634) + ' ' + alfav.info_lista['created'] + ' ' + config.get_localized_string(70635) + ' ' + alfav.info_lista['updated']
@@ -790,7 +790,7 @@ def compartir_lista(item):
# Apuntar código en fichero de log y dentro de la lista # Apuntar código en fichero de log y dentro de la lista
save_log_lista_shared(config.get_localized_string(70648) + ' ' + item.lista + ' ' + codigo + ' ' + config.get_localized_string(70649)) save_log_lista_shared(config.get_localized_string(70648) + ' ' + item.lista + ' ' + codigo + ' ' + config.get_localized_string(70649))
alfav = kodfavoritesData(item.lista) alfav = KodfavouritesData(item.lista)
alfav.info_lista['tinyupload_date'] = fechahora_actual() alfav.info_lista['tinyupload_date'] = fechahora_actual()
alfav.info_lista['tinyupload_code'] = codigo alfav.info_lista['tinyupload_code'] = codigo
alfav.save() alfav.save()
@@ -851,7 +851,7 @@ def crear_lista(item):
return False return False
# Provocar que se guarde con las carpetas vacías por defecto # Provocar que se guarde con las carpetas vacías por defecto
alfav = kodfavoritesData(filename) alfav = KodfavouritesData(filename)
platformtools.itemlist_refresh() platformtools.itemlist_refresh()
return True return True
+23
View File
@@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
def context():
from platformcode import config
context = []
if config.get_setting('quick_menu'): context += [{ 'title': config.get_localized_string(60360).upper(), 'channel': 'shortcuts', 'action': "shortcut_menu"}]
if config.get_setting('side_menu'): context += [{ 'title': config.get_localized_string(70737).upper(), 'channel': 'shortcuts', 'action': "side_menu"}]
if config.get_setting('kod_menu'): context += [{ 'title': config.get_localized_string(30025), 'channel': 'shortcuts', 'action': "settings_menu"}]
return context
def side_menu(item):
from specials import side_menu
side_menu.open_menu(item)
def shortcut_menu(item):
from platformcode import keymaptools
keymaptools.open_shortcut_menu()
def settings_menu(item):
from platformcode import config
config.open_settings()