Commit Graph

54 Commits

Author SHA1 Message Date
Sander van Grieken 91efb3e1f4 common_qt: move QtEventListener and qt_event_listener decorator to common_qt 2026-03-03 13:03:46 +01:00
f321x 5952d8c614 qml: validate server address in ServerConfig
Same as Qt, validate the server address the user enters and prevent the
user from continuing in the wizard or clicking 'Ok' in the ServerConfig
if the entered address is clearly invalid.
2026-01-26 14:40:02 +01:00
SomberNight eef562389c qml: qenetwork: fix type confusion for "server"
exc triggered when switching from same server to same server:
```
  9.43 | D | gui.qml.qenetwork | server_status updated: Connecting
  9.43 | E | network | Exception in _run_new_interface: Exception('diagnostic name not yet available?')
Traceback (most recent call last):
  File "/home/user/wspace/electrum/electrum/logging.py", line 241, in __get_logger_for_obj
    diag_name = self.diagnostic_name()
  File "/home/user/wspace/electrum/electrum/interface.py", line 555, in diagnostic_name
    return self.server.net_addr_str()
AttributeError: 'str' object has no attribute 'net_addr_str'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/user/wspace/electrum/electrum/util.py", line 1218, in wrapper
    return await func(*args, **kwargs)
  File "/home/user/wspace/electrum/electrum/network.py", line 986, in _run_new_interface
    interface = Interface(network=self, server=server)
  File "/home/user/wspace/electrum/electrum/interface.py", line 502, in __init__
    Logger.__init__(self)
  File "/home/user/wspace/electrum/electrum/logging.py", line 232, in __init__
    self.logger = self.__get_logger_for_obj()
  File "/home/user/wspace/electrum/electrum/logging.py", line 243, in __get_logger_for_obj
    raise Exception("diagnostic name not yet available?") from e
Exception: diagnostic name not yet available?
```
2025-07-18 14:16:30 +00:00
SomberNight c1d21aab1d qml: QENetwork: reduce log spam a bit in ln-gossip mode 2025-06-23 13:10:44 +00:00
Sander van Grieken 7df2a1159b qml: fix updating network settings
Previously the server parameters were each handled differently, e.g. auto-connect was only applied when updating Network.server
and not when Config.autoConnect was updated. Similarly, updating Network.server did not restart the network, leading to >1 connection
when Network.oneServer was set to True before updating Network.server.

Consolidate server parameter updates into a single call, remove the individual setters, and move Config.autoConnect and Config.autoConnectDefined to Network.
2025-06-03 13:22:45 +02:00
Sander van Grieken 1dfe2ccec0 qml: show option for single server in ServerConfig 2025-05-19 18:07:29 +02:00
Sander van Grieken eb29b7c95c qml: simplify QEConfig and QEDaemon use.
force QEDaemon singleton, and refer to QEDaemon.instance where possible
In cases where we would run into circular dependencies, pass the instance

also refer to singleton QEConfig instead of passing instance in qeapp.py
2025-04-09 13:44:26 +02:00
SomberNight 2aa427b4bf Merge branch 'pr/9507': qt: refactor NetworkChoiceLayout to ProxyWidget+ServerWidget
ref https://github.com/spesmilo/electrum/pull/9507
2025-03-05 15:01:05 +00:00
ThomasV 840243e029 separate fee policy from config
- Wallet.make_unsigned_transaction takes a FeePolicy parameter
 - fee sliders act on a FeePolicy instead of config
 - different fee policies may be used for different purposes
 - do not detect dust outputs in lnsweep, delegate that to lnwatcher
