Index: channels/__init__.py ================================================================== --- channels/__init__.py +++ channels/__init__.py @@ -282,15 +282,15 @@ self.status("Category parsed empty.") self.streams[category] = self.nothing_found log.INFO("Oooops, parser returned nothing for category " + category) # Update treeview/model (if category is still selected) + log.UI("load columns datamap streams") if self.current == category: - uikit.do(lambda:[ - uikit.columns(self.gtk_list, self.datamap, self.prepare(self.streams[category])), - y and self.gtk_list.scroll_to_point(0, y) # scroll to previous position - ]) + uikit.do(uikit.columns, self.gtk_list, self.datamap, self.prepare(self.streams[category])) + if y: + uikit.do(self.gtk_list.scroll_to_point, 0, y) # scroll to previous position # set pointer self.status("") self.status(1.0) @@ -300,11 +300,11 @@ conf.save("cache/" + self.module, self.streams, gz=1) # called occasionally while retrieving and parsing def update_streams_partially_done(self, entries): - uikit.do(lambda: uikit.columns(self.gtk_list, self.datamap, entries)) + uikit.do(uikit.columns, self.gtk_list, self.datamap, entries) # finds differences in new/old streamlist, marks deleted with flag def deleted_streams(self, new, old): diff = [] @@ -404,11 +404,11 @@ log.STAT(self.module, "→ first_show(); use first category as current =", self.current) self.shown = 0, # Show current category in any case log.UI(self.module, "→ first_show(); station list → load(", self.current, ")") - uikit.do(self.load, self.current) + self.load(self.current) # put selection/cursor on last position if True:#self.shown != None: log.STAT(self.module+".first_show()", "select last known category treelist position =", self.shown) try: @@ -438,24 +438,23 @@ if self.categories: conf.save("cache/categories_"+self.module, self.categories) if self.catmap: conf.save("cache/catmap_" + self.module, self.catmap); - # display outside of this non-main thread + # display outside of this non-main thread uikit.do(self.display_categories) # insert content into gtk category list def display_categories(self): - # remove any existing columns - if self.gtk_cat: - [self.gtk_cat.remove_column(c) for c in self.gtk_cat.get_columns()] # rebuild gtk.TreeView - uikit.tree(self.gtk_cat, self.categories, title="Category", icon=gtk.STOCK_OPEN); + log.UI("display_categoris: tree→gtk_cat") + uikit.tree(self.gtk_cat, self.categories, title="Category", icon=gtk.STOCK_OPEN) # if it's a short list of categories, there's probably subfolders + log.UI("display_categoris: expand_all") if len(self.categories) < 20: self.gtk_cat.expand_all() # select any first element self.gtk_cat.get_selection().select_path("0") #set_cursor @@ -484,11 +483,11 @@ else: streams += rows # Now appending to the liststore directly would be even nicer y = int(tv.get_vadjustment().get_value()) - uikit.do(self.load, self.current, y=y) + self.load(self.current, y=y) @@ -592,10 +591,11 @@ sw1.set_property("width_request", 150) sw1.show() tv1 = gtk.TreeView() tv1.set_property("width_request", 75) tv1.set_property("enable_tree_lines", True) + uikit.tree_column(tv1, "Category") tv1.connect("button_release_event", parent.on_category_clicked) tv1.show() sw1.add(tv1) vbox.pack1(sw1, resize=False, shrink=True) # stream list