mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-04-16 05:53:06 -04:00
copy monero payment uri to clipboard in qr code window
This commit is contained in:
parent
61a62a1d94
commit
03a1132c2f
@ -765,9 +765,7 @@ public abstract class Overlay<T extends Overlay<T>> {
|
||||
FormBuilder.getIconForLabel(AwesomeIcon.COPY, copyIcon, "1.1em");
|
||||
copyIcon.addEventHandler(MOUSE_CLICKED, mouseEvent -> {
|
||||
if (message != null) {
|
||||
String forClipboard = headLineLabel.getText() + System.lineSeparator() + message
|
||||
+ System.lineSeparator() + (messageHyperlinks == null ? "" : messageHyperlinks.toString());
|
||||
Utilities.copyToClipboard(forClipboard);
|
||||
Utilities.copyToClipboard(getClipboardText());
|
||||
Tooltip tp = new Tooltip(Res.get("shared.copiedToClipboard"));
|
||||
Node node = (Node) mouseEvent.getSource();
|
||||
UserThread.runAfter(() -> tp.hide(), 1);
|
||||
@ -1083,6 +1081,11 @@ public abstract class Overlay<T extends Overlay<T>> {
|
||||
return isDisplayed;
|
||||
}
|
||||
|
||||
public String getClipboardText() {
|
||||
return headLineLabel.getText() + System.lineSeparator() + message
|
||||
+ System.lineSeparator() + (messageHyperlinks == null ? "" : messageHyperlinks.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Popup{" +
|
||||
|
@ -37,10 +37,10 @@ import java.io.ByteArrayInputStream;
|
||||
public class QRCodeWindow extends Overlay<QRCodeWindow> {
|
||||
private static final Logger log = LoggerFactory.getLogger(QRCodeWindow.class);
|
||||
private final ImageView qrCodeImageView;
|
||||
private final String bitcoinURI;
|
||||
private final String moneroUri;
|
||||
|
||||
public QRCodeWindow(String bitcoinURI) {
|
||||
this.bitcoinURI = bitcoinURI;
|
||||
this.moneroUri = bitcoinURI;
|
||||
final byte[] imageBytes = QRCode
|
||||
.from(bitcoinURI)
|
||||
.withSize(300, 300)
|
||||
@ -70,7 +70,7 @@ public class QRCodeWindow extends Overlay<QRCodeWindow> {
|
||||
GridPane.setHalignment(qrCodeImageView, HPos.CENTER);
|
||||
gridPane.getChildren().add(qrCodeImageView);
|
||||
|
||||
String request = bitcoinURI.replace("%20", " ").replace("?", "\n?").replace("&", "\n&");
|
||||
String request = moneroUri.replace("%20", " ").replace("?", "\n?").replace("&", "\n&");
|
||||
Label infoLabel = new AutoTooltipLabel(Res.get("qRCodeWindow.request", request));
|
||||
infoLabel.setMouseTransparent(true);
|
||||
infoLabel.setWrapText(true);
|
||||
@ -87,4 +87,8 @@ public class QRCodeWindow extends Overlay<QRCodeWindow> {
|
||||
applyStyles();
|
||||
display();
|
||||
}
|
||||
|
||||
public String getClipboardText() {
|
||||
return moneroUri;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user