Commit Graph

178 Commits

Author SHA1 Message Date
ThomasV
a500d5194d make plugins dialog available in tray
This makes it possible to install a third-party plugin from
the wizard, before creating a wallet, e.g. for a hardware wallet.
2025-04-11 10:27:34 +02:00
Sander van Grieken
f1e9abf04e qt,qml: review rework, refactor spinner, add tor probe active indicator 2025-03-05 10:52:25 +01:00
Sander van Grieken
0debe6675a qt: whitespace, imports 2025-02-04 11:13:37 +01:00
f321x
ea10c7cfc1 add filehash of external plugins to PluginDialog
remove hashlib import

add filehash of external plugins to PluginDialog

add emptyline

add filehash of external plugins to PluginDialog
2025-01-09 18:15:12 +01:00
SomberNight
264a5fe421 qt gui: add command for console use: "scan_qr()"
try
```
>>> scan_qr().data
```
to read a qr code from the screen
2025-01-09 12:18:10 +00:00
Sander van Grieken
adb567b20f qt: wizard: implement user feedback TODOs, consistently use wizard.check_multisig_constraints 2024-10-24 14:48:39 +02:00
ThomasV
2fd70d5d94 qt: replace BlockingWaitingDialog with RunCoroutineDialog
RunCoroutineDialog has a run() method that blocks the thread
without blocking the GUI (using exec), and a Cancel button
that cancels the coroutine.

main_window.run_coroutine_dialog() is a wrapper that returns
the coroutine result and may raise exceptions.

