stoped -> stopped
This commit is contained in:
parent
88cd5c3a50
commit
34f04c69b7
|
@ -60,7 +60,7 @@ class ConnectionBytestream:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.files_props = {}
|
self.files_props = {}
|
||||||
|
|
||||||
def is_transfer_stoped(self, file_props):
|
def is_transfer_stopped(self, file_props):
|
||||||
if file_props.has_key('error') and file_props['error'] != 0:
|
if file_props.has_key('error') and file_props['error'] != 0:
|
||||||
return True
|
return True
|
||||||
if file_props.has_key('completed') and file_props['completed']:
|
if file_props.has_key('completed') and file_props['completed']:
|
||||||
|
@ -89,7 +89,7 @@ class ConnectionBytestream:
|
||||||
def remove_transfers_for_contact(self, contact):
|
def remove_transfers_for_contact(self, contact):
|
||||||
''' stop all active transfer for contact '''
|
''' stop all active transfer for contact '''
|
||||||
for file_props in self.files_props.values():
|
for file_props in self.files_props.values():
|
||||||
if self.is_transfer_stoped(file_props):
|
if self.is_transfer_stopped(file_props):
|
||||||
continue
|
continue
|
||||||
receiver_jid = unicode(file_props['receiver']).split('/')[0]
|
receiver_jid = unicode(file_props['receiver']).split('/')[0]
|
||||||
if contact.jid == receiver_jid:
|
if contact.jid == receiver_jid:
|
||||||
|
|
|
@ -140,7 +140,7 @@ class ConnectionBytestream:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.files_props = {}
|
self.files_props = {}
|
||||||
|
|
||||||
def is_transfer_stoped(self, file_props):
|
def is_transfer_stopped(self, file_props):
|
||||||
if file_props.has_key('error') and file_props['error'] != 0:
|
if file_props.has_key('error') and file_props['error'] != 0:
|
||||||
return True
|
return True
|
||||||
if file_props.has_key('completed') and file_props['completed']:
|
if file_props.has_key('completed') and file_props['completed']:
|
||||||
|
@ -169,7 +169,7 @@ class ConnectionBytestream:
|
||||||
def remove_transfers_for_contact(self, contact):
|
def remove_transfers_for_contact(self, contact):
|
||||||
''' stop all active transfer for contact '''
|
''' stop all active transfer for contact '''
|
||||||
for file_props in self.files_props.values():
|
for file_props in self.files_props.values():
|
||||||
if self.is_transfer_stoped(file_props):
|
if self.is_transfer_stopped(file_props):
|
||||||
continue
|
continue
|
||||||
receiver_jid = unicode(file_props['receiver']).split('/')[0]
|
receiver_jid = unicode(file_props['receiver']).split('/')[0]
|
||||||
if contact.jid == receiver_jid:
|
if contact.jid == receiver_jid:
|
||||||
|
|
|
@ -128,7 +128,7 @@ class FileTransfersWindow:
|
||||||
if file_props['tt_account'] == account:
|
if file_props['tt_account'] == account:
|
||||||
receiver_jid = unicode(file_props['receiver']).split('/')[0]
|
receiver_jid = unicode(file_props['receiver']).split('/')[0]
|
||||||
if jid == receiver_jid:
|
if jid == receiver_jid:
|
||||||
if not self.is_transfer_stoped(file_props):
|
if not self.is_transfer_stopped(file_props):
|
||||||
active_transfers[0].append(file_props)
|
active_transfers[0].append(file_props)
|
||||||
|
|
||||||
# 'account' is the recipient
|
# 'account' is the recipient
|
||||||
|
@ -136,7 +136,7 @@ class FileTransfersWindow:
|
||||||
if file_props['tt_account'] == account:
|
if file_props['tt_account'] == account:
|
||||||
sender_jid = unicode(file_props['sender']).split('/')[0]
|
sender_jid = unicode(file_props['sender']).split('/')[0]
|
||||||
if jid == sender_jid:
|
if jid == sender_jid:
|
||||||
if not self.is_transfer_stoped(file_props):
|
if not self.is_transfer_stopped(file_props):
|
||||||
active_transfers[1].append(file_props)
|
active_transfers[1].append(file_props)
|
||||||
return active_transfers
|
return active_transfers
|
||||||
|
|
||||||
|
@ -654,7 +654,7 @@ _('Connection with peer cannot be established.'))
|
||||||
return True
|
return True
|
||||||
return not file_props['paused']
|
return not file_props['paused']
|
||||||
|
|
||||||
def is_transfer_stoped(self, file_props):
|
def is_transfer_stopped(self, file_props):
|
||||||
if file_props.has_key('error') and file_props['error'] != 0:
|
if file_props.has_key('error') and file_props['error'] != 0:
|
||||||
return True
|
return True
|
||||||
if file_props.has_key('completed') and file_props['completed']:
|
if file_props.has_key('completed') and file_props['completed']:
|
||||||
|
@ -696,7 +696,7 @@ _('Connection with peer cannot be established.'))
|
||||||
self.remove_menuitem.set_sensitive(is_row_selected)
|
self.remove_menuitem.set_sensitive(is_row_selected)
|
||||||
self.open_folder_menuitem.set_sensitive(is_row_selected)
|
self.open_folder_menuitem.set_sensitive(is_row_selected)
|
||||||
is_stopped = False
|
is_stopped = False
|
||||||
if self.is_transfer_stoped(file_props):
|
if self.is_transfer_stopped(file_props):
|
||||||
is_stopped = True
|
is_stopped = True
|
||||||
self.cancel_button.set_sensitive(not is_stopped)
|
self.cancel_button.set_sensitive(not is_stopped)
|
||||||
self.cancel_menuitem.set_sensitive(not is_stopped)
|
self.cancel_menuitem.set_sensitive(not is_stopped)
|
||||||
|
@ -750,7 +750,7 @@ _('Connection with peer cannot be established.'))
|
||||||
iter = self.model.get_iter((i))
|
iter = self.model.get_iter((i))
|
||||||
sid = self.model[iter][C_SID].decode('utf-8')
|
sid = self.model[iter][C_SID].decode('utf-8')
|
||||||
file_props = self.files_props[sid[0]][sid[1:]]
|
file_props = self.files_props[sid[0]][sid[1:]]
|
||||||
if self.is_transfer_stoped(file_props):
|
if self.is_transfer_stopped(file_props):
|
||||||
self._remove_transfer(iter, sid, file_props)
|
self._remove_transfer(iter, sid, file_props)
|
||||||
i -= 1
|
i -= 1
|
||||||
self.tree.get_selection().unselect_all()
|
self.tree.get_selection().unselect_all()
|
||||||
|
|
Loading…
Reference in New Issue