Make seed uncopyable
Other wallets, such as Mycelium, do not allow the user to simply copy and paste the seed. This is very useful to assure users follow directions on the next screen, because previously it was easily possible to just copy the seed and paste it on the next screen. The user's wallet would work well for a while like this, but without having the seed written down it's more of a ticking time bomb than a wallet. I recommend pulling this patch as I have read many cases where users do not write the seed down, and I believe that the main cause is lack of friction forcing them to do so. This patch was inspired by reading this Reddit conversation: https://www.reddit.com/r/Bitcoin/comments/3p4bq1/electrum_v25/cw380kg But I'm not a participant in that convo.
This commit is contained in:
parent
b6e1e9e3ce
commit
b14b5d3dd4
|
@ -8,10 +8,25 @@ from util import ButtonsTextEdit
|
|||
|
||||
class ShowQRTextEdit(ButtonsTextEdit):
|
||||
|
||||
def __init__(self, text=None):
|
||||
def __init__(self, text=None, paranoid=False):
|
||||
ButtonsTextEdit.__init__(self, text)
|
||||
self.setReadOnly(1)
|
||||
self.addButton(":icons/qrcode.png", self.qr_show, _("Show as QR code"))
|
||||
|
||||
if paranoid:
|
||||
# Paranoid flag forces the user to write down what's in the box,
|
||||
# like Mycelium does. This is useful since many users just copy
|
||||
# and paste their code, then when disaster strikes they don't have
|
||||
# it written down anywhere.
|
||||
self.setAcceptDrops(False) # No dragging and dropping
|
||||
# Use custom context menu to remove copy/paste from menu
|
||||
self.setContextMenuPolicy(Qt.ActionsContextMenu)
|
||||
self.qaction = QAction(_("Show as QR code"), self)
|
||||
self.qaction.triggered.connect(self.qr_show)
|
||||
self.addAction(self.qaction)
|
||||
# No text selection allowed.
|
||||
self.setTextInteractionFlags(Qt.NoTextInteraction)
|
||||
|
||||
run_hook('show_text_edit', self)
|
||||
|
||||
def qr_show(self):
|
||||
|
@ -22,12 +37,6 @@ class ShowQRTextEdit(ButtonsTextEdit):
|
|||
s = unicode(self.toPlainText())
|
||||
QRDialog(s).exec_()
|
||||
|
||||
def contextMenuEvent(self, e):
|
||||
m = self.createStandardContextMenu()
|
||||
m.addAction(_("Show as QR code"), self.qr_show)
|
||||
m.exec_(e.globalPos())
|
||||
|
||||
|
||||
class ScanQRTextEdit(ButtonsTextEdit):
|
||||
|
||||
def __init__(self, text=""):
|
||||
|
|
|
@ -75,7 +75,7 @@ def enter_seed_box(msg, window, sid=None, text=None):
|
|||
seed_e = ScanQRTextEdit()
|
||||
seed_e.setTabChangesFocus(True)
|
||||
else:
|
||||
seed_e = ShowQRTextEdit(text=text)
|
||||
seed_e = ShowQRTextEdit(text=text, paranoid=True)
|
||||
seed_e.setMaximumHeight(130)
|
||||
vbox.addWidget(label)
|
||||
grid = QGridLayout()
|
||||
|
|
Loading…
Reference in New Issue