Index: channels/__init__.py ================================================================== --- channels/__init__.py +++ channels/__init__.py @@ -94,10 +94,12 @@ nothing_found = [dict(genre="./.", title="No contents found on directory server", playing="Notice", listeners=0, bitrate=0, state="gtk-info")] # regex rx_www_url = re.compile("""(www(\.\w+[\w-]+){2,}|(\w+[\w-]+[ ]?\.)+(com|FM|net|org|de|PL|fr|uk))""", re.I) + + #-- keep track of currently selected genre/category __current = None @property def current(self): return self.__current @current.setter @@ -418,22 +420,24 @@ __print__(dbg.ERR, "HTTP error or extraction failure.") self.categories = ["empty"] self.display_categories() # Select first category - #self.current = self.str_from_struct(self.categories) or None - #__print__(dbg.STAT, self.module, "→ first_show(); use first category as current =", self.current) - try: - self.load(self.current) - except: - pass + if not self.current: + self.current = self.str_from_struct(self.categories) or None + __print__(dbg.STAT, self.module, "→ first_show(); use first category as current =", self.current) + self.shown = 0, + + # Show current category in any case + __print__(dbg.UI, self.module, "→ first_show(); station list → load(", self.current, ")") + uikit.do(self.load, self.current) # put selection/cursor on last position - if self.shown: + if True:#self.shown != None: __print__(dbg.STAT, self.module+".first_show()", "select last known category treelist position =", self.shown) try: - self.gtk_list.get_selection().select_path(self.shown) + uikit.do(lambda:self.gtk_list.get_selection().select_path(self.shown)) except: pass # Invoke only once self.shown = 55555 Index: channels/bookmarks.py ================================================================== --- channels/bookmarks.py +++ channels/bookmarks.py @@ -45,12 +45,12 @@ # cache list, to determine if a PLS url is bookmarked urls = [] def gui(self, parent): - GenericChannel.gui(self, parent) parent.notebook_channels.set_menu_label_text(parent.v_bookmarks, "bookmarks") + GenericChannel.gui(self, parent) # this channel does not actually retrieve/parse data from anywhere def update_categories(self): pass @@ -64,11 +64,12 @@ return self.streams.get(cat, []) # streams are already loaded at instantiation #def first_show(self): - # pass + # print "first_show", len(self.streams["favourite"]) + # GenericChannel.first_show(self) # all entries just come from "bookmarks.json" def cache(self): # stream list