Commit Graph

44 Commits

Author SHA1 Message Date
SomberNight abef454237 qt: better handle unparseable URIs
fixes https://github.com/spesmilo/electrum/issues/7941
2022-08-16 15:27:13 +00:00
SomberNight 2d68350900 qt: (refactor) split "send tab" out from main_window.py 2022-06-30 20:29:08 +02:00
SomberNight ed1567e841 lnurl: make requests async, don't block Qt GUI, rm LUD-16 support
- in lnurl.py, make request methods async
- in Qt GUI, lnurl network requests no longer block the GUI thread
  - but they still do in the kivy GUI
- "lightning address" (LUD-16) support is removed for now as the
  email addresses are indistinguishable from openalias email addresses
  (both protocols should have added and enforced a prefix, or similar,
   to remove this kind of ambiguity -- now we would need to make a
   network request just to identify what kind of ID we were given)
2022-06-29 16:56:04 +02:00
SomberNight df974c2384 qt paytoedit: evaluate text on textChanged(), but no network requests
- add param to _check_text to toggle if network requests are allowed ("full check")
- every 0.5 sec, if the textedit has no focus, do full check
- on textChanged()
  - detect if user copy-pasted by comparing current text against clipboard contents,
    if so, do full check
  - otherwise, do partial check
- on clicking ButtonsWidget btns (scan qr, paste, read file), do full check
2022-06-29 16:18:30 +02:00
SomberNight 649cad0122 lnurl: clean-up 2022-06-29 16:18:23 +02:00
bitromortac fe2fbbd9b1 add lnurl-pay and lightning address support
* bundles all payment identifiers into handle_payment_identifier
* adds lnurl decoding
* adds lightning address decoding
2022-06-29 16:18:15 +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
SomberNight 2e260bd602 qt PayToEdit: rm redundant code
This is already handled by `self.textChanged.connect(self.check_text)` in __init__.
2022-05-14 01:28:37 +02:00
SomberNight 433c6762c9 Qt Send tab: handle exc when "." is entered into amount_e
To reproduce: enter "." to amount_e in Send tab; then click "Save".

Traceback (most recent call last):
  File "/home/user/wspace/electrum/electrum/gui/qt/main_window.py", line 1638, in do_save_invoice
    self.pending_invoice = self.read_invoice()
  File "/home/user/wspace/electrum/electrum/gui/qt/main_window.py", line 1625, in read_invoice
    outputs = self.read_outputs()
  File "/home/user/wspace/electrum/electrum/gui/qt/main_window.py", line 1501, in read_outputs
    outputs = self.payto_e.get_outputs(self.max_button.isChecked())
  File "/home/user/wspace/electrum/electrum/gui/qt/paytoedit.py", line 235, in get_outputs
    self.outputs = [PartialTxOutput(scriptpubkey=self.payto_scriptpubkey, value=amount)]
  File "/home/user/wspace/electrum/electrum/transaction.py", line 1533, in __init__
    TxOutput.__init__(self, *args, **kwargs)
  File "/home/user/wspace/electrum/electrum/transaction.py", line 113, in __init__
    raise ValueError(f"bad txout value: {value!r}")
