23 #include <QDateTimeEdit>
24 #include <QDesktopServices>
25 #include <QDoubleValidator>
26 #include <QHBoxLayout>
27 #include <QHeaderView>
33 #include <QSignalMapper>
36 #include <QVBoxLayout>
39 QWidget(parent), model(0), transactionProxyModel(0),
43 setContentsMargins(0,0,0,0);
45 QHBoxLayout *hlayout =
new QHBoxLayout();
46 hlayout->setContentsMargins(0,0,0,0);
48 hlayout->setSpacing(5);
49 hlayout->addSpacing(26);
51 hlayout->setSpacing(0);
52 hlayout->addSpacing(23);
96 #if QT_VERSION >= 0x040700
97 addressWidget->setPlaceholderText(tr(
"Enter address or label to search"));
102 #if QT_VERSION >= 0x040700
110 amountWidget->setValidator(
new QDoubleValidator(0, 1e20, 8,
this));
113 QVBoxLayout *vlayout =
new QVBoxLayout(
this);
114 vlayout->setContentsMargins(0,0,0,0);
115 vlayout->setSpacing(0);
117 QTableView *view =
new QTableView(
this);
118 vlayout->addLayout(hlayout);
120 vlayout->addWidget(view);
121 vlayout->setSpacing(0);
122 int width = view->verticalScrollBar()->sizeHint().width();
125 hlayout->addSpacing(width+2);
127 hlayout->addSpacing(width);
130 view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
131 view->setTabKeyNavigation(
false);
132 view->setContextMenuPolicy(Qt::CustomContextMenu);
137 QAction *copyAddressAction =
new QAction(tr(
"Copy address"),
this);
138 QAction *copyLabelAction =
new QAction(tr(
"Copy label"),
this);
139 QAction *copyAmountAction =
new QAction(tr(
"Copy amount"),
this);
140 QAction *copyTxIDAction =
new QAction(tr(
"Copy transaction ID"),
this);
141 QAction *editLabelAction =
new QAction(tr(
"Edit label"),
this);
142 QAction *showDetailsAction =
new QAction(tr(
"Show transaction details"),
this);
164 connect(view, SIGNAL(customContextMenuRequested(QPoint)),
this, SLOT(
contextualMenu(QPoint)));
166 connect(copyAddressAction, SIGNAL(triggered()),
this, SLOT(
copyAddress()));
167 connect(copyLabelAction, SIGNAL(triggered()),
this, SLOT(
copyLabel()));
168 connect(copyAmountAction, SIGNAL(triggered()),
this, SLOT(
copyAmount()));
169 connect(copyTxIDAction, SIGNAL(triggered()),
this, SLOT(
copyTxID()));
170 connect(editLabelAction, SIGNAL(triggered()),
this, SLOT(
editLabel()));
171 connect(showDetailsAction, SIGNAL(triggered()),
this, SLOT(
showDetails()));
191 transactionView->setSelectionMode(QAbstractItemView::ExtendedSelection);
208 for (
int i = 0; i < listUrls.size(); ++i)
210 QString host = QUrl(listUrls[i].trimmed(), QUrl::StrictMode).host();
213 QAction *thirdPartyTxUrlAction =
new QAction(host,
this);
235 QDate current = QDate::currentDate();
251 QDate startOfWeek = current.addDays(-(current.dayOfWeek()-1));
253 QDateTime(startOfWeek),
259 QDateTime(QDate(current.year(), current.month(), 1)),
264 QDateTime(QDate(current.year(), current.month()-1, 1)),
265 QDateTime(QDate(current.year(), current.month(), 1)));
269 QDateTime(QDate(current.year(), 1, 1)),
306 qint64 amount_parsed = 0;
321 tr(
"Export Transaction History"), QString(),
322 tr(
"Comma separated file (*.csv)"), NULL);
324 if (filename.isNull())
341 if(!writer.
write()) {
342 emit
message(tr(
"Exporting Failed"), tr(
"There was an error trying to save the transaction history to %1.").arg(filename),
346 emit
message(tr(
"Exporting Successful"), tr(
"The transaction history was successfully saved to %1.").arg(filename),
384 QModelIndexList selection =
transactionView->selectionModel()->selectedRows();
385 if(!selection.isEmpty())
391 if(address.isEmpty())
402 QModelIndex modelIdx = addressBook->
index(idx, 0, QModelIndex());
430 QModelIndexList selection =
transactionView->selectionModel()->selectedRows();
431 if(!selection.isEmpty())
442 QModelIndexList selection =
transactionView->selectionModel()->selectedRows(0);
443 if(!selection.isEmpty())
453 layout->setContentsMargins(0,0,0,0);
454 layout->addSpacing(23);
455 layout->addWidget(
new QLabel(tr(
"Range:")));
458 dateFrom->setDisplayFormat(
"dd/MM/yy");
461 dateFrom->setDate(QDate::currentDate().addDays(-7));
463 layout->addWidget(
new QLabel(tr(
"to")));
465 dateTo =
new QDateTimeEdit(
this);
466 dateTo->setDisplayFormat(
"dd/MM/yy");
467 dateTo->setCalendarPopup(
true);
468 dateTo->setMinimumWidth(100);
469 dateTo->setDate(QDate::currentDate());
470 layout->addWidget(
dateTo);
471 layout->addStretch();
489 QDateTime(
dateTo->date()).addDays(1));
506 QWidget::resizeEvent(event);
void stretchColumnWidth(int column)
void changedPrefix(const QString &prefix)
TransactionView(QWidget *parent=0)
void addColumn(const QString &title, int column, int role=Qt::EditRole)
QModelIndex index(int row, int column, const QModelIndex &parent) const
void openThirdPartyTxUrl(QString url)
QWidget * createDateRangeWidget()
Dialog showing transaction details.
int lookupAddress(const QString &address) const
void focusTransaction(const QModelIndex &)
TransactionRecord * index(int idx)
void setTypeFilter(quint32 modes)
QTableView * transactionView
static bool parse(int unit, const QString &value, qint64 *val_out)
Parse string to coin amount.
AddressTableModel * getAddressTableModel()
Export a Qt table model to a CSV file.
TransactionTableModel * parent
void chooseWatchonly(int idx)
void setAddressPrefix(const QString &addrPrefix)
static quint32 TYPE(int type)
static QString getAmountColumnTitle(int unit)
Gets title for amount column including current display unit if optionsModel reference available */...
void setModel(AddressTableModel *model)
static const QDateTime MIN_DATE
Earliest date that can be represented (far in the past)
virtual void resizeEvent(QResizeEvent *event)
static const QDateTime MAX_DATE
Last date that can be represented (far in the future)
QSignalMapper * mapperThirdPartyTxUrls
void setDateRange(const QDateTime &from, const QDateTime &to)
void message(const QString &title, const QString &message, unsigned int style)
Fired when a message should be reported to the user.
Is transaction confirmed?
Makes a QTableView last column feel as if it was being resized from its left border.
void changedAmount(const QString &amount)
void setMinAmount(qint64 minimum)
Date and time this transaction was created.
void updateWatchOnlyColumn(bool fHaveWatchOnly)
TransactionTableModel * getTransactionTableModel()
void setWatchOnlyFilter(WatchOnlyFilter filter)
Qt model of the address book in the core.
TransactionFilterProxy * transactionProxyModel
QComboBox * watchOnlyWidget
void setModel(const QAbstractItemModel *model)
void setModel(WalletModel *model)
QVariant data(const QModelIndex &index, int role) const
Filter the transaction list according to pre-specified rules.
void setAddress(const QString &address)
Interface to Anoncoin wallet from Qt view code.
QString getSaveFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedSuffixOut)
Get save filename, mimics QFileDialog::getSaveFileName, except that it appends a default suffix when ...
static const QString Receive
Specifies receive address.
Dialog for editing an address and associated information.
bool haveWatchOnly() const
Label of address related to transaction.
static const quint32 ALL_TYPES
Type filter bit field (all types)
QLineEdit * addressWidget
void contextualMenu(const QPoint &)
Formatted amount, without brackets when unconfirmed.
void copyEntryData(QAbstractItemView *view, int column, int role)
Copy a field of the currently selected entry of a view to the clipboard.
GUIUtil::TableViewLastColumnResizingFixer * columnResizingFixer
bool write()
Perform export of the model to CSV.
void doubleClicked(const QModelIndex &)
Type of address (Send or Receive)
OptionsModel * getOptionsModel()
Predefined combinations for certain default usage cases.
QString getThirdPartyTxUrls()