gui: display address on external signer
This commit is contained in:
6 files changed
+36
No files matched your search
@@ -254,6 +254,19 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnVerify">
|
||||
<property name="text">
|
||||
<string>&Verify</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Verify this address on e.g. a hardware wallet screen</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnSaveAs">
|
||||
<property name="text">
|
||||
|
||||
@@ -89,6 +89,12 @@ void ReceiveRequestDialog::setInfo(const SendCoinsRecipient &_info)
|
||||
ui->wallet_tag->hide();
|
||||
ui->wallet_content->hide();
|
||||
}
|
||||
|
||||
ui->btnVerify->setVisible(this->model->wallet().hasExternalSigner());
|
||||
|
||||
connect(ui->btnVerify, &QPushButton::clicked, [this] {
|
||||
model->displayAddress(info.address.toStdString());
|
||||
});
|
||||
}
|
||||
|
||||
void ReceiveRequestDialog::updateDisplayUnit()
|
||||
|
||||
@@ -571,6 +571,18 @@ bool WalletModel::bumpFee(uint256 hash, uint256& new_hash)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WalletModel::displayAddress(std::string sAddress)
|
||||
{
|
||||
CTxDestination dest = DecodeDestination(sAddress);
|
||||
bool res = false;
|
||||
try {
|
||||
res = m_wallet->displayAddress(dest);
|
||||
} catch (const std::runtime_error& e) {
|
||||
QMessageBox::critical(nullptr, tr("Can't display address"), e.what());
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
bool WalletModel::isWalletEnabled()
|
||||
{
|
||||
return !gArgs.GetBoolArg("-disablewallet", DEFAULT_DISABLE_WALLET);
|
||||
|
||||
@@ -139,6 +139,7 @@ public:
|
||||
bool saveReceiveRequest(const std::string &sAddress, const int64_t nId, const std::string &sRequest);
|
||||
|
||||
bool bumpFee(uint256 hash, uint256& new_hash);
|
||||
bool displayAddress(std::string sAddress);
|
||||
|
||||
static bool isWalletEnabled();
|
||||
|
||||
|
||||
Reference in new issue
Block a user