mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
feat(qt): add MN type to MN tab (#5201)
## Issue being fixed or feature implemented Added a "Type" column on the masternode tab so it's easy to distinguish between regular and HPMN ## What was done? Added column with type ## How Has This Been Tested? Built locally and tried on devnet with an HPMN registered ## Breaking Changes <!--- Please describe any breaking changes your code introduces --> ## Checklist: <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation **For repository code-owners and collaborators only** - [x] I have assigned this pull request to a milestone --------- Co-authored-by: Odysseas Gabrielides <odysseas.gabrielides@gmail.com>
This commit is contained in:
parent
50f16bc753
commit
919f6306fe
@ -132,6 +132,11 @@
|
||||
<string>Service</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Type</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Status</string>
|
||||
|
@ -58,6 +58,7 @@ MasternodeList::MasternodeList(QWidget* parent) :
|
||||
GUIUtil::setFont({ui->label_filter_2}, GUIUtil::FontWeight::Normal, 15);
|
||||
|
||||
int columnAddressWidth = 200;
|
||||
int columnTypeWidth = 160;
|
||||
int columnStatusWidth = 80;
|
||||
int columnPoSeScoreWidth = 80;
|
||||
int columnRegisteredWidth = 80;
|
||||
@ -70,6 +71,7 @@ MasternodeList::MasternodeList(QWidget* parent) :
|
||||
int columnVotingWidth = 130;
|
||||
|
||||
ui->tableWidgetMasternodesDIP3->setColumnWidth(COLUMN_SERVICE, columnAddressWidth);
|
||||
ui->tableWidgetMasternodesDIP3->setColumnWidth(COLUMN_TYPE, columnTypeWidth);
|
||||
ui->tableWidgetMasternodesDIP3->setColumnWidth(COLUMN_STATUS, columnStatusWidth);
|
||||
ui->tableWidgetMasternodesDIP3->setColumnWidth(COLUMN_POSE, columnPoSeScoreWidth);
|
||||
ui->tableWidgetMasternodesDIP3->setColumnWidth(COLUMN_REGISTERED, columnRegisteredWidth);
|
||||
@ -230,6 +232,7 @@ void MasternodeList::updateDIP3List()
|
||||
auto addr_key = dmn.pdmnState->addr.GetKey();
|
||||
QByteArray addr_ba(reinterpret_cast<const char*>(addr_key.data()), addr_key.size());
|
||||
QTableWidgetItem* addressItem = new CMasternodeListWidgetItem<QByteArray>(QString::fromStdString(dmn.pdmnState->addr.ToString()), addr_ba);
|
||||
QTableWidgetItem* typeItem = new QTableWidgetItem(QString::fromStdString(std::string(GetMnType(dmn.nType).description)));
|
||||
QTableWidgetItem* statusItem = new QTableWidgetItem(mnList.IsMNValid(dmn) ? tr("ENABLED") : (mnList.IsMNPoSeBanned(dmn) ? tr("POSE_BANNED") : tr("UNKNOWN")));
|
||||
QTableWidgetItem* PoSeScoreItem = new CMasternodeListWidgetItem<int>(QString::number(dmn.pdmnState->nPoSePenalty), dmn.pdmnState->nPoSePenalty);
|
||||
QTableWidgetItem* registeredItem = new CMasternodeListWidgetItem<int>(QString::number(dmn.pdmnState->nRegisteredHeight), dmn.pdmnState->nRegisteredHeight);
|
||||
@ -284,6 +287,7 @@ void MasternodeList::updateDIP3List()
|
||||
|
||||
if (strCurrentFilterDIP3 != "") {
|
||||
strToFilter = addressItem->text() + " " +
|
||||
typeItem->text() + " " +
|
||||
statusItem->text() + " " +
|
||||
PoSeScoreItem->text() + " " +
|
||||
registeredItem->text() + " " +
|
||||
@ -300,6 +304,7 @@ void MasternodeList::updateDIP3List()
|
||||
|
||||
ui->tableWidgetMasternodesDIP3->insertRow(0);
|
||||
ui->tableWidgetMasternodesDIP3->setItem(0, COLUMN_SERVICE, addressItem);
|
||||
ui->tableWidgetMasternodesDIP3->setItem(0, COLUMN_TYPE, typeItem);
|
||||
ui->tableWidgetMasternodesDIP3->setItem(0, COLUMN_STATUS, statusItem);
|
||||
ui->tableWidgetMasternodesDIP3->setItem(0, COLUMN_POSE, PoSeScoreItem);
|
||||
ui->tableWidgetMasternodesDIP3->setItem(0, COLUMN_REGISTERED, registeredItem);
|
||||
|
@ -42,6 +42,7 @@ public:
|
||||
|
||||
enum {
|
||||
COLUMN_SERVICE,
|
||||
COLUMN_TYPE,
|
||||
COLUMN_STATUS,
|
||||
COLUMN_POSE,
|
||||
COLUMN_REGISTERED,
|
||||
|
Loading…
Reference in New Issue
Block a user