Skip to content

Commit

Permalink
Fix bug #322
Browse files Browse the repository at this point in the history
Disable buttonbox while broadcasting certification/send
  • Loading branch information
Insoleet committed Jan 17, 2016
1 parent b00fa64 commit 693b000
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/sakia/gui/certification.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def certify_identity(cls, app, account, password_asker, community, identity):
@asyncify
@asyncio.coroutine
def accept(self):
self.button_box.setEnabled(False)
if self.radio_contact.isChecked():
for contact in self.account.contacts:
if contact['name'] == self.combo_contact.currentText():
Expand All @@ -64,6 +65,7 @@ def accept(self):

password = yield from self.password_asker.async_exec()
if password == "":
self.button_box.setEnabled(True)
return
QApplication.setOverrideCursor(Qt.WaitCursor)
result = yield from self.account.certify(password, self.community, pubkey)
Expand All @@ -85,6 +87,7 @@ def accept(self):
self.tr("Could not broadcast certification : {0}"
.format(result[1])))
QApplication.restoreOverrideCursor()
self.button_box.setEnabled(True)

def change_current_community(self, index):
self.community = self.account.communities[index]
Expand Down
3 changes: 3 additions & 0 deletions src/sakia/gui/transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def send_transfer_again(cls, app, account, password_asker, community, transfer):
@asyncify
@asyncio.coroutine
def accept(self):
self.button_box.setEnabled(False)
comment = self.edit_message.text()

if self.radio_contact.isChecked():
Expand All @@ -108,6 +109,7 @@ def accept(self):
yield from QAsyncMessageBox.critical(self, self.tr("Money transfer"),
self.tr("No amount. Please give the transfert amount"),
QMessageBox.Ok)
self.button_box.setEnabled(True)
return

password = yield from self.password_asker.async_exec()
Expand Down Expand Up @@ -139,6 +141,7 @@ def accept(self):
yield from QAsyncMessageBox.critical(self, self.tr("Transfer"), result[1])

QApplication.restoreOverrideCursor()
self.button_box.setEnabled(True)

@asyncify
@asyncio.coroutine
Expand Down

0 comments on commit 693b000

Please sign in to comment.