Add wallet name to address book page title #757

pull pablomartin4btc wants to merge 1 commits into bitcoin-core:master from pablomartin4btc:gui-wallet-on-address-page-title changing 4 files +20 −11
  1. pablomartin4btc commented at 11:47 pm on September 13, 2023: contributor

    It fixes bitcoin-core/gui#756.

    Each address book page window it’s now labeled with the wallet name they were opened with, so the user can easily identify which addresses belong to which wallet even when there are many windows opened. It’s a helpful enhancement for users managing multiple wallets.

    image

  2. DrahtBot commented at 11:47 pm on September 13, 2023: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK hebasto
    Stale ACK MarnixCroes

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #753 (Add new “address type” column to the “receiving tab” address book page by pablomartin4btc)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  3. DrahtBot added the label CI failed on Sep 14, 2023
  4. DrahtBot removed the label CI failed on Sep 14, 2023
  5. MarnixCroes approved
  6. MarnixCroes commented at 10:27 am on September 18, 2023: contributor
    tACK 9fc21cfd3bdf2ab7d446a5f78318ce1b95b0dbbe
  7. hebasto commented at 10:01 am on September 23, 2023: member

    Tested 9fc21cfd3bdf2ab7d446a5f78318ce1b95b0dbbe. It works as expected.

    However, I’m curious, doesn’t the ability to open “Sending/Receiving addresses” windows for multiple wallets rather confuse the user than improve their experience?

    Maybe, it makes sense to make those windows modal?

  8. hebasto added the label Wallet on Sep 23, 2023
  9. hebasto added the label UX on Sep 23, 2023
  10. hebasto commented at 10:03 am on September 23, 2023: member
  11. pablomartin4btc commented at 8:50 pm on September 23, 2023: contributor

    Making those windows modal could be an alternative but it would change the present behaviour unexpectedly for those users that are used to it. Perhaps a current use case could be that a user may want to make transfers between wallets and needs to see their addresses.

    Some other alternative could be that when a user selects a different wallet a dialog shows up asking to confirm the preference to close the addresses book page/ s (sending/ receiving/ both) hide them temporarily (until the user selects the wallet back) or just keep them open? Then we can also save it as a setting so that dialog doesn’t show up anymore or ask for confirmation every time.

  12. in src/qt/addressbookpage.cpp:331 in 9fc21cfd3b outdated
    326+
    327+    if (mode == ForEditing) {
    328+        switch(tab)
    329+        {
    330+        case SendingTab: setWindowTitle(tr("Sending addresses - ").append(walletName)); break;
    331+        case ReceivingTab: setWindowTitle(tr("Receiving addresses - ").append(walletName)); break;
    


    luke-jr commented at 11:50 pm on October 2, 2023:
    0        case SendingTab: setWindowTitle(tr("Sending addresses - %s").arg(walletName)); break;
    1        case ReceivingTab: setWindowTitle(tr("Receiving addresses - %s").arg(walletName)); break;
    

    pablomartin4btc commented at 3:48 pm on October 4, 2023:
    done

    hebasto commented at 6:53 pm on October 4, 2023:
    It does not work.

    pablomartin4btc commented at 7:57 pm on October 4, 2023:
    Thanks @hebasto for checking it and provide also the QT QString documentation regarding usage of .arg! I’ve verified that %s doesn’t actually work.
  13. in src/qt/addressbookpage.cpp:334 in 9fc21cfd3b outdated
    329+        {
    330+        case SendingTab: setWindowTitle(tr("Sending addresses - ").append(walletName)); break;
    331+        case ReceivingTab: setWindowTitle(tr("Receiving addresses - ").append(walletName)); break;
    332+        }
    333+    }
    334+}
    


    luke-jr commented at 11:50 pm on October 2, 2023:
    Add newline at end

    pablomartin4btc commented at 3:48 pm on October 4, 2023:
    done
  14. in src/qt/addresstablemodel.cpp:455 in 9fc21cfd3b outdated
    450@@ -451,3 +451,5 @@ void AddressTableModel::emitDataChanged(int idx)
    451 {
    452     Q_EMIT dataChanged(index(idx, 0, QModelIndex()), index(idx, columns.length()-1, QModelIndex()));
    453 }
    454+
    455+QString AddressTableModel::GetWalletDisplayName() const { return walletModel->getDisplayName(); };
    


    luke-jr commented at 11:51 pm on October 2, 2023:
    Missing newline

    luke-jr commented at 11:53 pm on October 2, 2023:
    nit: This shouldn’t be flattened to a single line.

    pablomartin4btc commented at 3:25 pm on October 4, 2023:

    I was following the same convention as in 7 lines above to keep it consistent:

    https://github.com/bitcoin-core/gui/blob/9fc21cfd3bdf2ab7d446a5f78318ce1b95b0dbbe/src/qt/addresstablemodel.cpp#L448

    I’m happy to change it, or move it to the header file maybe? I saw other places in the code where we have single line in headers with the implementation, but there were mostly getters and setters I think.


    pablomartin4btc commented at 3:48 pm on October 4, 2023:
    done
  15. luke-jr changes_requested
  16. pablomartin4btc force-pushed on Oct 4, 2023
  17. gui: Add wallet name to address book page
    Extend addresstablemodel to return the display name from the wallet and
    set it to the addressbookpage window title when its  model is set.
    58c9b50a95
  18. in src/qt/addressbookpage.cpp:331 in e604229ce1 outdated
    326+
    327+    if (mode == ForEditing) {
    328+        switch(tab)
    329+        {
    330+        case SendingTab: setWindowTitle(tr("Sending addresses - %s").arg(walletName)); break;
    331+        case ReceivingTab: setWindowTitle(tr("Receiving addresses - %s").arg(walletName)); break;
    


    hebasto commented at 6:52 pm on October 4, 2023:
    0        case SendingTab: setWindowTitle(tr("Sending addresses - %1").arg(walletName)); break;
    1        case ReceivingTab: setWindowTitle(tr("Receiving addresses - %1").arg(walletName)); break;
    

    Please refer to https://doc.qt.io/qt-5/qstring.html#arg


    pablomartin4btc commented at 7:51 pm on October 4, 2023:
    This works now.
  19. pablomartin4btc force-pushed on Oct 4, 2023
  20. hebasto approved
  21. hebasto commented at 8:23 pm on October 4, 2023: member
    ACK 58c9b50a952951cb326c99ba86cb706a1e7d533e, tested on Ubuntu 22.04.
  22. DrahtBot requested review from MarnixCroes on Oct 4, 2023
  23. hebasto merged this on Oct 4, 2023
  24. hebasto closed this on Oct 4, 2023

  25. Frank-GER referenced this in commit 8c44b4fe1d on Oct 13, 2023
  26. bitcoin-core locked this on Oct 3, 2024

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/gui. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-21 09:20 UTC

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