hi at all
someone can be explain me how to show the plugin in the main menu like as plugin that have the option
"show in the main menu integrated"
thankss at all
Posted 6 September 2018 - 22:10
i have this code
from Plugins.Plugin import PluginDescriptor from Components.Label import Label from Screens.Screen import Screen from Screens.Console import Console from Components.ActionMap import ActionMap from Components.MenuList import MenuList from os import listdir class OpenScript(Screen): skin = """ <screen position="center,center" size="480,420" title="grifo-update" > <widget name="line1" position="5,5" size="420,30" font="Regular; 26" halign="left" valign="center" transparent="1" /> <eLabel backgroundColor="grey" position="2,38" size="475,2" zPosition="3" /> <widget name="list" position="5,45" size="470,320" scrollbarMode="showOnDemand" /> <ePixmap position="5,372" size="140,40" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/grifone/buttons/red.png" alphatest="on" /> <widget position="5,372" size="140,40" name="key_red" font="Regular;20" halign="center" valign="center" backgroundColor="red" zPosition="2" transparent="1" /> <ePixmap position="155,380" size="35,25" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/grifone/buttons/key_ok.png" alphatest="on" zPosition="1" /> </screen>""" def __init__(self, session, args=None): Screen.__init__(self, session) self.session = session try: list = listdir("/etc/enigma2") list = [x[:-3] for x in list if x.endswith('.sh')] except: list = [] self['line1'] = Label(_('Available scripts:')) self['key_red'] = Label(_('Close')) self["list"] = MenuList(list) self["actions"] = ActionMap(['OkCancelActions', 'ColorActions'], {'ok': self.run, 'red': self.close, 'cancel': self.close}, -1) def run(self): script = self["list"].getCurrent() if script is not None: self.session.open(Console, script.replace("_", " "), cmdlist=[("/etc/enigma2/%s.sh" % script)]) def main(session, **kwargs): session.open(OpenScript) def Plugins(**kwargs): return PluginDescriptor(name="Ricarica lista", description=_("Grifo Update"), where = PluginDescriptor.WHERE_PLUGINMENU, icon="plugin.png", fnc=main)
Posted 7 September 2018 - 15:08
i have this now but not work
from Plugins.Plugin import PluginDescriptor from Components.Label import Label from Screens.Screen import Screen from Screens.Console import Console from Components.ActionMap import ActionMap from Components.MenuList import MenuList from os import listdir class OpenScript(Screen): skin = """ <screen position="center,center" size="480,420" title="grifo-update" > <widget name="line1" position="5,5" size="420,30" font="Regular; 26" halign="left" valign="center" transparent="1" /> <eLabel backgroundColor="grey" position="2,38" size="475,2" zPosition="3" /> <widget name="list" position="5,45" size="470,320" scrollbarMode="showOnDemand" /> <ePixmap position="5,372" size="140,40" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/grifone/buttons/red.png" alphatest="on" /> <widget position="5,372" size="140,40" name="key_red" font="Regular;20" halign="center" valign="center" backgroundColor="red" zPosition="2" transparent="1" /> <ePixmap position="155,380" size="35,25" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/grifone/buttons/key_ok.png" alphatest="on" zPosition="1" /> </screen>""" def __init__(self, session, args=None): Screen.__init__(self, session) self.session = session try: list = listdir("/etc/enigma2") list = [x[:-3] for x in list if x.endswith('.sh')] except: list = [] self['line1'] = Label(_('Available scripts:')) self['key_red'] = Label(_('Close')) self["list"] = MenuList(list) self["actions"] = ActionMap(['OkCancelActions', 'ColorActions'], {'ok': self.run, 'red': self.close, 'cancel': self.close}, -1) def run(self): script = self["list"].getCurrent() if script is not None: self.session.open(Console, script.replace("_", " "), cmdlist=[("/etc/enigma2/%s.sh" % script)]) def main(session, **kwargs): session.open(OpenScript) def Plugins(**kwargs): return PluginDescriptor(name="Ricarica lista", description=_("Grifo Update"), where = PluginDescriptor.WHERE_MENU, fnc = start_from_mainmenu, icon="plugin.png", fnc=main)
Posted 7 September 2018 - 15:24
Define "not work"? Have you restarted Enigma after making this change?
Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)
Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.
Many answers to your question can be found in our new and improved wiki.
Posted 7 September 2018 - 16:06
--- return PluginDescriptor(name="Ricarica lista", description=_("Grifo Update"), where = PluginDescriptor.WHERE_MENU, fnc = start_from_mainmenu, icon="plugin.png", fnc=main)
+++ return PluginDescriptor(name="Ricarica lista", description=_("Grifo Update"), where = PluginDescriptor.WHERE_MENU, icon="plugin.png", fnc=main)
his function is main, must be fnc=main
Posted 7 September 2018 - 16:15
GigaBlue UHD Quad 4K /Lunix3-4K/Duo 4K
Posted 7 September 2018 - 16:43
not that easy, what I suggested didn´t work here, the easiest way is to put in Extensions, you´ll get it pressing blue key
return PluginDescriptor(name="Ricarica lista", description=_("Grifo Update"), where = PluginDescriptor.WHERE_EXTENSIONSMENU, icon="plugin.png", fnc=main)
Posted 8 September 2018 - 15:15
much thanks mrvica
now the plugin show in blue button
thnks at all friend that help me
not that easy, what I suggested didn´t work here, the easiest way is to put in Extensions, you´ll get it pressing blue key
return PluginDescriptor(name="Ricarica lista", description=_("Grifo Update"), where = PluginDescriptor.WHERE_EXTENSIONSMENU, icon="plugin.png", fnc=main)
0 members, 3 guests, 0 anonymous users