Commit Graph

137 Commits

Author SHA1 Message Date
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
ThomasV
eef1f0b2fd transaction_dialog: move tx_dialog_fetch_txin_data checkbox into toolbar 2023-03-13 08:16:44 +01:00
ThomasV
37a0e125c6 move config settings that are related to invoice creation to receive tab. 2023-03-12 10:42:26 +01:00
ThomasV
473c86c395 toolbar: use custom MyMenu class with addToggle 2023-03-12 10:11:08 +01:00
ThomasV
d6a65a06a7 Qt: move remaining menu items that are tab specific to tab toolbars: history, addresses, contacts 2023-03-11 17:47:01 +01:00
ThomasV
c595df3972 Qt: call create_toolbar in create_list_tab 2023-03-11 15:41:13 +01:00
ThomasV
1a0a52f9b6 invoices and requests lists: move import/export menus into local toolbars 2023-03-11 15:15:16 +01:00
ThomasV
d766f2fd9e Qt: make copy menus more consistent 2023-02-12 11:13:03 +01:00
SomberNight
1e3f9b942f qt: MyTreeView.refresh_all to use maybe_defer_update
In particular, window.timer_actions() calls
request_list.refresh_all() and invoice_list.refresh_all(),
every 0.5 seconds.
We avoid doing this at least when those lists are not visible anyway.
2023-02-08 00:45:18 +00:00
SomberNight
8cbf49fec9 Qt balance dialog: use monospace font for btc amounts 2022-08-24 14:05:35 +00:00
SomberNight
388811296e qt: replace some hardcoded pixel sizes for better high-dpi support 2022-08-10 20:23:56 +02:00
ThomasV
58b56b3039 receive_tab: use QStackedWidget instead of QTabWidget 2022-08-03 18:15:56 +02:00
ThomasV
0c8a828704 follow-up 7dcd8d8dc8
- set minimumHeight of VTabWidget (needed for small window size)
  - keep self.tabBar visible, otherwise the widget border is rendered with a gap on linux
  - apply stylesheet to both tabTar and surrounding widget
  - buttons style: align text left, NoFocus
  - on button click: setChecked always True, draw qr code at the end because it is slow
2022-07-31 11:33:26 +02:00
SomberNight
7dcd8d8dc8 Qt receive_tab: fix receive_tabs widget on macOS
QTabWidget with "West" tab pos and horizontal text looks completely broken on macOS
(despite looking good on e.g. Ubuntu GNOME and Windows).

The alternative here looks ok on all three OSes.

fixes https://github.com/spesmilo/electrum/issues/7908
2022-07-30 02:16:38 +02:00
ThomasV
6a74ffe80e Qt: improve channel details dialog. Add util.ShowQRLineEdit class. 2022-07-19 14:57:33 +02:00
SomberNight
955986d024 qt: PayToEdit and OverlayControlMixin: move around input buttons 2022-07-11 19:08:53 +02:00
ghost43
05226437bf Merge pull request #7839 from SomberNight/202202_lnurl_2
add lnurl-pay (`LUD-06`) support
2022-06-30 16:30:21 +00:00
SomberNight
0509109d61 qt.util.MyTreeView: handle find_row_by_key returning None
fixes https://github.com/spesmilo/electrum/issues/7780
fixes https://github.com/spesmilo/electrum/issues/7815

Re FIXME in main_window.py, in particular, adb might call `add_transaction` on the same tx multiple times.
In `wallet.on_event_adb_added_tx`, maybe we should propagate `notify_GUI` to `wallet._update_request_statuses_touched_by_tx`.

The issue being fixed here (above TARS reports) can be triggered in multiple ways, e.g.:
- have an already paid receive request, and receive a payment to the same address again
- have an already paid receive request, and *spend from* that address (in which case the history of the address will change, and address_synchronizer will call add_transaction again on the old tx that satisfied the old receive request)
2022-06-29 19:11:05 +02:00
SomberNight
649cad0122 lnurl: clean-up 2022-06-29 16:18:23 +02:00
SomberNight
5b000a871f EventListener follow-ups: adapt left-out classes and minor clean-ups 2022-06-22 02:09:26 +02:00
ThomasV
dbf055de9a EventListener class to handle callbacks
and QtEventListener for Qt
2022-06-22 02:07:46 +02:00
SomberNight
fbc750bab1 qt.util: HelpLabel, HelpButton, InfoButton: factor out HelpMixin
based on 3ca8854007

Co-authored-by: Calin Culianu <calin.culianu@gmail.com>
2022-06-02 15:25:07 +02:00
Jonas Lundqvist
b7b53e56bc Qt PayToEdit: add option to scan QR code from screen(shot)
this ports the following commits:
448376e441
6053f6f696
2022-06-01 19:10:01 +02:00
Axel Gembe
01d20cba49 qt PayToEdit: various fixes, incl icon size/pos, field size, scrollbar
this ports https://github.com/Electron-Cash/Electron-Cash/pull/1371

including commits:
---
bab816e2c3

Buttons Editor: Make background non-transparent and change to push button

There were some issues with transparent backgrounds with QToolButton on
Linux and as there is no real reason for them to be transparent we just
make them opaque.
---
2cb698affc
Pay to editor: Fix size computations to use the proper values

Previously this did not take into account the spacing between lines nor
the margins of the control and the document. There is also a sensible
minimum height of one line now and it expands to up to 10 lines before
we show the scroll bar. When the scroll bar is active, we move the buttons
so they do not obscure the scroll bar.
---
1b7a70f4f5
Pay to editor: Increase height by one if cursor is under buttons
---
abd42d9f66
 Buttons Editor: Always center if the document is just one line high
