Browse Source

Fix context menu when paranoid=False

283
Fredrick Brennan 9 years ago
parent
commit
88ca99c624
  1. 8
      gui/qt/qrtextedit.py

8
gui/qt/qrtextedit.py

@ -12,6 +12,7 @@ class ShowQRTextEdit(ButtonsTextEdit):
ButtonsTextEdit.__init__(self, text)
self.setReadOnly(1)
self.addButton(":icons/qrcode.png", self.qr_show, _("Show as QR code"))
self.paranoid = paranoid
if paranoid:
# Paranoid flag forces the user to write down what's in the box,
@ -37,6 +38,13 @@ class ShowQRTextEdit(ButtonsTextEdit):
s = unicode(self.toPlainText())
QRDialog(s).exec_()
def contextMenuEvent(self, e):
if self.paranoid: return
m = self.createStandardContextMenu()
m.addAction(_("Show as QR code"), self.qr_show)
m.exec_(e.globalPos())
class ScanQRTextEdit(ButtonsTextEdit):
def __init__(self, text=""):

Loading…
Cancel
Save