mirror of
https://github.com/developersu/ns-usbloader.git
synced 2025-05-13 06:34:43 -04:00
v0.2
This commit is contained in:
parent
c4d0959cf3
commit
f5a9ddf8df
13 changed files with 162 additions and 91 deletions
|
@ -6,22 +6,24 @@ import javafx.scene.Parent;
|
|||
import javafx.scene.Scene;
|
||||
import javafx.scene.image.Image;
|
||||
import javafx.stage.Stage;
|
||||
import nsusbloader.Controllers.NSLMainController;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
public class NSLMain extends Application {
|
||||
static final String appVersion = "v0.2-DEVELOPMENT";
|
||||
public static final String appVersion = "v0.2";
|
||||
@Override
|
||||
public void start(Stage primaryStage) throws Exception{
|
||||
|
||||
FXMLLoader loader = new FXMLLoader(getClass().getResource("/NSLMain.fxml"));
|
||||
|
||||
ResourceBundle rb;
|
||||
if (Locale.getDefault().getISO3Language().equals("rus"))
|
||||
rb = ResourceBundle.getBundle("locale", new Locale("ru"));
|
||||
else
|
||||
rb = ResourceBundle.getBundle("locale", new Locale("en"));
|
||||
|
||||
FXMLLoader loader = new FXMLLoader(getClass().getResource("/NSLMain.fxml"));
|
||||
|
||||
loader.setResources(rb);
|
||||
Parent root = loader.load();
|
||||
|
||||
|
@ -36,7 +38,9 @@ public class NSLMain extends Application {
|
|||
primaryStage.setMinWidth(600);
|
||||
primaryStage.setMinHeight(375);
|
||||
Scene mainScene = new Scene(root, 800, 400);
|
||||
mainScene.getStylesheets().add("/res/app.css");
|
||||
|
||||
mainScene.getStylesheets().add(AppPreferences.getInstance().getTheme());
|
||||
|
||||
primaryStage.setScene(mainScene);
|
||||
primaryStage.show();
|
||||
|
||||
|
@ -45,6 +49,9 @@ public class NSLMain extends Application {
|
|||
if(! ServiceWindow.getConfirmationWindow(rb.getString("windowTitleConfirmExit"), rb.getString("windowBodyConfirmExit")))
|
||||
e.consume();
|
||||
});
|
||||
|
||||
NSLMainController controller = loader.getController();
|
||||
primaryStage.setOnHidden(e-> controller.exit());
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue