Skip to content
Snippets Groups Projects
Commit 2a3a2e17 authored by Robert Goldmann's avatar Robert Goldmann
Browse files

Fixed #55 - if settings.json not existing

parent c709caed
No related branches found
No related tags found
1 merge request!58merge new_database_structure into master
......@@ -76,14 +76,6 @@ public class Controller implements Refreshable
settings = Utils.loadSettings();
if(settings == null)
{
Platform.runLater(() -> {
AlertGenerator.showAlert(AlertType.WARNING, "Warnung", "", "Bitte gibt zuerst deine Serverdaten ein!", icon, stage, null, false);
tabPane.getSelectionModel().select(tabSettings);
});
}
try
{
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/de/deadlocker8/budgetmaster/ui/HomeTab.fxml"));
......@@ -140,8 +132,18 @@ public class Controller implements Refreshable
buttonLeft.setStyle("-fx-background-color: transparent;");
buttonRight.setStyle("-fx-background-color: transparent;");
if(settings == null)
{
Platform.runLater(() -> {
AlertGenerator.showAlert(AlertType.WARNING, "Warnung", "", "Bitte gibt zuerst deine Serverdaten ein!", icon, stage, null, false);
tabPane.getSelectionModel().select(tabSettings);
});
}
else
{
refresh();
}
}
public Stage getStage()
{
......
......@@ -12,12 +12,12 @@
<children>
<VBox alignment="TOP_CENTER" layoutY="24.0" prefHeight="562.0" prefWidth="772.0" spacing="15.0" AnchorPane.bottomAnchor="14.0" AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="14.0">
<children>
<Label fx:id="labelBudget" text="372,56 €">
<Label fx:id="labelBudget" text="0,00 €">
<font>
<Font name="System Bold" size="55.0" />
</font>
</Label>
<Label fx:id="labelStartBudget" text="von 560,00 € verbleibend">
<Label fx:id="labelStartBudget" text="von 0,00 € verbleibend">
<font>
<Font name="System Bold" size="18.0" />
</font>
......
......@@ -173,8 +173,13 @@ public class PaymentController implements Refreshable
private void refreshCounter()
{
Budget budget = new Budget(listView.getItems());
labelIncomes.setText(String.valueOf(Helpers.NUMBER_FORMAT.format(budget.getIncomeSum()).replace(".", ",")) + " " + controller.getSettings().getCurrency());
labelPayments.setText(String.valueOf(Helpers.NUMBER_FORMAT.format(budget.getPaymentSum()).replace(".", ",")) + " " + controller.getSettings().getCurrency());
String currency = "€";
if(controller.getSettings() != null)
{
currency = controller.getSettings().getCurrency();
}
labelIncomes.setText(String.valueOf(Helpers.NUMBER_FORMAT.format(budget.getIncomeSum()).replace(".", ",")) + " " + currency);
labelPayments.setText(String.valueOf(Helpers.NUMBER_FORMAT.format(budget.getPaymentSum()).replace(".", ",")) + " " + currency);
}
public void deleteNormalPayment(NormalPayment payment)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment