ui improvements and bug fix

This commit is contained in:
ingvar1995 2016-03-22 21:00:42 +03:00
parent 4c1a02c9a3
commit f7969f8381
6 changed files with 12 additions and 6 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 469 B

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
src/images/call.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -227,7 +227,7 @@ class FileTransferItem(QtGui.QListWidget):
def cancel_transfer(self, friend_number, file_number): def cancel_transfer(self, friend_number, file_number):
pr = profile.Profile.get_instance() pr = profile.Profile.get_instance()
pr.cancel_transfer(friend_number, file_number) pr.cancel_transfer(friend_number, file_number)
self.setStyleSheet('QListWidget { background-color: red; }') self.setStyleSheet('QListWidget { background-color: #B40404; }')
self.cancel.setVisible(False) self.cancel.setVisible(False)
self.accept.setVisible(False) self.accept.setVisible(False)
self.pb.setVisible(False) self.pb.setVisible(False)
@ -243,7 +243,7 @@ class FileTransferItem(QtGui.QListWidget):
def update(self, state, progress): def update(self, state, progress):
self.pb.setValue(int(progress * 100)) self.pb.setValue(int(progress * 100))
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: #B40404; }')
self.cancel.setVisible(False) self.cancel.setVisible(False)
self.accept.setVisible(False) self.accept.setVisible(False)
self.pb.setVisible(False) self.pb.setVisible(False)

View file

@ -190,9 +190,12 @@ class MainWindow(QtGui.QMainWindow):
self.account_status.setFont(font) self.account_status.setFont(font)
self.account_status.setObjectName("account_status") self.account_status.setObjectName("account_status")
self.callButton = QtGui.QPushButton(Form) self.callButton = QtGui.QPushButton(Form)
self.callButton.setGeometry(QtCore.QRect(550, 30, 75, 30)) self.callButton.setGeometry(QtCore.QRect(550, 30, 50, 50))
self.callButton.setObjectName("callButton") self.callButton.setObjectName("callButton")
self.callButton.setText(QtGui.QApplication.translate("Form", "Start call", None, QtGui.QApplication.UnicodeUTF8)) pixmap = QtGui.QPixmap(curr_directory() + '/images/call.png')
icon = QtGui.QIcon(pixmap)
self.callButton.setIcon(icon)
self.callButton.setIconSize(QtCore.QSize(50, 50))
QtCore.QMetaObject.connectSlotsByName(Form) QtCore.QMetaObject.connectSlotsByName(Form)
def setup_left_center(self, widget): def setup_left_center(self, widget):

View file

@ -733,8 +733,8 @@ class Profile(Contact, Singleton):
friend = self.get_friend_by_number(friend_number) friend = self.get_friend_by_number(friend_number)
if settings['allow_auto_accept'] and friend.tox_id in settings['auto_accept_from_friends']: if settings['allow_auto_accept'] and friend.tox_id in settings['auto_accept_from_friends']:
path = settings['auto_accept_path'] or curr_directory() path = settings['auto_accept_path'] or curr_directory()
self.accept_transfer(path + '/' + file_name.decode('utf-8'), friend_number, file_number) item = self.create_file_transfer_item(file_name.decode('utf-8'), size, friend_number, file_number, False)
self.create_file_transfer_item(file_name.decode('utf-8'), size, friend_number, file_number, False) self.accept_transfer(item, path + '/' + file_name.decode('utf-8'), friend_number, file_number)
else: else:
self.create_file_transfer_item(file_name.decode('utf-8'), size, friend_number, file_number, True) self.create_file_transfer_item(file_name.decode('utf-8'), size, friend_number, file_number, True)
@ -743,6 +743,8 @@ class Profile(Contact, Singleton):
tr = self._file_transfers[(friend_number, file_number)] tr = self._file_transfers[(friend_number, file_number)]
tr.cancel() tr.cancel()
del self._file_transfers[(friend_number, file_number)] del self._file_transfers[(friend_number, file_number)]
else:
self._tox.file_control(friend_number, file_number, TOX_FILE_CONTROL['CANCEL'])
def accept_transfer(self, item, path, friend_number, file_number, size): def accept_transfer(self, item, path, friend_number, file_number, size):
rt = ReceiveTransfer(path, self._tox, friend_number, size, file_number) rt = ReceiveTransfer(path, self._tox, friend_number, size, file_number)

View file

@ -1244,4 +1244,5 @@ MessageEdit:hover
QListWidget QPushButton QListWidget QPushButton
{ {
background-color: transparent; background-color: transparent;
border: none;
} }