Skip to content

Commit c88813f

Browse files
feat(qt): DashPay opt-in, privacy gating and Platform network checks
Add the DashPay tab (behind the Show DashPay Tab option, default off) with the per-wallet opt-in it needs before anything contacts Platform. The opt-in dialog says the wallet connects to Dash Platform through evonodes and what the evonode answering each request can see (your IP address, or your proxy's; your identity and what it looks up; the usernames you search for), that connections are encrypted and use the same network settings and proxy as the rest of Dash Core, and that usernames, profiles and contact requests are public. It writes only the platform/enabled record and the record layout version. The chain id the records belong to is never taken from configuration: the first read the client verified stamps platform/chain-id with the chain id it was verified for. PlatformPage::maybeCreateService constructs the PlatformService only when the wallet opted in, is a descriptor wallet holding its own keys, the node's network settings leave DashPay a network to use, network activity is on and the node has a ChainLock; otherwise the page shows the reason. DashPay connects to evonodes as Core connects to its peers (PlatformRoute): with IPv4 or IPv6 reachable, through -proxy or directly, to evonodes on those networks, and to onion ones only when the onion proxy is that same proxy; with only onion reachable (-onlynet=onion), through the onion proxy to onion evonodes; never to I2P or CJDNS ones. The reachable networks come from interfaces::Node::isReachable and the proxies from getProxy, so -onion, -noonion and the Tor controller's onion proxy count, not -onlynet alone. The route is chosen once when the service is created, its proxy configures the client, and only evonodes on it are pushed; when the masternode list has evonodes but none on the route, nothing is pushed and the page says no evonode can be reached over the networks the settings allow. The service pushes an empty endpoint set while network activity is off, feeds evonode endpoints, Platform quorum keys and the best ChainLock height into the client on a timer and on every NotifyChainLock, and mints the SigningOperation every write signs under, which needs a wallet unlock that is released with the operation. Every client status passes through the service: an UnsupportedProtocolVersion freezes writes; a CHAIN_ID_MISMATCH on any response enters the mismatch state, which blocks writes until a verified read clears it; and records stamped for another chain id enter the network-changed state, which offers to discard the local Platform state and re-scan rather than leaving the wallet registered on a chain that no longer exists. -platformchainid is a GUI-only argument applied on testnet and devnets and refused at startup on mainnet; the chain id itself comes from CChainParams::PlatformChainId(). The mismatch text names -platformchainid only when it is set. WalletModel::UnlockContext becomes movable so an operation can own it. After this commit the tab shows only the opt-in state; usernames, contacts and payments follow. Tests (test_dash-qt PlatformTests over FakePlatformClient): no service and no client with the opt-in off; opting in records no chain id; with no network DashPay can use the service is refused with a reason, while a proxy is no gate; the route for Core's defaults, -proxy, -proxy with -onion or -noonion, a Unix socket proxy, -onlynet=ipv4 and -onlynet=onion with and without an onion proxy, never reaching I2P, and read from the node's reachable networks (routeSelection); evonodes off the route not pushed and reported until one on it is (endpointsOffTheRouteAreNotPushed); the opt-in text names evonodes and the proxy and not other people or a proxy left unused (optInDisclosureCopy); the mainnet chain id is never overridden; records for another chain enter the network-changed state where nothing signs until they are discarded, and discarding leaves the chain id to the next verified read; an inactive network pushes an empty endpoint set; opting out wipes every record; every failure kind has a user-visible description and OK/AlreadyExists have none. The welcome and network-changed panels are a centred column between stretches rather than an aligned widget, so wrapped text gets the height its width needs, and a card whose text changes is measured again. When -platformchainid is set, the network-changed page says the setting may be what is wrong. The service pushes endpoints again as soon as network activity is back and reports when endpoints return (endpointsAvailable) and when network activity changes. A context change that comes while the endpoints are being collected (network activity turned off or on again quickly) has them collected again when that collection lands, not at the next timer tick, and the collection made before the change is dropped rather than pushed, so a set gathered while network activity was on never reaches the client after it was turned off. A message line can show a message that clears itself after a few seconds, and Show details text is built from the failed step's operation, status and time. Headings use the Overview page's section size. Test: network activity off empties the client's endpoints, turning it on pushes them again at once, a quick off and on collects them again, and a quick on and off pushes only the empty set (networkResumePushesEndpointsAgain). The page is built from shared DashPay building blocks (qt/platform/platformui): the masternode dialogs' secondary-button style, busy bar and hints, and a message line with a Show details / Copy details disclosure. A failed Platform call is described in plain sentences mapped from its status kind and rs-dpp consensus code; the raw result is only in the details. A page that cannot start names what resolves it (Turn network on) or, for network settings, says what DashPay needs. Test: status descriptions are sentences without codes or internal messages, with the result in the details, and the mismatch text mentions -platformchainid only when it is set. DashPay is turned on and off in Options, Wallet, in a DashPay group for the wallet the main window shows (DashPayOptionsWidget). Opting in is a per-wallet record, not a global setting, so the group names the wallet, says each wallet has its own setting, and its Enable DashPay… or Disable DashPay… acts at once through the opt-in or a confirmation whose default is Cancel and whose destructive button is secondary, like Reset Options, never through the dialog's OK or Cancel. The DashPay tab has no Disable button: where DashPay is on but not working, the welcome and network-changed pages offer DashPay settings…, which opens that group. The Show DashPay Tab tooltip says hiding the tab does not turn DashPay off. Test: the group turns DashPay on through the opt-in and off through the confirmation, Cancel changes nothing, and the tab offers no Disable button (dashPayOptionsSection). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent 0a75528 commit c88813f

31 files changed

Lines changed: 2889 additions & 6 deletions

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ share/qt/Info.plist
5353

5454
src/qt/*.moc
5555
src/qt/moc_*.cpp
56+
src/qt/platform/moc_*.cpp
5657
src/qt/forms/ui_*.h
5758

5859
src/qt/test/moc*.cpp

‎src/Makefile.qt.include‎

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,15 @@ QT_MOC_CPP = \
122122
qt/moc_walletmodel.cpp \
123123
qt/moc_walletview.cpp
124124

125+
if ENABLE_PLATFORM_GUI
126+
QT_MOC_CPP += \
127+
qt/platform/moc_dashpayoptionswidget.cpp \
128+
qt/platform/moc_platformoptindialog.cpp \
129+
qt/platform/moc_platformpage.cpp \
130+
qt/platform/moc_platformservice.cpp \
131+
qt/platform/moc_platformui.cpp
132+
endif
133+
125134
BITCOIN_MM = \
126135
qt/macdockiconhandler.mm \
127136
qt/macnotificationhandler.mm \
@@ -224,6 +233,15 @@ BITCOIN_QT_H = \
224233
qt/walletview.h \
225234
qt/winshutdownmonitor.h
226235

236+
if ENABLE_PLATFORM_GUI
237+
BITCOIN_QT_H += \
238+
qt/platform/dashpayoptionswidget.h \
239+
qt/platform/platformoptindialog.h \
240+
qt/platform/platformpage.h \
241+
qt/platform/platformservice.h \
242+
qt/platform/platformui.h
243+
endif
244+
227245
QT_RES_ICONS = \
228246
qt/res/icons/address-book.png \
229247
qt/res/icons/connect1_16.png \
@@ -357,12 +375,22 @@ BITCOIN_QT_WALLET_CPP = \
357375
qt/walletmodeltransaction.cpp \
358376
qt/walletview.cpp
359377

378+
BITCOIN_QT_PLATFORM_CPP = \
379+
qt/platform/dashpayoptionswidget.cpp \
380+
qt/platform/platformoptindialog.cpp \
381+
qt/platform/platformpage.cpp \
382+
qt/platform/platformservice.cpp \
383+
qt/platform/platformui.cpp
384+
360385
BITCOIN_QT_CPP = $(BITCOIN_QT_BASE_CPP)
361386
if TARGET_WINDOWS
362387
BITCOIN_QT_CPP += $(BITCOIN_QT_WINDOWS_CPP)
363388
endif
364389
if ENABLE_WALLET
365390
BITCOIN_QT_CPP += $(BITCOIN_QT_WALLET_CPP)
391+
if ENABLE_PLATFORM_GUI
392+
BITCOIN_QT_CPP += $(BITCOIN_QT_PLATFORM_CPP)
393+
endif # ENABLE_PLATFORM_GUI
366394
endif # ENABLE_WALLET
367395

368396
QT_RES_IMAGES = \
@@ -521,7 +549,7 @@ $(srcdir)/qt/dashstrings.cpp: FORCE
521549

522550
# The resulted dash_en.xlf source file should follow Transifex requirements.
523551
# See: https://docs.transifex.com/formats/xliff#how-to-distinguish-between-a-source-file-and-a-translation-file
524-
translate: $(srcdir)/qt/dashstrings.cpp $(QT_FORMS_UI) $(QT_FORMS_UI) $(BITCOIN_QT_BASE_CPP) qt/bitcoin.cpp $(BITCOIN_QT_WINDOWS_CPP) $(BITCOIN_QT_WALLET_CPP) $(BITCOIN_QT_H) $(BITCOIN_MM)
552+
translate: $(srcdir)/qt/dashstrings.cpp $(QT_FORMS_UI) $(QT_FORMS_UI) $(BITCOIN_QT_BASE_CPP) qt/bitcoin.cpp $(BITCOIN_QT_WINDOWS_CPP) $(BITCOIN_QT_WALLET_CPP) $(BITCOIN_QT_PLATFORM_CPP) $(BITCOIN_QT_H) $(BITCOIN_MM)
525553
@test -n $(LUPDATE) || echo "lupdate is required for updating translations"
526554
$(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(LUPDATE) -no-obsolete -I $(srcdir) -locations relative $^ -ts $(srcdir)/qt/locale/dash_en.ts
527555
@test -n $(LCONVERT) || echo "lconvert is required for updating translations"
@@ -557,6 +585,7 @@ ui_%.h: %.ui
557585
$(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(MOC) $(DEFAULT_INCLUDES) $(QT_INCLUDES_UNSUPPRESSED) $(MOC_DEFS) $< > $@
558586

559587
moc_%.cpp: %.h
588+
@$(MKDIR_P) $(@D)
560589
$(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(MOC) $(DEFAULT_INCLUDES) $(QT_INCLUDES_UNSUPPRESSED) $(MOC_DEFS) $< > $@
561590

562591
%.qm: %.ts

‎src/Makefile.qttest.include‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ TEST_QT_MOC_CPP += \
2525
qt/test/moc_sharedmnwidgettests.cpp \
2626
qt/test/moc_sharedmnwizardtests.cpp \
2727
qt/test/moc_wallettests.cpp
28+
if ENABLE_PLATFORM_GUI
29+
TEST_QT_MOC_CPP += qt/test/moc_platformtests.cpp
30+
endif
2831
endif # ENABLE_WALLET
2932

3033
TEST_QT_H = \
@@ -35,6 +38,7 @@ TEST_QT_H = \
3538
qt/test/masternodetestutil.h \
3639
qt/test/masternodewidgettests.h \
3740
qt/test/optiontests.h \
41+
qt/test/platformtests.h \
3842
qt/test/proposalvotetests.h \
3943
qt/test/providertransactiontests.h \
4044
qt/test/rpcnestedtests.h \
@@ -73,6 +77,9 @@ qt_test_test_dash_qt_SOURCES += \
7377
qt/test/sharedmnwizardtests.cpp \
7478
qt/test/wallettests.cpp \
7579
wallet/test/wallet_test_fixture.cpp
80+
if ENABLE_PLATFORM_GUI
81+
qt_test_test_dash_qt_SOURCES += qt/test/platformtests.cpp
82+
endif
7683
endif # ENABLE_WALLET
7784

7885
nodist_qt_test_test_dash_qt_SOURCES = $(TEST_QT_MOC_CPP)

‎src/qt/bitcoin.cpp‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,9 @@ static void SetupUIArgs(ArgsManager& argsman)
498498
argsman.AddArg("-uiplatform", strprintf("Select platform to customize UI for (one of windows, macosx, other; default: %s)", GUIUtil::defaultUIPlatform()), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::GUI);
499499
argsman.AddArg("-debug-ui", "Updates the UI's stylesheets in realtime with changes made to the css files in -custom-css-dir and forces some widgets to show up which are usually only visible under certain circumstances. (default: 0)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::GUI);
500500
argsman.AddArg("-windowtitle=<name>", _("Sets a window title which is appended to \"Dash Core - \"").translated, ArgsManager::ALLOW_ANY, OptionsCategory::GUI);
501+
#ifdef ENABLE_PLATFORM_GUI
502+
argsman.AddArg("-platformchainid=<id>", "Tenderdash chain id DashPay verifies Platform responses against on testnet and devnets (GUI only; the chain id of mainnet cannot be overridden)", ArgsManager::ALLOW_ANY, OptionsCategory::GUI);
503+
#endif
501504
}
502505

503506
int GuiMain(int argc, char* argv[])
@@ -638,6 +641,14 @@ int GuiMain(int argc, char* argv[])
638641

639642
QScopedPointer<const NetworkStyle> networkStyle(NetworkStyle::instantiate(Params().NetworkIDString()));
640643
assert(!networkStyle.isNull());
644+
#ifdef ENABLE_PLATFORM_GUI
645+
if (gArgs.IsArgSet("-platformchainid") && Params().NetworkIDString() == CBaseChainParams::MAIN) {
646+
const bilingual_str error{_("-platformchainid cannot override the Platform chain id of mainnet.")};
647+
InitError(error);
648+
QMessageBox::critical(nullptr, PACKAGE_NAME, QString::fromStdString(error.translated));
649+
return EXIT_FAILURE;
650+
}
651+
#endif
641652
// Allow for separate UI settings for testnets
642653
// QApplication::setApplicationName(networkStyle->getAppName()); // moved to NetworkStyle::NetworkStyle
643654
// Re-initialize translations after changing application name (language in network-specific settings can be different)

‎src/qt/bitcoingui.cpp‎

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
#include <qt/openuridialog.h>
3333
#include <qt/optionsdialog.h>
3434
#include <qt/optionsmodel.h>
35+
#ifdef ENABLE_PLATFORM_GUI
36+
#include <qt/platform/dashpayoptionswidget.h>
37+
#endif
3538
#include <qt/proposallist.h>
3639
#include <qt/rpcconsole.h>
3740
#include <qt/utilitydialog.h>
@@ -775,6 +778,13 @@ void BitcoinGUI::createToolBars()
775778
coinJoinCoinsButton->setStatusTip(coinJoinCoinsAction->statusTip());
776779
tabGroup->addButton(coinJoinCoinsButton);
777780

781+
#ifdef ENABLE_PLATFORM_GUI
782+
platformButton = new QToolButton(this);
783+
platformButton->setText(tr("&DashPay"));
784+
platformButton->setStatusTip(tr("Usernames, profiles and contacts on Dash Platform"));
785+
tabGroup->addButton(platformButton);
786+
#endif
787+
778788
masternodeButton = new QToolButton(this);
779789
masternodeButton->setText(tr("&Masternodes"));
780790
masternodeButton->setStatusTip(tr("Browse masternodes"));
@@ -792,6 +802,9 @@ void BitcoinGUI::createToolBars()
792802
connect(historyButton, &QToolButton::clicked, this, &BitcoinGUI::gotoHistoryPage);
793803
connect(governanceButton, &QToolButton::clicked, this, &BitcoinGUI::gotoGovernancePage);
794804
connect(masternodeButton, &QToolButton::clicked, this, &BitcoinGUI::gotoMasternodePage);
805+
#ifdef ENABLE_PLATFORM_GUI
806+
connect(platformButton, &QToolButton::clicked, this, &BitcoinGUI::gotoPlatformPage);
807+
#endif
795808

796809
// Give the selected tab button a bolder font.
797810
connect(tabGroup, qOverload<QAbstractButton *, bool>(&QButtonGroup::buttonToggled), this, &BitcoinGUI::highlightTabButton);
@@ -805,6 +818,9 @@ void BitcoinGUI::createToolBars()
805818
if (button == coinJoinCoinsButton) { m_coinjoin_action = action; }
806819
else if (button == governanceButton) { m_governance_action = action; }
807820
else if (button == masternodeButton) { m_masternode_action = action; }
821+
#ifdef ENABLE_PLATFORM_GUI
822+
else if (button == platformButton) { m_platform_action = action; }
823+
#endif
808824
}
809825

810826
overviewButton->setChecked(true);
@@ -931,6 +947,9 @@ void BitcoinGUI::setClientModel(ClientModel *_clientModel, interfaces::BlockAndH
931947
connect(optionsModel, &OptionsModel::showGovernanceChanged, this, &BitcoinGUI::updateGovernanceVisibility);
932948
connect(optionsModel, &OptionsModel::showGovernanceClockChanged, this, &BitcoinGUI::updateGovernanceCycleIcon);
933949
connect(optionsModel, &OptionsModel::showMasternodesChanged, this, &BitcoinGUI::updateMasternodesVisibility);
950+
#ifdef ENABLE_PLATFORM_GUI
951+
connect(optionsModel, &OptionsModel::showPlatformChanged, this, &BitcoinGUI::updatePlatformVisibility);
952+
#endif
934953

935954
if (trayIcon) {
936955
// be aware of the tray icon disable state change reported by the OptionsModel object.
@@ -968,6 +987,9 @@ void BitcoinGUI::setClientModel(ClientModel *_clientModel, interfaces::BlockAndH
968987
updateCoinJoinVisibility();
969988
updateGovernanceVisibility();
970989
updateMasternodesVisibility();
990+
#ifdef ENABLE_PLATFORM_GUI
991+
updatePlatformVisibility();
992+
#endif
971993
}
972994

973995
#ifdef ENABLE_WALLET
@@ -1023,6 +1045,10 @@ void BitcoinGUI::addWallet(WalletModel* walletModel)
10231045
});
10241046
connect(wallet_view, &WalletView::encryptionStatusChanged, this, &BitcoinGUI::updateWalletStatus);
10251047
connect(wallet_view, &WalletView::incomingTransaction, this, &BitcoinGUI::incomingTransaction);
1048+
#ifdef ENABLE_PLATFORM_GUI
1049+
connect(wallet_view, &WalletView::dashPaySettingsRequested, this,
1050+
[this] { openOptionsDialogWithTab(OptionsDialog::TAB_WALLET); });
1051+
#endif
10261052
connect(wallet_view, &WalletView::showProposalInfo, this, [this] {
10271053
rpcConsole->setInfoView(RPCConsole::InfoView::Governance);
10281054
showDebugWindow();
@@ -1341,6 +1367,16 @@ void BitcoinGUI::gotoMasternodePage()
13411367
}
13421368
}
13431369

1370+
#ifdef ENABLE_PLATFORM_GUI
1371+
void BitcoinGUI::gotoPlatformPage()
1372+
{
1373+
if (platformButton) {
1374+
platformButton->setChecked(true);
1375+
if (walletFrame) walletFrame->gotoPlatformPage();
1376+
}
1377+
}
1378+
#endif
1379+
13441380
void BitcoinGUI::gotoReceiveCoinsPage()
13451381
{
13461382
receiveCoinsButton->setChecked(true);
@@ -1490,6 +1526,13 @@ void BitcoinGUI::openOptionsDialogWithTab(OptionsDialog::Tab tab)
14901526
dlg->setCurrentTab(tab);
14911527
dlg->setClientModel(clientModel);
14921528
dlg->setModel(clientModel->getOptionsModel());
1529+
#ifdef ENABLE_PLATFORM_GUI
1530+
// DashPay is turned on and off per wallet: the section is for the wallet
1531+
// the window shows, which cannot change while the dialog is open.
1532+
if (WalletView* view{walletFrame ? walletFrame->currentWalletView() : nullptr}; view && view->getPlatformPage()) {
1533+
dlg->addWalletSection(new DashPayOptionsWidget(*view->getPlatformPage(), *view->getWalletModel(), dlg));
1534+
}
1535+
#endif
14931536
connect(dlg, &OptionsDialog::appearanceChanged, [this]() {
14941537
updateWidth();
14951538
});
@@ -1577,6 +1620,29 @@ void BitcoinGUI::updateMasternodesVisibility()
15771620
updateWidth();
15781621
}
15791622

1623+
#ifdef ENABLE_PLATFORM_GUI
1624+
void BitcoinGUI::updatePlatformVisibility()
1625+
{
1626+
if (!clientModel || !clientModel->getOptionsModel()) return;
1627+
const bool fShow = clientModel->getOptionsModel()->getShowPlatformTab();
1628+
1629+
// Show/hide the underlying QAction, hiding the QToolButton itself doesn't
1630+
// work for the GUI part but is still needed for shortcuts to work properly.
1631+
if (m_platform_action) m_platform_action->setVisible(fShow);
1632+
if (platformButton) {
1633+
#ifdef ENABLE_WALLET
1634+
if (!fShow && platformButton->isChecked()) {
1635+
gotoOverviewPage();
1636+
}
1637+
#endif // ENABLE_WALLET
1638+
platformButton->setVisible(fShow);
1639+
}
1640+
1641+
GUIUtil::updateButtonGroupShortcuts(tabGroup);
1642+
updateWidth();
1643+
}
1644+
#endif // ENABLE_PLATFORM_GUI
1645+
15801646
void BitcoinGUI::updateWidth()
15811647
{
15821648
if (walletFrame == nullptr) {

‎src/qt/bitcoingui.h‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ class BitcoinGUI : public QMainWindow
143143
QToolButton* historyButton = nullptr;
144144
QToolButton* masternodeButton = nullptr;
145145
QToolButton* governanceButton = nullptr;
146+
#ifdef ENABLE_PLATFORM_GUI
147+
QToolButton* platformButton = nullptr;
148+
#endif
146149
QAction* appToolBarLogoAction = nullptr;
147150
QAction* quitAction = nullptr;
148151
QAction* sendCoinsAction = nullptr;
@@ -154,6 +157,9 @@ class BitcoinGUI : public QMainWindow
154157
QAction* m_coinjoin_action = nullptr;
155158
QAction* m_governance_action = nullptr;
156159
QAction* m_masternode_action = nullptr;
160+
#ifdef ENABLE_PLATFORM_GUI
161+
QAction* m_platform_action = nullptr;
162+
#endif
157163
QAction* m_load_psbt_action = nullptr;
158164
QAction* m_load_psbt_clipboard_action = nullptr;
159165
QAction* aboutAction = nullptr;
@@ -356,6 +362,10 @@ public Q_SLOTS:
356362
void gotoHistoryPage();
357363
/** Switch to masternode page */
358364
void gotoMasternodePage();
365+
#ifdef ENABLE_PLATFORM_GUI
366+
/** Switch to DashPay (Dash Platform) page */
367+
void gotoPlatformPage();
368+
#endif
359369
/** Switch to receive coins page */
360370
void gotoReceiveCoinsPage();
361371
/** Switch to send coins page */
@@ -417,6 +427,9 @@ public Q_SLOTS:
417427
void updateCoinJoinVisibility();
418428
void updateGovernanceVisibility();
419429
void updateMasternodesVisibility();
430+
#ifdef ENABLE_PLATFORM_GUI
431+
void updatePlatformVisibility();
432+
#endif
420433

421434
void updateWidth();
422435
};

