Skip to content

Commit 0829180

Browse files
committed
qt: move third-party tx URL setting from Display to Wallet options tab
Out of all the settings in the Display tab, the 'Third-party transaction URLs' is the odd one out. All other settings here affect the way the GUI is displayed. This action affects what context menu actions are available when wallet functionality is enabled, and we have a transaction. As such, it is a better fit for this to be in the Wallet tab.
1 parent ab25ef8 commit 0829180

File tree

3 files changed

+40
-40
lines changed

3 files changed

+40
-40
lines changed

src/qt/forms/optionsdialog.ui

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@
189189
<item>
190190
<widget class="QCheckBox" name="enableServer">
191191
<property name="toolTip">
192-
<string extracomment="Tooltip text for Options window setting that enables the RPC server.">This allows you or a third party tool to communicate with the node through command-line and JSON-RPC commands.</string>
192+
<string extracomment="Tooltip text for Options window setting that enables the RPC server.">This allows you or a third-party tool to communicate with the node through command-line and JSON-RPC commands.</string>
193193
</property>
194194
<property name="text">
195195
<string extracomment="An Options window setting to enable the RPC server.">Enable RPC &amp;server</string>
@@ -226,6 +226,33 @@
226226
</property>
227227
</widget>
228228
</item>
229+
<item>
230+
<layout class="QHBoxLayout" name="horizontalLayout_3_Display">
231+
<item>
232+
<widget class="QLabel" name="thirdPartyTxUrlsLabel">
233+
<property name="toolTip">
234+
<string>Third-party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. "%s" in the URL is replaced by the transaction hash. Multiple URLs are separated by a vertical bar |.</string>
235+
</property>
236+
<property name="text">
237+
<string>&amp;Third-party transaction URLs</string>
238+
</property>
239+
<property name="buddy">
240+
<cstring>thirdPartyTxUrls</cstring>
241+
</property>
242+
</widget>
243+
</item>
244+
<item>
245+
<widget class="QLineEdit" name="thirdPartyTxUrls">
246+
<property name="toolTip">
247+
<string>Third-party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. "%s" in the URL is replaced by the transaction hash. Multiple URLs are separated by a vertical bar |.</string>
248+
</property>
249+
<property name="placeholderText">
250+
<string notr="true">https://example.com/tx/%s</string>
251+
</property>
252+
</widget>
253+
</item>
254+
</layout>
255+
</item>
229256
<item>
230257
<widget class="QGroupBox" name="groupBox">
231258
<property name="title">
@@ -734,33 +761,6 @@
734761
</item>
735762
</layout>
736763
</item>
737-
<item>
738-
<layout class="QHBoxLayout" name="horizontalLayout_3_Display">
739-
<item>
740-
<widget class="QLabel" name="thirdPartyTxUrlsLabel">
741-
<property name="toolTip">
742-
<string>Third-party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</string>
743-
</property>
744-
<property name="text">
745-
<string>&amp;Third-party transaction URLs</string>
746-
</property>
747-
<property name="buddy">
748-
<cstring>thirdPartyTxUrls</cstring>
749-
</property>
750-
</widget>
751-
</item>
752-
<item>
753-
<widget class="QLineEdit" name="thirdPartyTxUrls">
754-
<property name="toolTip">
755-
<string>Third-party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</string>
756-
</property>
757-
<property name="placeholderText">
758-
<string notr="true">https://example.com/tx/%s</string>
759-
</property>
760-
</widget>
761-
</item>
762-
</layout>
763-
</item>
764764
<item>
765765
<widget class="QGroupBox" name="font_groupBox">
766766
<property name="title">

src/qt/optionsdialog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ void OptionsDialog::setModel(OptionsModel *_model)
207207
connect(ui->externalSignerPath, &QLineEdit::textChanged, [this]{ showRestartWarning(); });
208208
connect(ui->threadsScriptVerif, qOverload<int>(&QSpinBox::valueChanged), this, &OptionsDialog::showRestartWarning);
209209
/* Wallet */
210+
connect(ui->thirdPartyTxUrls, &QLineEdit::textChanged, [this] { showRestartWarning(); });
210211
connect(ui->spendZeroConfChange, &QCheckBox::clicked, this, &OptionsDialog::showRestartWarning);
211212
/* Network */
212213
connect(ui->allowIncoming, &QCheckBox::clicked, this, &OptionsDialog::showRestartWarning);
@@ -215,7 +216,6 @@ void OptionsDialog::setModel(OptionsModel *_model)
215216
connect(ui->connectSocksTor, &QCheckBox::clicked, this, &OptionsDialog::showRestartWarning);
216217
/* Display */
217218
connect(ui->lang, qOverload<>(&QValueComboBox::valueChanged), [this]{ showRestartWarning(); });
218-
connect(ui->thirdPartyTxUrls, &QLineEdit::textChanged, [this]{ showRestartWarning(); });
219219
}
220220

