Changeset 46 for conseil.py

Show
Ignore:
Timestamp:
07/21/06 11:14:01 (2 years ago)
Author:
ploum
Message:

Statusbar now displays the number of results.
Warning : staging.launchpad has changed and protocol is no more compatible

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • conseil.py

    r42 r46  
    3131                self.wTree = gtk.glade.XML("conseil.glade") 
    3232                self.bugs_tabs= self.wTree.get_widget("bugs_tabs") 
     33                self.statusbar = self.wTree.get_widget("statusbar") 
    3334                #hpane = self.wTree.get_widget("hpaned1") 
    3435                #hpane.set_property("min-position", 100) 
     
    4546                        "on_quitter1_activate": gtk.main_quit, 
    4647                        "on_importer_activate" : self.import_bookmarks,  
    47                         "on_ouvrir1_activate" : self.open_bookmarks } 
     48                        "on_ouvrir1_activate" : self.open_bookmarks, 
     49                        "on_bugs_tabs_switch_page" : self.switch_page } 
    4850                self.wTree.signal_autoconnect(dic) 
    4951                #self.sidebar_bm.connect("button_press_event", self.bookmarks_button_press) 
     
    6971                except: 
    7072                        return 0 
     73 
     74        def switch_page(self,notebook,pointer,position) : 
     75                widget = notebook.get_nth_page(position) 
     76                descr = tab_descr(widget) 
     77                title = read_title(descr) 
     78                zetype = read_type(descr) 
     79                if zetype == 2 or zetype == 3 : 
     80                        try : 
     81                                ztree = widget.get_children() 
     82                                model= ztree[0].get_model() 
     83                                total = str(model.iter_n_children(None)) 
     84                                title = "search for %s  - (%s results)" %(title,total) 
     85                        #eek.. this is ugly, isn't it ? 
     86                        except : 
     87                                title = "%s" %title 
     88                self.statusbar.pop(0) 
     89                self.statusbar.push(0,title) 
    7190 
    7291        #bookmark is edited