|
|
@ -51,6 +51,13 @@ TransactionView::TransactionView(QWidget *parent) : |
|
|
|
hlayout->addSpacing(23); |
|
|
|
hlayout->addSpacing(23); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
watchOnlyWidget = new QComboBox(this); |
|
|
|
|
|
|
|
watchOnlyWidget->setFixedWidth(24); |
|
|
|
|
|
|
|
watchOnlyWidget->addItem("", TransactionFilterProxy::WatchOnlyFilter_All); |
|
|
|
|
|
|
|
watchOnlyWidget->addItem(QIcon(":/icons/eye_plus"), "", TransactionFilterProxy::WatchOnlyFilter_Yes); |
|
|
|
|
|
|
|
watchOnlyWidget->addItem(QIcon(":/icons/eye_minus"), "", TransactionFilterProxy::WatchOnlyFilter_No); |
|
|
|
|
|
|
|
hlayout->addWidget(watchOnlyWidget); |
|
|
|
|
|
|
|
|
|
|
|
dateWidget = new QComboBox(this); |
|
|
|
dateWidget = new QComboBox(this); |
|
|
|
#ifdef Q_OS_MAC |
|
|
|
#ifdef Q_OS_MAC |
|
|
|
dateWidget->setFixedWidth(121); |
|
|
|
dateWidget->setFixedWidth(121); |
|
|
@ -150,6 +157,7 @@ TransactionView::TransactionView(QWidget *parent) : |
|
|
|
|
|
|
|
|
|
|
|
connect(dateWidget, SIGNAL(activated(int)), this, SLOT(chooseDate(int))); |
|
|
|
connect(dateWidget, SIGNAL(activated(int)), this, SLOT(chooseDate(int))); |
|
|
|
connect(typeWidget, SIGNAL(activated(int)), this, SLOT(chooseType(int))); |
|
|
|
connect(typeWidget, SIGNAL(activated(int)), this, SLOT(chooseType(int))); |
|
|
|
|
|
|
|
connect(watchOnlyWidget, SIGNAL(activated(int)), this, SLOT(chooseWatchonly(int))); |
|
|
|
connect(addressWidget, SIGNAL(textChanged(QString)), this, SLOT(changedPrefix(QString))); |
|
|
|
connect(addressWidget, SIGNAL(textChanged(QString)), this, SLOT(changedPrefix(QString))); |
|
|
|
connect(amountWidget, SIGNAL(textChanged(QString)), this, SLOT(changedAmount(QString))); |
|
|
|
connect(amountWidget, SIGNAL(textChanged(QString)), this, SLOT(changedAmount(QString))); |
|
|
|
|
|
|
|
|
|
|
@ -187,6 +195,7 @@ void TransactionView::setModel(WalletModel *model) |
|
|
|
transactionView->verticalHeader()->hide(); |
|
|
|
transactionView->verticalHeader()->hide(); |
|
|
|
|
|
|
|
|
|
|
|
transactionView->setColumnWidth(TransactionTableModel::Status, STATUS_COLUMN_WIDTH); |
|
|
|
transactionView->setColumnWidth(TransactionTableModel::Status, STATUS_COLUMN_WIDTH); |
|
|
|
|
|
|
|
transactionView->setColumnWidth(TransactionTableModel::Watchonly, WATCHONLY_COLUMN_WIDTH); |
|
|
|
transactionView->setColumnWidth(TransactionTableModel::Date, DATE_COLUMN_WIDTH); |
|
|
|
transactionView->setColumnWidth(TransactionTableModel::Date, DATE_COLUMN_WIDTH); |
|
|
|
transactionView->setColumnWidth(TransactionTableModel::Type, TYPE_COLUMN_WIDTH); |
|
|
|
transactionView->setColumnWidth(TransactionTableModel::Type, TYPE_COLUMN_WIDTH); |
|
|
|
transactionView->setColumnWidth(TransactionTableModel::Amount, AMOUNT_MINIMUM_COLUMN_WIDTH); |
|
|
|
transactionView->setColumnWidth(TransactionTableModel::Amount, AMOUNT_MINIMUM_COLUMN_WIDTH); |
|
|
@ -211,6 +220,12 @@ void TransactionView::setModel(WalletModel *model) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// show/hide column Watch-only
|
|
|
|
|
|
|
|
updateWatchOnlyColumn(model->haveWatchOnly()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Watch-only signal
|
|
|
|
|
|
|
|
connect(model, SIGNAL(notifyWatchonlyChanged(bool)), this, SLOT(updateWatchOnlyColumn(bool))); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -270,6 +285,14 @@ void TransactionView::chooseType(int idx) |
|
|
|
typeWidget->itemData(idx).toInt()); |
|
|
|
typeWidget->itemData(idx).toInt()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void TransactionView::chooseWatchonly(int idx) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if(!transactionProxyModel) |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
transactionProxyModel->setWatchOnlyFilter( |
|
|
|
|
|
|
|
(TransactionFilterProxy::WatchOnlyFilter)watchOnlyWidget->itemData(idx).toInt()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void TransactionView::changedPrefix(const QString &prefix) |
|
|
|
void TransactionView::changedPrefix(const QString &prefix) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if(!transactionProxyModel) |
|
|
|
if(!transactionProxyModel) |
|
|
@ -307,6 +330,8 @@ void TransactionView::exportClicked() |
|
|
|
// name, column, role
|
|
|
|
// name, column, role
|
|
|
|
writer.setModel(transactionProxyModel); |
|
|
|
writer.setModel(transactionProxyModel); |
|
|
|
writer.addColumn(tr("Confirmed"), 0, TransactionTableModel::ConfirmedRole); |
|
|
|
writer.addColumn(tr("Confirmed"), 0, TransactionTableModel::ConfirmedRole); |
|
|
|
|
|
|
|
if (model && model->haveWatchOnly()) |
|
|
|
|
|
|
|
writer.addColumn(tr("Watchonly"), TransactionTableModel::Watchonly); |
|
|
|
writer.addColumn(tr("Date"), 0, TransactionTableModel::DateRole); |
|
|
|
writer.addColumn(tr("Date"), 0, TransactionTableModel::DateRole); |
|
|
|
writer.addColumn(tr("Type"), TransactionTableModel::Type, Qt::EditRole); |
|
|
|
writer.addColumn(tr("Type"), TransactionTableModel::Type, Qt::EditRole); |
|
|
|
writer.addColumn(tr("Label"), 0, TransactionTableModel::LabelRole); |
|
|
|
writer.addColumn(tr("Label"), 0, TransactionTableModel::LabelRole); |
|
|
@ -501,3 +526,10 @@ bool TransactionView::eventFilter(QObject *obj, QEvent *event) |
|
|
|
} |
|
|
|
} |
|
|
|
return QWidget::eventFilter(obj, event); |
|
|
|
return QWidget::eventFilter(obj, event); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// show/hide column Watch-only
|
|
|
|
|
|
|
|
void TransactionView::updateWatchOnlyColumn(bool fHaveWatchOnly) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
watchOnlyWidget->setVisible(fHaveWatchOnly); |
|
|
|
|
|
|
|
transactionView->setColumnHidden(TransactionTableModel::Watchonly, !fHaveWatchOnly); |
|
|
|
|
|
|
|
} |
|
|
|