updated buttons in FT window when selected row status changes. fixes #2785
This commit is contained in:
parent
230a77ba94
commit
867abb8677
|
@ -399,6 +399,8 @@ _('Connection with peer cannot be established.'))
|
|||
elif status == 'ok':
|
||||
file_props['completed'] = True
|
||||
self.model.set(iter, C_IMAGE, self.images[status])
|
||||
path = self.model.get_path(iter)
|
||||
self.select_func(path)
|
||||
|
||||
def _format_percent(self, percent):
|
||||
''' add extra spaces from both sides of the percent, so that
|
||||
|
@ -475,6 +477,9 @@ _('Connection with peer cannot be established.'))
|
|||
if iter is None:
|
||||
iter = self.get_iter_by_sid(typ, sid)
|
||||
if iter is not None:
|
||||
just_began = False
|
||||
if self.model[iter][C_PERCENT] == 0 and int(percent > 0):
|
||||
just_began = True
|
||||
text = self._format_percent(percent)
|
||||
if transfered_size == 0:
|
||||
text += '0'
|
||||
|
@ -515,6 +520,9 @@ _('Connection with peer cannot be established.'))
|
|||
self.model.set(iter, 0, self.images[status])
|
||||
if transfered_size == full_size:
|
||||
self.set_status(typ, sid, 'ok')
|
||||
elif just_began:
|
||||
path = self.model.get_path(iter)
|
||||
self.select_func(path)
|
||||
|
||||
def get_iter_by_sid(self, typ, sid):
|
||||
'''returns iter to the row, which holds file transfer, identified by the
|
||||
|
|
Loading…
Reference in New Issue