mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-08-10 23:50:10 -04:00
update block explorer preferences for xmr, remove address url
This commit is contained in:
parent
9aea5e0c58
commit
75f5255050
10 changed files with 20 additions and 132 deletions
|
@ -33,7 +33,6 @@ import haveno.desktop.common.view.ActivatableView;
|
|||
import haveno.desktop.common.view.FxmlView;
|
||||
import haveno.desktop.components.AddressTextField;
|
||||
import haveno.desktop.components.AutoTooltipLabel;
|
||||
import haveno.desktop.components.ExternalHyperlink;
|
||||
import haveno.desktop.components.HyperlinkWithIcon;
|
||||
import haveno.desktop.components.InputTextField;
|
||||
import haveno.desktop.components.TitledGroupBg;
|
||||
|
@ -308,11 +307,6 @@ public class DepositView extends ActivatableView<VBox, Void> {
|
|||
}
|
||||
}
|
||||
|
||||
private void openBlockExplorer(DepositListItem item) {
|
||||
if (item.getAddressString() != null)
|
||||
GUIUtil.openWebPage(preferences.getBlockChainExplorer().addressUrl + item.getAddressString(), false);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Private
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -391,13 +385,7 @@ public class DepositView extends ActivatableView<VBox, Void> {
|
|||
|
||||
if (item != null && !empty) {
|
||||
String address = item.getAddressString();
|
||||
field = new ExternalHyperlink(address);
|
||||
field.setOnAction(event -> {
|
||||
openBlockExplorer(item);
|
||||
tableView.getSelectionModel().select(item);
|
||||
});
|
||||
field.setTooltip(new Tooltip(Res.get("tooltip.openBlockchainForAddress", address)));
|
||||
setGraphic(field);
|
||||
setGraphic(new AutoTooltipLabel(address));
|
||||
} else {
|
||||
setGraphic(null);
|
||||
if (field != null)
|
||||
|
|
|
@ -35,7 +35,6 @@ import haveno.desktop.common.view.ActivatableView;
|
|||
import haveno.desktop.common.view.FxmlView;
|
||||
import haveno.desktop.components.AutoTooltipButton;
|
||||
import haveno.desktop.components.AutoTooltipLabel;
|
||||
import haveno.desktop.components.ExternalHyperlink;
|
||||
import haveno.desktop.components.HyperlinkWithIcon;
|
||||
import haveno.desktop.main.overlays.windows.OfferDetailsWindow;
|
||||
import haveno.desktop.main.overlays.windows.TradeDetailsWindow;
|
||||
|
@ -222,10 +221,6 @@ public class LockedView extends ActivatableView<VBox, Void> {
|
|||
.collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
private void openBlockExplorer(LockedListItem item) {
|
||||
GUIUtil.openWebPage(preferences.getBlockChainExplorer().addressUrl + item.getAddressString(), false);
|
||||
}
|
||||
|
||||
private Optional<Tradable> getTradable(LockedListItem item) {
|
||||
String offerId = item.getAddressEntry().getOfferId();
|
||||
Optional<Trade> tradeOptional = tradeManager.getOpenTrade(offerId);
|
||||
|
@ -330,7 +325,6 @@ public class LockedView extends ActivatableView<VBox, Void> {
|
|||
public TableCell<LockedListItem, LockedListItem> call(TableColumn<LockedListItem,
|
||||
LockedListItem> column) {
|
||||
return new TableCell<>() {
|
||||
private HyperlinkWithIcon hyperlinkWithIcon;
|
||||
|
||||
@Override
|
||||
public void updateItem(final LockedListItem item, boolean empty) {
|
||||
|
@ -338,14 +332,9 @@ public class LockedView extends ActivatableView<VBox, Void> {
|
|||
|
||||
if (item != null && !empty) {
|
||||
String address = item.getAddressString();
|
||||
hyperlinkWithIcon = new ExternalHyperlink(address);
|
||||
hyperlinkWithIcon.setOnAction(event -> openBlockExplorer(item));
|
||||
hyperlinkWithIcon.setTooltip(new Tooltip(Res.get("tooltip.openBlockchainForAddress", address)));
|
||||
setGraphic(hyperlinkWithIcon);
|
||||
setGraphic(new AutoTooltipLabel(address));
|
||||
} else {
|
||||
setGraphic(null);
|
||||
if (hyperlinkWithIcon != null)
|
||||
hyperlinkWithIcon.setOnAction(null);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -35,7 +35,6 @@ import haveno.desktop.common.view.ActivatableView;
|
|||
import haveno.desktop.common.view.FxmlView;
|
||||
import haveno.desktop.components.AutoTooltipButton;
|
||||
import haveno.desktop.components.AutoTooltipLabel;
|
||||
import haveno.desktop.components.ExternalHyperlink;
|
||||
import haveno.desktop.components.HyperlinkWithIcon;
|
||||
import haveno.desktop.main.overlays.windows.OfferDetailsWindow;
|
||||
import haveno.desktop.main.overlays.windows.TradeDetailsWindow;
|
||||
|
@ -221,10 +220,6 @@ public class ReservedView extends ActivatableView<VBox, Void> {
|
|||
.collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
private void openBlockExplorer(ReservedListItem item) {
|
||||
GUIUtil.openWebPage(preferences.getBlockChainExplorer().addressUrl + item.getAddressString(), false);
|
||||
}
|
||||
|
||||
private Optional<Tradable> getTradable(ReservedListItem item) {
|
||||
String offerId = item.getAddressEntry().getOfferId();
|
||||
Optional<Trade> tradeOptional = tradeManager.getOpenTrade(offerId);
|
||||
|
@ -329,7 +324,6 @@ public class ReservedView extends ActivatableView<VBox, Void> {
|
|||
public TableCell<ReservedListItem, ReservedListItem> call(TableColumn<ReservedListItem,
|
||||
ReservedListItem> column) {
|
||||
return new TableCell<>() {
|
||||
private HyperlinkWithIcon hyperlinkWithIcon;
|
||||
|
||||
@Override
|
||||
public void updateItem(final ReservedListItem item, boolean empty) {
|
||||
|
@ -337,14 +331,9 @@ public class ReservedView extends ActivatableView<VBox, Void> {
|
|||
|
||||
if (item != null && !empty) {
|
||||
String address = item.getAddressString();
|
||||
hyperlinkWithIcon = new ExternalHyperlink(address);
|
||||
hyperlinkWithIcon.setOnAction(event -> openBlockExplorer(item));
|
||||
hyperlinkWithIcon.setTooltip(new Tooltip(Res.get("tooltip.openBlockchainForAddress", address)));
|
||||
setGraphic(hyperlinkWithIcon);
|
||||
setGraphic(new AutoTooltipLabel(address));
|
||||
} else {
|
||||
setGraphic(null);
|
||||
if (hyperlinkWithIcon != null)
|
||||
hyperlinkWithIcon.setOnAction(null);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -244,12 +244,6 @@ public class TransactionsView extends ActivatableView<VBox, Void> {
|
|||
GUIUtil.openWebPage(preferences.getBlockChainExplorer().txUrl + item.getTxId(), false);
|
||||
}
|
||||
|
||||
private void openAddressInBlockExplorer(TransactionsListItem item) {
|
||||
if (item.getAddressString() != null) {
|
||||
GUIUtil.openWebPage(preferences.getBlockChainExplorer().addressUrl + item.getAddressString(), false);
|
||||
}
|
||||
}
|
||||
|
||||
private void openDetailPopup(TransactionsListItem item) {
|
||||
if (item.getTradable() instanceof OpenOffer)
|
||||
offerDetailsWindow.show(item.getTradable().getOffer());
|
||||
|
@ -349,7 +343,6 @@ public class TransactionsView extends ActivatableView<VBox, Void> {
|
|||
String addressString = item.getAddressString();
|
||||
field = new AddressWithIconAndDirection(item.getDirection(), addressString,
|
||||
item.getReceived());
|
||||
field.setOnAction(event -> openAddressInBlockExplorer(item));
|
||||
field.setTooltip(new Tooltip(Res.get("tooltip.openBlockchainForAddress", addressString)));
|
||||
setGraphic(field);
|
||||
} else {
|
||||
|
|
|
@ -54,7 +54,7 @@ import static javafx.beans.binding.Bindings.createBooleanBinding;
|
|||
|
||||
public class EditCustomExplorerWindow extends Overlay<EditCustomExplorerWindow> {
|
||||
|
||||
private InputTextField nameInputTextField, txUrlInputTextField, addressUrlInputTextField;
|
||||
private InputTextField nameInputTextField, txUrlInputTextField;
|
||||
private UrlInputValidator urlInputValidator;
|
||||
private BlockChainExplorer currentExplorer;
|
||||
private ListView<BlockChainExplorer> listView;
|
||||
|
@ -70,9 +70,10 @@ public class EditCustomExplorerWindow extends Overlay<EditCustomExplorerWindow>
|
|||
|
||||
public BlockChainExplorer getEditedBlockChainExplorer() {
|
||||
return new BlockChainExplorer(nameInputTextField.getText(),
|
||||
txUrlInputTextField.getText(), addressUrlInputTextField.getText());
|
||||
txUrlInputTextField.getText());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void show() {
|
||||
|
||||
width = 1000;
|
||||
|
@ -83,20 +84,17 @@ public class EditCustomExplorerWindow extends Overlay<EditCustomExplorerWindow>
|
|||
|
||||
urlInputValidator = new UrlInputValidator();
|
||||
txUrlInputTextField.setValidator(urlInputValidator);
|
||||
addressUrlInputTextField.setValidator(urlInputValidator);
|
||||
nameInputTextField.setValidator(new LengthValidator(1, 50));
|
||||
|
||||
actionButton.disableProperty().bind(createBooleanBinding(() -> {
|
||||
String name = nameInputTextField.getText();
|
||||
String txUrl = txUrlInputTextField.getText();
|
||||
String addressUrl = addressUrlInputTextField.getText();
|
||||
|
||||
// Otherwise we require that input is valid
|
||||
return !nameInputTextField.getValidator().validate(name).isValid ||
|
||||
!txUrlInputTextField.getValidator().validate(txUrl).isValid ||
|
||||
!addressUrlInputTextField.getValidator().validate(addressUrl).isValid;
|
||||
!txUrlInputTextField.getValidator().validate(txUrl).isValid;
|
||||
},
|
||||
nameInputTextField.textProperty(), txUrlInputTextField.textProperty(), addressUrlInputTextField.textProperty()));
|
||||
nameInputTextField.textProperty(), txUrlInputTextField.textProperty()));
|
||||
|
||||
applyStyles();
|
||||
display();
|
||||
|
@ -127,7 +125,6 @@ public class EditCustomExplorerWindow extends Overlay<EditCustomExplorerWindow>
|
|||
if (blockChainExplorer != null) {
|
||||
nameInputTextField.setText(blockChainExplorer.name);
|
||||
txUrlInputTextField.setText(blockChainExplorer.txUrl);
|
||||
addressUrlInputTextField.setText(blockChainExplorer.addressUrl);
|
||||
}
|
||||
});
|
||||
button.setStyle("-fx-pref-width: 50px; -fx-pref-height: 30; -fx-padding: 3 3 3 3;");
|
||||
|
@ -169,7 +166,6 @@ public class EditCustomExplorerWindow extends Overlay<EditCustomExplorerWindow>
|
|||
BlockChainExplorer blockChainExplorer = listView.getSelectionModel().getSelectedItem();
|
||||
nameInputTextField.setText(blockChainExplorer.name);
|
||||
txUrlInputTextField.setText(blockChainExplorer.txUrl);
|
||||
addressUrlInputTextField.setText(blockChainExplorer.addressUrl);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -186,9 +182,7 @@ public class EditCustomExplorerWindow extends Overlay<EditCustomExplorerWindow>
|
|||
nameInputTextField = addInputTextField(autoConfirmGridPane, ++localRowIndex, Res.get("settings.preferences.editCustomExplorer.name"), Layout.FIRST_ROW_DISTANCE);
|
||||
nameInputTextField.setPrefWidth(Layout.INITIAL_WINDOW_WIDTH);
|
||||
txUrlInputTextField = addInputTextField(autoConfirmGridPane, ++localRowIndex, Res.get("settings.preferences.editCustomExplorer.txUrl"));
|
||||
addressUrlInputTextField = addInputTextField(autoConfirmGridPane, ++localRowIndex, Res.get("settings.preferences.editCustomExplorer.addressUrl"));
|
||||
nameInputTextField.setText(currentExplorer.name);
|
||||
txUrlInputTextField.setText(currentExplorer.txUrl);
|
||||
addressUrlInputTextField.setText(currentExplorer.addressUrl);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -771,7 +771,7 @@ public class PreferencesView extends ActivatableViewAndModel<GridPane, Preferenc
|
|||
resetDontShowAgainButton.setOnAction(e -> preferences.resetDontShowAgain());
|
||||
|
||||
editCustomBtcExplorer.setOnAction(e -> {
|
||||
EditCustomExplorerWindow urlWindow = new EditCustomExplorerWindow("BTC",
|
||||
EditCustomExplorerWindow urlWindow = new EditCustomExplorerWindow("XMR",
|
||||
preferences.getBlockChainExplorer(), preferences.getBlockChainExplorers());
|
||||
urlWindow
|
||||
.actionButtonText(Res.get("shared.save"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue