Skip to content

Commit f44878d

Browse files
committed
Unconfirmed transactions status connected (style).
1 parent a589c7d commit f44878d

File tree

6 files changed

+53
-16
lines changed

6 files changed

+53
-16
lines changed

src/qt/pivx/res/css/style_light.css

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,11 @@ HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH*/
616616
font-size:16px;
617617
}
618618

619+
*[cssClass="text-list-body-unconfirmed"] {
620+
color:#B6B6B6;
621+
font-size:16px;
622+
}
623+
619624
*[cssClass="text-list-body2"] {
620625
color:#707070;
621626
font-size:15.5px;
@@ -641,6 +646,10 @@ HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH*/
641646
color:#707070;
642647
}
643648

649+
*[cssClass="text-list-caption-unconfirmed"] {
650+
color:#B6B6B6;
651+
}
652+
644653
*[cssClass="text-list-caption-grey"] {
645654
color:#707070;
646655
font-size:12px;
@@ -658,6 +667,11 @@ HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH*/
658667
font-size:16px;
659668
}
660669

670+
*[cssClass="text-list-amount-unconfirmed"] {
671+
color:#B6B6B6;
672+
font-size:16px;
673+
}
674+
661675

662676
/*HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
663677
HH TEXT

src/qt/pivx/txrow.cpp

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,20 @@ TxRow::TxRow(bool isLightTheme, QWidget *parent) :
99
ui(new Ui::TxRow)
1010
{
1111
ui->setupUi(this);
12-
13-
ui->lblAddress->setProperty("cssClass", "text-list-body1");
14-
ui->lblDate->setProperty("cssClass", "text-list-caption");
15-
12+
setConfirmStatus(true);
1613
updateStatus(isLightTheme, false, false);
1714
}
1815

16+
void TxRow::setConfirmStatus(bool isConfirm){
17+
if(isConfirm){
18+
ui->lblAddress->setProperty("cssClass", "text-list-body1");
19+
ui->lblDate->setProperty("cssClass", "text-list-caption");
20+
}else{
21+
ui->lblAddress->setProperty("cssClass", "text-list-body-unconfirmed");
22+
ui->lblDate->setProperty("cssClass","text-list-caption-unconfirmed");
23+
}
24+
}
25+
1926
void TxRow::updateStatus(bool isLightTheme, bool isHover, bool isSelected){
2027
if(isLightTheme)
2128
ui->lblDivisory->setStyleSheet("background-color:#bababa");
@@ -36,7 +43,7 @@ void TxRow::setAmount(QString str){
3643
}
3744

3845
// TODO: Agregar send to zPIV and receive zPIV icons..
39-
void TxRow::setType(bool isLightTheme, TransactionRecord::Type type){
46+
void TxRow::setType(bool isLightTheme, TransactionRecord::Type type, bool isConfirmed){
4047
QString path;
4148
QString css;
4249
switch (type) {
@@ -74,6 +81,13 @@ void TxRow::setType(bool isLightTheme, TransactionRecord::Type type){
7481
path = ":/icons/tx_inout";
7582
break;
7683
}
84+
if (!isConfirmed){
85+
css = "text-list-amount-unconfirmed";
86+
setConfirmStatus(false);
87+
}else{
88+
setConfirmStatus(true);
89+
}
90+
7791
if (!isLightTheme){
7892
path += "-dark";
7993
}

src/qt/pivx/txrow.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,12 @@ class TxRow : public QWidget
2828
void setDate(QDateTime);
2929
void setLabel(QString);
3030
void setAmount(QString);
31-
void setType(bool isLightTheme, TransactionRecord::Type type);
31+
void setType(bool isLightTheme, TransactionRecord::Type type, bool isConfirmed);
32+
void setConfirmStatus(bool isConfirmed);
3233

3334
private:
3435
Ui::TxRow *ui;
36+
bool isConfirmed = false;
3537
};
3638

3739
#endif // TXROW_H

src/qt/pivx/txviewholder.cpp

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,26 @@ void TxViewHolder::init(QWidget* holder,const QModelIndex &index, bool isHovered
1919
QModelIndex rIndex = (filter) ? filter->mapToSource(index) : index;
2020
TransactionRecord *rec = static_cast<TransactionRecord*>(rIndex.internalPointer());
2121
QDateTime date = rIndex.data(TransactionTableModel::DateRole).toDateTime();
22-
QString address = rIndex.data(Qt::DisplayRole).toString();
2322
qint64 amount = rIndex.data(TransactionTableModel::AmountRole).toLongLong();
24-
bool isConfirmed = rIndex.data(TransactionTableModel::ConfirmedRole).toBool();
23+
//bool isConfirmed = rIndex.data(TransactionTableModel::ConfirmedRole).toBool();
2524
QString amountText = BitcoinUnits::formatWithUnit(nDisplayUnit, amount, true, BitcoinUnits::separatorAlways);
2625
QModelIndex indexType = rIndex.sibling(rIndex.row(),TransactionTableModel::Type);
27-
if(address.length() > 20) {
28-
address = address.left(ADDRESS_SIZE) + "..." + address.right(ADDRESS_SIZE);
26+
bool isUnconfirmed = (rec->status.status == TransactionStatus::Unconfirmed) || (rec->status.status == TransactionStatus::Immature);
27+
QString label = indexType.data(Qt::DisplayRole).toString();
28+
if(rec->type != TransactionRecord::ZerocoinMint &&
29+
rec->type != TransactionRecord::ZerocoinSpend_Change_zPiv &&
30+
rec->type != TransactionRecord::StakeZPIV){
31+
QString address = rIndex.data(Qt::DisplayRole).toString();
32+
if(address.length() > 20) {
33+
address = address.left(ADDRESS_SIZE) + "..." + address.right(ADDRESS_SIZE);
34+
}
35+
label += " " + address;
2936
}
30-
QString label = indexType.data(Qt::DisplayRole).toString() + " " + address;
31-
32-
//std::cout << "label: " << label.toStdString() << ", type: " << rec->type << std::endl;
3337

3438
txRow->setDate(date);
3539
txRow->setLabel(label);
3640
txRow->setAmount(amountText);
37-
txRow->setType(isLightTheme, rec->type);
41+
txRow->setType(isLightTheme, rec->type, !isUnconfirmed);
3842
}
3943

4044
QColor TxViewHolder::rectColor(bool isHovered, bool isSelected){

src/qt/transactionfilterproxy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ TransactionFilterProxy::TransactionFilterProxy(QObject* parent) : QSortFilterPro
2626
minAmount(0),
2727
limitRows(-1),
2828
showInactive(true),
29-
fHideOrphans(false)
29+
fHideOrphans(true)
3030
{
3131
}
3232

src/qt/transactiontablemodel.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,10 @@ QString TransactionTableModel::formatTxToAddress(const TransactionRecord* wtx, b
434434
case TransactionRecord::ZerocoinSpend_Change_zPiv:
435435
case TransactionRecord::StakeZPIV:
436436
return tr("Anonymous");
437-
case TransactionRecord::SendToSelf:
437+
case TransactionRecord::SendToSelf: {
438+
QString label = walletModel->getAddressTableModel()->labelForAddress(QString::fromStdString(wtx->address));
439+
return label.isEmpty() ? "" : label;
440+
}
438441
default:
439442
return tr("(n/a)") + watchAddress;
440443
}

0 commit comments

Comments
 (0)