Fix context menu when paranoid=False
This commit is contained in:
@@ -12,6 +12,7 @@ class ShowQRTextEdit(ButtonsTextEdit):
|
|||||||
ButtonsTextEdit.__init__(self, text)
|
ButtonsTextEdit.__init__(self, text)
|
||||||
self.setReadOnly(1)
|
self.setReadOnly(1)
|
||||||
self.addButton(":icons/qrcode.png", self.qr_show, _("Show as QR code"))
|
self.addButton(":icons/qrcode.png", self.qr_show, _("Show as QR code"))
|
||||||
|
self.paranoid = paranoid
|
||||||
|
|
||||||
if paranoid:
|
if paranoid:
|
||||||
# Paranoid flag forces the user to write down what's in the box,
|
# Paranoid flag forces the user to write down what's in the box,
|
||||||
@@ -37,6 +38,13 @@ class ShowQRTextEdit(ButtonsTextEdit):
|
|||||||
s = unicode(self.toPlainText())
|
s = unicode(self.toPlainText())
|
||||||
QRDialog(s).exec_()
|
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):
|
class ScanQRTextEdit(ButtonsTextEdit):
|
||||||
|
|
||||||
def __init__(self, text=""):
|
def __init__(self, text=""):
|
||||||
|
|||||||
Reference in New Issue
Block a user