Commit ed7aaf8d authored by Dan Pascu's avatar Dan Pascu

Allow incoming file transfer dialogs to be ignored by pressing Esc

parent 53211ad7
...@@ -4751,6 +4751,8 @@ class IncomingFileTransferDialog(base_class, ui_class): ...@@ -4751,6 +4751,8 @@ class IncomingFileTransferDialog(base_class, ui_class):
font.setPointSizeF(self.uri_label.fontInfo().pointSizeF() - 1) font.setPointSizeF(self.uri_label.fontInfo().pointSizeF() - 1)
self.file_label.setFont(font) self.file_label.setFont(font)
self.position = None self.position = None
self.reject_mode = 'ignore'
self.reject_button.released.connect(self._set_reject_mode)
def show(self, activate=True, position=1): def show(self, activate=True, position=1):
blink = QApplication.instance() blink = QApplication.instance()
...@@ -4780,6 +4782,9 @@ class IncomingFileTransferDialog(base_class, ui_class): ...@@ -4780,6 +4782,9 @@ class IncomingFileTransferDialog(base_class, ui_class):
self.setAttribute(Qt.WA_ShowWithoutActivating, not activate) self.setAttribute(Qt.WA_ShowWithoutActivating, not activate)
super(IncomingFileTransferDialog, self).show() super(IncomingFileTransferDialog, self).show()
def _set_reject_mode(self):
self.reject_mode = 'reject'
del ui_class, base_class del ui_class, base_class
...@@ -4837,7 +4842,7 @@ class IncomingFileTransferRequest(QObject): ...@@ -4837,7 +4842,7 @@ class IncomingFileTransferRequest(QObject):
self.accepted.emit(self) self.accepted.emit(self)
def _SH_DialogRejected(self): def _SH_DialogRejected(self):
self.rejected.emit(self) self.rejected.emit(self, self.reject_mode)
ui_class, base_class = uic.loadUiType(Resources.get('conference_dialog.ui')) ui_class, base_class = uic.loadUiType(Resources.get('conference_dialog.ui'))
...@@ -5154,12 +5159,13 @@ class SessionManager(object): ...@@ -5154,12 +5159,13 @@ class SessionManager(object):
self.file_transfers.append(transfer) self.file_transfers.append(transfer)
transfer.init_incoming(incoming_request.contact, incoming_request.contact_uri, incoming_request.session, incoming_request.stream) transfer.init_incoming(incoming_request.contact, incoming_request.contact_uri, incoming_request.session, incoming_request.stream)
def _SH_IncomingFileTransferRequestRejected(self, incoming_request): def _SH_IncomingFileTransferRequestRejected(self, incoming_request, mode):
if incoming_request.dialog.position is not None: if incoming_request.dialog.position is not None:
bisect.insort_left(self.dialog_positions, incoming_request.dialog.position) bisect.insort_left(self.dialog_positions, incoming_request.dialog.position)
self.incoming_requests.remove(incoming_request) self.incoming_requests.remove(incoming_request)
self.update_ringtone() self.update_ringtone()
incoming_request.session.reject(603) if mode == 'reject':
incoming_request.session.reject(603)
@run_in_gui_thread @run_in_gui_thread
def handle_notification(self, notification): def handle_notification(self, notification):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment