Adding refresh button to select server dialog
This commit is contained in:
parent
9caad6b714
commit
825eb124cb
3 changed files with 22 additions and 1 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
# Eclipse project files and folders
|
||||
bin/*
|
||||
/bin/
|
||||
|
|
|
|||
|
|
@ -22,7 +22,14 @@
|
|||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<HBox alignment="CENTER_LEFT" prefWidth="200.0" />
|
||||
<HBox prefWidth="200.0">
|
||||
<children>
|
||||
<Button fx:id="refreshButton" mnemonicParsing="false" onAction="#refresh" text="Refresh">
|
||||
<HBox.margin>
|
||||
<Insets left="10.0" />
|
||||
</HBox.margin>
|
||||
</Button>
|
||||
</children></HBox>
|
||||
<HBox alignment="TOP_RIGHT" prefWidth="200.0" GridPane.columnIndex="1">
|
||||
<children>
|
||||
<Button fx:id="exitButton" mnemonicParsing="false" onAction="#exit" text="Exit">
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ public class SelectServerDialog extends GuiWindow {
|
|||
@FXML private Button exitButton;
|
||||
@FXML private Button connectButton;
|
||||
@FXML private Label errorLabel;
|
||||
@FXML private Button refreshButton;
|
||||
|
||||
public SelectServerDialog(final CoderClient client) throws IOException {
|
||||
super(SelectServerDialog.class.getResource("SelectServerDialog.fxml"));
|
||||
|
|
@ -171,6 +172,12 @@ public class SelectServerDialog extends GuiWindow {
|
|||
}else if(event.getCode() == KeyCode.ESCAPE){
|
||||
logger.fine("User pressed the ESCAPE key");
|
||||
exitButton.fire();
|
||||
}else if(event.getCode() == KeyCode.F5){
|
||||
logger.fine("User pressed the F5 key");
|
||||
refreshButton.fire();
|
||||
}else if(event.getCode() == KeyCode.R && event.isControlDown()){
|
||||
logger.fine("User pressed the CTRL+R key");
|
||||
refreshButton.fire();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -179,6 +186,12 @@ public class SelectServerDialog extends GuiWindow {
|
|||
logger.fine("exit button triggered");
|
||||
client.exit();
|
||||
}
|
||||
|
||||
@FXML
|
||||
protected void refresh(ActionEvent event){
|
||||
logger.fine("refresh button triggered");
|
||||
client.getSSDPHandler().requestService("coder:discover");
|
||||
}
|
||||
|
||||
@FXML
|
||||
protected void connect(ActionEvent event){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue