accept and decline images

This commit is contained in:
ingvar1995 2016-03-21 17:37:56 +03:00
parent 75225e5b34
commit 61d4a28d6b
4 changed files with 14 additions and 4 deletions

View File

@ -161,11 +161,15 @@ def tox_file_recv(window, tray):
def file_recv_chunk(tox, friend_number, file_number, position, chunk, length, user_data): def file_recv_chunk(tox, friend_number, file_number, position, chunk, length, user_data):
Profile.get_instance().incoming_chunk(friend_number, file_number, position, chunk[:length] if length else None) invoke_in_main_thread(Profile.get_instance().incoming_chunk,
friend_number,
file_number,
position,
chunk[:length] if length else None)
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):
Profile.get_instance().outgoing_chunk( invoke_in_main_thread(Profile.get_instance().outgoing_chunk,
friend_number, friend_number,
file_number, file_number,
position, position,

BIN
src/images/accept.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 B

BIN
src/images/decline.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -188,12 +188,18 @@ class FileTransferItem(QtGui.QListWidget):
self.cancel = QtGui.QPushButton(self) self.cancel = QtGui.QPushButton(self)
self.cancel.setGeometry(QtCore.QRect(500, 0, 50, 50)) self.cancel.setGeometry(QtCore.QRect(500, 0, 50, 50))
self.cancel.setText("Cancel") pixmap = QtGui.QPixmap(curr_directory() + '/images/decline.png')
icon = QtGui.QIcon(pixmap)
self.cancel.setIcon(icon)
self.cancel.setIconSize(QtCore.QSize(50, 50))
self.cancel.clicked.connect(lambda: self.cancel_transfer(friend_number, file_number)) self.cancel.clicked.connect(lambda: self.cancel_transfer(friend_number, file_number))
self.accept = QtGui.QPushButton(self) self.accept = QtGui.QPushButton(self)
self.accept.setGeometry(QtCore.QRect(450, 0, 50, 50)) self.accept.setGeometry(QtCore.QRect(450, 0, 50, 50))
self.accept.setText("Accept") pixmap = QtGui.QPixmap(curr_directory() + '/images/accept.png')
icon = QtGui.QIcon(pixmap)
self.accept.setIcon(icon)
self.accept.setIconSize(QtCore.QSize(50, 50))
self.accept.clicked.connect(lambda: self.accept_transfer(friend_number, file_number)) self.accept.clicked.connect(lambda: self.accept_transfer(friend_number, file_number))
self.accept.setVisible(is_incoming_transfer) self.accept.setVisible(is_incoming_transfer)