---
33bd0b82e0
Pay to editor: Make button movement on scrollbar change reliable
---
94f8476c2e
Pay to editor: Use document lineCount instead of height
---
5bedfce392
Buttons Editor: Improve vertical centering of the buttons, needs to take into account the frame width
---
0cd0b490c4
Buttons Editor: Add transparent border which is somehow needed for correct macOS layout
2022-06-01 18:24:37 +02:00
Axel Gembe
2d1727520f qt ButtonsWidget: refactor into OverlayControlMixin; fix alignmt/hover
This ports the following:
782f213bbd
2e5af27a7c
889fcbd26a
c07b0ad616
2022-06-01 17:27:32 +02:00
Axel Gembe
798dbca880 qt ButtonsWidget: Don't pass app instance to addCopyButton
Doesn't make sense to pass the application when we can just use
QApplication.instance() instead.

from 54ccf640c5
2022-06-01 17:01:21 +02:00
SomberNight
abe3955d91 qt.util.ButtonsWidget: add custom setText arg to methods
I am planning to use this in qt.PayToEdit.
2022-05-31 16:40:22 +02:00
ThomasV
3e0d7ff549 improve channels_list menus (minor) 2022-05-24 12:48:19 +02:00
ThomasV
0431cd825e Allow the QR code in the receive tab to be variable size 2022-05-23 13:17:25 +02:00
ThomasV
917f256e33 remove scheduled invoices: bad UX. better expect the user to retry later. 2022-05-21 12:24:26 +02:00
SomberNight
a0b7782e6d Qt addr/utxo lists: in dark theme, fix item bgcolor (was pure black)
regression from e362d1aac4
2022-05-20 18:26:30 +02:00
SomberNight
57ec9612cb Qt ConfirmTxDialog: make sure dialog is deleted when closed
Same for BlockingWaitingDialog.

related: https://github.com/spesmilo/electrum/issues/3956#issuecomment-1017593613
Note that this change does not solve the "dialog sometimes does not get drawn properly" issue,
just the "dialog sometimes does not get closed properly" issue.

closes: https://github.com/spesmilo/electrum/issues/7816
2022-05-20 18:05:16 +02:00
SomberNight
3cc6c0dd2d qt: start using ButtonsWidget's add_qr_input_button/add_qr_show_button 2022-05-14 18:56:11 +02:00
SomberNight
5398b9d9c9 qr qrtextedit: move functionality up to ButtonsWidget 2022-05-14 18:56:07 +02:00
ThomasV
60865f3902 Show options if we do not have the liquidity to pay a lightning invoice:
pay onchain, open channel, rebalance.

If we do a swap or open a channel, the payment will be scheduled.
2022-04-20 12:48:22 +02:00
ThomasV
9ba5a34800 Qt receive tab:
- show payment options in tabs: URI, Address or Lightning
 - use vertical tabs to save space
 - switch between QR and text views
 - open standalone QR window through menu, instead of clicking on QR code
2022-04-20 12:48:22 +02:00
SomberNight
96c063028a qt TaskThread: implement cancellation of tasks, for cleaner shutdown
fixes https://github.com/spesmilo/electrum/issues/7750

Each task we schedule on `TaskThread` can provide an optional `cancel` method.
When stopping `TaskThread`, we call this `cancel` method on all tasks in the queue.
If the currently running task does not implement `cancel`, `TaskThread.stop` will block
until that task finishes.

Note that there is a significant change in behaviour here:
`ElectrumWindow.run_coroutine_from_thread` and `ElectrumWindow.pay_lightning_invoice`
previously serialised the execution of their coroutines via wallet.thread.
This is no longer the case: they will now schedule coroutines immediately.
So for example, the GUI now allows trying to pay multiple LN invoices "concurrently".
2022-04-07 19:51:58 +02:00
ThomasV
92c6d91157 Qt: on status changes, refresh item in invoice_list and request_list,
instead of calling update(), which repopulates the model.
2022-03-23 19:52:28 +01:00
SomberNight
31b3673461 qt: follow-up changing light/dark theme at runtime
follow-up 11a04c0d72
2022-02-18 21:54:31 +01:00
SomberNight
88a1c1a618 python 3.10: fix some deprecation warnings and compat with 3.10 2021-11-09 01:02:57 +01:00
SomberNight
be084dd44b qt wallet info: make labels selectable 2021-09-16 09:13:44 +02:00
SomberNight
c1dbcab9bb qt: new qrreader using QtMultimedia; drop CalinsQRReader(mac)
This commit ports the work of EchterAgo and cculianu from Electron-Cash,
to implement a new toolchain to scan qr codes.

Previously, on Linux and Win, we have been using zbar to access the camera
and read qrcodes; and on macOS we used CalinsQRReader (an objective-C
project by cculianu).

The new toolchain added here can use QtMultimedia to access the camera,
and then feed that image into zbar. When used this way, zbar needs
fewer dependencies and is easier to compile, in particular it can be
compiled for macOS.

The new toolchain works on all three platforms, with some caveats
(see code comments in related commits) -- so we also keep the end-to-end
zbar toolchain; but at least we can drop CalinsQRReader.

The related changes in Electron-Cash are spread over 50+ commits (several PRs and direct
pushes to master), but see in particular:
https://github.com/Electron-Cash/Electron-Cash/pull/1376

some other interesting links:
b2b737001c
163224cf1f
3b31e0fcb1
eda015908e
https://github.com/Electron-Cash/Electron-Cash/pull/1545
052aa06c23
2021-06-25 16:51:58 +02:00