various minor fixes

This commit is contained in:
Craig Raw 2021-10-29 14:33:47 +02:00
parent 6b6b23b51a
commit ceb5d85648
6 changed files with 10 additions and 15 deletions

2
drongo

@ -1 +1 @@
Subproject commit bdb9900d8d94f62b8714e14e151635813c7c258d Subproject commit 6c03c4106ae612c0b80370c3ed5495b1ba9225bc

View file

@ -1283,7 +1283,7 @@ public class AppController implements Initializable {
addWalletSubTab(subTabs, storage, wallet, backupWallet); addWalletSubTab(subTabs, storage, wallet, backupWallet);
Tab masterTab = subTabs.getTabs().stream().filter(tab -> ((WalletTabData)tab.getUserData()).getWallet().isMasterWallet()).findFirst().orElse(subTabs.getTabs().get(0)); Tab masterTab = subTabs.getTabs().stream().filter(tab -> ((WalletTabData)tab.getUserData()).getWallet().isMasterWallet()).findFirst().orElse(subTabs.getTabs().get(0));
Label masterLabel = (Label)masterTab.getGraphic(); Label masterLabel = (Label)masterTab.getGraphic();
masterLabel.setText(wallet.getMasterWallet().getLabel() != null ? wallet.getMasterWallet().getLabel() : getAutomaticName(wallet.getMasterWallet())); masterLabel.setText(wallet.getMasterWallet().getLabel() != null ? wallet.getMasterWallet().getLabel() : wallet.getMasterWallet().getAutomaticName());
Platform.runLater(() -> { Platform.runLater(() -> {
setSubTabsVisible(subTabs, true); setSubTabsVisible(subTabs, true);
}); });
@ -1313,7 +1313,7 @@ public class AppController implements Initializable {
try { try {
Tab subTab = new Tab(); Tab subTab = new Tab();
subTab.setClosable(false); subTab.setClosable(false);
String label = wallet.getLabel() != null ? wallet.getLabel() : (wallet.isMasterWallet() ? getAutomaticName(wallet) : wallet.getName()); String label = wallet.getLabel() != null ? wallet.getLabel() : (wallet.isMasterWallet() ? wallet.getAutomaticName() : wallet.getName());
Label subTabLabel = new Label(label); Label subTabLabel = new Label(label);
subTabLabel.setPadding(new Insets(0, 3, 0, 3)); subTabLabel.setPadding(new Insets(0, 3, 0, 3));
subTabLabel.setGraphic(getSubTabGlyph(wallet)); subTabLabel.setGraphic(getSubTabGlyph(wallet));
@ -1368,11 +1368,6 @@ public class AppController implements Initializable {
return tabGlyph; return tabGlyph;
} }
private String getAutomaticName(Wallet wallet) {
int account = wallet.getAccountIndex();
return (account < 0 || account > 9) ? wallet.getName() : (!wallet.isWhirlpoolMasterWallet() || account > 1 ? "Account #" + account : "Deposit");
}
public WalletForm getSelectedWalletForm() { public WalletForm getSelectedWalletForm() {
Tab selectedTab = tabs.getSelectionModel().getSelectedItem(); Tab selectedTab = tabs.getSelectionModel().getSelectedItem();
TabData tabData = (TabData)selectedTab.getUserData(); TabData tabData = (TabData)selectedTab.getUserData();

View file

@ -140,7 +140,7 @@ public class PaymentController extends WalletFormController implements Initializ
return null; return null;
} }
}); });
openWallets.setItems(FXCollections.observableList(AppServices.get().getOpenWallets().keySet().stream().filter(Wallet::isValid).collect(Collectors.toList()))); openWallets.setItems(FXCollections.observableList(AppServices.get().getOpenWallets().keySet().stream().filter(wallet -> wallet.isValid() && !wallet.isWhirlpoolChildWallet()).collect(Collectors.toList())));
openWallets.prefWidthProperty().bind(address.widthProperty()); openWallets.prefWidthProperty().bind(address.widthProperty());
openWallets.valueProperty().addListener((observable, oldValue, newValue) -> { openWallets.valueProperty().addListener((observable, oldValue, newValue) -> {
if(newValue != null) { if(newValue != null) {
@ -475,6 +475,6 @@ public class PaymentController extends WalletFormController implements Initializ
@Subscribe @Subscribe
public void openWallets(OpenWalletsEvent event) { public void openWallets(OpenWalletsEvent event) {
openWallets.setItems(FXCollections.observableList(event.getWallets().stream().filter(Wallet::isValid).collect(Collectors.toList()))); openWallets.setItems(FXCollections.observableList(event.getWallets().stream().filter(wallet -> wallet.isValid() && !wallet.isWhirlpoolChildWallet()).collect(Collectors.toList())));
} }
} }

View file

@ -7,7 +7,7 @@
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
<AnchorPane stylesheets="@keystoreimport.css" xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml" fx:controller="com.sparrowwallet.sparrow.keystoreimport.HwAirgappedController"> <AnchorPane stylesheets="@keystoreimport.css" xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml" fx:controller="com.sparrowwallet.sparrow.keystoreimport.HwAirgappedController">
<ScrollPane AnchorPane.leftAnchor="0" AnchorPane.rightAnchor="0" fitToWidth="true"> <ScrollPane AnchorPane.leftAnchor="0" AnchorPane.rightAnchor="0" fitToWidth="true" hbarPolicy="NEVER" prefHeight="620">
<Accordion fx:id="importAccordion" /> <Accordion fx:id="importAccordion" />
</ScrollPane> </ScrollPane>
</AnchorPane> </AnchorPane>

View file

@ -7,7 +7,7 @@
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
<AnchorPane stylesheets="@keystoreimport.css" xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml" fx:controller="com.sparrowwallet.sparrow.keystoreimport.HwUsbDevicesController"> <AnchorPane stylesheets="@keystoreimport.css" xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml" fx:controller="com.sparrowwallet.sparrow.keystoreimport.HwUsbDevicesController">
<ScrollPane AnchorPane.leftAnchor="0" AnchorPane.rightAnchor="0" fitToWidth="true"> <ScrollPane AnchorPane.leftAnchor="0" AnchorPane.rightAnchor="0" fitToWidth="true" hbarPolicy="NEVER" prefHeight="620">
<Accordion fx:id="deviceAccordion" /> <Accordion fx:id="deviceAccordion" />
</ScrollPane> </ScrollPane>
</AnchorPane> </AnchorPane>

View file

@ -7,7 +7,7 @@
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
<AnchorPane stylesheets="@keystoreimport.css" xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml" fx:controller="com.sparrowwallet.sparrow.keystoreimport.SwController"> <AnchorPane stylesheets="@keystoreimport.css" xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml" fx:controller="com.sparrowwallet.sparrow.keystoreimport.SwController">
<ScrollPane AnchorPane.leftAnchor="0" AnchorPane.rightAnchor="0" fitToWidth="true"> <ScrollPane AnchorPane.leftAnchor="0" AnchorPane.rightAnchor="0" fitToWidth="true" hbarPolicy="NEVER" prefHeight="620">
<Accordion fx:id="importAccordion" /> <Accordion fx:id="importAccordion" />
</ScrollPane> </ScrollPane>
</AnchorPane> </AnchorPane>