Commit Graph

19768 Commits

Author SHA1 Message Date
ghost43 cb97200933 Merge pull request #10494 from f321x/console_font_size
qt: console: allow changing font size
2026-02-23 16:33:08 +00:00
f321x 2df68d9249 qt: console: allow changing font size
Allows changing the font size in the qt Console with
`Ctrl` + `+` and `Ctrl` + `-`.
2026-02-23 17:27:39 +01:00
ghost43 9a71382c5a Merge pull request #10479 from SomberNight/202602_locale_fancy_names
locale: gui: show translation completion percentage in language names
2026-02-21 04:07:54 +00:00
SomberNight 4d2ea4f22c update locale
This includes https://github.com/spesmilo/electrum-locale/pull/54,
which adds the new "X-Electrum-SourceStringCount" header into the .po/.mo files.
2026-02-21 03:51:52 +00:00
SomberNight 3afa2fcdf3 locale: gui: show translation completion percentage in language names
In the GUIs, on the language-select screen, show e.g.
  Czech (100%), Danish (13%), Dutch (54%)
instead of
  Czech, Danish, Dutch

- we count the source strings when creating the .pot PO-template file
  and add an "X-Electrum-SourceStringCount" header to it, in the push_locale.py script that uploads the .pot file to crowdin.
  - later, when we run electrum-locale/update.py to download the translations in .po files, these files will also contain the same header.
  - then when the build_locale.sh script compiles those .po files, we can read the header and use it to populate a new "stats.json" file
    that we place in electrum/locale/locale/ and bundle in the all release binaries/distributables.
    - stats.json also includes the number of translated strings for each lang
- at runtime we simply read stats.json and use the values to calculate the percentages
  - a prior implementation did not pre-calc stats.json but did all calculations at runtime (by opening all .mo translations)
    - however that was deemed to slow, hence the build-time pre-calc
      - runtime calc took 40 ms on my laptop, so I guess it could easily take 10x that on an old phone
- just as we have always been very tolerant of any locale files or even the whole locale/ dir missing, we also tolerate stats.json missing
2026-02-21 03:40:09 +00:00
SomberNight 6de3fef717 (trivial) consistent whitespaces in .gitmodules 2026-02-20 16:30:48 +00:00
ghost43 49f1eff115 Merge pull request #10490 from f321x/locale_llm_proofreader_cleanup
locale: exclude llm proofreader directory from build
2026-02-20 16:20:38 +00:00
f321x 0e7f7b30fc locale: rm llm_proofreader directory during build
Deletes the llm_proofreader directory during the build so
these scripts aren't bundled into the binaries.
2026-02-20 16:39:18 +01:00
f321x 53166cc077 git: ignore changes to locale submodule
add ignore = dirty to electrum locale submodule so changes to the
locale submodule files don't show up in the main git status.
2026-02-20 16:39:11 +01:00
f321x a1f1b39368 wallet_db: assert WalletDBUpgrader.storage is dict
Assert `WalletDBUpgrader.data` is a regular in-memory dict and not
some StoredDict, so if an exception would happen during a wallet
db upgrade the partial changes don't get commited to disk.
2026-02-20 16:06:42 +01:00
ghost43 71a1e96df6 Merge pull request #10489 from f321x/fix_10487
wallet_db: handle non-existing parent_set_key in v65
2026-02-20 14:54:38 +00:00
f321x 73a03249df wallet_db: handle non-existing parent_set_key in v65
Handles non-existing parent_set_key in _convert_version_65.

Fixes #10487
2026-02-20 13:58:51 +01:00
SomberNight 6c1e085937 contrib/locale/push_locale: do not sort source-strings
xgettext and related tools have a -s/--sort-output option, which results in the output being lexicographically sorted. The gettext maintainers recommend against using this option and even started deprecating it in some of their tools (xgettext included):
- with -s, source strings are lexicographically sorted in the .pot/.po files
- without -s, source string are output in the same order they are found in the code
  - this way, translators have to do much fewer context switches when contributing translations

