Lisätty versiotieto ohjelmaan
Signed-off-by: laurimaaninka <lauri.maaninka@gmail.com>
This commit is contained in:
@@ -24,6 +24,8 @@ public class App extends Application {
|
||||
@Override
|
||||
public void start(Stage primaryStage) throws IOException {
|
||||
new Tietokanta(Main.dev);
|
||||
|
||||
|
||||
TabPane root = new TabPane();
|
||||
root.setSide(Side.LEFT);
|
||||
root.setTabMinWidth(50);
|
||||
@@ -53,7 +55,13 @@ public class App extends Application {
|
||||
|
||||
Scene scene = new Scene(root);
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.setTitle("Ruokamanageri");
|
||||
|
||||
StringBuilder title = new StringBuilder();
|
||||
title.append("Ruokamanageri");
|
||||
title.append(" v").append(Main.properties.getProperty("version"));
|
||||
if (Main.dev) title.append(" KEHITYS");
|
||||
primaryStage.setTitle(title.toString());
|
||||
|
||||
primaryStage.setMaximized(true);
|
||||
primaryStage.show();
|
||||
primaryStage.getIcons().add(new Image(Objects.requireNonNull(Main.class.getResourceAsStream("kuljetusruokalaatikko.jpg"))));
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
package fi.lpam;
|
||||
|
||||
import javax.print.DocFlavor;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.Properties;
|
||||
|
||||
public class Main {
|
||||
public static boolean dev;
|
||||
public static Properties properties;
|
||||
|
||||
static void main(String[] args) {
|
||||
//noinspection RedundantIfStatement
|
||||
@@ -10,6 +16,16 @@ public class Main {
|
||||
} else {
|
||||
dev = false;
|
||||
}
|
||||
|
||||
InputStream stream = Main.class.getClassLoader().getResourceAsStream("app.properties");
|
||||
properties = new Properties();
|
||||
try {
|
||||
properties.load(stream);
|
||||
}
|
||||
catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
App.main();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
version=${project.version}
|
||||
Reference in New Issue
Block a user