Commit 2aa78287 authored by Josselin ENET's avatar Josselin ENET

Added a disconnect button to UI #55

A disconnect button is now visible at the bottom of agent and admin hom
screens.
parent bd99a470
......@@ -76,6 +76,14 @@ public class AdminHomeController extends SceneController {
gui.setController(new AdminTravelReservationController(gui));
});
//disconnect button
Button disconnectButton = new Button();
disconnectButton.setText("Disconnect");
disconnectButton.setOnAction(event -> {
gui.setController(new LoginFormController(gui));
gui.setCurrentUser(null);
});
root.add(userManagementText, 0, 0);
root.setMargin(userManagementText, new Insets(2));
......@@ -95,9 +103,12 @@ public class AdminHomeController extends SceneController {
root.setMargin(agentReservationText, new Insets(2));
root.add(reserveTravelButton, 0, 11);
root.setMargin(reserveTravelButton, new Insets(2));
root.add(disconnectButton, 0, 13);
root.setMargin(disconnectButton, new Insets(10, 2, 2, 2));
Scene result = new Scene(root,400,300);
Scene result = new Scene(root,400,350);
return result;
}
......
......@@ -88,11 +88,20 @@ public class AgentHomeController extends SceneController {
gui.setController(new AgentBookedTravelsController(gui));
});
//disconnect button
Button disconnectButton = new Button();
disconnectButton.setText("Disconnect");
disconnectButton.setOnAction(event -> {
gui.setController(new LoginFormController(gui));
gui.setCurrentUser(null);
});
root.add(travelReservationText, 0,0);
root.add(lbTravelsComboBox,0,2);
root.add(travelsComboBox, 1, 2);
root.add(reserveButton, 0, 4);
root.add(bookedTravelsButton, 0, 6);
root.add(disconnectButton, 0, 8);
Scene result = new Scene(root,400,250);
return result;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment