Skip to content
This repository has been archived by the owner on Oct 7, 2022. It is now read-only.

Commit

Permalink
Merge pull request #58 from mtricht/version-about
Browse files Browse the repository at this point in the history
Add version to about page.
  • Loading branch information
mtricht authored Mar 5, 2020
2 parents 8cfbaad + 101093e commit 4743eea
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
34 changes: 34 additions & 0 deletions src/main/java/dev/tricht/lunaris/settings/AboutGUI.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package dev.tricht.lunaris.settings;

import dev.tricht.lunaris.AutoUpdateConfiguration;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Label;
import lombok.extern.slf4j.Slf4j;

import java.io.IOException;
import java.net.URL;
import java.util.Properties;
import java.util.ResourceBundle;

@Slf4j
public class AboutGUI implements Initializable {

@FXML
private Label version;

public AboutGUI(){ }

@Override
public void initialize(URL url, ResourceBundle resourceBundle) {
Properties properties = new Properties();
try {
properties.load(AutoUpdateConfiguration.class.getResourceAsStream("/lunaris.properties"));
version.setText("Version " + properties.getProperty("version"));
} catch (IOException e) {
log.error("Failed to load lunaris.properties", e);
}

}

}
6 changes: 4 additions & 2 deletions src/main/resources/settings/about.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>

<AnchorPane prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/10.0.2-internal" xmlns:fx="http://javafx.com/fxml/1">
<AnchorPane prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/10.0.2-internal" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="dev.tricht.lunaris.settings.AboutGUI">
<children>
<VBox spacing="10.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<children>
Expand All @@ -28,7 +29,8 @@
</rowConstraints>
<children>
<Label text="Lunaris by mtricht and pvaass" />
<Label text="https://github.com/mtricht/lunaris" GridPane.rowIndex="1" />
<Label text="https://github.com/mtricht/lunaris" GridPane.rowIndex="1" />
<Label fx:id="version" text="" GridPane.rowIndex="2" />
</children>
</GridPane>
</children>
Expand Down

0 comments on commit 4743eea

Please sign in to comment.