‎src/qt/forms/optionsdialog.ui‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,6 +1080,16 @@ https://explore.transifex.com/dash/dash/</string>
10801080
</property>
10811081
</widget>
10821082
</item>
1083+
<item>
1084+
<widget class="QCheckBox" name="showPlatformTab">
1085+
<property name="toolTip">
1086+
<string>Show additional tab for DashPay usernames, profiles and contacts on Dash Platform. Hiding the tab doesn't turn DashPay off; use Wallet → DashPay for that.</string>
1087+
</property>
1088+
<property name="text">
1089+
<string>Show DashPay Tab</string>
1090+
</property>
1091+
</widget>
1092+
</item>
10831093
<item>
10841094
<widget class="QCheckBox" name="showGovernanceTab">
10851095
<property name="toolTip">

‎src/qt/optionsdialog.cpp‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ OptionsDialog::OptionsDialog(QWidget* parent, bool enableWallet)
111111

112112
pageButtons = new QButtonGroup(this);
113113
pageButtons->addButton(ui->btnMain, pageButtons->buttons().size());
114+
#ifndef ENABLE_PLATFORM_GUI
115+
ui->showPlatformTab->hide();
116+
#endif
114117
/* Remove Wallet/CoinJoin tabs and 3rd party-URL textbox in case of -disablewallet */
115118
if (!m_enable_wallet) {
116119
ui->stackedWidgetOptions->removeWidget(ui->pageWallet);
@@ -120,6 +123,7 @@ OptionsDialog::OptionsDialog(QWidget* parent, bool enableWallet)
120123
ui->thirdPartyTxUrlsLabel->setVisible(false);
121124
ui->thirdPartyTxUrls->setVisible(false);
122125
ui->showMasternodesTab->hide();
126+
ui->showPlatformTab->hide();
123127
ui->showGovernanceTab->hide();
124128
ui->showGovernanceCycleIcon->hide();
125129
} else {
@@ -342,6 +346,12 @@ void OptionsDialog::setCurrentTab(OptionsDialog::Tab tab)
342346
showPage(std23::to_underlying(tab));
343347
}
344348

