From 72ff1df61e50c7920ed650d7197948bda32c5c14 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Tue, 14 Dec 2021 20:08:56 +0200 Subject: [PATCH] add menu item to show paynym --- .../com/sparrowwallet/sparrow/AppController.java | 13 +++++++++++++ .../resources/com/sparrowwallet/sparrow/app.fxml | 6 ++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/AppController.java b/src/main/java/com/sparrowwallet/sparrow/AppController.java index 7e46a744..a1899b3f 100644 --- a/src/main/java/com/sparrowwallet/sparrow/AppController.java +++ b/src/main/java/com/sparrowwallet/sparrow/AppController.java @@ -28,6 +28,7 @@ import com.sparrowwallet.sparrow.net.ServerType; import com.sparrowwallet.sparrow.preferences.PreferenceGroup; import com.sparrowwallet.sparrow.preferences.PreferencesDialog; import com.sparrowwallet.sparrow.soroban.CounterpartyDialog; +import com.sparrowwallet.sparrow.soroban.PayNymDialog; import com.sparrowwallet.sparrow.soroban.Soroban; import com.sparrowwallet.sparrow.soroban.SorobanServices; import com.sparrowwallet.sparrow.transaction.TransactionController; @@ -163,6 +164,9 @@ public class AppController implements Initializable { @FXML private MenuItem findMixingPartner; + @FXML + private MenuItem showPayNym; + @FXML private CheckMenuItem preventSleep; private static final BooleanProperty preventSleepProperty = new SimpleBooleanProperty(); @@ -329,6 +333,7 @@ public class AppController implements Initializable { lockWallet.setDisable(true); refreshWallet.disableProperty().bind(Bindings.or(exportWallet.disableProperty(), Bindings.or(serverToggle.disableProperty(), AppServices.onlineProperty().not()))); sendToMany.disableProperty().bind(exportWallet.disableProperty()); + showPayNym.disableProperty().bind(findMixingPartner.disableProperty()); findMixingPartner.setDisable(true); AppServices.onlineProperty().addListener((observable, oldValue, newValue) -> { findMixingPartner.setDisable(exportWallet.isDisable() || getSelectedWalletForm() == null || !SorobanServices.canWalletMix(getSelectedWalletForm().getWallet()) || !newValue); @@ -1289,6 +1294,14 @@ public class AppController implements Initializable { } } + public void showPayNym(ActionEvent event) { + WalletForm selectedWalletForm = getSelectedWalletForm(); + if(selectedWalletForm != null) { + PayNymDialog payNymDialog = new PayNymDialog(selectedWalletForm.getWalletId(), false); + payNymDialog.showAndWait(); + } + } + public void minimizeToTray(ActionEvent event) { AppServices.get().minimizeStage((Stage)tabs.getScene().getWindow()); } diff --git a/src/main/resources/com/sparrowwallet/sparrow/app.fxml b/src/main/resources/com/sparrowwallet/sparrow/app.fxml index 8e162881..1d9037bc 100644 --- a/src/main/resources/com/sparrowwallet/sparrow/app.fxml +++ b/src/main/resources/com/sparrowwallet/sparrow/app.fxml @@ -110,9 +110,11 @@ - - + + + +