Change selection event handler

This commit is contained in:
Manfred Karrer 2015-05-12 00:49:24 +02:00
parent 844a6dd66c
commit b5e29d0cf7
2 changed files with 3 additions and 3 deletions

View File

@ -46,7 +46,7 @@
</TextField>
<Label text="Select Network:" GridPane.rowIndex="1"/>
<ComboBox fx:id="netWorkComboBox" onAction="#onSelectNetwork" GridPane.rowIndex="1" GridPane.columnIndex="1"/>
<ComboBox fx:id="netWorkComboBox" GridPane.rowIndex="1" GridPane.columnIndex="1"/>
<Label text="Bitcoin network connected peers:" GridPane.rowIndex="2"/>
<TextField fx:id="connectedPeersBTC" GridPane.rowIndex="2" GridPane.columnIndex="1"

View File

@ -78,6 +78,7 @@ public class NetworkSettingsView extends InitializableView {
netWorkComboBox.setItems(FXCollections.observableArrayList(BitcoinNetwork.values()));
netWorkComboBox.getSelectionModel().select(preferences.getBitcoinNetwork());
netWorkComboBox.setOnAction(e -> onSelectNetwork());
}
@FXML
@ -85,7 +86,6 @@ public class NetworkSettingsView extends InitializableView {
preferences.setUseUPnP(useUPnP.isSelected());
}
@FXML
void onSelectNetwork() {
preferences.setBitcoinNetwork(netWorkComboBox.getSelectionModel().getSelectedItem());
@ -106,7 +106,7 @@ public class NetworkSettingsView extends InitializableView {
}
});
Action response = Popups.openConfirmPopup("Info", null,
Action response = Popups.openConfirmPopup("Info", "",
"You need to restart the application to apply the change of the Bitcoin network." +
"\n\nDo you want to shutdown now?",
actions);