bug fixes
This commit is contained in:
parent
1caf7cd63c
commit
43d9a41dae
2 changed files with 7 additions and 3 deletions
|
@ -78,8 +78,9 @@ class FileTransfer(QtCore.QObject):
|
||||||
t = ((time() - self._creation_time) / percentage) * (1 - percentage)
|
t = ((time() - self._creation_time) / percentage) * (1 - percentage)
|
||||||
self._state_changed.signal.emit(self.state, percentage, int(t))
|
self._state_changed.signal.emit(self.state, percentage, int(t))
|
||||||
|
|
||||||
def finished(self):
|
def finished(self, emit=False):
|
||||||
self._finished.signal.emit(self._friend_number, self._file_number)
|
if type(self) is not ReceiveAvatar or emit:
|
||||||
|
self._finished.signal.emit(self._friend_number, self._file_number)
|
||||||
|
|
||||||
def get_file_number(self):
|
def get_file_number(self):
|
||||||
return self._file_number
|
return self._file_number
|
||||||
|
@ -340,3 +341,4 @@ class ReceiveAvatar(ReceiveTransfer):
|
||||||
chdir(dirname(avatar_path))
|
chdir(dirname(avatar_path))
|
||||||
remove(avatar_path)
|
remove(avatar_path)
|
||||||
rename(self._path, avatar_path)
|
rename(self._path, avatar_path)
|
||||||
|
self.finished(True)
|
||||||
|
|
|
@ -1100,7 +1100,8 @@ class Profile(contact.Contact, Singleton):
|
||||||
t = type(transfer)
|
t = type(transfer)
|
||||||
if t is ReceiveAvatar:
|
if t is ReceiveAvatar:
|
||||||
self.get_friend_by_number(friend_number).load_avatar()
|
self.get_friend_by_number(friend_number).load_avatar()
|
||||||
self.set_active(None)
|
if friend_number == self.get_active_number():
|
||||||
|
self.set_active(None)
|
||||||
elif t is ReceiveToBuffer or (t is SendFromBuffer and Settings.get_instance()['allow_inline']): # inline image
|
elif t is ReceiveToBuffer or (t is SendFromBuffer and Settings.get_instance()['allow_inline']): # inline image
|
||||||
print('inline')
|
print('inline')
|
||||||
inline = InlineImage(transfer.get_data())
|
inline = InlineImage(transfer.get_data())
|
||||||
|
@ -1115,6 +1116,7 @@ class Profile(contact.Contact, Singleton):
|
||||||
elem.setSizeHint(QtCore.QSize(self._messages.width(), item.height()))
|
elem.setSizeHint(QtCore.QSize(self._messages.width(), item.height()))
|
||||||
self._messages.insertItem(count + i + 1, elem)
|
self._messages.insertItem(count + i + 1, elem)
|
||||||
self._messages.setItemWidget(elem, item)
|
self._messages.setItemWidget(elem, item)
|
||||||
|
self._messages.scrollToBottom()
|
||||||
elif t is not SendAvatar:
|
elif t is not SendAvatar:
|
||||||
self.get_friend_by_number(friend_number).update_transfer_data(file_number,
|
self.get_friend_by_number(friend_number).update_transfer_data(file_number,
|
||||||
TOX_FILE_TRANSFER_STATE['FINISHED'])
|
TOX_FILE_TRANSFER_STATE['FINISHED'])
|
||||||
|
|
Loading…
Reference in a new issue