349+
void OptionsDialog::addWalletSection(QWidget* section)
350+
{
351+
// Above the spacer that keeps the page's content at the top.
352+
ui->verticalLayout_Wallet->insertWidget(ui->verticalLayout_Wallet->count() - 1, section);
353+
}
354+
345355
void OptionsDialog::setMapper()
346356
{
347357
/* Main */
@@ -394,6 +404,9 @@ void OptionsDialog::setMapper()
394404

395405
/* Display */
396406
mapper->addMapping(ui->showMasternodesTab, OptionsModel::ShowMasternodesTab);
407+
#ifdef ENABLE_PLATFORM_GUI
408+
mapper->addMapping(ui->showPlatformTab, OptionsModel::ShowPlatformTab);
409+
#endif
397410
mapper->addMapping(ui->showGovernanceCycleIcon, OptionsModel::ShowGovernanceClock);
398411
mapper->addMapping(ui->showGovernanceTab, OptionsModel::ShowGovernanceTab);
399412
mapper->addMapping(ui->digits, OptionsModel::Digits);

‎src/qt/optionsdialog.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ class OptionsDialog : public QDialog
5656
void setModel(OptionsModel *model);
5757
void setMapper();
5858
void setCurrentTab(OptionsDialog::Tab tab);
59+
//! Add a section to the end of the Wallet page (the current wallet's
60+
//! DashPay setting).
61+
void addWalletSection(QWidget* section);
5962

6063
private Q_SLOTS:
6164
/** custom tab buttons clicked */

0 commit comments

Comments
 (0)