Esempio n. 1
0
    def calibration_dialog(self, window):
        d = WindowModalDialog(window, _("Cosigner Pool Settings"))

        d.setMinimumSize(150, 100)

        vbox = QVBoxLayout(d)

        purge = QPushButton(_("Purge Transactions"))
        purge.clicked.connect(partial(self.purge_transaction, window))
        purge.setIcon(read_QIcon("warning.png"))
        vbox.addWidget(purge)

        vbox.addWidget(QLabel(_('Wallet Owner:')))
        grid = QGridLayout()
        vbox.addLayout(grid)

        grid.addWidget(QLabel(_('Name:')), 0, 0)
        name = QLineEdit()
        name.setText(self.config.get('wallet_owner', ''))
        grid.addWidget(name, 0, 1)

        sync = QPushButton(_("Sync Name"))
        sync.clicked.connect(partial(self.sync_name, name, window))
        vbox.addWidget(sync)

        status = QPushButton(_("Tx. Status"))
        status.clicked.connect(partial(self.tx_status_dialog, window))
        vbox.addWidget(status)

        vbox.addStretch()
        vbox.addSpacing(13)
        vbox.addLayout(Buttons(CloseButton(d), OkButton(d)))

        if not d.exec_():
            return
Esempio n. 2
0
    def transaction_dialog(self, dialog):
        b = QPushButton()
        b.setIcon(read_QIcon("speaker.png"))

        def handler():
            blob = json.dumps(dialog.tx.as_dict())
            self._send(parent=dialog, blob=blob)
        b.clicked.connect(handler)
        dialog.sharing_buttons.insert(-1, b)
Esempio n. 3
0
 def on_new_window(self, window):
     wallet = window.wallet
     if not isinstance(wallet, self.wallet_class):
         return
     wallet.handler_2fa = HandlerTwoFactor(self, window)
     if wallet.can_sign_without_server():
         msg = ' '.join([
             _('This wallet was restored from seed, and it contains two master private keys.'
               ),
             _('Therefore, two-factor authentication is disabled.')
         ])
         action = lambda: window.show_message(msg)
     else:
         action = partial(self.settings_dialog, window)
     button = StatusBarButton(read_QIcon("trustedcoin-status.png"),
                              _("TrustedCoin"), action)
     window.statusBar().addPermanentWidget(button)
     self.start_request_thread(window.wallet)
Esempio n. 4
0
 def load_wallet(self, wallet, window):
     for keystore in wallet.get_keystores():
         if not isinstance(keystore, self.keystore_class):
             continue
         if not self.libraries_available:
             message = keystore.plugin.get_library_not_available_message()
             window.show_error(message)
             return
         tooltip = self.device + '\n' + (keystore.label or 'unnamed')
         cb = partial(self.show_settings_dialog, window, keystore)
         button = StatusBarButton(read_QIcon(self.icon_unpaired), tooltip, cb)
         button.icon_paired = self.icon_paired
         button.icon_unpaired = self.icon_unpaired
         window.statusBar().addPermanentWidget(button)
         handler = self.create_handler(window)
         handler.button = button
         keystore.handler = handler
         keystore.thread = TaskThread(window, on_error=partial(self.on_task_thread_error, window, keystore))
         self.add_show_address_on_hw_device_button_for_receive_addr(wallet, keystore, window)
         # Trigger a pairing
         keystore.thread.add(partial(self.get_client, keystore))
Esempio n. 5
0
 def create_status_bar(self, parent):
     b = StatusBarButton(read_QIcon('revealer.png'), "Revealer "+_("secret backup utility"),
                         partial(self.setup_dialog, parent))
     parent.addPermanentWidget(b)
Esempio n. 6
0
 def _update_status(self, paired):
     if hasattr(self, 'button'):
         button = self.button
         icon_name = button.icon_paired if paired else button.icon_unpaired
         button.setIcon(read_QIcon(icon_name))