Index: channels/myoggradio.py ================================================================== --- channels/myoggradio.py +++ channels/myoggradio.py @@ -2,11 +2,11 @@ # api: streamtuner2 # title: MyOggRadio # description: Open source internet radio directory. # type: channel # category: radio -# version: 0.6 +# version: 0.7 # url: http://www.myoggradio.org/ # depends: json, StringIO # config: # { name: myoggradio_login, type: text, value: "user:password", description: "Account for storing personal favourites." } # { name: myoggradio_morph, type: boolean, value: 0, description: "Convert pls/m3u into direct shoutcast url." } @@ -26,20 +26,20 @@ # on myoggradio doesn't require an email address or personal information.) # from channels import * -from config import conf +from config import * from action import action from uikit import uikit import ahttp as http import re import json from compat2and3 import StringIO import copy - +from uikit import gtk # open source radio sharing stie class myoggradio(ChannelPlugin): @@ -64,11 +64,12 @@ # prepare GUI def __init__(self, parent): ChannelPlugin.__init__(self, parent) if parent: - uikit.add_menu([parent.extensions, parent.extensions_context], "Share in MyOggRadio", self.share) + #uikit.add_menu([parent.extensions, parent.extensions_context], "Share in MyOggRadio", self.share) + uikit.add_menu([parent.streammenu, parent.streamactions], "Share in MyOggRadio", self.share, insert=4) # this is simple, there are no categories def update_categories(self): @@ -182,9 +183,11 @@ return conf.myoggradio_login.split(":") else: lap = conf.netrc(["myoggradio", "myoggradio.org", "www.myoggradio.org"]) if lap: return [lap[0] or lap[1], lap[2]] + else: + self.parent.status("No login data for MyOggRadio configured. See F12 for setup, or F1 for help."); pass Index: channels/radiotray.py ================================================================== --- channels/radiotray.py +++ channels/radiotray.py @@ -73,12 +73,11 @@ self.bm.add_category("radiotray", plugin=self); self.bm.streams["radiotray"] = self.update_streams(cat="radiotray") self.bm.reload_if_current(self.module) # add context menu - if parent: - uikit.add_menu([parent.extensions, parent.extensions_context], "Keep in RadioTray", self.share) + uikit.add_menu([parent.streammenu, parent.streamactions], "Keep in RadioTray", self.share, insert=4) # load RadioTray bookmarks def update_streams(self, cat): r = [] Index: channels/timer.py ================================================================== --- channels/timer.py +++ channels/timer.py @@ -47,18 +47,19 @@ # prepare gui def __init__(self, parent): - if parent: + if not parent: + return # keep reference to main window self.parent = parent self.bookmarks = parent.bookmarks # add menu - uikit.add_menu([parent.extensions, parent.extensions_context], "Add timer for station", self.edit_timer) + uikit.add_menu([parent.streammenu, parent.streamactions], "Add timer for station", self.edit_timer, insert=4) # target channel if not self.bookmarks.streams.get("timer"): self.bookmarks.streams["timer"] = [{"title":"--- timer events ---"}] self.bookmarks.add_category("timer") Index: gtk3.xml.gz ================================================================== --- gtk3.xml.gz +++ gtk3.xml.gz cannot compute difference between binary files Index: uikit.py ================================================================== --- uikit.py +++ uikit.py @@ -433,16 +433,19 @@ return b # Attach textual menu entry and callback @staticmethod - def add_menu(menuwidget, label, action): + def add_menu(menuwidget, label, action, insert=None): for where in list(menuwidget): m = gtk.MenuItem(label) m.connect("activate", action) m.show() - where.add(m) + if insert: + where.insert(m, insert) + else: + where.add(m) # gtk.messagebox @staticmethod def msg(text, style=gtk.MESSAGE_INFO, buttons=gtk.BUTTONS_CLOSE):