PIVX Core  5.6.99
P2P Digital Currency
mnrow.cpp
Go to the documentation of this file.
1 // Copyright (c) 2019-2021 The PIVX Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #include "mnrow.h"
6 #include "ui_mnrow.h"
7 
8 #include "qtutils.h"
9 
10 MNRow::MNRow(QWidget *parent) :
11  QWidget(parent),
12  ui(new Ui::MNRow)
13 {
14  ui->setupUi(this);
15  setCssProperty(ui->labelAddress, "text-list-body2");
16  setCssProperty(ui->labelName, "text-list-title1");
17  setCssProperty(ui->labelDate, "text-list-caption-medium");
18  ui->lblDivisory->setStyleSheet("background-color:#bababa;");
19 }
20 
21 void MNRow::updateView(QString address, const QString& label, QString status, bool wasCollateralAccepted)
22 {
23  ui->labelName->setText(label);
24  address = address.size() < 40 ? address : address.left(20) + "..." + address.right(20);
25  ui->labelAddress->setText(address);
26  if (!wasCollateralAccepted) status = tr("Collateral tx not found");
27  ui->labelDate->setText(tr("Status: %1").arg(status));
28 }
29 
31 {
32  delete ui;
33 }
Definition: mnrow.h:15
~MNRow()
Definition: mnrow.cpp:30
Ui::MNRow * ui
Definition: mnrow.h:27
void updateView(QString address, const QString &label, QString status, bool wasCollateralAccepted)
Definition: mnrow.cpp:21
MNRow(QWidget *parent=nullptr)
Definition: mnrow.cpp:10
void setCssProperty(std::initializer_list< QWidget * > args, const QString &value)
Definition: qtutils.cpp:334