Skip to content
Snippets Groups Projects
Verified Commit 86997c29 authored by Théo Pirkl's avatar Théo Pirkl :nail_care:
Browse files

Begins LeftJourney handling

parent d78718cf
No related branches found
No related tags found
1 merge request!21*poof* final version
......@@ -22,7 +22,7 @@ public final class AppConfig {
public static final String ERROR_API_UNREACHABLE = "Impossible de contacter les services de transport Suisses.";
public static final String DEFAULT_JOURNEY_TEXT = "Vous n'avez prévu aucun voyage pour le moment.";
public static List<String> CHAT_COMMANDS = List.of(
"help",
......
......@@ -74,6 +74,7 @@ public class MainWindowController implements Initializable {
private Pane connectionContainer;
private List<Connection> currentConnections;
private Connection currentConnection;
/**
* Shows a sad message when the API crashes.
......@@ -325,7 +326,7 @@ public class MainWindowController implements Initializable {
*/
@Override
public void initialize(URL url, ResourceBundle resourceBundle) {
currentJourneyLabel.setText("Vous n'avez prévu aucun voyage pour le moment.");
currentJourneyLabel.setText(AppConfig.DEFAULT_JOURNEY_TEXT);
startStopLabel.setText(""); // No text should be visible when no journey has been selected.
messageTextBox.textProperty().addListener((ov, oldValue, newValue) -> {
if (messageTextBox.getText().length() > 60) {
......@@ -358,7 +359,10 @@ public class MainWindowController implements Initializable {
pane.setOnMouseClicked(e -> {
Pane pnl = (Pane) e.getSource();
Integer pos = Integer.parseInt(pnl.getId());
app.getMessageManager().sendJoinedJourney(new JoinedJourney(app.getUser().get(), currentConnections.get(pos)));
currentConnection = currentConnections.get(pos);
currentJourneyLabel.setText("");
app.getMessageManager()
.sendJoinedJourney(new JoinedJourney(app.getUser().get(), currentConnection));
});
});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment