mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-27 11:43:26 -03:00
4732fa133a
d795c610d3
[qt] TransactionView: highlight replacement tx after fee bump (Sjors Provoost)
Pull request description:
Consistent with #12421 which highlights the transaction after send.
<img width="747" alt="1" src="https://user-images.githubusercontent.com/10217/38036280-a7358ea4-32a6-11e8-8f92-417e9e1e3e8b.png">
<img width="685" alt="2" src="https://user-images.githubusercontent.com/10217/38036289-aac87040-32a6-11e8-9f94-81745ff6c592.png">
~I'm not too proud of the `QTimer::singleShot(10` bit; any suggestions on how to properly wait for the transactions table to become aware of the new transaction?~
Although I could have called `focusTransaction()` directly from `TransactionView::bumpFee()` I'm using the same signal as the send screen. This should make it easier to move fee bump / transaction replacement functionality around later.
Tree-SHA512: 242055b7c3d32c7b2cf871f5ceda2581221902fd53fa29e0b092713fc16d3191adbe8cbb28417d522dda9febec8cc05e07afe3489cd7caaecd33460c1dde6fbc
126 lines
3 KiB
C++
126 lines
3 KiB
C++
// Copyright (c) 2011-2018 The Bitcoin Core developers
|
|
// Distributed under the MIT software license, see the accompanying
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
#ifndef BITCOIN_QT_TRANSACTIONVIEW_H
|
|
#define BITCOIN_QT_TRANSACTIONVIEW_H
|
|
|
|
#include <qt/guiutil.h>
|
|
|
|
#include <uint256.h>
|
|
|
|
#include <QWidget>
|
|
#include <QKeyEvent>
|
|
|
|
class PlatformStyle;
|
|
class TransactionFilterProxy;
|
|
class WalletModel;
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
class QComboBox;
|
|
class QDateTimeEdit;
|
|
class QFrame;
|
|
class QLineEdit;
|
|
class QMenu;
|
|
class QModelIndex;
|
|
class QSignalMapper;
|
|
class QTableView;
|
|
QT_END_NAMESPACE
|
|
|
|
/** Widget showing the transaction list for a wallet, including a filter row.
|
|
Using the filter row, the user can view or export a subset of the transactions.
|
|
*/
|
|
class TransactionView : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit TransactionView(const PlatformStyle *platformStyle, QWidget *parent = 0);
|
|
|
|
void setModel(WalletModel *model);
|
|
|
|
// Date ranges for filter
|
|
enum DateEnum
|
|
{
|
|
All,
|
|
Today,
|
|
ThisWeek,
|
|
ThisMonth,
|
|
LastMonth,
|
|
ThisYear,
|
|
Range
|
|
};
|
|
|
|
enum ColumnWidths {
|
|
STATUS_COLUMN_WIDTH = 30,
|
|
WATCHONLY_COLUMN_WIDTH = 23,
|
|
DATE_COLUMN_WIDTH = 120,
|
|
TYPE_COLUMN_WIDTH = 113,
|
|
AMOUNT_MINIMUM_COLUMN_WIDTH = 120,
|
|
MINIMUM_COLUMN_WIDTH = 23
|
|
};
|
|
|
|
private:
|
|
WalletModel *model;
|
|
TransactionFilterProxy *transactionProxyModel;
|
|
QTableView *transactionView;
|
|
|
|
QComboBox *dateWidget;
|
|
QComboBox *typeWidget;
|
|
QComboBox *watchOnlyWidget;
|
|
QLineEdit *search_widget;
|
|
QLineEdit *amountWidget;
|
|
|
|
QMenu *contextMenu;
|
|
QSignalMapper *mapperThirdPartyTxUrls;
|
|
|
|
QFrame *dateRangeWidget;
|
|
QDateTimeEdit *dateFrom;
|
|
QDateTimeEdit *dateTo;
|
|
QAction *abandonAction;
|
|
QAction *bumpFeeAction;
|
|
|
|
QWidget *createDateRangeWidget();
|
|
|
|
GUIUtil::TableViewLastColumnResizingFixer *columnResizingFixer;
|
|
|
|
virtual void resizeEvent(QResizeEvent* event);
|
|
|
|
bool eventFilter(QObject *obj, QEvent *event);
|
|
|
|
private Q_SLOTS:
|
|
void contextualMenu(const QPoint &);
|
|
void dateRangeChanged();
|
|
void showDetails();
|
|
void copyAddress();
|
|
void editLabel();
|
|
void copyLabel();
|
|
void copyAmount();
|
|
void copyTxID();
|
|
void copyTxHex();
|
|
void copyTxPlainText();
|
|
void openThirdPartyTxUrl(QString url);
|
|
void updateWatchOnlyColumn(bool fHaveWatchOnly);
|
|
void abandonTx();
|
|
void bumpFee();
|
|
|
|
Q_SIGNALS:
|
|
void doubleClicked(const QModelIndex&);
|
|
|
|
/** Fired when a message should be reported to the user */
|
|
void message(const QString &title, const QString &message, unsigned int style);
|
|
|
|
void bumpedFee(const uint256& txid);
|
|
|
|
public Q_SLOTS:
|
|
void chooseDate(int idx);
|
|
void chooseType(int idx);
|
|
void chooseWatchonly(int idx);
|
|
void changedAmount();
|
|
void changedSearch();
|
|
void exportClicked();
|
|
void focusTransaction(const QModelIndex&);
|
|
void focusTransaction(const uint256& txid);
|
|
};
|
|
|
|
#endif // BITCOIN_QT_TRANSACTIONVIEW_H
|