mirror of
https://github.com/retoaccess1/haveno-reto.git
synced 2024-12-12 04:43:32 +01:00
fix link to open default monero wallet from deposit view
This commit is contained in:
parent
a5663e1411
commit
02ba804432
@ -107,6 +107,7 @@ public class HavenoSetup {
|
||||
private final WalletsManager walletsManager;
|
||||
private final WalletsSetup walletsSetup;
|
||||
private final BtcWalletService btcWalletService;
|
||||
@Getter
|
||||
private final XmrWalletService xmrWalletService;
|
||||
private final P2PService p2PService;
|
||||
private final PrivateNotificationManager privateNotificationManager;
|
||||
|
@ -97,7 +97,7 @@ public class AddressTextField extends AnchorPane {
|
||||
|
||||
private void openWallet() {
|
||||
try {
|
||||
Utilities.openURI(URI.create(getBitcoinURI()));
|
||||
Utilities.openURI(URI.create(getMoneroURI()));
|
||||
} catch (Exception e) {
|
||||
log.warn(e.getMessage());
|
||||
new Popup().warning(Res.get("addressTextField.openWallet.failed")).show();
|
||||
@ -150,12 +150,15 @@ public class AddressTextField extends AnchorPane {
|
||||
// Private
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
private String getBitcoinURI() {
|
||||
private String getMoneroURI() {
|
||||
if (amount.get().compareTo(BigInteger.valueOf(0)) < 0) {
|
||||
log.warn("Amount must not be negative");
|
||||
setAmount(BigInteger.valueOf(0));
|
||||
}
|
||||
return GUIUtil.getBitcoinURI(address.get(), HavenoUtils.atomicUnitsToCoin(amount.get()),
|
||||
paymentLabel.get());
|
||||
}
|
||||
return GUIUtil.getMoneroURI(
|
||||
address.get(),
|
||||
amount.get(),
|
||||
paymentLabel.get(),
|
||||
HavenoUtils.havenoSetup.getXmrWalletService().getWallet());
|
||||
}
|
||||
}
|
||||
|
@ -96,9 +96,7 @@ import monero.daemon.model.MoneroTx;
|
||||
import monero.wallet.MoneroWallet;
|
||||
import monero.wallet.model.MoneroTxConfig;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.bitcoinj.core.Address;
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.uri.BitcoinURI;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.File;
|
||||
@ -683,13 +681,6 @@ public class GUIUtil {
|
||||
.setNote(label));
|
||||
}
|
||||
|
||||
public static String getBitcoinURI(String address, Coin amount, String label) {
|
||||
return address != null ?
|
||||
BitcoinURI.convertToBitcoinURI(Address.fromString(Config.baseCurrencyNetworkParameters(),
|
||||
address), amount, label, null) :
|
||||
"";
|
||||
}
|
||||
|
||||
public static boolean isBootstrappedOrShowPopup(P2PService p2PService) {
|
||||
if (p2PService.isBootstrapped() && p2PService.getNumConnectedPeers().get() > 0) {
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user