note that the qml part we have already *not* been sorting
2026-02-19 16:25:22 +00:00
SomberNight cf25990973 locale: don't translate string "Electrum", "BIP39" 2026-02-19 16:13:44 +00:00
Sander van Grieken b10b14c2f8 qml: ReceiveDetailsDialog use proper ButtonContainer 2026-02-19 17:12:17 +01:00
ThomasV 0c32bde721 Merge pull request #10480 from f321x/fix_exc_offline_mode
qt: fix toolbar action exc in offline mode
2026-02-18 17:41:23 +01:00
ThomasV 51322137bd Merge pull request #10481 from f321x/nwc_thread_safety
plugin: nwc: qt: fix thread safety bug
2026-02-18 16:25:57 +01:00
accumulator c097c05e07 Merge pull request #10484 from f321x/fix_android_8_startup_error
android: biometry: catch java import errors
2026-02-18 13:50:34 +01:00
SomberNight c6dfc8e649 fix: bip21.py: add missing import
urllib.parse needs to be explicitly imported for e.g. urllib.parse.urlparse to work.
I think this was not erroring only because urllib.parse is imported in other modules.
2026-02-17 18:11:13 +00:00
SomberNight e2c41aabbe locale: don't translate string "Electrum" 2026-02-17 13:48:51 +00:00
SomberNight 6eb6f31301 contrib/locale/push_locale: add comments re proofreader-approval
see https://github.com/spesmilo/electrum-locale/commit/6b07fc29ceee1489d825334e0682983dc450f228
2026-02-17 13:33:05 +00:00
f321x f573ab2d56 android: biometry: catch java import errors
Catch JavaError when trying to load the java classes of the biometry
module on startup. This can raise if the device is on an old API version
and the loaded java class depends on apis unknown to the os.

Fixes #10470

```
02-17 10:07:25.714  5254  5270 I python  :   0.47 | E | __main__ | daemon.run_gui errored
02-17 10:07:25.714  5254  5270 I python  : Traceback (most recent call last):
02-17 10:07:25.714  5254  5270 I python  :   File "app/main.py", line 514, in handle_cmd
02-17 10:07:25.714  5254  5270 I python  :   File "app/electrum/daemon.py", line 653, in run_gui
02-17 10:07:25.714  5254  5270 I python  :   File "app/electrum/gui/qml/__init__.py", line 38, in <module>
02-17 10:07:25.714  5254  5270 I python  :   File "app/electrum/gui/qml/qeapp.py", line 49, in <module>
02-17 10:07:25.714  5254  5270 I python  :   File "app/electrum/gui/qml/qebiometrics.py", line 33, in <module>
02-17 10:07:25.714  5254  5270 I python  :   File "jnius/reflect.py", line 243, in autoclass
02-17 10:07:25.714  5254  5270 I python  :   File "jnius/jnius_export_class.pxi", line 877, in jnius.jnius.JavaMethod.__call__
02-17 10:07:25.714  5254  5270 I python  :   File "jnius/jnius_export_class.pxi", line 964, in jnius.jnius.JavaMethod.call_method
02-17 10:07:25.714  5254  5270 I python  :   File "jnius/jnius_utils.pxi", line 79, in jnius.jnius.check_exception
02-17 10:07:25.714  5254  5270 I python  : jnius.jnius.JavaException: JVM exception occurred: Failed resolution of: Landroid/hardware/biometrics/BiometricPrompt$AuthenticationResult; java.lang.NoClassDefFoundError
```
2026-02-17 10:18:21 +01:00
Felix 6f23d50b1b Merge pull request #10483 from f321x/add_server
servers.json: add additional default server
2026-02-17 09:35:57 +01:00
f321x 52b554a5f2 servers.json: add additional default server
Add new additional default server on protocol version 1.6.0 operated
by a known contributor.
2026-02-17 09:33:43 +01:00
ThomasV 952737594b announcement_signatures: add more early returns 2026-02-17 08:57:49 +01:00
ghost43 a6f4a25f57 Merge pull request #10482 from Sanksari12/master
Remove non-existing electrum server on owner's request
2026-02-17 06:58:17 +00:00
Sanksari12 67f3fcfb16 Update servers.json
Remove lavahost.org from servers.json as the host does not host a public electrum instance.
2026-02-16 19:47:42 +00:00
SomberNight cf072f6ece contrib/locale/push_locale: trivial follow-up: write vs writelines
kinda wild that writelines worked there too, that's what we get for dynamic typing... :)

follow-up https://github.com/spesmilo/electrum/commit/d20c9364efb01a513e14b5eb9195f51b9919c695
2026-02-16 17:29:24 +00:00
f321x 4556d59fc0 plugin: nwc: qt: fix thread safety bug
Call `NWCServer.event_handler_task.cancel()` on asyncio thread.

