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

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

  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:

    qt/transactionview.cpp: In member function ‘void TransactionView::bumpFee()’:
    qt/transactionview.cpp:446:10: error: no matching function for call to ‘QTimer::singleShot(int, TransactionView::bumpFee()::__lambda0)’
             });
              ^
    qt/transactionview.cpp:446:10: note: candidate is:
    In file included from /usr/include/qt4/QtCore/QTimer:1:0,
                     from ./qt/sendcoinsdialog.h:13,
                     from qt/transactionview.cpp:13:
    /usr/include/qt4/QtCore/qtimer.h:78:17: note: static void QTimer::singleShot(int, QObject*, const char*)
         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:

    connect(this, &TransactionView::bumpedFee, [this](const uint256& txid) {
        focusTransaction(txid);
    });
    
    connect(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

    <!--5d09a71f8925f3f132321140b44b946d-->The last travis run for this pull request was 60 days ago and is thus outdated. To trigger a fresh travis build, this pull request should be closed and re-opened.

  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: 2026-04-13 21:15 UTC

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