BlockingWaitingDialog was removed is transaction_dialog,
where it was not particularly useful.
2024-10-18 12:37:54 +02:00
ThomasV
eccc5900e0 move plugin icons to plugins 2024-10-17 13:32:30 +02:00
SomberNight
cfe8502f96 qt desktop gui: upgrade qt5->qt6
closes https://github.com/spesmilo/electrum/issues/8007
2024-09-18 15:48:38 +00:00
Sander van Grieken
a01ae99a6f qt: fix scanning multi (privkeys, addresses) from QR. 2024-09-17 11:50:21 +02:00
Sander van Grieken
0b09592ef1 qt: move query_choice to MessageBoxMixin, document ChoiceWidget 2024-09-14 11:12:42 +02:00
Sander van Grieken
0277950247 qt: factor out remaining ChoicesLayout uses 2024-09-13 17:10:52 +02:00
ThomasV
ad774a49be external plugins: add methods to read image files 2024-04-13 11:35:49 +02:00
SomberNight
d6ef53dfab qt: fix some strings for localization
closes https://github.com/spesmilo/electrum/issues/8919
2024-02-28 13:40:01 +00:00
Sander van Grieken
2dd4195ad8 qt: ChoiceWidget fix init selected_key 2024-02-08 11:42:14 +01:00
SomberNight
ff8f8d6104 qt: sweep_key_dialog: make UI a bit more intuitive
user complained:
> when you want to sweep an address. it's very unclear to me as a noob who is getting the money
> might want a little picture with an arrow to show which direction the funds are going
2024-02-05 23:26:39 +00:00
Sander van Grieken
2b3d7096c6 qt: add typing to ResizableStackedWidget, add index validation to setCurrentIndex,
return None for currentWidget() if current_index == -1
2024-01-16 11:13:57 +01:00
SomberNight
66b24411e0 qt BalanceToolButton: better sizing on high DPI screens
specifically, on Windows, with display scaling > 100%, the pie btn was too small (not scaled)
2024-01-15 14:41:00 +00:00
SomberNight
d89f9846b9 qt/qrreader(zbar): don't call callback if user closes camera window
- without this, in send tab paytoedit, try_payment_identifier will get called and it will error
df1b9a223c/electrum/gui/qt/paytoedit.py (L153)
- also, in all text fields this used to result in clearing the current text (but now it is kept instead)
2024-01-10 20:39:58 +00:00
SomberNight
37173845c2 qt wizard: WizardComponent: (fix) also inherit ABC
for `@abstractmethod` decorator to work
(except, turns out, it's not so simple because of pyqt's own magic for QWidget)
2024-01-05 13:26:33 +00:00
SomberNight
c52853341c qt util: add VLine class, for vertical line separators 2023-12-12 10:50:47 +00:00
Sander van Grieken
d917c27a31 util: more code-style cleanup 2023-12-08 14:07:32 +01:00
Sander van Grieken
f5340b7791 qt: replace QStackedWidget with custom ResizableStackedWidget, remove unused imports in util 2023-12-08 13:55:45 +01:00
Sander van Grieken
4671c002c9 qt: fix detected account select (#8673) 2023-11-02 12:49:31 +01:00
SomberNight
711a325085 main_window: split out "walet info" dlg into separate file
- no semantic changes, only moving code
- the change in qt/util.py is to avoid GC issues
  - due to moving code, the group was moving out of scope and getting GC-ed,
    as we only keep a reference to the vbox

(idea from 263fb2ba33 )
2023-10-31 17:41:11 +00:00
SomberNight
22a8348303 renames: use consistent naming of cltv delta vs cltv abs
to avoid confusing relative vs absolute cltvs
(see b0401a6386)
2023-10-19 16:40:05 +00:00
Sander van Grieken
0aebc1a31e qt+plugins: cleanup. remove all old wizard code 2023-09-20 14:34:31 +02:00
Sander van Grieken
1e570bdd36 qt: make QtEventListener more robust against stale PyQt wrappers 2023-09-20 14:34:31 +02:00
Sander van Grieken
7a2633b2de flake happifier 2023-09-20 14:34:31 +02:00
Sander van Grieken
d3a1cef9ba create ChoiceWidget, refactor ChoicesLayout to ChoiceWidget 2023-09-20 14:34:31 +02:00
SomberNight
357ae985cc config: move tooltips from Qt gui into configvars 2023-09-18 13:54:48 +00:00
ThomasV
9df8bb61a5 Give users an option to cancel a submarine swap while awaiting HTLCs.
Note that HTLCs must not be cancelled after the funding transaction
has been broadcast. If one want to cancel a swap once the funding
transaction is in mempool, one should double spend the transaction.
2023-09-13 16:28:31 +02:00
SomberNight
635880b3cb qt gui: input_qr_from_screenshot: better msg if screenshot is black
The input_qr_from_screenshot functionality is broken on some Linux machines:
on some machines, `screen.grabWindow(0)` returns an all-black image.

In such cases, instead of telling the user "No QR code was found on the screen",
we will tell them "Failed to take screenshot".

To test:
`QApplication.instance().primaryScreen().grabWindow(0).save("/home/user/wspace/tmp/pic2.png", "png")`

Tested on:
- machine 1:
    - ubuntu 22.04, gnome, wayland
    - pyqt.version: 5.15.9
    - qt.version: 5.15.2
    => gets all-black image for screenshot
- machine 2:
    - manjaro, kde, x11
    - pyqt.version: 5.15.9
    - qt.version: 5.15.8
    => screenshot works

I guess it might be due to x11 vs wayland.
2023-08-16 17:38:42 +00:00
SomberNight
c5493a354d qt PayToEdit: always add context menu items
fixes regression from https://github.com/spesmilo/electrum/pull/8462
2023-08-09 16:00:09 +00:00
Sander van Grieken
bde066f9ce qt: refactor send_tab, paytoedit 2023-06-28 16:49:28 +02:00
ThomasV
15eb765eac payment_identifiers:
- this separates GUI from core handling
 - the PaymentIdentifier class handles network requests
 - the GUI is agnostic about the type of PI
2023-06-28 16:49:28 +02:00
SomberNight
24980feab7 config: introduce ConfigVars
A new config API is introduced, and ~all of the codebase is adapted to it.
The old API is kept but mainly only for dynamic usage where its extra flexibility is needed.

Using examples, the old config API looked this:
```
>>> config.get("request_expiry", 86400)
604800
>>> config.set_key("request_expiry", 86400)
>>>
```

The new config API instead:
```
>>> config.WALLET_PAYREQ_EXPIRY_SECONDS
604800
>>> config.WALLET_PAYREQ_EXPIRY_SECONDS = 86400
>>>
```

The old API operated on arbitrary string keys, the new one uses
a static ~enum-like list of variables.

With the new API:
- there is a single centralised list of config variables, as opposed to
  these being scattered all over
- no more duplication of default values (in the getters)
- there is now some (minimal for now) type-validation/conversion for
  the config values

closes https://github.com/spesmilo/electrum/pull/5640
closes https://github.com/spesmilo/electrum/pull/5649

Note: there is yet a third API added here, for certain niche/abstract use-cases,
where we need a reference to the config variable itself.
It should only be used when needed:
```
>>> var = config.cv.WALLET_PAYREQ_EXPIRY_SECONDS
>>> var
<ConfigVarWithConfig key='request_expiry'>
>>> var.get()
604800
>>> var.set(3600)
>>> var.get_default_value()
86400
>>> var.is_set()
True
>>> var.is_modifiable()
True
```
2023-05-25 17:39:48 +00:00
SomberNight
03ab33f4b2 SimpleConfig: change API of set_key(): "save" is now kwarg-only 2023-05-25 17:37:16 +00:00
SomberNight
a0c43573ab locale/i18n: get default language and set it as early as possible
TODO elaborate xxxxx
2023-05-05 17:00:18 +00:00
SomberNight
312f2641e7 don't use bare except
use "except Exception", or if really needed explicitly "except BaseException"
2023-04-24 12:58:01 +00:00
SomberNight
417423ecd7 qt: PayToEdit: fix input_qr_from_camera
closes https://github.com/spesmilo/electrum/issues/8342

probably regression from 1f4cedf56a
2023-04-24 00:58:41 +00:00
ThomasV
f04e2e2e6f Add an extra state for invoices where our tx has been broadcast
successfully, but it is not in our history yet.

(follow-up 159646fe54)
2023-04-04 19:31:25 +02:00
SomberNight
bcd2ec3d70 (trivial) qt/util: add some leftover type-hints 2023-03-31 01:04:54 +00:00
ThomasV
a080e5130f Qt receive_tab: toggle_view_button instead of tabs 2023-03-21 10:34:26 +01:00
ThomasV
206bacbcb3 move MyTreeView and related classes to own submodule 2023-03-15 14:25:42 +01:00
ThomasV
0bda808b29 Qt lists: always show item detail on double click
No longer enter edit mode for editable columns.
(that behaviour was difficult to learn, because
it is not explicit which columns are editable)
2023-03-15 10:35:44 +01:00
ThomasV
1f4cedf56a Rework PaytoEdit:
- show a QLineEdit by default, a QTextEdit only if paytomany is active.
   paytomany is a rare use case, it should not interfer with regular
   use (e.g. when a user inadvertently types enter).
 - this also fixes the visual appearance if the payto line
 - keep paytomany menu in sync with actual state
2023-03-14 15:37:20 +01:00
SomberNight
9d64fe7046 qt: MyTreeView: disambiguate "parent" and "main_window" 2023-03-13 17:29:29 +00:00
SomberNight
08c37ab088 qt: HistoryList to also use BaseColumnsEnum 2023-03-13 16:39:13 +00:00
SomberNight
d3c241db4c qt: MyTreeView: use enum.auto() in Columns enum 2023-03-13 16:12:50 +00:00