Jump to content


Photo

how to show plugin in the main menu


  • Please log in to reply
13 replies to this topic

#1 morpheus1969

  • Senior Member
  • 41 posts

0
Neutral

Posted 6 September 2018 - 20:58

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



Re: how to show plugin in the main menu #2 ims

  • PLi® Core member
  • 13,781 posts

+214
Excellent

Posted 6 September 2018 - 21:37

PluginDescriptor.WHERE_MENU

 

See f.eg. into MediaPlayer plugin in plugin.py


Kdo nic nedělá, nic nezkazí!

Re: how to show plugin in the main menu #3 morpheus1969

  • Senior Member
  • 41 posts

0
Neutral

Posted 6 September 2018 - 21:58

thx but can't understand how to

sorry but not expert like you my friend

can you help me how to make this?

thx



Re: how to show plugin in the main menu #4 morpheus1969

  • Senior Member
  • 41 posts

0
Neutral

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)


Re: how to show plugin in the main menu #5 MCelliotG

  • Senior Member
  • 443 posts

+35
Good

Posted 7 September 2018 - 00:53

What you were told is clear, try to replace

where=PluginDescriptor.WHERE_PLUGINMENU

 

with

 

where = PluginDescriptor.WHERE_MENU, fnc = start_from_mainmenu


Edited by MCelliotG, 7 September 2018 - 00:54.


Re: how to show plugin in the main menu #6 morpheus1969

  • Senior Member
  • 41 posts

0
Neutral

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)



Re: how to show plugin in the main menu #7 WanWizard

  • PLi® Core member
  • 70,497 posts

+1,810
Excellent

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.


Re: how to show plugin in the main menu #8 morpheus1969

  • Senior Member
  • 41 posts

0
Neutral

Posted 7 September 2018 - 15:26

restart enigma end not show in main menu

also in plugin i have error



Re: how to show plugin in the main menu #9 mrvica

  • Senior Member
  • 1,259 posts

+86
Good

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



Re: how to show plugin in the main menu #10 Dimitrij

  • PLi® Core member
  • 10,323 posts

+350
Excellent

Posted 7 September 2018 - 16:15

https://github.com/O.../plugin.py#L395


Edited by Dimitrij, 7 September 2018 - 16:16.

GigaBlue UHD Quad 4K /Lunix3-4K/Duo 4K


Re: how to show plugin in the main menu #11 mrvica

  • Senior Member
  • 1,259 posts

+86
Good

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)



Re: how to show plugin in the main menu #12 littlesat

  • PLi® Core member
  • 57,159 posts

+698
Excellent

Posted 7 September 2018 - 16:52

Why ‘destroy’ the main menu while you can also put it more easily at the blue button (extensions menu) which is also a one button press ;)

Edited by littlesat, 7 September 2018 - 16:52.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: how to show plugin in the main menu #13 betacentauri

  • PLi® Core member
  • 7,185 posts

+323
Excellent

Posted 7 September 2018 - 17:01

Remove this “fnc = start_from_mainmenu, ”
Xtrend ET-9200, ET-8000, ET-10000, OpenPliPC on Ubuntu 12.04

Re: how to show plugin in the main menu #14 morpheus1969

  • Senior Member
  • 41 posts

0
Neutral

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)




2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users