```
 File "/home/user/Documents/electrum/electrum/plugins/nwc/nwcserver.py", line 281, in restart_event_handler
   self.event_handler_task.cancel()
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
 File "/usr/lib64/python3.14/asyncio/base_events.py", line 829, in call_soon
   self._check_thread()
   ~~~~~~~~~~~~~~~~~~^^
 File "/usr/lib64/python3.14/asyncio/base_events.py", line 866, in _check_thread
   raise RuntimeError(
       "Non-thread-safe operation invoked on an event loop other "
       "than the current one")
RuntimeError: Non-thread-safe operation invoked on an event loop other than the current one
```
2026-02-16 09:28:16 +01:00
f321x 907fff46e5 qt: fix toolbar action exc in offline mode
Fix exception when clicking on "Donate to server" in offline mode by not
showing the "Donate to server" menu action when no network is set.

Raise CancelledError in `fetch_bitcoin_paper` as
`_fetch_tx_from_network` already shows an according error message so the
second, subsequent error message shown by `on_error` is not useful if
`_fetch_tx_from_network` already failed.

```
63.53 | E | gui.qt.exception_window.Exception_Hook | exception caught by crash reporter
Traceback (most recent call last):
 File "/home/user/Documents/electrum/electrum/gui/qt/main_window.py", line 864, in donate_to_server
   d = self.network.get_donation_address()
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get_donation_address'
```
2026-02-16 09:17:42 +01:00
SomberNight 4c597ffb5a follow-up prev: satisfy ban_unicode.py 2026-02-14 10:10:59 +00:00
SomberNight 1fc8804791 locale: don't translate names of languages
note this is just a conceptual change, in practice it is a no-op:
i18n.py global scope is executed much earlier than the language gets set.
see https://github.com/spesmilo/electrum/blob/61a6ab1d95e6faccce45ed008426283430fa99d4/run_electrum#L422
2026-02-14 10:03:03 +00:00
SomberNight 61a6ab1d95 locale: don't translate URL, like wtf
please, use common sense :(
I guess it was a copy-paste error, but still, treat all _() and qsTr() calls as "scary" and as potential attack vectors. Don't blindly call _(): every call needs to be weighed separately.
2026-02-14 09:25:39 +00:00
SomberNight d20c9364ef contrib/locale/push_locale: more deterministic messages.pot (fs order)
Tries to remove differences caused by filesystem-order in the generated .pot file.

The crowdin activity stream is full of events:
```
SomberNight_CI_BOT changed the context of 126 strings
02:42
String	Previous context	New context	File	Time
{} blocks	#: electrum/gui/qt/channel_details.py:256 #: electrum/gui/qt/channel_details.py:257 electrum/gui/qt/network_dialog.py:514 	#: electrum/gui/qt/network_dialog.py:514 electrum/gui/qt/channel_details.py:256 #: electrum/gui/qt/channel_details.py:257 	messages.pot	02:42
[...]
```
^ i.e. on every CI push, the comments containing the file paths and line-numbers were getting mixed up randomly
This is undesirable noise.
2026-02-14 08:10:26 +00:00
SomberNight cd802c6e41 CI: changed API key for crowdin translations, update notes
api key was previously for "SomberNight" crowdin acc, now it's for a fresh acc "SomberNight_CI_BOT".

- "SomberNight_CI_BOT" acc has fewer permissions overall
- the new api key is minimally scoped
  - I can't remember what the old api key was scoped to, and crowdin does not show the settings of existing api key, one can only revoke them
- the crowdin audit log can now distinguish actions of the bot vs actions I do manually
2026-02-13 17:30:35 +00:00
SomberNight 0c33994d70 plugins: hardware: HardwareHandlerBase.show_error() takes str, not exc
This is just a minor conceptual clean-up,
runtime behaviour is not being changed, as ultimately, much later in the exec flow,
the msg object being passed around is cast to str already.
(e.g. see str(text) at https://github.com/spesmilo/electrum/blob/4f7b6e897710338e8a4cfb8fa97c305218bdff88/electrum/gui/qt/util.py#L375-L379)
2026-02-12 17:04:20 +00:00
SomberNight 4f7b6e8977 contrib/freeze_packages: use stdlib "venv" vs 3rd party virtualenv 2026-02-11 15:23:16 +00:00
SomberNight fb1b811bde gitignore: add ".venv"
I have virtualenvs for different python versions in top-level folders such as .venv314.
2026-02-11 15:16:21 +00:00
ghost43 f95e6ac1e8 Merge pull request #10462 from f321x/fix_wizard_tc_exc+
wizard: fix exception when loading new tc wallet
2026-02-11 14:27:00 +00:00
f321x 3905f8d9ec wizard: fix exception when loading new tc wallet
I tried to reproduce:
https://github.com/spesmilo/electrum/issues/8815#issuecomment-2094259186
which triggered the following exception for me:

```
Traceback (most recent call last):
  File "/home/user/code/electrum-fork/electrum/gui/qt/__init__.py", line 409, in start_new_window
    window = self._create_window_for_wallet(wallet)
  File "/home/user/code/electrum-fork/electrum/gui/qt/__init__.py", line 329, in _create_window_for_wallet
    w = ElectrumWindow(self, wallet)
  File "/home/user/code/electrum-fork/electrum/gui/qt/main_window.py", line 290, in __init__
    self.load_wallet(wallet)
    ~~~~~~~~~~~~~~~~^^^^^^^^
  File "/home/user/code/electrum-fork/electrum/util.py", line 495, in do_profile
    o = func(*args, **kw_args)
  File "/home/user/code/electrum-fork/electrum/gui/qt/main_window.py", line 589, in load_wallet
    self.update_recently_opened_menu()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/home/user/code/electrum-fork/electrum/gui/qt/main_window.py", line 741, in update_recently_opened_menu
    for i, k in enumerate(recent):
                ~~~~~~~~~^^^^^^^^
TypeError: 'NoneType' object is not iterable
```

This happens because the trustedcoin wallet is loaded outside of
Daemon.load_wallet() so Daemon.update_recently_opened_wallets()
is not getting called and config.RECENTLY:_OPEN_WALLET_FILES is
still None when we try to iterate through it.
As fix i now use load_wallet() instead of manually
instantiating the Wallet
and additionally handle
RECENTLY_OPEN_WALLET_FILES being None in
ElectrumWindow.update_recently_opened_menu().

My pull request https://github.com/spesmilo/electrum/pull/10121
would have sent this exception to the crash reporter so we
might have noticed it earlier. I think we should not just catch
all exceptions in the wizard like on master as it causes us to
repeatedly miss regressions in the wizard that could be sent to
the crash reporter.
2026-02-11 09:14:35 +01:00
ghost43 f2a70357c3 Merge pull request #10121 from f321x/qml_create_storage_exc
wizard: raise more specific exc in create_storage() and pass some to crash reporter
2026-02-10 16:55:07 +00:00
SomberNight 5ca2699580 qt: wizard: (trivial) simplify prevprev (HEAD~1)
ref 457a09219e
2026-02-10 16:47:49 +00:00
ghost43 aefc4aa5b3 Merge pull request #10459 from SomberNight/202602_lnaddr_format_rtags
lnwallet.pay_to_node: log r_tags from invoice
2026-02-09 17:06:21 +00:00
SomberNight 21c1dd8c96 Merge remote-tracking branch 'spesmilo/pr/10451': history export
merges https://github.com/spesmilo/electrum/pull/10451
2026-02-09 16:40:43 +00:00
ThomasV 7e73aa7b7a CLI: separate list_channels and list_channel_backups
Add '--public' option flag to list public channels
2026-02-09 11:39:54 +01:00
ThomasV b03d6a478d gossip: broadcast channel updates along with channel announcements
The channel update in mark_open is only sent once, and only to the
channel peer. In addition, it seems to be discarded by Eclair.
2026-02-09 11:00:16 +01:00
ThomasV b2a3e08ac8 ignore exceptions in process_gossip
A failing signature verification should not kill the taskgroup
2026-02-09 10:58:24 +01:00
ghost43 3e18d010e8 Merge pull request #10452 from SomberNight/202601_build_android_debian13
build: android: upgrade docker base img to debian 13
2026-02-04 16:59:22 +00:00
f321x 2fd74c1884 qml: wizard: differentiate between create_storage exc types
Differentiate between the `UserFacingException` and other exceptions
when creating the storage. Forward other exceptions to the reporter so
they can get fixed.
2026-02-04 11:56:51 +01:00
f321x 457a09219e qt: wizard: differentiate between create_storage exc types
Differentiate between the `UserFacingException` and other exceptions
when creating the storage. Forward other exceptions to the reporter so
they can get fixed.
2026-02-04 11:56:49 +01:00