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
  • 26 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
  • 9,729 posts

+157
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
  • 26 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
  • 26 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
  • 292 posts

+24
Neutral

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
  • 26 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

  • Forum Moderator
    PLi® Core member
  • 41,181 posts

+650
Excellent

Posted 7 September 2018 - 15:24

Define "not work"? Have you restarted Enigma after making this change?


Many answers to your question can be found in our new and improved wiki.

Currently in active use: VU+Solo 4K (1xFBC, 2xS2), VU+Zero, Edision OS mini+, Amiko Viper 2TC, Zgemma H3.2TC, Zgemma H6

For testing purposes: XP1000, Formuler F1 (2xS2), Miraclebox Premium Micro (S2+C/T), ET7500 (S2), ET8500 (S2), Zgemma H2.H (S2+C), Zgemma H5.2TC, SAB TripleAlpha (S2+C/T), Galaxy 4K (FBC), VU Zero 4K, HD2400 (4xS2), ET10000 (4xS2), VU+Duo2 (1xS2), Edision OS nino


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

  • Senior Member
  • 26 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
  • 575 posts

+30
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
  • 6,057 posts

+199
Excellent

Posted 7 September 2018 - 16:15

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


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

Formuler1/VU+solo4k(thanks guys to gisclub.tv)


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

  • Senior Member
  • 575 posts

+30
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
  • 44,905 posts

+455
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 Thanks to Henksat

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

  • PLi® Core member
  • 4,203 posts

+208
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
  • 26 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)






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users