fix: remove LocaleAware constraint from MainCtrl

This commit is contained in:
Zhongheng Liu 2025-12-04 21:09:12 +01:00
commit 40d157cc6c
Signed by: steven
GPG key ID: F69B980899C1C09D
2 changed files with 2 additions and 26 deletions

View file

@ -15,9 +15,6 @@
*/ */
package client.scenes; package client.scenes;
import client.utils.LocaleAware;
import client.utils.LocaleManager;
import jakarta.inject.Inject;
import javafx.fxml.FXML; import javafx.fxml.FXML;
import javafx.scene.Parent; import javafx.scene.Parent;
import javafx.scene.Scene; import javafx.scene.Scene;
@ -26,9 +23,7 @@ import javafx.util.Pair;
import java.io.IOException; import java.io.IOException;
public class MainCtrl implements LocaleAware { public class MainCtrl {
private final LocaleManager localeManager;
@FXML @FXML
private Stage primaryStage; private Stage primaryStage;
@ -36,11 +31,6 @@ public class MainCtrl implements LocaleAware {
private FoodpalApplicationCtrl foodpalCtrl; private FoodpalApplicationCtrl foodpalCtrl;
private Scene foodpal; private Scene foodpal;
@Inject
public MainCtrl(LocaleManager localeManager) {
this.localeManager = localeManager;
}
public void setup(Stage primaryStage, public void setup(Stage primaryStage,
Pair<FoodpalApplicationCtrl, Parent> foodpal) throws IOException, InterruptedException { Pair<FoodpalApplicationCtrl, Parent> foodpal) throws IOException, InterruptedException {
@ -51,20 +41,7 @@ public class MainCtrl implements LocaleAware {
showFoodpal(); showFoodpal();
primaryStage.show(); primaryStage.show();
initialize(); // Initialize LocaleManager stuff manually since MainCtrl isn't loaded from FXML.
} }
@Override
public void updateText() {
// nothing here, no actual text objects managed by MainCtrl
}
@Override
public LocaleManager getLocaleManager() {
return localeManager;
}
public void showFoodpal() { public void showFoodpal() {
primaryStage.setTitle("FoodPal"); primaryStage.setTitle("FoodPal");
primaryStage.setScene(foodpal); primaryStage.setScene(foodpal);

View file

@ -15,7 +15,6 @@
*/ */
package client.scenes; package client.scenes;
import client.utils.LocaleManager;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
@ -24,7 +23,7 @@ public class MainCtrlTest {
@BeforeEach @BeforeEach
public void setup() { public void setup() {
sut = new MainCtrl(new LocaleManager()); sut = new MainCtrl();
} }
@Test @Test