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

⌈⌋ ⎇ branch:  streamtuner2


Diff

Differences From Artifact [14781849fd]:

To Artifact [025a11079e]:


281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
            if t == gtk.TreeView:
                r[wn]["columns:width"] = []
                for col in w.get_columns():
                    r[wn]["columns:width"].append( col.get_width() )
                # - Rows
                r[wn]["rows:expanded"] = []
                for i in xrange(0,50):
                    if w.row_expanded(str(i)):
                        r[wn]["rows:expanded"].append(i)
                # - selected
                (model, paths) = w.get_selection().get_selected_rows()
                if paths:
                    r[wn]["row:selected"] = paths[0]
            # gtk.Toolbar
            if t == gtk.Toolbar:
                r[wn]["icon_size"] = int(w.get_icon_size())
                r[wn]["style"] = int(w.get_style())
            # gtk.Notebook
            if t == gtk.Notebook:
                r[wn]["tab_pos"] = int(w.get_tab_pos())







|




|







281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
            if t == gtk.TreeView:
                r[wn]["columns:width"] = []
                for col in w.get_columns():
                    r[wn]["columns:width"].append( col.get_width() )
                # - Rows
                r[wn]["rows:expanded"] = []
                for i in xrange(0,50):
                    if w.row_expanded(treepath(i)):   # Gtk.TreePath for Gtk3
                        r[wn]["rows:expanded"].append(i)
                # - selected
                (model, paths) = w.get_selection().get_selected_rows()
                if paths:
                    r[wn]["row:selected"] = treepath_to_str(paths[0])
            # gtk.Toolbar
            if t == gtk.Toolbar:
                r[wn]["icon_size"] = int(w.get_icon_size())
                r[wn]["style"] = int(w.get_style())
            # gtk.Notebook
            if t == gtk.Notebook:
                r[wn]["tab_pos"] = int(w.get_tab_pos())
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
                    for i,col in enumerate(w.get_columns()):
                        if (i < len(args)):
                            col.set_fixed_width(args[i])
                #  - Rows
                if method == "rows:expanded":
                    w.collapse_all()
                    for i in args:
                        w.expand_row(str(i), False)                        
                #  - selected
                if method == "row:selected":
                    w.get_selection().select_path(tuple(args))
                # gtk.Toolbar
                if method == "icon_size":
                    w.set_icon_size(args)
                if method == "style":
                    w.set_style(args)
                # gtk.Notebook
                if method == "tab_pos":







|


|







326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
                    for i,col in enumerate(w.get_columns()):
                        if (i < len(args)):
                            col.set_fixed_width(args[i])
                #  - Rows
                if method == "rows:expanded":
                    w.collapse_all()
                    for i in args:
                        w.expand_row(treepath(i), False)
                #  - selected
                if method == "row:selected":
                    w.get_selection().select_path(treepath(args))
                # gtk.Toolbar
                if method == "icon_size":
                    w.set_icon_size(args)
                if method == "style":
                    w.set_style(args)
                # gtk.Notebook
                if method == "tab_pos":
511
512
513
514
515
516
517





















518
519
520
521
522
523
524
# Transparent png            
empty_pixbuf = uikit.pixbuf(
    """iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAA
    B6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/wD/AP+gvaeTAAAAB3RJTUU
    H3wQLEAE6zgxuGAAAABFJREFUOBFjGAWjYBSMAigAAAQQAAFWMn04AAAAAElFTkSuQmCC"""
)























# Text-only dropdown list.
#
# Necessary because gtk.ComboBoxText binding is absent in debian packages
# https://bugzilla.gnome.org/show_bug.cgi?id=660659
#
# This one implements a convenience method `.set_default()` to define the active







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
# Transparent png            
empty_pixbuf = uikit.pixbuf(
    """iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAA
    B6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/wD/AP+gvaeTAAAAB3RJTUU
    H3wQLEAE6zgxuGAAAABFJREFUOBFjGAWjYBSMAigAAAQQAAFWMn04AAAAAElFTkSuQmCC"""
)



#-- Gtk3 wrappers

# Use a str of "1:2:3" as treepath,
# literally in Gtk2, TreePath-wrapped for Gtk3
def treepath(ls):
    if isinstance(ls, (list,tuple)):
        ls = ls[0]
    if ver==2:
        return str(ls)
    else:
        return gtk.TreePath.new_from_string(str(ls))
#
def treepath_to_str(tp):
    if ver==2:
        return tp
    else:
        return tp.to_string()
        


# Text-only dropdown list.
#
# Necessary because gtk.ComboBoxText binding is absent in debian packages
# https://bugzilla.gnome.org/show_bug.cgi?id=660659
#
# This one implements a convenience method `.set_default()` to define the active