HomePhabricator

[electrum] simplify and inline InvoiceList.chkVisible

Description

[electrum] simplify and inline InvoiceList.chkVisible

Summary:
This method is poorly named (it does more than just checking the widget's visibility), it unnecessarily accesses the main window (its grandparent widget) API, and is needlesly complicated.

Fix these issues by:

  • letting the parent widget decide on whether the child should initially be visible
  • not checking for the main_window's visibility
  • adding a visibility_changed signal so the visibility of the label widget can automatically be connected to the visibility of the invoice list

Checking the main window's visibility is unnecessary, because (from the QWidget doc):

Calling setVisible(true) or show() sets the widget to visible status if all its parent widgets up to the window are visible. If an ancestor is not visible, the widget won't become visible until all its ancestors are shown.

Test Plan:

$ curl -L -H 'Content-Type: application/json' -d '{"values":{"network":"XEC","outputs":[{"value":3000,"scriptHex":"76a914154205358162a6f59457d83dea828a15261aaba388ac"}]}}' https://p.be.cash/create-invoice
{"bitcoinUri":"ecash:?r=https://p.be.cash/i/QRPJCg","wsUrl":"wss://p.be.cash/ws/QRPJCg","invoiceId":"QRPJCg"}

Paste the ecash:?r=https://p.be.cash/i/QRPJCg URI in the send tab, check that the invoices list and label become visible at the bottom.
Right click on the invoice and choose the Delete action, check that the widgets disappear.

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D18335

Details

Provenance
PiRKAuthored on Jul 7 2025, 14:11
PiRKPushed on Jul 8 2025, 12:08
Reviewer
Restricted Project
Differential Revision
D18335: [electrum] simplify and inline InvoiceList.chkVisible
Parents
rABCde6aaf9412a4: test: Avoid intermittent errors in feture_index_prune.py
Branches
Unknown
Tags
Unknown