2025-03-05 10:29:26 +01:00
Sander van Grieken fea598cfbe network: create ProxySettings class replacing dict and encapsulating proxy related funcs,
allow enable/disable proxy without nuking proxy mode, host and port (explicit enable_proxy config setting),
move tor probe from frontend to backend code, add probe buttons for Qt and QML
2025-03-04 14:23:33 +01:00
Sander van Grieken 482ec89b5d minor, code style, imports 2024-02-05 21:25:13 +01:00
Sander van Grieken 0d476f73df network: rename network.tor_proxy to network.is_proxy_tor and keep it at None until TOR probe is done. 2023-12-04 10:42:32 +01:00
Sander van Grieken 90d1d587e8 network: async tor probe 2023-11-30 14:32:19 +01:00
Sander van Grieken 6270eae5c9 qml: port PyQt5 to PyQt6 2023-11-07 10:16:18 +01:00
Sander van Grieken 190c19d48c whitespace, imports, code style 2023-09-22 16:38:37 +02:00
Sander van Grieken a23457f48d qml: consistency camelcase pyqtProperties 2023-04-25 14:15:13 +02:00
ThomasV 08c478f8d2 network: use IntEnum for connection states. Export user-visible strings in get_connection_status_for_GUI 2023-04-14 15:55:03 +02:00
Sander van Grieken b0778d0281 qml: fix typo 2023-04-12 12:32:25 +02:00
Sander van Grieken 2773e0d8b8 qml: fix 46b25317a9 2023-04-12 12:14:11 +02:00
ThomasV 46b25317a9 qt and qml: update swap dialogs when new fees are received (see #8295) 2023-04-12 12:01:47 +02:00
SomberNight 2de9ca24a2 qml history: update mempool depth for unconf txs on new histogram 2023-04-05 14:32:11 +00:00
SomberNight 8ea63f9bde qml network overview: show server height, if lagging
to see how many blocks it is behind
2023-04-05 11:21:31 +00:00
SomberNight 771ffa371c qml: mempool histogram color bar: show tooltips
to teach meanings of colours and positions in the bar
2023-03-31 11:55:33 +00:00
Sander van Grieken e40ab26bd3 qml: qenetwork log server_status only when changing, log network_status updates 2023-03-30 09:29:02 +02:00
SomberNight 3149ccf729 qml: update server in network dialog on more events
"defaultServerChanged" was not the right event to listen to. It is only sent
*after* the interface is ready.
"network_updated" is a bit overkill as it is triggered every time any of the
interfaces goes down or a new one is created, still, better to trigger a
few more times than to be stale.
In particular, if there is no internet connection, the server string is now
updated as expected, instead of showing stale values and ignoring trying
to change servers.
Also, a further state that did not exist before: just like it worked in
the kivy GUI, if the main server was changed but it is not yet connected,
instead of showing the old server still, we now show f"{new_server} (connecting...)".
2023-03-30 00:59:16 +00:00
SomberNight 44f91ab88f qml: add TODO about --offline missing 2023-03-30 00:59:06 +00:00
SomberNight 57786049e9 qml: network dialog to update "status" more often 2023-03-29 16:41:20 +00:00
SomberNight f4e66810e7 qml: ElectrumGui to inherit BaseElectrumGui 2023-03-29 16:41:04 +00:00
ThomasV fcbd25c1fd qml: display network status and history server status separately. Also, show network fees on full screen width 2023-03-17 10:15:07 +01:00
ThomasV 49683d6ff1 qml: do not set oneserver based on auto_connect. 2023-03-17 09:22:35 +01:00
Sander van Grieken bcb06e5075 qml: set default minimum histogram if histogram empty 2023-03-16 10:25:15 +01:00
Sander van Grieken 876b0ff295 qml: handle empty histogram more gracefully, set histogram limit to 10MB 2023-03-14 13:59:56 +01:00
Sander van Grieken c29e82053f qml: use config.FEERATE_DEFAULT_RELAY as lower bound for fee histogram 2023-03-13 15:51:36 +01:00
Sander van Grieken a7e5349a58 qml: clamp min fees in histogram to 1, server can report invalid 0 fees 2023-03-13 14:24:11 +01:00
Sander van Grieken 0ebec200e2 qml: render fee histogram as a HSV gradient over next 25 blocks 2023-03-13 12:17:36 +01:00
Sander van Grieken 7cc344dbc9 qml: show Tor status in NetworkOverview 2023-01-13 11:13:56 +01:00
Sander van Grieken 0bc8460005 qml: don't initialize instance variables on class scope for non-singletons
(this somehow escaped attention before, as most objects usually don't have multiple instances,
unless multiple wallets are open at the same time.)
Also, move all signal declarations, class constants and variables to the top of class definitions.
2023-01-12 13:09:21 +01:00
Sander van Grieken d52afee635 qml: fix autoconnect/single server selection, tapping server selects. 2023-01-04 10:32:27 +01:00
Sander van Grieken f774174c85 qml: add serverlistmodel.py, add server list to ServerConfigDialog.qml 2022-12-30 23:46:04 +01:00
Sander van Grieken 4f3dc7a2cc qml: fixes 2022-07-26 18:08:32 +02:00
Sander van Grieken 93392b8917 qml: also show proxy in networkstatusindicator and a little gimmick when a fork is detected 2022-07-22 14:08:13 +02:00
Sander van Grieken 279b5a1b48 qml: let qenetwork monitor gossip events, start/stop gossip service on config change
add simple gossip feedback on NetworkStats page
2022-07-22 14:08:06 +02:00
Sander van Grieken 623de58b7b qml: network status improvements
create NetworkStatusIndicator component
add forks/chaintips and lagging property to qenetwork
add synchronizing and synchronizing progress properties to qewallet
Note: new wallet synchronizing is not picked up in UI yet, missing
an is_up_to_date event at the start still..
2022-07-21 19:46:12 +02:00
Sander van Grieken ccd182ec18 qml: qenetwork events don't need to be handled in qt thread
don't retrieve fee histogram from backend as it's passed in the event
2022-07-21 14:15:06 +02:00
Sander van Grieken 0228169852 refactor to new event listener framework 2022-07-08 11:09:08 +02:00
Sander van Grieken 5889c92e81 improve network status display and states of items when no wallet loaded 2022-07-07 18:29:01 +02:00
Sander van Grieken d3e2737308 complete and refactor Fx preferences and use in Send/Receive tabs 2022-07-07 18:29:01 +02:00
Sander van Grieken 3a8e787b58 qenetwork: add height and fiat changed signals 2022-07-07 18:29:01 +02:00
Sander van Grieken 7b71323506 cleanup 2022-07-07 18:28:00 +02:00
Sander van Grieken cf059cb31b add initial fee histogram 2022-07-07 18:28:00 +02:00