Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new "address type" column to the "receiving tab" address book page #753

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Commits on Oct 7, 2023

  1. gui: Refactor AddressType from ReceiveCoinsDialog

    Extract and refactor ui->addressType combo content filling into GUIUtil,
    having the translated descriptions in one place and allowing other Qt widget
    containers to easily create similar combo boxes with customizable tooltips
    per item and default selected item, both specified by the caller.
    pablomartin4btc committed Oct 7, 2023
    Configuration menu
    Copy the full SHA
    bc0e33f View commit details
    Browse the repository at this point in the history
  2. wallet: Correct output type for Segwit address

    Current OutputTypeFromDestination at outputtype, returns OUTPUT_TYPE_STRING_LEGACY
    for Segwit addresses, as p2sh-segwit requires extra info from the wallet to figure
    that out, this change adds a correct way to obtain the desired result from the
    wallet interface. So far this will be needed from the UI to identify such type,
    as currently a user could select this output type to create an address (receivecoinsdialog)
    but no display of it exists.
    pablomartin4btc committed Oct 7, 2023
    Configuration menu
    Copy the full SHA
    90284c7 View commit details
    Browse the repository at this point in the history
  3. gui: Add Address Type Column to AddressBookPage

    Add new address type column to the addresstablemodel, use the getOutputType
    function from the wallet interface to display the correct address type in the
    new column content. Update the address book page to set the new column resize mode
    and to display the new column only when the receiving tab is enabled
    so it must be hidden on the sending tab.
    
    Update AddressBookFilterProxyModel::filterAcceptsRow so the filter works also
    on the new addressType column content. Also the searLineEdit greyed text
    reflects that the new field/ column addressType will be included in the search/
    filter by but only when the receiving tab is enabled.
    
    Add the new column to the export feature.
    pablomartin4btc committed Oct 7, 2023
    Configuration menu
    Copy the full SHA
    7be6b79 View commit details
    Browse the repository at this point in the history
  4. gui: Extend address book filter for nested filtering

    Extend AddressBookFilterProxyModel to allow using nested filters to be applied
    on top of it. If future needs arise for similar filters outside the address book page,
    the code could be easily refactored and moved in a new subclass of QSortFilterProxyModel,
    perhaps with limits on nested levels.
    
    For safety and performance reasons, the code of the filter proxy model class declaration
    (in addressbookpage.h) and its instance creation were updated by aligning it with
    TransactionFilterProxy in overviewpage.h as this addresses situations of unexpected crashes,
    such as segfault on closing the app, double free or corruption, or stack smashing detection.
    pablomartin4btc committed Oct 7, 2023
    Configuration menu
    Copy the full SHA
    5d597c0 View commit details
    Browse the repository at this point in the history
  5. gui: Add a combo widget to filter by address type

    Introduce a label and a combobox UI widgets for address type filtering on the address book page.
    These 2 widgets are been displayed only on the Receiving tab.
    To ensure that the combo box selection updates the filter model correctly, an intermediary signal
    (addressTypeChanged) and a slot (handleAddressTypeChanged) were necessary due to the incompatibility
    between QComboBox::currentIndexChanged and QSortFilterProxyModel::setFilterFixedString.
    
    Update filter model to use nested filtering so when selected item changes on address type combo
    it will update the filter pattern on top of what the parent filter has already, which is lead by the
    searchLineEdit widget and all references of the current proxyModel (eg mapToSource, mapFromSource)
    to the nested and final filter model.
    
    Use GUIUtil::AddItemsToAddressTypeCombo to populate the combo with the default output types descriptions
    passing a defined local map for the output types tooltips that will be displayed for each item,
    similarly to the address types combobox in receivecoinsdialog.
    pablomartin4btc committed Oct 7, 2023
    Configuration menu
    Copy the full SHA
    dffc37f View commit details
    Browse the repository at this point in the history