commit 37a49752eb765f436fdb8d88fcc773bc14abcb1c
parent 0ecf2565ce484ab0d79cf902f417a3fb6307f6d1
Author: Neil Booth <kyuupichan@gmail.com>
Date: Wed, 23 Dec 2015 20:13:17 +0900
Fix greenaddress modality and centring issues
Diffstat:
2 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py
@@ -2193,8 +2193,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
d.exec_()
def password_dialog(self, msg=None, parent=None):
- if parent == None:
- parent = self
+ parent = parent or self
d = WindowModalDialog(parent, _("Enter Password"))
pw = QLineEdit()
pw.setEchoMode(2)
diff --git a/plugins/greenaddress_instant/qt.py b/plugins/greenaddress_instant/qt.py
@@ -21,7 +21,7 @@ import urllib
import sys
import requests
-from PyQt4.QtGui import QMessageBox, QApplication, QPushButton
+from PyQt4.QtGui import QApplication, QPushButton
from electrum.plugins import BasePlugin, hook
from electrum.i18n import _
@@ -65,7 +65,7 @@ class Plugin(BasePlugin):
'to verify that transaction is instant.\n'
'Please enter your password to sign a\n'
'verification request.')
- password = window.password_dialog(msg)
+ password = window.password_dialog(msg, parent=d)
if not password:
return
try:
@@ -84,14 +84,12 @@ class Plugin(BasePlugin):
# 3. display the result
if response.get('verified'):
- QMessageBox.information(None, _('Verification successful!'),
- _('%s is covered by GreenAddress instant confirmation') % (tx.hash()), _('OK'))
+ d.show_message(_('%s is covered by GreenAddress instant confirmation') % (tx.hash()), title=_('Verification successful!'))
else:
- QMessageBox.critical(None, _('Verification failed!'),
- _('%s is not covered by GreenAddress instant confirmation') % (tx.hash()), _('OK'))
+ d.show_critical(_('%s is not covered by GreenAddress instant confirmation') % (tx.hash()), title=_('Verification failed!'))
except BaseException as e:
import traceback
traceback.print_exc(file=sys.stdout)
- QMessageBox.information(None, _('Error'), str(e), _('OK'))
+ d.show_error(str(e))
finally:
d.verify_button.setText(self.button_label)