mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-04-18 14:55:53 -04:00
Add support if desktop.browse(uri) is not supported
This commit is contained in:
parent
b7d6c5195e
commit
279145a5ca
@ -23,8 +23,6 @@ import io.bitsquare.util.Utilities;
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.uri.BitcoinURI;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
@ -34,10 +32,7 @@ import javafx.beans.property.ObjectProperty;
|
||||
import javafx.beans.property.SimpleObjectProperty;
|
||||
import javafx.beans.property.SimpleStringProperty;
|
||||
import javafx.beans.property.StringProperty;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.control.*;
|
||||
import javafx.scene.image.Image;
|
||||
import javafx.scene.image.*;
|
||||
import javafx.scene.layout.*;
|
||||
import javafx.stage.Window;
|
||||
@ -75,7 +70,7 @@ public class AddressTextField extends AnchorPane {
|
||||
Tooltip.install(textField, new Tooltip("Open your default Bitcoin wallet with that address."));
|
||||
textField.setOnMouseClicked(mouseEvent -> {
|
||||
try {
|
||||
Desktop.getDesktop().browse(URI.create(getBitcoinURI()));
|
||||
Utilities.openURI(URI.create(getBitcoinURI()));
|
||||
} catch (IOException e) {
|
||||
log.warn(e.getMessage());
|
||||
Popups.openWarningPopup("Warning", "Opening a system Bitcoin wallet application has failed. " +
|
||||
|
@ -95,11 +95,11 @@ public class TxIdTextField extends AnchorPane {
|
||||
textField.setOnMouseClicked(mouseEvent -> {
|
||||
try {
|
||||
// TODO get the url form the app preferences
|
||||
Utilities.openURL("https://www.biteasy.com/testnet/transactions/" + txID);
|
||||
Utilities.openWebPage("https://www.biteasy.com/testnet/transactions/" + txID);
|
||||
//Utilities.openURL("https://blockchain.info/tx/" + txID);
|
||||
} catch (Exception e) {
|
||||
log.warn(e.getMessage());
|
||||
Popups.openWarningPopup("Warning", "Opening blockchain.info failed. Please check your internet " +
|
||||
log.error(e.getMessage());
|
||||
Popups.openWarningPopup("Warning", "Opening browser failed. Please check your internet " +
|
||||
"connection.");
|
||||
}
|
||||
});
|
||||
|
@ -205,9 +205,11 @@ public class IrcAccountViewCB extends CachedViewCB<IrcAccountPm> implements Cont
|
||||
@FXML
|
||||
void onOpenIRC() {
|
||||
try {
|
||||
Utilities.openURL("https://webchat.freenode.net/?channels=bitsquare-trading");
|
||||
Utilities.openWebPage("https://webchat.freenode.net/?channels=bitsquare-trading");
|
||||
} catch (Exception e) {
|
||||
log.error("Cannot open browser. " + e.getMessage());
|
||||
log.error(e.getMessage());
|
||||
Popups.openWarningPopup("Warning", "Opening browser failed. Please check your internet " +
|
||||
"connection.");
|
||||
}
|
||||
}
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
package io.bitsquare.gui.main.help;
|
||||
|
||||
import io.bitsquare.gui.components.Popups;
|
||||
import io.bitsquare.util.Utilities;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
@ -33,10 +34,12 @@ public class Help {
|
||||
|
||||
public static void openWindow(HelpId id) {
|
||||
try {
|
||||
Utilities.openURL("https://docs.bitsquare.io/0.1.0-SNAPSHOT/userguide/index.html");
|
||||
Utilities.openWebPage("https://docs.bitsquare.io/0.1.0-SNAPSHOT/userguide/index.html");
|
||||
// URL url = new URL("https://docs.bitsquare.io/0.1.0-SNAPSHOT/userguide/index.html#" + id);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
Popups.openWarningPopup("Warning", "Opening browser failed. Please check your internet " +
|
||||
"connection.");
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user