Ticket #1388: sugar-1388.patch

File sugar-1388.patch, 1.8 KB (added by alsroot, 14 years ago)
  • src/jarabe/journal/listview.py

    From a9eb591c307a4d346658f85c5f601c9c149c7653 Mon Sep 17 00:00:00 2001
    From: Aleksey Lim <alsroot@member.fsf.org>
    Date: Sat, 19 Sep 2009 23:01:32 +0000
    Subject: Invisible downlading progress bar in Journal #1388
    
    ---
     src/jarabe/journal/listview.py |   15 +++++++++++++++
     1 files changed, 15 insertions(+), 0 deletions(-)
    
    diff --git a/src/jarabe/journal/listview.py b/src/jarabe/journal/listview.py
    index 7189fc6..adc1d58 100644
    a b class BaseListView(gtk.Bin): 
    170170            buddies_column.pack_start(cell_icon)
    171171            buddies_column.props.fixed_width += cell_icon.props.width
    172172            buddies_column.add_attribute(cell_icon, 'buddy', column_index)
     173            buddies_column.set_cell_data_func(cell_icon,
     174                    self.__buddies_set_data_cb, lambda x: x >= 100)
     175
     176        cell_progress = gtk.CellRendererProgress()
     177        cell_progress.props.ypad = style.GRID_CELL_SIZE / 4
     178        buddies_column.pack_start(cell_progress)
     179        buddies_column.add_attribute(cell_progress, 'value',
     180                ListModel.COLUMN_PROGRESS)
     181        buddies_column.set_cell_data_func(cell_progress,
     182                self.__buddies_set_data_cb, lambda x: x < 100)
    173183
    174184        cell_text = gtk.CellRendererText()
    175185        cell_text.props.xalign = 1
    class BaseListView(gtk.Bin): 
    212222        if self._model is not None:
    213223            self._model.stop()
    214224
     225    def __buddies_set_data_cb(self, column, cell, tree_model, tree_iter,
     226            get_visible):
     227        progress = tree_model[tree_iter][ListModel.COLUMN_PROGRESS]
     228        cell.props.visible = get_visible(progress)
     229
    215230    def __favorite_set_data_cb(self, column, cell, tree_model, tree_iter):
    216231        favorite = tree_model[tree_iter][ListModel.COLUMN_FAVORITE]
    217232        if favorite: