Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

Commit

Permalink
Pass platformStyle to transaction history and fix missing confirmatio…
Browse files Browse the repository at this point in the history
…n icons
  • Loading branch information
zathras-crypto committed Mar 19, 2017
1 parent 2178775 commit d9e35e0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
17 changes: 9 additions & 8 deletions src/qt/txhistorydialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,12 @@
using std::string;
using namespace mastercore;

TXHistoryDialog::TXHistoryDialog(QWidget *parent) :
TXHistoryDialog::TXHistoryDialog(const PlatformStyle *platformStyle, QWidget *parent) :
QDialog(parent),
ui(new Ui::txHistoryDialog),
clientModel(0),
walletModel(0)
walletModel(0),
platformStyle(platformStyle)
{
ui->setupUi(this);

Expand Down Expand Up @@ -313,16 +314,16 @@ void TXHistoryDialog::UpdateConfirmations()
// setup the appropriate icon
QIcon ic = QIcon(":/icons/transaction_0");
switch(confirmations) {
case 1: ic = QIcon(":/icons/clock_1"); break;
case 2: ic = QIcon(":/icons/clock_2"); break;
case 3: ic = QIcon(":/icons/clock_3"); break;
case 4: ic = QIcon(":/icons/clock_4"); break;
case 5: ic = QIcon(":/icons/clock_5"); break;
case 1: ic = QIcon(":/icons/transaction_1"); break;
case 2: ic = QIcon(":/icons/transaction_2"); break;
case 3: ic = QIcon(":/icons/transaction_3"); break;
case 4: ic = QIcon(":/icons/transaction_4"); break;
case 5: ic = QIcon(":/icons/transaction_5"); break;
}
if (confirmations > 5) ic = QIcon(":/icons/transaction_confirmed");
if (!valid) ic = QIcon(":/icons/transaction_conflicted");
QTableWidgetItem *iconCell = new QTableWidgetItem;
// ic = platformStyle->SingleColorIcon(ic);
ic = platformStyle->SingleColorIcon(ic);
iconCell->setIcon(ic);
ui->txHistoryTable->setItem(row, 2, iconCell);
}
Expand Down
4 changes: 3 additions & 1 deletion src/qt/txhistorydialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

class ClientModel;
class WalletModel;
class PlatformStyle;

QT_BEGIN_NAMESPACE
class QMenu;
Expand Down Expand Up @@ -50,7 +51,7 @@ class TXHistoryDialog : public QDialog
Q_OBJECT

public:
explicit TXHistoryDialog(QWidget *parent = 0);
explicit TXHistoryDialog(const PlatformStyle *platformStyle, QWidget *parent = 0);
~TXHistoryDialog();

void setClientModel(ClientModel *model);
Expand All @@ -66,6 +67,7 @@ class TXHistoryDialog : public QDialog
GUIUtil::TableViewLastColumnResizingFixer *borrowedColumnResizingFixer;
QMenu *contextMenu;
HistoryMap txHistoryMap;
const PlatformStyle *platformStyle;

private Q_SLOTS:
void contextualMenu(const QPoint &point);
Expand Down
2 changes: 1 addition & 1 deletion src/qt/walletview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ WalletView::WalletView(const PlatformStyle *platformStyle, QWidget *parent):
hbox_buttons->addWidget(exportButton);
vbox->addLayout(hbox_buttons);
litecoinTXTab->setLayout(vbox);
mpTXTab = new TXHistoryDialog;
mpTXTab = new TXHistoryDialog(platformStyle, this);
transactionsPage = new QWidget(this);
QVBoxLayout *txvbox = new QVBoxLayout();
txTabHolder = new QTabWidget();
Expand Down

0 comments on commit d9e35e0

Please sign in to comment.