Commit 8455a0fa authored by Philipp Hörist's avatar Philipp Hörist

Fix filetransfer tooltip

parent 53d6b1dc
...@@ -563,8 +563,7 @@ class FileTransfersTooltip(): ...@@ -563,8 +563,7 @@ class FileTransfersTooltip():
self.sid = sid self.sid = sid
return False, self.widget return False, self.widget
@staticmethod def _create_tooltip(self, file_props, _sid):
def _create_tooltip(file_props, _sid):
ft_table = Gtk.Table(2, 1) ft_table = Gtk.Table(2, 1)
ft_table.set_property('column-spacing', 2) ft_table.set_property('column-spacing', 2)
current_row = 1 current_row = 1
...@@ -596,26 +595,7 @@ class FileTransfersTooltip(): ...@@ -596,26 +595,7 @@ class FileTransfersTooltip():
if not transfered_len: if not transfered_len:
transfered_len = 0 transfered_len = 0
properties.append((_('Transferred: '), helpers.convert_bytes(transfered_len))) properties.append((_('Transferred: '), helpers.convert_bytes(transfered_len)))
status = '' status = self._get_current_status(file_props)
if file_props.started:
status = _('Not started')
if file_props.stopped:
status = _('Stopped')
elif file_props.completed:
status = _('Completed')
elif not file_props.connected:
if file_props.completed:
status = _('Completed')
else:
if file_props.paused:
status = Q_('?transfer status:Paused')
elif file_props.stalled:
# stalled is not paused. it is like 'frozen' it stopped alone
status = _('Stalled')
else:
status = _('Transferring')
else:
status = _('Not started')
properties.append((_('Status: '), status)) properties.append((_('Status: '), status))
file_desc = file_props.desc or '' file_desc = file_props.desc or ''
properties.append((_('Description: '), GLib.markup_escape_text( properties.append((_('Description: '), GLib.markup_escape_text(
...@@ -643,6 +623,24 @@ class FileTransfersTooltip(): ...@@ -643,6 +623,24 @@ class FileTransfersTooltip():
ft_table.show_all() ft_table.show_all()
return ft_table return ft_table
@staticmethod
def _get_current_status(file_props):
if file_props.stopped:
return _('Aborted')
if file_props.completed:
return _('Completed')
if file_props.paused:
return Q_('?transfer status:Paused')
if file_props.stalled:
# stalled is not paused. it is like 'frozen' it stopped alone
return _('Stalled')
if file_props.connected:
if file_props.started:
return _('Transferring')
return _('Not started')
return _('Not started')
def colorize_status(status): def colorize_status(status):
""" """
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment