Internet radio browser GUI for music/video streams from various directory services.

⌈⌋ ⎇ branch:  streamtuner2


Check-in [7aa0ce2a25]

Overview
Comment:Statusbar updates via uikit.do, immediate=True.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 7aa0ce2a259ae53b97cb20593be95d49e8cbbedf
User & Date: mario on 2015-04-23 18:58:35
Other Links: manifest | tags
Context
2015-04-23
19:03
Draw gtk_cat columns on initialiation in .gui() call. Use more literal uikit.do() invocations without lambda: wrapping. Let display_categories only run in uikit.do/idle, whereas .load() is run directly from there now. check-in: f1a357a60d user: mario tags: trunk
18:58
Statusbar updates via uikit.do, immediate=True. check-in: 7aa0ce2a25 user: mario tags: trunk
18:57
Make uikit.do() manage a task spool itself. Run new tasks immediately if invoked already within gtk_idle callback. Move uikit.tree column creation into separate function, for immediate use through GenericChannel.gui() - instead of destroying+repopulating it on category-list reloads. check-in: 7f51022370 user: mario tags: trunk
Changes

Modified st2.py from [8c09094d97] to [9776e658be].

232
233
234
235
236
237
238

239

240
241
242
243
244
245
246
    # Notebook tab has been clicked (receives numeric page_num), but *NOT* yet changed (visually).
    def channel_switch(self, notebook, page, page_num=0, *args):
        self.current_channel = notebook.get_menu_label_text(notebook.get_nth_page(page_num))
        log.UI("main.channel_switch() :=", self.current_channel)
        self.update_title()
        # if first selected, load current category
        # (run in thread, to make it look speedy on first startup)

        self.thread( self.channel().first_show )


    # Invoked from the menu instead, uses module name instead of numeric tab id
    def channel_switch_by_name(self, name):
        self.notebook_channels.set_current_page(self.channel_names.index(name))

    # Mirror selected channel tab into main window title
    def update_title(self):







>
|
>







232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
    # Notebook tab has been clicked (receives numeric page_num), but *NOT* yet changed (visually).
    def channel_switch(self, notebook, page, page_num=0, *args):
        self.current_channel = notebook.get_menu_label_text(notebook.get_nth_page(page_num))
        log.UI("main.channel_switch() :=", self.current_channel)
        self.update_title()
        # if first selected, load current category
        # (run in thread, to make it look speedy on first startup)
        self.thread( 
        self.channel().first_show
        )

    # Invoked from the menu instead, uses module name instead of numeric tab id
    def channel_switch_by_name(self, name):
        self.notebook_channels.set_current_page(self.channel_names.index(name))

    # Mirror selected channel tab into main window title
    def update_title(self):
357
358
359
360
361
362
363
364
365
366
367
368
369

370
371
372
373
374
375
376
377
378
379
380
381
382
383
    # (hacked to work from within threads, circumvents the statusbar msg pool actually)
    def status(self, text="", sbar_msg=[]):
        # init
        sbar_cid = self.get_widget("statusbar").get_context_id("messages")
        # remove text
        while ((not text) and (type(text)==str) and len(sbar_msg)):
            sbar_msg.pop()
            uikit.do(lambda:self.statusbar.pop(sbar_cid))
        # progressbar
        if (type(text)==float):
            if text >= 0.999 or text < 0.0:  # completed
                uikit.do(lambda:self.progress.hide())
            else:  # show percentage

                uikit.do(lambda:self.progress.show() or self.progress.set_fraction(text))
                if (text <= 0):  # unknown state
                    uikit.do(lambda:self.progress.pulse())
        # add text
        elif (type(text)==str):
            sbar_msg.append(1)
            uikit.do(lambda:self.statusbar.push(sbar_cid, text))
        pass


    # load plugins from /usr/share/streamtuner2/channels/
    def load_plugin_channels(self):

        # initialize plugin modules (pre-ordered)







|



|

>
|

|



|







359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
    # (hacked to work from within threads, circumvents the statusbar msg pool actually)
    def status(self, text="", sbar_msg=[]):
        # init
        sbar_cid = self.get_widget("statusbar").get_context_id("messages")
        # remove text
        while ((not text) and (type(text)==str) and len(sbar_msg)):
            sbar_msg.pop()
            uikit.do(self.statusbar.pop, sbar_cid, immediate=1)
        # progressbar
        if (type(text)==float):
            if text >= 0.999 or text < 0.0:  # completed
                uikit.do(self.progress.hide)
            else:  # show percentage
                uikit.do(self.progress.show, immediate=1)
                uikit.do(self.progress.set_fraction, text, immediate=1)
                if (text <= 0):  # unknown state
                    uikit.do(self.progress.pulse, immediate=1)
        # add text
        elif (type(text)==str):
            sbar_msg.append(1)
            uikit.do(self.statusbar.push, sbar_cid, text, immediate=1)
        pass


    # load plugins from /usr/share/streamtuner2/channels/
    def load_plugin_channels(self):

        # initialize plugin modules (pre-ordered)