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.
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.
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
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.
Differentiate between the `UserFacingException` and other exceptions
when creating the storage. Forward other exceptions to the reporter so
they can get fixed.
Differentiate between the `UserFacingException` and other exceptions
when creating the storage. Forward other exceptions to the reporter so
they can get fixed.
Modifies `NewWalletWizard.create_storage()` to raise more specific
exception types instead of plain `Exception`. This should allow the
calling GUI to separate between non-bug exceptions (like invalid user
input), and bugs which should not happen and be
passed to the bug reporter.
Adds unittest for Abstract_Wallet.export_history_to_file that
compares the output against reference files. This
should help to prevent regressions and ensure the layout
of the export stays static over time.
Change fees from sats to bitcoin so the fee value is consistent with the
other values.
Fixes#10445
Also adds a plugin hook so plugins can create fancy history exports.
And stops adding unconfirmed/local transactions to the history as they
are unordered and make the export non-deterministic. Also transactions
that haven't happened yet don't seem useful for accounting.
So it can be moved out of HistoryList, get unittested and potentially
used by QML too for example.
Also fix inconsistency between fiat_value and fees_fiat, sometimes if
fiat_value was `No Data` (value=None), fees_fiat was '0' as
fees_fiat.value was Decimal() instead of None.
When gossip is enabled we waste a lot of time trying to connect
to onion peers if we don't have a proxy enabled. We should just skip
them and try to connect to clearnet peers instead.
LNPeerManager.add_peer would only check if self.network.proxy is set,
which it is always as Network is initialized with self.proxy =
ProxySettings(). Instead it should check if proxy is set and enabled.
Don't set the NETWORK_AUTO_CONNECT config if the user checked the custom
server config checkbox and then cancels the wizard, so the next time the
user starts the wizard they again will have the choice instead of
silently being forced into a random server.
Currently if the user cancels the wizard during the network config the
welcome component will already have set the NETWORK_AUTO_CONNECT config
to False (as the user selected the custom server checkbox), preventing
the wizard from starting again on the next startup.
Passes the default server (Network.default_server) to
Network.set_parameters instead of an empty string in
ServerConnectWizard.do_configure_server to avoid a traceback like in
I am not entirely sure how the user in #10437 managed to trigger
the exception as Network.set_parameters should already exit early at
`not self._was_started` in the Wizard as the network shouldn't have been
started yet during the wizard. However passing the default ServerAddr
instead of an empty string to set_parameters should avoid this
exception.
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.
The `ServerWidget` didn't validate the input of server_e, which allowed
the user to enter an invalid server connection string and exit the
dialog without knowing they entered an invalid string.
In the wizard this behavior is very misleading as the user explicitly
wanted to use a custom server, can click next after entering an invalid
server, and we will just silently fall back to automatic server selection.
This change will disable the "Next" button in the wizard if an invalid
address has been entered and show a red background in the server_e while
the input is not valid, so the user clearly sees that this input is not
going to be used.