----------------------------------------------------------------------------------------------------------
import os
import time
import sys
import menu
import config
from gui import ConfirmBox from item import Item from plugin import MainMenuPlugin
class HomeAutomationItem(Item):
def actions(self):
items = [(self.createMenu, _('Home Automation'))]
return itemsdef createMenu(self, arg=None, menuw=None):
ha_menu_items=[]
ha_menu_items+=[menu.MenuItem("Living Room",self.livingroom)]
ha_menu_items+=[menu.MenuItem("Master Bedroom",self.masterbedroom)]
ha_menu_items+=[menu.MenuItem("Office",self.office)]
ha_menu=menu.Menu("Home Automation", ha_menu_items)
menuw.pushmenu(radio_ha)
menuw.refresh()
class PluginInterface(MainMenuPlugin):
def items(self, parent):
return [ HomeAutomationItem(parent) ]
----------------------------------------------------------------------------------------------------------Thanks, Ryan
[EMAIL PROTECTED] wrote:
Ryan, within your mainMenu item, you'll need something like the below (chopped from my shoutcast plugin - see the dev archives for a full copy).
It's all to do with the actions function. here you can choose whether to create another submenu or to actually do something.
def actions(self): return [(self.createMenu,'Web Radio')]
def createMenu(self, arg=None, menuw=None): radio_menu_items=[] radio_menu_items+=[menu.MenuItem("Top20",self.top20)] radio_menu_items+=[menu.MenuItem("Genre",self.genre)] radio_menu_items+=[menu.MenuItem("Search",self.searchPB)] radio_menu=menu.Menu("Web Radio", radio_menu_items) menuw.pushmenu(radio_menu) menuw.refresh()
Rande
Here is the little that I have been able to figure out. I am able to create a main menu item, and I know how to shell a command, but I cannot create sub menus, and I don't have a clue on how to read and generate it from a config file. Any help would be appreciated.
Thank you,
Ryan
------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Freevo-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/freevo-users
------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Freevo-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/freevo-users
