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

⌈⌋ ⎇ branch:  streamtuner2


Check-in [b5a787d470]

Overview
Comment:Hopefully fix Gtk3 error by wrapping second set_current() call in uikit.do
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b5a787d470f50446d47df97ef204a920b0ac0c06
User & Date: mario on 2015-05-04 15:20:15
Other Links: manifest | tags
Context
2015-05-04
15:20
Shorter format option descriptions. check-in: f4887cae4e user: mario tags: trunk
15:20
Hopefully fix Gtk3 error by wrapping second set_current() call in uikit.do check-in: b5a787d470 user: mario tags: trunk
2015-05-03
20:26
Add some version: bumps and add a few versions to depends: references. check-in: beebec9c76 user: mario tags: trunk
Changes

Modified channels/__init__.py from [fcabfb47c7] to [704d24e7cb].

177
178
179
180
181
182
183


184
185
186
187
188
189
190
        
    #--------------------- streams/model data accesss ---------------------------

    # traverse category TreeModel to set current, expand parent nodes
    def select_current(self, name):
        log.UI("reselect .current category in treelist:", name)
        model = self.gtk_cat.get_model()


        iter = model.get_iter_first()
        self.iter_cats(name, model, iter)

    # iterate over children to find current category        
    def iter_cats(self, name, model, iter):
        while iter:
            val = model.get_value(iter, 0)







>
>







177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
        
    #--------------------- streams/model data accesss ---------------------------

    # traverse category TreeModel to set current, expand parent nodes
    def select_current(self, name):
        log.UI("reselect .current category in treelist:", name)
        model = self.gtk_cat.get_model()
           # [Gtk3] Warning: g_object_ref_sink: assertion 'object->ref_count >= 1' failed
           # ERROR:../../gi/pygobject.c:688:pygobject_register_wrapper: assertion failed: (gself->obj->ref_count >= 1)
        iter = model.get_iter_first()
        self.iter_cats(name, model, iter)

    # iterate over children to find current category        
    def iter_cats(self, name, model, iter):
        while iter:
            val = model.get_value(iter, 0)
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
        if not self.current:
            log.STAT(self.module, "→ first_show(); use first category as current =", self.current)
            self.current = self.str_from_struct(self.categories) or None

        # put selection/cursor on last position
        if True:
            uikit.do(self.select_current, self.current)
            #uikit.do(lambda:self.gtk_list.get_selection().select_path(self.shown))

        # Show current category in any case
        log.UI(self.module, "→ first_show(); station list → load(", self.current, ")")
        self.load(self.current)
            
        # Invoke only once
        self.shown = 55555







<







442
443
444
445
446
447
448

449
450
451
452
453
454
455
        if not self.current:
            log.STAT(self.module, "→ first_show(); use first category as current =", self.current)
            self.current = self.str_from_struct(self.categories) or None

        # put selection/cursor on last position
        if True:
            uikit.do(self.select_current, self.current)


        # Show current category in any case
        log.UI(self.module, "→ first_show(); station list → load(", self.current, ")")
        self.load(self.current)
            
        # Invoke only once
        self.shown = 55555
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501

        # if it's a short list of categories, there's probably subfolders
        if len(self.categories) < 20:
            self.gtk_cat.expand_all()
            
        # Select last .current or any first element
        if self.current:
            self.select_current(self.current)
            #self.currentcat()
        #else: self.gtk_cat.get_selection().select_path("0") #set_cursor

            

    
    # Insert/append new station rows - used by importing/drag'n'drop plugins







|







488
489
490
491
492
493
494
495
496
497
498
499
500
501
502

        # if it's a short list of categories, there's probably subfolders
        if len(self.categories) < 20:
            self.gtk_cat.expand_all()
            
        # Select last .current or any first element
        if self.current:
            uikit.do(self.select_current, self.current)
            #self.currentcat()
        #else: self.gtk_cat.get_selection().select_path("0") #set_cursor

            

    
    # Insert/append new station rows - used by importing/drag'n'drop plugins