[qt] TransactionView: highlight replacement tx after fee bump #12818

pull Sjors wants to merge 1 commits into bitcoin:master from Sjors:2018/03/bump-fee-focus changing 4 files +17 −5
  1. Sjors commented at 2:43 pm on March 28, 2018: member

    Consistent with #12421 which highlights the transaction after send.

    ~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.

  2. fanquake added the label GUI on Mar 28, 2018
  3. meshcollider commented at 9:14 pm on March 28, 2018: contributor
    Concept ACK
  4. Sjors commented at 10:33 am on March 29, 2018: member

    Travis fails with:

    0qt/transactionview.cpp: In member function void TransactionView::bumpFee():
    1qt/transactionview.cpp:446:10: error: no matching function for call to QTimer::singleShot(int, TransactionView::bumpFee()::__lambda0)
    2         });
    3          ^
    4qt/transactionview.cpp:446:10: note: candidate is:
    5In file included from /usr/include/qt4/QtCore/QTimer:1:0,
    6                 from ./qt/sendcoinsdialog.h:13,
    7                 from qt/transactionview.cpp:13:
    8/usr/include/qt4/QtCore/qtimer.h:78:17: note: static void QTimer::singleShot(int, QObject*, const char*)
    9     static void singleShot(int msec, QObject *receiver, const char *member);
    

    Seems to be a QT 4 issue. Will look into that later, since it might go away if there’s a way to avoidsingleShot (or if #8263 happens first). For now I just skip it for QT < 5.4.

  5. Sjors force-pushed on Mar 29, 2018
  6. promag commented at 10:59 am on March 29, 2018: member
    Concept ACK. NACK the timed single shot 😄
  7. Sjors force-pushed on Mar 29, 2018
  8. Sjors force-pushed on Apr 3, 2018
  9. in src/qt/transactionview.cpp:445 in bc48ac4067 outdated
    441         // Update the table
    442+        transactionView->selectionModel()->clearSelection();
    443         model->getTransactionTableModel()->updateTransaction(hashQStr, CT_UPDATED, true);
    444+
    445+        #if QT_VERSION >= 0x050400
    446+        QTimer::singleShot(10, [=](){
    


    jonasschnelli commented at 6:21 pm on April 10, 2018:
    IMO just avoid the lambda and make it therefore Qt4 compile compatible.
  10. in src/qt/transactionview.cpp:446 in bc48ac4067 outdated
    442+        transactionView->selectionModel()->clearSelection();
    443         model->getTransactionTableModel()->updateTransaction(hashQStr, CT_UPDATED, true);
    444+
    445+        #if QT_VERSION >= 0x050400
    446+        QTimer::singleShot(10, [=](){
    447+            Q_EMIT bumpedFee(newHash);
    


    jonasschnelli commented at 6:26 pm on April 10, 2018:
    Have you tried qApp->processEvents(); instead of the single shot dummy timer?
  11. jonasschnelli changes_requested
  12. jonasschnelli commented at 6:47 am on April 11, 2018: contributor
    Needs rebase
  13. Sjors force-pushed on Apr 11, 2018
  14. Sjors commented at 10:36 am on April 11, 2018: member
    Rebased @promag @jonasschnelli I replaced the single shot with qApp->processEvents(), which also removes the need for any Qt4 specific code.
  15. in src/qt/transactionview.cpp:208 in 90c614cb8b outdated
    202@@ -202,6 +203,9 @@ TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *pa
    203     connect(copyTxPlainText, SIGNAL(triggered()), this, SLOT(copyTxPlainText()));
    204     connect(editLabelAction, SIGNAL(triggered()), this, SLOT(editLabel()));
    205     connect(showDetailsAction, SIGNAL(triggered()), this, SLOT(showDetails()));
    206+
    207+    // Highlight transaction after fee bump
    208+    connect(this, SIGNAL(bumpedFee(uint256)), this, SLOT(focusTransaction(uint256)));
    


    MarcoFalke commented at 7:19 pm on July 22, 2018:
    Could use the new connect syntax?

    Sjors commented at 3:03 pm on July 24, 2018:
    @MarcoFalke not sure what you mean by new connect syntax: http://doc.qt.io/qt-5/signalsandslots.html

    ken2812221 commented at 3:23 pm on July 24, 2018:

    promag commented at 3:33 pm on July 24, 2018:

    Two options ATM:

    0connect(this, &TransactionView::bumpedFee, [this](const uint256& txid) {
    1    focusTransaction(txid);
    2});
    
    0connect(this, &TransactionView::bumpedFee, this, static_cast<void (TransactionView::*)(const uint256&)>(&TransactionView::focusTransaction));
    

    Because TransactionView::focusTransaction is overloaded.


    Sjors commented at 4:32 pm on August 1, 2018:
    @promag I find the first version more readable and less intimidating. I noticed the other version in your PR for a similar signal.
  16. DrahtBot closed this on Jul 22, 2018

  17. DrahtBot commented at 11:50 pm on July 22, 2018: member
  18. DrahtBot reopened this on Jul 22, 2018

  19. [qt] TransactionView: highlight replacement tx after fee bump d795c610d3
  20. Sjors force-pushed on Aug 1, 2018
  21. Sjors commented at 4:43 pm on August 1, 2018: member
    Rebased and switched the to the QT5 connect() syntax.
  22. MarcoFalke commented at 5:18 pm on August 1, 2018: member
    Tested ACK d795c610d3
  23. jonasschnelli commented at 6:56 am on August 2, 2018: contributor
    utACK d795c610d3095eeff1bfe5c1a34877cf0a841823, missed the 0.17 feature freeze though.
  24. jonasschnelli approved
  25. MarcoFalke added this to the milestone 0.18.0 on Aug 2, 2018
  26. MarcoFalke merged this on Aug 20, 2018
  27. MarcoFalke closed this on Aug 20, 2018

  28. MarcoFalke referenced this in commit 4732fa133a on Aug 20, 2018
  29. Sjors deleted the branch on Aug 21, 2018
  30. Munkybooty referenced this in commit 4b01e6d453 on Jun 30, 2021
  31. Munkybooty referenced this in commit 0d8f98b21e on Jun 30, 2021
  32. Munkybooty referenced this in commit dc4e393e67 on Jun 30, 2021
  33. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-17 12:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me