Add UR decoding capability to scanners on desktop & Android#10518
Add UR decoding capability to scanners on desktop & Android#10518hectorchu wants to merge 2 commits intospesmilo:masterfrom
Conversation
|
(ref #7905) |
There was a problem hiding this comment.
Note: the qtmultimedia toolchain is only used on Windows and macOS. Desktop Linux uses zbar.
But perhaps this is something we should reconsider.
See comment here:
electrum/electrum/gui/qt/qrreader/__init__.py
Lines 5 to 20 in 169227e
There was a problem hiding this comment.
Thanks a lot for this. It looks like a solid start.
Would you be interested in adding also the encode/display qr code parts to the GUIs?
There was a problem hiding this comment.
I have the encoding change for QRCodeWidget, but it currently generates the parts upfront, and then these are passed to the QRCodeWidget which then cycles them. But this was only for compatibility with Cake Wallet, which makes the assumption there are n-fixed parts. UR codes are actually intended to be used as a fountain code. See the description I wrote up here.
So I would take this change, but instead the QRCodeWidget should accept the data string and an argument encode_ur, if the latter is True then use a UREncoder to generate a new part on every refresh. These changes aren't difficult and I doubt they are difficult for the Android one also, but I haven't looked at the Android code. Could you do it?
There was a problem hiding this comment.
Actually, the QRCodeWidget should just accept a UR|str, because a UR also includes a type, and it would be better for all that to be created by the caller.
The widget creates encoder = UREncoder(ur), then the widget would just call encoder.next_part() per refresh.
|
HI! Here just to signal two python projects that implements these feature, hoping it could be useful :) |
As title. Only decoding - no encoding was added.