@@ -3,11 +3,11 @@ # api: python # type: application # title: streamtuner2 # description: directory browser for internet radio / audio streams # depends: gtk, pygtk, xml.dom.minidom, threading, lxml, pyquery, kronos -# version: 2.0.8 +# version: 2.0.9 # author: mario salzer # license: public domain # url: http://freshmeat.net/projects/streamtuner2 # config: # category: multimedia @@ -113,11 +113,11 @@ # this represents the main window # and also contains most application behaviour main = None -class StreamTunerTwo(gtk.glade.XML): +class StreamTunerTwo(gtk.Builder): # object containers widgets = {} # non-glade widgets (the manually instantiated ones) channels = {} # channel modules @@ -134,11 +134,13 @@ # gtkrc stylesheet self.load_theme(), gui_startup(0.05) # instantiate gtk/glade widgets in current object - gtk.glade.XML.__init__(self, ("st2.glade" if os.path.exists("st2.glade") else conf.share+"/st2.glade")), gui_startup(0.10) + gtk.Builder.__init__(self) + ui_file = ("st2.xml" if os.path.exists("st2.xml") else conf.share+"/st2.xml"); + gtk.Builder.add_from_file(self, ui_file), gui_startup(0.10) # manual gtk operations self.extensionsCTM.set_submenu(self.extensions) # duplicates Station>Extension menu into stream context menu # initialize channels self.channels = { @@ -170,11 +172,11 @@ except: print("channel .first_show() initialization error") # bind gtk/glade event names to functions gui_startup(0.95) - self.signal_autoconnect({ + self.connect_signals({ "gtk_main_quit" : self.gtk_main_quit, # close window # treeviews / notebook "on_stream_row_activated" : self.on_play_clicked, # double click in a streams list "on_category_clicked": self.on_category_clicked, # new selection in category list "on_notebook_channels_switch_page": self.channel_switch, # channel notebook tab changed @@ -238,18 +240,18 @@ # also looks in self.channels[] for the named channel plugins def __getattr__(self, name): if (self.channels.has_key(name)): return self.channels[name] # like self.shoutcast else: - return self.get_widget(name) # or gives an error if neither exists + return self.get_object(name) # or gives an error if neither exists # custom-named widgets are available from .widgets{} not via .get_widget() def get_widget(self, name): if self.widgets.has_key(name): return self.widgets[name] else: - return gtk.glade.XML.get_widget(self, name) + return gtk.Builder.get_object(self, name) # returns the currently selected directory/channel object @@ -517,11 +519,11 @@ # auxiliary window: about dialog class AboutStreamtuner2: # about us def __init__(self): a = gtk.AboutDialog() - a.set_version("2.0.8") + a.set_version("2.0.9") a.set_name("streamtuner2") a.set_license("Public Domain\n\nNo Strings Attached.\nUnrestricted distribution,\nmodification, use.") a.set_authors(["Mario Salzer \n\nConcept based on streamtuner 0.99.99 from\nJean-Yves Lefort, of which some code remains\nin the Google stations plugin.\n\n\nMyOggRadio plugin based on cooperation\nwith Christian Ehm. "]) a.set_website("http://milki.include-once.org/streamtuner2/") a.connect("response", lambda a, ok: ( a.hide(), a.destroy() ) )