Skip to content

Commit

Permalink
Add masternode count to GUI info
Browse files Browse the repository at this point in the history
  • Loading branch information
Remapper authored and Remapper committed Jul 2, 2020
1 parent afdd18f commit ed9dc5f
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 3 deletions.
2 changes: 1 addition & 1 deletion share/genbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
61 changes: 60 additions & 1 deletion src/qt/pivx/settings/forms/settingsinformationwidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,67 @@
</item>
<item>
<widget class="QLabel" name="labelInfoConnections">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
<property name="text">
<string>N/A</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="layoutOptions2_1" native="true">
<layout class="QHBoxLayout" name="horizontalMasternodes" stretch="0,1">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>10</number>
</property>
<item>
<widget class="QLabel" name="labelTitleMasternodes">
<property name="minimumSize">
<size>
<width>290</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>290</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Number of Masternodes:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="labelInfoMasternodes">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
<property name="text">
<string>TextLabel</string>
<string notr="true">N/A</string>
</property>
</widget>
</item>
Expand Down
11 changes: 10 additions & 1 deletion src/qt/pivx/settings/settingsinformationwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand All @@ -47,6 +47,7 @@ SettingsInformationWidget::SettingsInformationWidget(PIVXGUI* _window,QWidget *p
ui->labelTitleTime,
ui->labelTitleName,
ui->labelTitleConnections,
ui->labelTitleMasternodes,
ui->labelTitleBlockNumber,
ui->labelTitleBlockTime,
ui->labelTitleNumberTransactions,
Expand All @@ -57,6 +58,7 @@ SettingsInformationWidget::SettingsInformationWidget(PIVXGUI* _window,QWidget *p
ui->labelInfoDataDir,
ui->labelInfoTime,
ui->labelInfoConnections,
ui->labelInfoMasternodes,
ui->labelInfoBlockNumber
}, "text-main-settings");

Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -133,6 +136,7 @@ void SettingsInformationWidget::loadClientModel(){

setNumBlocks(clientModel->getNumBlocks());
connect(clientModel, &ClientModel::numBlocksChanged, this, &SettingsInformationWidget::setNumBlocks);
connect(clientModel, &ClientModel::strMasternodesChanged, this, &SettingsInformationWidget::setMasternodeCount);
}
}

Expand All @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/qt/pivx/settings/settingsinformationwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit ed9dc5f

Please sign in to comment.