Page MenuHomePhabricator

[electrum] remove more uses of main_window in ContactList
ClosedPublic

Authored by PiRK on Sep 26 2023, 07:33.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC9a543a82755e: [electrum] remove more uses of main_window in ContactList
Summary

Ideally the child widget should not have to know its parent's API, so let's remove a few more unnecessary connections.

  • show_error and show_message are provided by MessageBoxMixin, which ContactList inherits from
  • the QApplication instance can be fetched directly through QWidget
  • main_window.get_wallet_folder() is a one-liner that only needs self.config, which ContactList already has a reference to
  • the parent parameter for new contact dialog can be get via the self.top_level_window(), provided for some reason by MessageBoxMixin
Test Plan

In the contacts tab, try all the context menu actions:

  • add contact (try with a valid address and an invalid addresse to trigger an error dialog)
  • export and import contacts (try also importing an invalid contacts file)
  • with one or multiple contacts selected, try "Copy Label" and check it is in the clipboard

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable