def __init__(self, parent=None, main=None): super(MessageSigningWidget, self).__init__(parent) self.main = main signMessageLayout = QGridLayout() self.setMinimumWidth(800) # Pick an Address in Row 0 of the grid layout addressLabel = QLabel('Sign with Address:') self.addressLineEdit = QLineEdit() self.addressBookButton = createAddrBookButton(self, self.addressLineEdit, None, selectMineOnly=True) signMessageLayout.addWidget(addressLabel, 0, 0) signMessageLayout.addWidget(self.addressLineEdit, 0, 1) signMessageLayout.addWidget(self.addressBookButton, 0, 2) # Create a message in Row 1 messageLabel = QLabel("Message to sign:") self.messageTextEdit = QTextEdit() self.messageTextEdit.setAcceptRichText(False) self.messageTextEdit.setStyleSheet("font: 9pt \"Courier\";") signMessageLayout.addWidget(messageLabel, 1, 0) signMessageLayout.addWidget(self.messageTextEdit, 1, 1, 1, 2) # Create a row with just a sign message button self.bareSigButton = QPushButton('Bare Signature (Protoshares-Qt Compatible)') self.base64SigButton = QPushButton('Base64 Signature') self.clearSigButton = QPushButton('Clearsign Signature') sigButtonFrame = makeHorizFrame([self.bareSigButton,\ self.base64SigButton,\ self.clearSigButton,\ 'Stretch']) signMessageLayout.addWidget(sigButtonFrame, 2, 1, 1, 3) # Create a Signature display signatureLabel = QLabel('Message Signature:') self.signatureDisplay = QTextEdit() self.signatureDisplay.setReadOnly(True) self.signatureDisplay.setStyleSheet("font: 9pt \"Courier\"; background-color: #bbbbbb;") signMessageLayout.addWidget(signatureLabel, 3, 0) signMessageLayout.addWidget(self.signatureDisplay, 3, 1, 1, 2) self.copySignatureButton = QPushButton("Copy Signature") self.clearFieldsButton = QPushButton("Clear All") buttonFrame = makeHorizFrame([self.copySignatureButton, self.clearFieldsButton,'Stretch']) signMessageLayout.addWidget(buttonFrame, 4, 1, 1, 3) self.setLayout(signMessageLayout) self.connect(self.bareSigButton, SIGNAL('clicked()'), \ self.bareSignMessage) self.connect(self.base64SigButton, SIGNAL('clicked()'), \ self.base64SignMessage) self.connect(self.clearSigButton, SIGNAL('clicked()'), \ self.clearSignMessage) self.connect(self.copySignatureButton, SIGNAL('clicked()'), \ self.copySignature) self.connect(self.clearFieldsButton, SIGNAL('clicked()'), \ self.clearFields)
def __init__(self, parent=None, main=None): super(BareSignatureVerificationWidget, self).__init__(parent, main) # Pick an Address in Row 0 of the grid layout addressLabel = QLabel('Signing Address:') self.addressLineEdit = QLineEdit() self.addressBookButton = createAddrBookButton(self, self.addressLineEdit, None, selectMineOnly=True) self.signMessageLayout.addWidget(addressLabel, 0, 0) self.signMessageLayout.addWidget(self.addressLineEdit, 0, 1) self.signMessageLayout.addWidget(self.addressBookButton, 0, 2) # Create a message text box messageLabel = QLabel("Signed Message:") self.messageTextEdit = QTextEdit() self.messageTextEdit.setAcceptRichText(False) self.messageTextEdit.setStyleSheet("font: 9pt \"Courier\";") self.signMessageLayout.addWidget(messageLabel, 1, 0) self.signMessageLayout.addWidget(self.messageTextEdit, 1, 1) # Create a Signature display signatureLabel = QLabel('Signature:') self.signatureTextEdit = QTextEdit() self.signatureTextEdit.setStyleSheet("font: 9pt \"Courier\";") self.signMessageLayout.addWidget(signatureLabel, 2, 0) self.signMessageLayout.addWidget(self.signatureTextEdit, 2, 1)
def __init__(self, parent=None, main=None): super(MessageSigningWidget, self).__init__(parent) self.main = main signMessageLayout = QGridLayout() self.setMinimumWidth(800) # Pick an Address in Row 0 of the grid layout addressLabel = QLabel('Sign with Address:') self.addressLineEdit = QLineEdit() self.addressBookButton = createAddrBookButton(self, self.addressLineEdit, None, selectMineOnly=True, showLockboxes=False) signMessageLayout.addWidget(addressLabel, 0, 0) signMessageLayout.addWidget(self.addressLineEdit, 0, 1) signMessageLayout.addWidget(self.addressBookButton, 0, 2) # Create a message in Row 1 messageLabel = QLabel("Message to sign:") self.messageTextEdit = QTextEdit() self.messageTextEdit.setAcceptRichText(False) self.messageTextEdit.setStyleSheet("font: 9pt \"Courier\";") signMessageLayout.addWidget(messageLabel, 1, 0) signMessageLayout.addWidget(self.messageTextEdit, 1, 1, 1, 2) # Create a row with just a sign message button self.bareSigButton = QPushButton( 'Bare Signature (Bitcoin-Qt Compatible)') self.base64SigButton = QPushButton('Base64 Signature') self.clearSigButton = QPushButton('Clearsign Signature') sigButtonFrame = makeHorizFrame([self.bareSigButton,\ self.base64SigButton,\ self.clearSigButton,\ 'Stretch']) signMessageLayout.addWidget(sigButtonFrame, 2, 1, 1, 3) # Create a Signature display signatureLabel = QLabel('Message Signature:') self.signatureDisplay = QTextEdit() self.signatureDisplay.setReadOnly(True) self.signatureDisplay.setStyleSheet( "font: 9pt \"Courier\"; background-color: #bbbbbb;") signMessageLayout.addWidget(signatureLabel, 3, 0) signMessageLayout.addWidget(self.signatureDisplay, 3, 1, 1, 2) self.copySignatureButton = QPushButton("Copy Signature") self.clearFieldsButton = QPushButton("Clear All") buttonFrame = makeHorizFrame( [self.copySignatureButton, self.clearFieldsButton, 'Stretch']) signMessageLayout.addWidget(buttonFrame, 4, 1, 1, 3) self.setLayout(signMessageLayout) self.connect(self.bareSigButton, SIGNAL('clicked()'), \ self.bareSignMessage) self.connect(self.base64SigButton, SIGNAL('clicked()'), \ self.base64SignMessage) self.connect(self.clearSigButton, SIGNAL('clicked()'), \ self.clearSignMessage) self.connect(self.copySignatureButton, SIGNAL('clicked()'), \ self.copySignature) self.connect(self.clearFieldsButton, SIGNAL('clicked()'), \ self.clearFields)