Commit Graph

119 Commits

Author SHA1 Message Date
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 https://github.com/Electron-Cash/Electron-Cash/commit/3ca8854007556363c6ef201aac5fe275294abf7e

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:
https://github.com/Electron-Cash/Electron-Cash/commit/448376e4410951f12f53ce42b59bdfe856afc66b
https://github.com/Electron-Cash/Electron-Cash/commit/6053f6f696c3f65a93a84e570454e8a1d8c5f490
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:
---
https://github.com/Electron-Cash/Electron-Cash/commit/bab816e2c3ace1624f6e981e947bcf1440728852

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.
---
https://github.com/Electron-Cash/Electron-Cash/commit/2cb698affc3ddf1049f1fdd5d55a842b9b7c192b
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.
---
https://github.com/Electron-Cash/Electron-Cash/commit/1b7a70f4f5b9362ca83d4d35627135bbd0d19aec
Pay to editor: Increase height by one if cursor is under buttons
---
https://github.com/Electron-Cash/Electron-Cash/commit/abd42d9f664960210d0c2df29c6ff9dfd6d44015
 Buttons Editor: Always center if the document is just one line high
---
https://github.com/Electron-Cash/Electron-Cash/commit/33bd0b82e0fac5bfd2447b06668889fa249213c9
Pay to editor: Make button movement on scrollbar change reliable
---
https://github.com/Electron-Cash/Electron-Cash/commit/94f8476c2e89584275280de280a93a18ad0194a3
Pay to editor: Use document lineCount instead of height
---
https://github.com/Electron-Cash/Electron-Cash/commit/5bedfce392a0aac0345a1c070c72d75d9449ea18
Buttons Editor: Improve vertical centering of the buttons, needs to take into account the frame width
---
https://github.com/Electron-Cash/Electron-Cash/commit/0cd0b490c45620a5700b0c1ccfad5d3593dbe6ff
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:
https://github.com/Electron-Cash/Electron-Cash/commit/782f213bbd945bb4e74dc73116afdaac5ddc9d84
https://github.com/Electron-Cash/Electron-Cash/commit/2e5af27a7ce65c3da6632b4787c70ff8359a8d2c
https://github.com/Electron-Cash/Electron-Cash/commit/889fcbd26aa85dd0c0b8a9537071c816e996835e
https://github.com/Electron-Cash/Electron-Cash/commit/c07b0ad616f136dc6c9f52d825d5a2add59a5175
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 https://github.com/Electron-Cash/Electron-Cash/commit/54ccf640c5f9f1eb3e38a644f8da3bd7ed1f93dd
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 https://github.com/spesmilo/electrum/commit/e362d1aac4c326917592bcfe1f5d679f7649366a
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:
https://github.com/Electron-Cash/Electron-Cash/commit/b2b737001c8cc41a38fa580ea252a6d24e08f5d5
https://github.com/Electron-Cash/Electron-Cash/commit/163224cf1fad3af63f2d3cbe68a34fb8ff279af6
https://github.com/Electron-Cash/Electron-Cash/commit/3b31e0fcb13f67646228ff42c0dd39d2a0912291
https://github.com/Electron-Cash/Electron-Cash/commit/eda015908e9d6ea9a0adfbda9db55b929c0926ba
https://github.com/Electron-Cash/Electron-Cash/pull/1545
https://github.com/Electron-Cash/Electron-Cash/commit/052aa06c23b939adcea07c701f70ae28ebcf9e0a
2021-06-25 16:51:58 +02:00
SomberNight 1436760d3d qt coins tab: Ctrl+F now searches the whole prevout string
(not just the truncated string that is displayed in the list)
2021-04-22 20:56:00 +02:00
SomberNight 3b77340671 Qt MyTreeView: rm usages of Qt.UserRole, use explicit roles instead
This is a bit more verbose but it explicitly shows what data is being
used where.

Also rm implicitly setting editable_columns based on stretch_column.
2021-04-22 20:37:14 +02:00
SomberNight 34e64ef152 qt gui: some more clean-up when exiting
related: https://github.com/spesmilo/electrum/issues/6889

This fixes the case where the user quits by pressing Ctrl+C,
and some other minor things.

There is still another issue that sometimes causes a segfault during shutdown...
2021-04-03 01:44:42 +02:00
SomberNight c5a677f4c9 qt channels list: hide unnamed column from "Copy" context menu 2021-03-29 16:14:40 +02:00
SomberNight db37938963 qt channels list: add "features" column with icons (e.g. trampoline) 2021-03-23 21:34:04 +01:00
Benoit Verret f731c38293 Minor style changes 2021-03-21 00:36:23 -04:00
ThomasV 222c70ada6 qt swap_dialog: use a single button to toggle direction 2021-03-03 10:45:46 +01:00
ThomasV 90abfda12b add unconfirmed state for onchain invoices and requests 2021-01-12 10:59:11 +01:00
SomberNight 4b5616ff14 qt BlockingWaitingDialog: try harder to get label drawn (refresh bug) 2021-01-06 02:29:59 +01:00
ThomasV 39fc72dad6 add paste button to qt payto_e. fixes #6878 2020-12-27 12:01:43 +01:00
SomberNight b28b3994c7 qt: move window.get{Open,Save}FileName to util
Sometimes we want its "remember path" behaviour but it does not make sense to
parent the dialog from main window. When so, caller code no longer needs to
get a reference to a main window.

Also rm last usages of get_parent_main_window().
2020-12-20 15:25:35 +01:00
SomberNight 096d853482 qt: rm some usages of get_parent_main_window
instead, pass around the main window or config (whichever is actually needed)

fixes #6342
2020-12-20 15:25:31 +01:00
SomberNight 6f14375a68 qt StatusBarButton: use QToolButton instead of QPushButton
related: #6299
2020-12-09 12:15:55 +01:00
ValdikSS 276d8f9a4d Use os._exit() for FORKed child browser opener process. Fixes #6404.
On Linux, when Electrum is executed from Appimage file, to prevent system library
inconsistence for Electrum and web browser and all issues involving that,
Electrum starts web browser and opens web page upon clicking on
'View on block explorer' by fork()'ing the process, unsetting
its custom LD_LIBRARY_PATH environment variable in the child process,
and calling webbrowser.open().

Due to incorrect usage of sys.exit() instead of os._exit() for child process,
Electrum (parent) can't be terminated and endlessly waits for child process upon
exit, while child process does nothing but still exists.

Fix this issue by using os._exit function, which should be used for
child processes (not only in Python).
2020-12-06 20:42:42 +03:00
SomberNight c69ce73814 qt coins tab: label(utxo) to consider both label(txid) and label(addr)
related: #6644
2020-10-13 18:57:59 +02:00
SomberNight 1ea4e42a96 Qt history/address tab: defer refreshing while editing (e.g. label)
This functionality was originally added in 0371a3dc32,
but was lost with #4915 in version 3.3.
2020-09-16 18:26:08 +02:00
SomberNight c313c702fd qt wallet>info: use QStackedWidget, one stack item for each keystore
Instead of single mpk_text widget for each ks and changing the contents
when switching, create an mpk_text widget for each ks and switch between those.
This allows putting the "show xpub on device" button inside mpk_text.
2020-08-28 20:10:58 +02:00
ThomasV b7c2820951 Qt: add Key_Enter wherever Key_Return is used 2020-08-26 19:37:52 +02:00