Ejemplo n.º 1
0
 def __init__(self, win):
     QRTextEdit.__init__(self)
     self.win = win
     self.amount_edit = win.amount_e
     self.document().contentsChanged.connect(self.update_size)
     self.heightMin = 0
     self.heightMax = 150
     self.setMinimumHeight(27)
     self.setMaximumHeight(27)
     self.c = None
     self.textChanged.connect(self.check_text)
     self.outputs = []
     self.is_pr = False
     self.scan_f = self.win.pay_from_URI
Ejemplo n.º 2
0
def text_dialog(parent, title, label, ok_label, default=None):
    from qrtextedit import QRTextEdit
    dialog = QDialog(parent)
    dialog.setMinimumWidth(500)
    dialog.setWindowTitle(title)
    dialog.setModal(1)
    l = QVBoxLayout()
    dialog.setLayout(l)
    l.addWidget(QLabel(label))
    txt = QRTextEdit()
    if default:
        txt.setText(default)
    l.addWidget(txt)
    l.addLayout(ok_cancel_buttons(dialog, ok_label))
    if dialog.exec_():
        return unicode(txt.toPlainText())
Ejemplo n.º 3
0
def text_dialog(parent, title, label, ok_label, default=None):
    from qrtextedit import QRTextEdit
    dialog = QDialog(parent)
    dialog.setMinimumWidth(500)
    dialog.setWindowTitle(title)
    dialog.setModal(1)
    l = QVBoxLayout()
    dialog.setLayout(l)
    l.addWidget(QLabel(label))
    txt = QRTextEdit()
    if default:
        txt.setText(default)
    l.addWidget(txt)
    l.addLayout(ok_cancel_buttons(dialog, ok_label))
    if dialog.exec_():
        return unicode(txt.toPlainText())
Ejemplo n.º 4
0
def show_seed_box(seed, sid=None):

    save_msg = _("Please save these %d words on paper (order is important).")%len(seed.split()) + " " 
    qr_msg = _("Your seed is also displayed as QR code, in case you want to transfer it to a mobile phone.") + "<p>"
    warning_msg = "<b>"+_("WARNING")+":</b> " + _("Never disclose your seed. Never type it on a website.") + "</b><p>"

    if sid is None:
        msg =  _("Your wallet generation seed is")
        msg2 = save_msg + " " \
               + _("This seed will allow you to recover your wallet in case of computer failure.") + "<br/>" \
               + warning_msg
        
    elif sid == 'cold':
        msg =  _("Your cold storage seed is")
        msg2 = save_msg + " " \
               + _("This seed will be permanently deleted from your wallet file. Make sure you have saved it before you press 'next'") + " " \
            
    elif sid == 'hot':
        msg =  _("Your hot seed is")
        msg2 = save_msg + " " \
               + _("If you ever need to recover your wallet from seed, you will need both this seed and your cold seed.") + " " \

    label1 = QLabel(msg+ ":")
    seed_text = QRTextEdit(seed)
    seed_text.setReadOnly(True)
    seed_text.setMaximumHeight(130)

    label2 = QLabel(msg2)
    label2.setWordWrap(True)

    logo = QLabel()

    logo.setPixmap(QPixmap(icon_filename(sid)).scaledToWidth(56))
    logo.setMaximumWidth(60)

    grid = QGridLayout()
    grid.addWidget(logo, 0, 0)
    grid.addWidget(label1, 0, 1)
    grid.addWidget(seed_text, 1, 0, 1, 2)
    #qrw = QRCodeWidget(seed)
    #grid.addWidget(qrw, 0, 2, 2, 1)
    vbox = QVBoxLayout()
    vbox.addLayout(grid)
    vbox.addWidget(label2)
    vbox.addStretch(1)
    
    return vbox
Ejemplo n.º 5
0
def enter_seed_box(msg, sid=None):

    vbox = QVBoxLayout()
    logo = QLabel()
    logo.setPixmap(QPixmap(icon_filename(sid)).scaledToWidth(56))
    logo.setMaximumWidth(60)

    label = QLabel(msg)
    label.setWordWrap(True)

    seed_e = QRTextEdit()
    seed_e.setMaximumHeight(100)
    seed_e.setTabChangesFocus(True)

    vbox.addWidget(label)

    grid = QGridLayout()
    grid.addWidget(logo, 0, 0)
    grid.addWidget(seed_e, 0, 1)

    vbox.addLayout(grid)
    return vbox, seed_e
Ejemplo n.º 6
0
def show_seed_box(seed, sid=None):

    save_msg = _("Please save these %d words on paper (order is important)."
                 ) % len(seed.split()) + " "
    qr_msg = _(
        "Your seed is also displayed as QR code, in case you want to transfer it to a mobile phone."
    ) + "<p>"
    warning_msg = "<b>" + _("WARNING") + ":</b> " + _(
        "Never disclose your seed. Never type it on a website.") + "</b><p>"

    if sid is None:
        msg = _("Your wallet generation seed is")
        msg2 = save_msg + " " \
               + _("This seed will allow you to recover your wallet in case of computer failure.") + "<br/>" \
               + warning_msg

    elif sid == 'cold':
        msg = _("Your cold storage seed is")
        msg2 = save_msg + " " \
               + _("This seed will be permanently deleted from your wallet file. Make sure you have saved it before you press 'next'") + " " \

    elif sid == 'hot':
        msg = _("Your hot seed is")
        msg2 = save_msg + " " \
               + _("If you ever need to recover your wallet from seed, you will need both this seed and your cold seed.") + " " \

    label1 = QLabel(msg + ":")
    seed_text = QRTextEdit(seed)
    seed_text.setReadOnly(True)
    seed_text.setMaximumHeight(130)

    label2 = QLabel(msg2)
    label2.setWordWrap(True)

    logo = QLabel()

    logo.setPixmap(QPixmap(icon_filename(sid)).scaledToWidth(56))
    logo.setMaximumWidth(60)

    grid = QGridLayout()
    grid.addWidget(logo, 0, 0)
    grid.addWidget(label1, 0, 1)
    grid.addWidget(seed_text, 1, 0, 1, 2)
    #qrw = QRCodeWidget(seed)
    #grid.addWidget(qrw, 0, 2, 2, 1)
    vbox = QVBoxLayout()
    vbox.addLayout(grid)
    vbox.addWidget(label2)
    vbox.addStretch(1)

    return vbox
Ejemplo n.º 7
0
def enter_seed_box(msg, sid=None):

    vbox = QVBoxLayout()
    logo = QLabel()
    logo.setPixmap(QPixmap(icon_filename(sid)).scaledToWidth(56))
    logo.setMaximumWidth(60)

    label = QLabel(msg)
    label.setWordWrap(True)

    seed_e = QRTextEdit()
    seed_e.setMaximumHeight(100)
    seed_e.setTabChangesFocus(True)

    vbox.addWidget(label)

    grid = QGridLayout()
    grid.addWidget(logo, 0, 0)
    grid.addWidget(seed_e, 0, 1)

    vbox.addLayout(grid)
    return vbox, seed_e