streamtuner2: Check-in [8b13ba0189]
Internet radio browser GUI for music/video streams from various directory services.

⌈⌋ branch:  streamtuner2


Check-in [8b13ba0189]

Overview
Comment:Introduce statusbar_img and GenericChannel.warn() function; albeit it allows any stock icon to be used. (May introduce a generalized background/foreground color wrapping.)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:8b13ba0189ce6683669931a5975d8c3faa382230
User & Date: mario on 2017-01-03 20:11:34
Other Links: manifest | tags
Context
2017-01-05
21:20
Set `no-show-all` for statusbar_img to remain hidden on window init. check-in: 0698d339c3 user: mario tags: trunk
2017-01-03
20:11
Introduce statusbar_img and GenericChannel.warn() function; albeit it allows any stock icon to be used. (May introduce a generalized background/foreground color wrapping.) check-in: 8b13ba0189 user: mario tags: trunk
2017-01-02
20:48
Support for #depends: and #breaks:, and optionally bin:… and python:… checks. check-in: 87e5798b35 user: mario tags: trunk
Changes

Modified channels/__init__.py from [76451770e4] to [c58402c723].

195
196
197
198
199
200
201


202
203
204
205
206
207
208
        # no longer using `conf.show_favicons`


    # Statusbar stub (defers to parent/main window, if in GUI mode)
    def status(self, *args, **kw):
        if self.parent: self.parent.status(*args, **kw)
        else: log.INFO("status():", *v)




        
    #--------------------- streams/model data accesss ---------------------------


    # Traverse category TreeModel to set current, expand parent nodes







>
>







195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
        # no longer using `conf.show_favicons`


    # Statusbar stub (defers to parent/main window, if in GUI mode)
    def status(self, *args, **kw):
        if self.parent: self.parent.status(*args, **kw)
        else: log.INFO("status():", *v)
    def warn(self, *args, **kw):
        self.status(*args, icon="gtk-dialog-warning", **kw)


        
    #--------------------- streams/model data accesss ---------------------------


    # Traverse category TreeModel to set current, expand parent nodes

Modified gtk3.xml.gz from [2a1b78224d] to [306a27ebf6].

cannot compute difference between binary files

Modified st2.py from [84989b8129] to [ffaad9d3ab].

366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
...
382
383
384
385
386
387
388


389
390
391
392
393
394
395
396
397

398
399
400
401
402
403
404
...
521
522
523
524
525
526
527

528
529
530
531
532
533
534
    def switch_notebook_tabs_position(self, w, pos):
        self.notebook_channels.set_tab_pos(pos);




    # Shortcut to statusbar and progressbar (receives either a string, or a float).
    def status(self, text=None, timeout=3, markup=False):
        self.status_last = time.time() + timeout
        gobject.timeout_add(int(timeout*1000), self.status_clear)
        #log.UI("progressbar := %s" %text)
        # progressbar
        if isinstance(text, (int, float)):
            if (text <= 0):  # unknown state
                uikit.do(self.progress.pulse, immediate=1)
................................................................................
                uikit.do(self.progress.hide)
            else:  # show percentage
                uikit.do(self.progress.show, immediate=1)
                uikit.do(self.progress.set_fraction, text, immediate=1)
        # add text
        elif isinstance(text, (str, unicode)):
            uikit.do(self.statusbar.set_markup if markup else self.statusbar.set_text, text)


        # clean up
        else:
            self.status_clear(anyway=True)

    # Clean up after 3 seconds
    def status_clear(self, anyway=False):
        if anyway or time.time() >= self.status_last:
            #log.UI("progressbar.hide()")
            self.statusbar.set_text("")

            self.progress.hide()
            return False
        else:
            return True


    # load plugins from /usr/share/streamtuner2/channels/
................................................................................
        # prepare main window
        main = StreamTunerTwo()

        # first invocation
        if (conf.get("firstrun")):
            main.configwin.open(None)
            del conf.firstrun


        # run
        gtk.main()
        [callback() for callback in main.hooks["quit"]]
        log.PROC(r" gtk_main_quit ")
        
    # invoke command-line interface







|







 







>
>









>







 







>







366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
...
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
...
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
    def switch_notebook_tabs_position(self, w, pos):
        self.notebook_channels.set_tab_pos(pos);




    # Shortcut to statusbar and progressbar (receives either a string, or a float).
    def status(self, text=None, timeout=3, markup=False, icon=None, *k, **kw):
        self.status_last = time.time() + timeout
        gobject.timeout_add(int(timeout*1000), self.status_clear)
        #log.UI("progressbar := %s" %text)
        # progressbar
        if isinstance(text, (int, float)):
            if (text <= 0):  # unknown state
                uikit.do(self.progress.pulse, immediate=1)
................................................................................
                uikit.do(self.progress.hide)
            else:  # show percentage
                uikit.do(self.progress.show, immediate=1)
                uikit.do(self.progress.set_fraction, text, immediate=1)
        # add text
        elif isinstance(text, (str, unicode)):
            uikit.do(self.statusbar.set_markup if markup else self.statusbar.set_text, text)
            if icon:
                uikit.do(lambda icon=icon, *x: self.statusbar_img.show() or self.statusbar_img.set_from_stock(icon, 2))
        # clean up
        else:
            self.status_clear(anyway=True)

    # Clean up after 3 seconds
    def status_clear(self, anyway=False):
        if anyway or time.time() >= self.status_last:
            #log.UI("progressbar.hide()")
            self.statusbar.set_text("")
            self.statusbar_img.hide()
            self.progress.hide()
            return False
        else:
            return True


    # load plugins from /usr/share/streamtuner2/channels/
................................................................................
        # prepare main window
        main = StreamTunerTwo()

        # first invocation
        if (conf.get("firstrun")):
            main.configwin.open(None)
            del conf.firstrun
        main.status("Initial startup, configure your audio players!", timeout=10, icon="gtk-dialog-error")

        # run
        gtk.main()
        [callback() for callback in main.hooks["quit"]]
        log.PROC(r" gtk_main_quit ")
        
    # invoke command-line interface