sending fix
This commit is contained in:
parent
bfbc82a9a3
commit
1897fa762a
3 changed files with 2 additions and 7 deletions
|
@ -169,7 +169,7 @@ def file_recv_chunk(tox, friend_number, file_number, position, chunk, length, us
|
||||||
|
|
||||||
|
|
||||||
def file_chunk_request(tox, friend_number, file_number, position, size, user_data):
|
def file_chunk_request(tox, friend_number, file_number, position, size, user_data):
|
||||||
invoke_in_main_thread(Profile.get_instance().outgoing_chunk,
|
Profile.get_instance().outgoing_chunk(
|
||||||
friend_number,
|
friend_number,
|
||||||
file_number,
|
file_number,
|
||||||
position,
|
position,
|
||||||
|
|
|
@ -79,10 +79,7 @@ class SendTransfer(FileTransfer):
|
||||||
if size:
|
if size:
|
||||||
self._file.seek(position)
|
self._file.seek(position)
|
||||||
data = self._file.read(size)
|
data = self._file.read(size)
|
||||||
try:
|
self._tox.file_send_chunk(self._friend_number, self._file_number, position, data)
|
||||||
self._tox.file_send_chunk(self._friend_number, self._file_number, position, data)
|
|
||||||
except:
|
|
||||||
print self._friend_number, self._file_number, position, data
|
|
||||||
self._done += size
|
self._done += size
|
||||||
self._state_changed.signal.emit(self.state, self._done / self._size)
|
self._state_changed.signal.emit(self.state, self._done / self._size)
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -241,8 +241,6 @@ class FileTransferItem(QtGui.QListWidget):
|
||||||
@QtCore.Slot(int, float)
|
@QtCore.Slot(int, float)
|
||||||
def update(self, state, progress):
|
def update(self, state, progress):
|
||||||
self.pb.setValue(int(progress * 100))
|
self.pb.setValue(int(progress * 100))
|
||||||
#self.pb.repaint()
|
|
||||||
print state, progress
|
|
||||||
if state == TOX_FILE_TRANSFER_STATE['CANCELED']:
|
if state == TOX_FILE_TRANSFER_STATE['CANCELED']:
|
||||||
self.setStyleSheet('QListWidget { background-color: red; }')
|
self.setStyleSheet('QListWidget { background-color: red; }')
|
||||||
self.cancel.setVisible(False)
|
self.cancel.setVisible(False)
|
||||||
|
|
Loading…
Reference in a new issue