mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-22 15:04:44 +01:00
gui: add external signer path to options dialog
This commit is contained in:
parent
22b845291c
commit
6cdbc83e93
4 changed files with 48 additions and 0 deletions
|
@ -229,6 +229,36 @@
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="groupBoxHww">
|
||||||
|
<property name="title">
|
||||||
|
<string>External Signer (e.g. hardware wallet)</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayoutHww">
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayoutHww">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="externalSignerPathLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>&External signer script path</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>externalSignerPath</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="externalSignerPath">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Full path to a Bitcoin Core compatible script (e.g. C:\Downloads\hwi.exe or /Users/you/Downloads/hwi.py). Beware: malware can steal your coins!</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer_Wallet">
|
<spacer name="verticalSpacer_Wallet">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
|
|
@ -199,6 +199,7 @@ void OptionsDialog::setModel(OptionsModel *_model)
|
||||||
connect(ui->prune, &QCheckBox::clicked, this, &OptionsDialog::togglePruneWarning);
|
connect(ui->prune, &QCheckBox::clicked, this, &OptionsDialog::togglePruneWarning);
|
||||||
connect(ui->pruneSize, qOverload<int>(&QSpinBox::valueChanged), this, &OptionsDialog::showRestartWarning);
|
connect(ui->pruneSize, qOverload<int>(&QSpinBox::valueChanged), this, &OptionsDialog::showRestartWarning);
|
||||||
connect(ui->databaseCache, qOverload<int>(&QSpinBox::valueChanged), this, &OptionsDialog::showRestartWarning);
|
connect(ui->databaseCache, qOverload<int>(&QSpinBox::valueChanged), this, &OptionsDialog::showRestartWarning);
|
||||||
|
connect(ui->externalSignerPath, &QLineEdit::textChanged, [this]{ showRestartWarning(); });
|
||||||
connect(ui->threadsScriptVerif, qOverload<int>(&QSpinBox::valueChanged), this, &OptionsDialog::showRestartWarning);
|
connect(ui->threadsScriptVerif, qOverload<int>(&QSpinBox::valueChanged), this, &OptionsDialog::showRestartWarning);
|
||||||
/* Wallet */
|
/* Wallet */
|
||||||
connect(ui->spendZeroConfChange, &QCheckBox::clicked, this, &OptionsDialog::showRestartWarning);
|
connect(ui->spendZeroConfChange, &QCheckBox::clicked, this, &OptionsDialog::showRestartWarning);
|
||||||
|
@ -233,6 +234,7 @@ void OptionsDialog::setMapper()
|
||||||
/* Wallet */
|
/* Wallet */
|
||||||
mapper->addMapping(ui->spendZeroConfChange, OptionsModel::SpendZeroConfChange);
|
mapper->addMapping(ui->spendZeroConfChange, OptionsModel::SpendZeroConfChange);
|
||||||
mapper->addMapping(ui->coinControlFeatures, OptionsModel::CoinControlFeatures);
|
mapper->addMapping(ui->coinControlFeatures, OptionsModel::CoinControlFeatures);
|
||||||
|
mapper->addMapping(ui->externalSignerPath, OptionsModel::ExternalSignerPath);
|
||||||
|
|
||||||
/* Network */
|
/* Network */
|
||||||
mapper->addMapping(ui->mapPortUpnp, OptionsModel::MapPortUPnP);
|
mapper->addMapping(ui->mapPortUpnp, OptionsModel::MapPortUPnP);
|
||||||
|
|
|
@ -117,6 +117,13 @@ void OptionsModel::Init(bool resetSettings)
|
||||||
settings.setValue("bSpendZeroConfChange", true);
|
settings.setValue("bSpendZeroConfChange", true);
|
||||||
if (!gArgs.SoftSetBoolArg("-spendzeroconfchange", settings.value("bSpendZeroConfChange").toBool()))
|
if (!gArgs.SoftSetBoolArg("-spendzeroconfchange", settings.value("bSpendZeroConfChange").toBool()))
|
||||||
addOverriddenOption("-spendzeroconfchange");
|
addOverriddenOption("-spendzeroconfchange");
|
||||||
|
|
||||||
|
if (!settings.contains("external_signer_path"))
|
||||||
|
settings.setValue("external_signer_path", "");
|
||||||
|
|
||||||
|
if (!gArgs.SoftSetArg("-signer", settings.value("external_signer_path").toString().toStdString())) {
|
||||||
|
addOverriddenOption("-signer");
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Network
|
// Network
|
||||||
|
@ -326,6 +333,8 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const
|
||||||
#ifdef ENABLE_WALLET
|
#ifdef ENABLE_WALLET
|
||||||
case SpendZeroConfChange:
|
case SpendZeroConfChange:
|
||||||
return settings.value("bSpendZeroConfChange");
|
return settings.value("bSpendZeroConfChange");
|
||||||
|
case ExternalSignerPath:
|
||||||
|
return settings.value("external_signer_path");
|
||||||
#endif
|
#endif
|
||||||
case DisplayUnit:
|
case DisplayUnit:
|
||||||
return nDisplayUnit;
|
return nDisplayUnit;
|
||||||
|
@ -445,6 +454,12 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
|
||||||
setRestartRequired(true);
|
setRestartRequired(true);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case ExternalSignerPath:
|
||||||
|
if (settings.value("external_signer_path") != value.toString()) {
|
||||||
|
settings.setValue("external_signer_path", value.toString());
|
||||||
|
setRestartRequired(true);
|
||||||
|
}
|
||||||
|
break;
|
||||||
#endif
|
#endif
|
||||||
case DisplayUnit:
|
case DisplayUnit:
|
||||||
setDisplayUnit(value);
|
setDisplayUnit(value);
|
||||||
|
|
|
@ -65,6 +65,7 @@ public:
|
||||||
Prune, // bool
|
Prune, // bool
|
||||||
PruneSize, // int
|
PruneSize, // int
|
||||||
DatabaseCache, // int
|
DatabaseCache, // int
|
||||||
|
ExternalSignerPath, // QString
|
||||||
SpendZeroConfChange, // bool
|
SpendZeroConfChange, // bool
|
||||||
Listen, // bool
|
Listen, // bool
|
||||||
OptionIDRowCount,
|
OptionIDRowCount,
|
||||||
|
|
Loading…
Add table
Reference in a new issue