sparrowwallet / sparrow

Desktop Bitcoin Wallet focused on security and privacy. Free and open source.
https://sparrowwallet.com/
Apache License 2.0
1.36k stars 192 forks source link

QRScanDialog$WebcamDependencyException: Missing Dependency Error Doesn't Display Link #1510

Closed dcavacec closed 1 month ago

dcavacec commented 1 month ago

On Windows 11 Home v23H2, this error references a link, but the link is not displayed.

image

sparrow.log:

2024-09-29 12:14:38,299 ERROR [JavaFX Application Thread] c.s.s.c.FileImportPane [null:-1] Error importing QR
com.sparrowwallet.sparrow.control.QRScanDialog$WebcamDependencyException: Your system is missing a dependency required for the webcam. Follow the link below for more details.

[https://sparrowwallet.com/docs/faq.html#your-system-is-missing-a-dependency-for-the-webcam]

source: https://github.com/sparrowwallet/sparrow/blob/1bbc586cd616e46c6ebd9615fb0e616ae44fb98c/src/main/java/com/sparrowwallet/sparrow/control/QRScanDialog.java#L143

I was able to fix the problem by installing the security package linked from that FAQ.

I think this is worth investigating, because some users may be comfortable with downloading and installing a Microsoft security patch (thus working through this independently), but not tracking down the link in source code.

I'd be interested in working on a PR, but not sure what the contribution policy is. If that's agreeable, just let me know :)

craigraw commented 1 month ago

Thanks for the report. This is an issue which unfortunately only presents itself occasionally (ie on certain systems). The right place to look would be here.

I'm happy to accept small PRs, or even just a description of what's causing the issue.

dcavacec commented 1 month ago

I proposed an update in [#1512]. Two main issues I learned about:

  1. The calculation for width wasn't handling newlines and URLs. In making changes for the second item, I found that the inherent javafx wrapping seems to be appropriate, but I don't have the (practical) ability to test this on Mac or Linux.
  2. The referenced URL wasn't rendered as a link, because JFX Label doesn't do that automatically. So, the proposed change is to find URLs and create JFX Hyperlink objects from them, then join with surrounding Label objects for regular text.

This seems to work within the modal in question, including for details sections without links.