From ed9dc5fbec0eb86d758a40ac82ccc21167ae14b1 Mon Sep 17 00:00:00 2001
From: Remapper <65514187+Remapper@users.noreply.github.com>
Date: Thu, 2 Jul 2020 20:41:59 +0100
Subject: [PATCH] Add masternode count to GUI info
---
share/genbuild.sh | 2 +-
.../forms/settingsinformationwidget.ui | 61 ++++++++++++++++++-
.../settings/settingsinformationwidget.cpp | 11 +++-
.../pivx/settings/settingsinformationwidget.h | 1 +
4 files changed, 72 insertions(+), 3 deletions(-)
diff --git a/share/genbuild.sh b/share/genbuild.sh
index 519cc6e8f13fb..c20aab4b19899 100755
--- a/share/genbuild.sh
+++ b/share/genbuild.sh
@@ -35,7 +35,7 @@ if [ "${BITCOIN_GENBUILD_NO_GIT}" != "1" -a -e "$(which git 2>/dev/null)" -a "$(
git diff-index --quiet HEAD -- && DESC=$RAWDESC
fi
- # otherwise generate suffix from git, i.e. string like "59887e8-dirty"
+ # otherwise generate suffix from git, i.e. string like "59887e8-Release"
SUFFIX=$(git rev-parse --short HEAD)
git diff-index --quiet HEAD -- || SUFFIX="$SUFFIX-dirty"
diff --git a/src/qt/pivx/settings/forms/settingsinformationwidget.ui b/src/qt/pivx/settings/forms/settingsinformationwidget.ui
index 26f1d6c4487e5..4ea892ee73d66 100644
--- a/src/qt/pivx/settings/forms/settingsinformationwidget.ui
+++ b/src/qt/pivx/settings/forms/settingsinformationwidget.ui
@@ -488,8 +488,67 @@
-
+
+ IBeamCursor
+
+
+ Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse
+
+
+ N/A
+
+
+
+
+
+
+ -
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 10
+
+
-
+
+
+
+ 290
+ 0
+
+
+
+
+ 290
+ 16777215
+
+
+
+ Number of Masternodes:
+
+
+
+ -
+
+
+ IBeamCursor
+
+
+ Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse
+
- TextLabel
+ N/A
diff --git a/src/qt/pivx/settings/settingsinformationwidget.cpp b/src/qt/pivx/settings/settingsinformationwidget.cpp
index 880b1c8204044..01579be439d6e 100644
--- a/src/qt/pivx/settings/settingsinformationwidget.cpp
+++ b/src/qt/pivx/settings/settingsinformationwidget.cpp
@@ -23,7 +23,7 @@ SettingsInformationWidget::SettingsInformationWidget(PIVXGUI* _window,QWidget *p
// Containers
setCssProperty(ui->left, "container");
ui->left->setContentsMargins(10,10,10,10);
- setCssProperty({ui->layoutOptions1, ui->layoutOptions2, ui->layoutOptions3}, "container-options");
+ setCssProperty({ ui->layoutOptions1, ui->layoutOptions2_1, ui->layoutOptions3 }, "container-options");
// Title
ui->labelTitle->setText(tr("Information"));
@@ -47,6 +47,7 @@ SettingsInformationWidget::SettingsInformationWidget(PIVXGUI* _window,QWidget *p
ui->labelTitleTime,
ui->labelTitleName,
ui->labelTitleConnections,
+ ui->labelTitleMasternodes,
ui->labelTitleBlockNumber,
ui->labelTitleBlockTime,
ui->labelTitleNumberTransactions,
@@ -57,6 +58,7 @@ SettingsInformationWidget::SettingsInformationWidget(PIVXGUI* _window,QWidget *p
ui->labelInfoDataDir,
ui->labelInfoTime,
ui->labelInfoConnections,
+ ui->labelInfoMasternodes,
ui->labelInfoBlockNumber
}, "text-main-settings");
@@ -85,6 +87,7 @@ SettingsInformationWidget::SettingsInformationWidget(PIVXGUI* _window,QWidget *p
ui->labelInfoName->setText(tr("Main"));
ui->labelInfoName->setProperty("cssClass", "text-main-settings");
ui->labelInfoConnections->setText("0 (In: 0 / Out:0)");
+ ui->labelInfoMasternodes->setText("Total: 0 (IPv4: 0 / IPv6: 0 / Tor: 0 / Unknown: 0)");
// Information Blockchain
ui->labelInfoBlockNumber->setText("0");
@@ -133,6 +136,7 @@ void SettingsInformationWidget::loadClientModel(){
setNumBlocks(clientModel->getNumBlocks());
connect(clientModel, &ClientModel::numBlocksChanged, this, &SettingsInformationWidget::setNumBlocks);
+ connect(clientModel, &ClientModel::strMasternodesChanged, this, &SettingsInformationWidget::setMasternodeCount);
}
}
@@ -153,6 +157,11 @@ void SettingsInformationWidget::setNumBlocks(int count){
ui->labelInfoBlockTime->setText(clientModel->getLastBlockDate().toString());
}
+void SettingsInformationWidget::setMasternodeCount(const QString& strMasternodes)
+{
+ ui->labelInfoMasternodes->setText(strMasternodes);
+}
+
void SettingsInformationWidget::openNetworkMonitor(){
if(!rpcConsole){
rpcConsole = new RPCConsole(0);
diff --git a/src/qt/pivx/settings/settingsinformationwidget.h b/src/qt/pivx/settings/settingsinformationwidget.h
index 1531829d49036..f5a6dd9098c3b 100644
--- a/src/qt/pivx/settings/settingsinformationwidget.h
+++ b/src/qt/pivx/settings/settingsinformationwidget.h
@@ -26,6 +26,7 @@ class SettingsInformationWidget : public PWidget
private Q_SLOTS:
void setNumConnections(int count);
void setNumBlocks(int count);
+ void setMasternodeCount(const QString& strMasternodes);
void openNetworkMonitor();
private: