diff options
author | Jonas Schnelli <dev@jonasschnelli.ch> | 2020-05-13 10:15:26 +0200 |
---|---|---|
committer | Jonas Schnelli <dev@jonasschnelli.ch> | 2020-05-13 10:15:32 +0200 |
commit | 246e878e784584dd0d323a612007dfdafddeba42 (patch) | |
tree | 795814a5e73ff9c3e40a81eba37e300ed62605ff /src/qt/coincontroldialog.h | |
parent | 8d17f8dc17732c16344dfd035207ce095a403d6e (diff) | |
parent | a8b5f1b133d4f23975a3fbfb7a415b17261466ee (diff) |
Merge #18894: gui: Fix manual coin control with multiple wallets loaded
a8b5f1b133d4f23975a3fbfb7a415b17261466ee gui: Fix manual coin control with multiple wallets loaded (João Barbosa)
Pull request description:
This PR ensures each loaded wallet has a dedicated coin control in the send view which is manipulated by the coin control dialog.
This is an alternative to #17457. Two main differences are:
- scope reduced - no unnecessary changes unrelated to the fix;
- approach taken - coin control instance now belongs to the send view.
All problems raised in #17457 reviews no longer apply due to the approach taken - https://github.com/bitcoin/bitcoin/pull/17457#pullrequestreview-319297589 and https://github.com/bitcoin/bitcoin/pull/17457#issuecomment-555920829)
No change in behavior if only one wallet is loaded.
Closes #15725.
ACKs for top commit:
jonasschnelli:
utACK a8b5f1b133d4f23975a3fbfb7a415b17261466ee
ryanofsky:
Code review ACK a8b5f1b133d4f23975a3fbfb7a415b17261466ee. Code changes are very straightforward, just replacing global CCoinControl object with SendCoinsDialog member. Not sure if this means coin control settings are reset between payments. It would be good to note in the PR description or release notes if single wallet behavior is affected
hebasto:
ACK a8b5f1b133d4f23975a3fbfb7a415b17261466ee
Sjors:
tACK a8b5f1b133d4f23975a3fbfb7a415b17261466ee
Tree-SHA512: 3ad9c51bab6f28ec0e90efbd6f43fa510c81dafb2eff0b8c3724efcee3e030054a10be013e27cefe35763374c5f6d7af8c02658736964f733d7e38b646b5df65
Diffstat (limited to 'src/qt/coincontroldialog.h')
-rw-r--r-- | src/qt/coincontroldialog.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/qt/coincontroldialog.h b/src/qt/coincontroldialog.h index 25557fa6fe..3de7fd6d54 100644 --- a/src/qt/coincontroldialog.h +++ b/src/qt/coincontroldialog.h @@ -42,20 +42,18 @@ class CoinControlDialog : public QDialog Q_OBJECT public: - explicit CoinControlDialog(const PlatformStyle *platformStyle, QWidget *parent = nullptr); + explicit CoinControlDialog(CCoinControl& coin_control, WalletModel* model, const PlatformStyle *platformStyle, QWidget *parent = nullptr); ~CoinControlDialog(); - void setModel(WalletModel *model); - // static because also called from sendcoinsdialog - static void updateLabels(WalletModel*, QDialog*); + static void updateLabels(CCoinControl& m_coin_control, WalletModel*, QDialog*); static QList<CAmount> payAmounts; - static CCoinControl *coinControl(); static bool fSubtractFeeFromAmount; private: Ui::CoinControlDialog *ui; + CCoinControl& m_coin_control; WalletModel *model; int sortColumn; Qt::SortOrder sortOrder; |