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

⌈⌋ ⎇ branch:  streamtuner2


Check-in [8b187d699a]

Overview
Comment:Return ListStore, rowmap and pix_entry from uikit.columns()
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 8b187d699a26b55a6e871bc8f09ea8103407f77b
User & Date: mario on 2015-05-09 21:36:38
Other Links: manifest | tags
Context
2015-05-09
21:36
Minor typo fixes. check-in: d1befc2a99 user: mario tags: trunk
21:36
Return ListStore, rowmap and pix_entry from uikit.columns() check-in: 8b187d699a user: mario tags: trunk
2015-05-08
11:05
Crash in search module again. Seemingly fixed it for threaded mode by preupdating the bookmarks.streams{search} result store before switching tabs. check-in: e6dd4c5376 user: mario tags: trunk
Changes

Modified uikit.py from [1f0ba0b7e4] to [9362b926ba].

82
83
84
85
86
87
88
89

90
91
92
93
94
95
96
82
83
84
85
86
87
88

89
90
91
92
93
94
95
96







-
+







    #
    # An according entries list then would contain a dictionary for each row:
    #   entries = [ {"titlerow":"first", "interndat":123}, {"titlerow":"..."}, ]
    # Keys not mentioned in the datamap get ignored, and defaults are applied
    # for missing cols. All values must already be in the correct type however.
    #
    @staticmethod
    def columns(widget, datamap=[], entries=None, pix_entry=False, typecast=0):
    def columns(widget, datamap=[], entries=None, pix_entry=False):

        # create treeviewcolumns?
        if (not widget.get_column(0)):
            # loop through titles
            datapos = 0
            for n_col,desc in enumerate(datamap):
                                
144
145
146
147
148
149
150
151
152
153
154
155




156
157
158
159
160
161
162
144
145
146
147
148
149
150





151
152
153
154
155
156
157
158
159
160
161







-
-
-
-
-
+
+
+
+







            #widget.set_reorderable(True)
           
        # add data?
        if (entries is not None):
            #- expand datamap
            vartypes = []  #(str, str, bool, str, int, int, gtk.gdk.Pixbuf, str, int)
            rowmap = []    #["title", "desc", "bookmarked", "name", "count", "max", "img", ...]
            if (not rowmap):
                for desc in datamap:
                    for var in xrange(2, len(desc)):
                        vartypes.append(desc[var][1])  # content types
                        rowmap.append(desc[var][0])    # dict{} column keys in entries[] list
            for desc in datamap:
                for var in xrange(2, len(desc)):
                    vartypes.append(desc[var][1])  # content types
                    rowmap.append(desc[var][0])    # dict{} column keys in entries[] list
            # create gtk array storage
            ls = gtk.ListStore(*vartypes)   # could be a TreeStore, too
            #log.UI(vartypes, len(vartypes))
            #log.DATA(rowmap, len(rowmap))
 
            # prepare for missing values, and special variable types
            defaults = {
202
203
204
205
206
207
208
209

210
211
212
213
214
215
216
201
202
203
204
205
206
207

208
209
210
211
212
213
214
215







-
+







                    ls.append( [va  if ty==gtk.gdk.Pixbuf  else ty(va)   for va,ty in zip(row,vartypes)]  )

            #if entries:
            #     log.ROWS(row, len(row))
            
            # apply array to widget
            widget.set_model(ls)
            return ls
            return ls, rowmap, pix_entry
            
        pass




    #-- treeview for categories