221221
void OptionsDialog::setCurrentTab(OptionsDialog::Tab tab)
@@ -241,6 +241,7 @@ void OptionsDialog::setMapper()
241241
mapper->addMapping(ui->spendZeroConfChange, OptionsModel::SpendZeroConfChange);
242242
mapper->addMapping(ui->coinControlFeatures, OptionsModel::CoinControlFeatures);
243243
mapper->addMapping(ui->subFeeFromAmount, OptionsModel::SubFeeFromAmount);
244+
mapper->addMapping(ui->thirdPartyTxUrls, OptionsModel::ThirdPartyTxUrls);
244245
mapper->addMapping(ui->externalSignerPath, OptionsModel::ExternalSignerPath);
245246

246247
/* Network */
@@ -269,7 +270,6 @@ void OptionsDialog::setMapper()
269270
/* Display */
270271
mapper->addMapping(ui->lang, OptionsModel::Language);
271272
mapper->addMapping(ui->unit, OptionsModel::DisplayUnit);
272-
mapper->addMapping(ui->thirdPartyTxUrls, OptionsModel::ThirdPartyTxUrls);
273273
mapper->addMapping(ui->embeddedFont_radioButton, OptionsModel::UseEmbeddedMonospacedFont);
274274
}
275275

src/qt/optionsmodel.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,6 @@ void OptionsModel::Init(bool resetSettings)
7575
settings.setValue("nDisplayUnit", BitcoinUnits::BTC);
7676
nDisplayUnit = settings.value("nDisplayUnit").toInt();
7777

78-
if (!settings.contains("strThirdPartyTxUrls"))
79-
settings.setValue("strThirdPartyTxUrls", "");
80-
strThirdPartyTxUrls = settings.value("strThirdPartyTxUrls", "").toString();
81-
8278
if (!settings.contains("fCoinControlFeatures"))
8379
settings.setValue("fCoinControlFeatures", false);
8480
fCoinControlFeatures = settings.value("fCoinControlFeatures", false).toBool();
@@ -129,6 +125,10 @@ void OptionsModel::Init(bool resetSettings)
129125
settings.setValue("SubFeeFromAmount", false);
130126
}
131127
m_sub_fee_from_amount = settings.value("SubFeeFromAmount", false).toBool();
128+
129+
if (!settings.contains("strThirdPartyTxUrls"))
130+
settings.setValue("strThirdPartyTxUrls", "");
131+
strThirdPartyTxUrls = settings.value("strThirdPartyTxUrls", "").toString();
132132
#endif
133133

134134
// Network
@@ -349,11 +349,11 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const
349349
return settings.value("external_signer_path");
350350
case SubFeeFromAmount:
351351
return m_sub_fee_from_amount;
352+
case ThirdPartyTxUrls:
353+
return strThirdPartyTxUrls;
352354
#endif
353355
case DisplayUnit:
354356
return nDisplayUnit;
355-
case ThirdPartyTxUrls:
356-
return strThirdPartyTxUrls;
357357
case Language:
358358
return settings.value("language");
359359
case UseEmbeddedMonospacedFont:
@@ -480,17 +480,17 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
480480
m_sub_fee_from_amount = value.toBool();
481481
settings.setValue("SubFeeFromAmount", m_sub_fee_from_amount);
482482
break;
483-
#endif
484-
case DisplayUnit:
485-
setDisplayUnit(value);
486-
break;
487483
case ThirdPartyTxUrls:
488484
if (strThirdPartyTxUrls != value.toString()) {
489485
strThirdPartyTxUrls = value.toString();
490486
settings.setValue("strThirdPartyTxUrls", strThirdPartyTxUrls);
491487
setRestartRequired(true);
492488
}
493489
break;
490+
#endif
491+
case DisplayUnit:
492+
setDisplayUnit(value);
493+
break;
494494
case Language:
495495
if (settings.value("language") != value) {
496496
settings.setValue("language", value);

0 commit comments

Comments
 (0)