Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BudgetMaster
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Robert Goldmann
BudgetMaster
Commits
d68912b1
Commit
d68912b1
authored
Aug 23, 2017
by
Robert Goldmann
Browse files
Options
Downloads
Patches
Plain Diff
Fixed
#128
- Add language chooser to settings (and restart application after language change)
parent
aae91815
No related branches found
No related tags found
1 merge request
!160
merge v1_4_0 into master
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/de/deadlocker8/budgetmaster/main/Main.java
+5
-1
5 additions, 1 deletion
src/de/deadlocker8/budgetmaster/main/Main.java
src/de/deadlocker8/budgetmaster/ui/controller/SettingsController.java
+32
-2
32 additions, 2 deletions
...ocker8/budgetmaster/ui/controller/SettingsController.java
with
37 additions
and
3 deletions
src/de/deadlocker8/budgetmaster/main/Main.java
+
5
−
1
View file @
d68912b1
...
...
@@ -18,9 +18,13 @@ import tools.PathUtils;
public
class
Main
extends
Application
{
public
static
Stage
primaryStage
;
@Override
public
void
start
(
Stage
stage
)
{
primaryStage
=
stage
;
try
{
Image
icon
=
new
Image
(
"/de/deadlocker8/budgetmaster/resources/icon.png"
);
...
...
This diff is collapsed.
Click to expand it.
src/de/deadlocker8/budgetmaster/ui/controller/SettingsController.java
+
32
−
2
View file @
d68912b1
...
...
@@ -13,10 +13,14 @@ import de.deadlocker8.budgetmaster.logic.utils.FileHelper;
import
de.deadlocker8.budgetmaster.logic.utils.Helpers
;
import
de.deadlocker8.budgetmaster.logic.utils.LanguageType
;
import
de.deadlocker8.budgetmaster.logic.utils.Strings
;
import
de.deadlocker8.budgetmaster.main.Main
;
import
de.deadlocker8.budgetmaster.ui.cells.LanguageCell
;
import
de.deadlocker8.budgetmasterserver.logic.database.Database
;
import
javafx.application.Platform
;
import
javafx.fxml.FXML
;
import
javafx.fxml.FXMLLoader
;
import
javafx.scene.Parent
;
import
javafx.scene.Scene
;
import
javafx.scene.control.Alert
;
import
javafx.scene.control.Alert.AlertType
;
import
javafx.scene.control.Button
;
...
...
@@ -29,6 +33,7 @@ import javafx.scene.control.TextArea;
import
javafx.scene.control.TextField
;
import
javafx.scene.control.TextInputDialog
;
import
javafx.scene.control.ToggleGroup
;
import
javafx.scene.image.Image
;
import
javafx.scene.layout.AnchorPane
;
import
javafx.stage.FileChooser
;
import
javafx.stage.Stage
;
...
...
@@ -281,6 +286,7 @@ public class SettingsController
controller
.
refresh
(
controller
.
getFilterSettings
());
controller
.
showNotification
(
Localization
.
getString
(
Strings
.
NOTIFICATION_SETTINGS_SAVE
));
//retstart application if language has changed
if
(
controller
.
getSettings
().
getLanguage
()
!=
previousLanguage
)
{
Alert
alert
=
new
Alert
(
AlertType
.
INFORMATION
);
...
...
@@ -297,7 +303,31 @@ public class SettingsController
Optional
<
ButtonType
>
result
=
alert
.
showAndWait
();
if
(
result
.
get
()
==
buttonTypeOne
)
{
//TODO restart programm
controller
.
getStage
().
close
();
Localization
.
loadLanguage
(
controller
.
getSettings
().
getLanguage
().
getLocale
());
try
{
Image
icon
=
new
Image
(
"/de/deadlocker8/budgetmaster/resources/icon.png"
);
FXMLLoader
loader
=
new
FXMLLoader
(
getClass
().
getClassLoader
().
getResource
(
"de/deadlocker8/budgetmaster/ui/fxml/SplashScreen.fxml"
));
loader
.
setResources
(
Localization
.
getBundle
());
Parent
root
=
(
Parent
)
loader
.
load
();
Scene
scene
=
new
Scene
(
root
,
450
,
230
);
((
SplashScreenController
)
loader
.
getController
()).
init
(
Main
.
primaryStage
,
icon
);
Main
.
primaryStage
.
setResizable
(
false
);
Main
.
primaryStage
.
getIcons
().
add
(
icon
);
Main
.
primaryStage
.
setTitle
(
Localization
.
getString
(
Strings
.
APP_NAME
));
Main
.
primaryStage
.
setScene
(
scene
);
Main
.
primaryStage
.
show
();
}
catch
(
Exception
e
)
{
Logger
.
error
(
e
);
}
}
else
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment