diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index e884f29975..9dcb9d68ad 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -583,6 +583,7 @@ void BitcoinGUI::createToolBars() masternodeButton->setStatusTip(tr("Browse masternodes")); tabGroup->addButton(masternodeButton); connect(masternodeButton, SIGNAL(clicked()), this, SLOT(gotoMasternodePage())); + masternodeButton->setEnabled(true); } connect(overviewButton, SIGNAL(clicked()), this, SLOT(gotoOverviewPage())); @@ -805,10 +806,6 @@ void BitcoinGUI::setWalletActionsEnabled(bool enabled) coinJoinCoinsButton->setEnabled(enabled && clientModel->coinJoinOptions().isEnabled()); receiveCoinsButton->setEnabled(enabled); historyButton->setEnabled(enabled); - if (masternodeButton != nullptr) { - QSettings settings; - masternodeButton->setEnabled(enabled && settings.value("fShowMasternodesTab").toBool()); - } } #endif // ENABLE_WALLET diff --git a/src/qt/masternodelist.cpp b/src/qt/masternodelist.cpp index 386b53be11..20db3e4bd5 100644 --- a/src/qt/masternodelist.cpp +++ b/src/qt/masternodelist.cpp @@ -91,6 +91,7 @@ MasternodeList::MasternodeList(QWidget* parent) : ui->tableWidgetMasternodesDIP3->setContextMenuPolicy(Qt::CustomContextMenu); ui->filterLineEditDIP3->setPlaceholderText(tr("Filter by any property (e.g. address or protx hash)")); + ui->checkBoxMyMasternodesOnly->setEnabled(false); QAction* copyProTxHashAction = new QAction(tr("Copy ProTx Hash"), this); QAction* copyCollateralOutpointAction = new QAction(tr("Copy Collateral Outpoint"), this); @@ -126,6 +127,7 @@ void MasternodeList::setClientModel(ClientModel* model) void MasternodeList::setWalletModel(WalletModel* model) { this->walletModel = model; + ui->checkBoxMyMasternodesOnly->setEnabled(model != nullptr); } void MasternodeList::showContextMenuDIP3(const QPoint& point) diff --git a/src/qt/walletframe.cpp b/src/qt/walletframe.cpp index e4cc1ba15f..42ecc02b5c 100644 --- a/src/qt/walletframe.cpp +++ b/src/qt/walletframe.cpp @@ -6,6 +6,7 @@ #include #include +#include #include #include @@ -28,6 +29,9 @@ WalletFrame::WalletFrame(BitcoinGUI* _gui) : QLabel *noWallet = new QLabel(tr("No wallet has been loaded.")); noWallet->setAlignment(Qt::AlignCenter); walletStack->addWidget(noWallet); + + masternodeListPage = new MasternodeList(); + walletStack->addWidget(masternodeListPage); } WalletFrame::~WalletFrame() @@ -38,6 +42,8 @@ void WalletFrame::setClientModel(ClientModel *_clientModel) { this->clientModel = _clientModel; + masternodeListPage->setClientModel(_clientModel); + for (auto i = mapWalletViews.constBegin(); i != mapWalletViews.constEnd(); ++i) { i.value()->setClientModel(_clientModel); } @@ -144,6 +150,12 @@ void WalletFrame::gotoHistoryPage() void WalletFrame::gotoMasternodePage() { QMap::const_iterator i; + + if (mapWalletViews.empty()) { + walletStack->setCurrentWidget(masternodeListPage); + return; + } + for (i = mapWalletViews.constBegin(); i != mapWalletViews.constEnd(); ++i) i.value()->gotoMasternodePage(); } diff --git a/src/qt/walletframe.h b/src/qt/walletframe.h index f3f1d777a7..4e02de5aee 100644 --- a/src/qt/walletframe.h +++ b/src/qt/walletframe.h @@ -13,6 +13,7 @@ class ClientModel; class SendCoinsRecipient; class WalletModel; class WalletView; +class MasternodeList; QT_BEGIN_NAMESPACE class QStackedWidget; @@ -53,6 +54,7 @@ private: BitcoinGUI *gui; ClientModel *clientModel; QMap mapWalletViews; + MasternodeList* masternodeListPage; bool bOutOfSync;