ValueError: bad txout value: None
2021-09-19 16:53:58 +02:00
Siddhant Chawla 65c3a892cf Multiple max spends functionality added (#7492)
this implements https://github.com/spesmilo/electrum/issues/7054
2021-09-15 14:35:15 +00:00
bitromortac c65caf6c68 qt+android: add lightning URI support 2021-07-30 08:44:15 +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
zebra-lucky 12c9de6bf9 qt: fix PayToEdit.parse_amount (#6951)
nicer error messages for malformed inputs
2021-01-18 22:07:29 +00: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 d40bedb2ac also support uppercase bip21 URIs
related https://github.com/btcpayserver/btcpayserver/issues/2110
2020-12-09 16:09:12 +01:00
SomberNight 4bd4fc7697 qt send tab: (regression) fix handling multiline fmt for single line
fixes #6761
2020-11-25 00:03:38 +01:00
SomberNight b95525896f qt send tab: show friendlier error on mistyped bitcoin address 2020-10-25 04:24:31 +01:00
SomberNight 4c7a92f39c bitcoin: implement construct_script and use it 2020-10-24 07:49:06 +02:00
SomberNight cb41a0fe89 qt send tab paytoedit: use monospace font 2020-01-21 14:32:18 +01:00
SomberNight b16164da4f qt paytoedit: fixes for pay-to-many (when including "!") 2020-01-18 04:15:26 +01:00
SomberNight d08ed6410a python3.8: fix DeprecationWarning in qt/paytoedit
.../electrum/electrum/gui/qt/paytoedit.py:221: DeprecationWarning: an integer is required (got type float).  Implicit conversion to integers using __int__ is deprecated, and may be removed in a future version of Python.
  self.setMinimumHeight(h)
2019-12-10 23:01:01 +01:00
SomberNight 4057140e6a lightning qr codes: more robust parsing
kivy qr code handling did not accept "lightning:" prefix or uppercase
2019-11-20 03:21:59 +01:00
SomberNight bafe8a2fff integrate PSBT support natively. WIP 2019-11-04 22:24:36 +01:00
SomberNight 8dabdf8bfb qt send tab: handle invalid ln invoice; and ln invoice with ln disabled
fixes #5639
fixes #5662
2019-10-01 19:15:26 +02:00
ThomasV aaed594772 Simplify invoices and requests.
- We need only two types: PR_TYPE_ONCHAIN and PR_TYPE_LN
 - BIP70 is no longer a type, but an optional field in the dict
 - Invoices in the wallet are indexed by a hash of their serialized list of outputs.
 - Requests are still indexed by address, because we never generate Paytomany requests.
 - Add 'clear_invoices' command to CLI
 - Add 'save invoice' button to Qt
2019-09-12 20:11:20 +02:00
ThomasV 3076eb75ea make parsing lightning qr codes more robust 2019-08-27 17:12:43 +02:00
ThomasV a5ab431b4b parse invoices with lightning: prefix 2019-08-20 09:03:10 +02:00
ThomasV f2b40c69fc do not set background in frozen_style, it does not look good with dark theme 2019-08-20 09:03:10 +02:00
ThomasV 34d5f1b2e3 lightning: connect send button 2019-08-20 09:03:10 +02:00
ThomasV 12d3877873 lightning GUI: use existing receive and send tabs with lightning invoices 2019-08-20 09:03:10 +02:00
SomberNight aac9826e1b qt paytoedit: better height adjustment
was sometimes weird...
e.g. pasting several lines of outputs would leave the textedit single line
2019-05-04 04:39:59 +02:00
SomberNight 3385a94753 logging: basics 2019-05-02 15:19:03 +02:00
ThomasV 9b4e490e3c leave max_button pressed (fix #5251) 2019-04-17 14:18:36 +02:00
SomberNight 441da52b51 fix more DeprecationWarnings 2019-03-27 19:27:45 +01:00
SomberNight e7f38467d7 move opcodes to bitcoin.py 2019-02-22 17:39:58 +01:00
SomberNight c03c17f1c7 transaction: replace custom enum type for opcodes with stdlib enum
based on Electron-Cash/Electron-Cash@99e60b4941
2019-02-22 16:52:08 +01:00
SomberNight 026448837f no more "import *"
fixes #5101
fixes #5105
2019-02-11 20:21:24 +01:00
SomberNight f819e9b6f4 openalias: minor clean-up 2018-10-29 17:09:23 +01:00
SomberNight 33d14e4238 some import clean-up in qt 2018-09-25 18:15:28 +02:00
SomberNight a2ed08615c minor.. move imports out of functions 2018-09-18 18:07:12 +02:00
SomberNight 2eb72d496f transaction: introduce TxOutput namedtuple 2018-08-01 19:10:08 +02:00
SomberNight f7dce426cb fix #4574 2018-07-19 19:52:06 +02:00
Janus 097ac144d9 file reorganization with top-level module 2018-07-13 14:01:37 +02:00