diff --git a/src/main/conf/AboutWindow.fxml b/src/main/conf/AboutWindow.fxml new file mode 100644 index 0000000..70d38cc --- /dev/null +++ b/src/main/conf/AboutWindow.fxml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/conf/MainMenu.fxml b/src/main/conf/MainMenu.fxml index 6e1b3f8..503c7fe 100644 --- a/src/main/conf/MainMenu.fxml +++ b/src/main/conf/MainMenu.fxml @@ -200,6 +200,6 @@ - + \ No newline at end of file diff --git a/src/main/java/io/github/mzmine/gui/mainwindow/MainMenuController.java b/src/main/java/io/github/mzmine/gui/mainwindow/MainMenuController.java index bc374b0..f0d7ecc 100644 --- a/src/main/java/io/github/mzmine/gui/mainwindow/MainMenuController.java +++ b/src/main/java/io/github/mzmine/gui/mainwindow/MainMenuController.java @@ -23,6 +23,7 @@ import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; +import java.net.URL; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -31,9 +32,12 @@ import io.github.mzmine.main.MZmineCore; import io.github.mzmine.main.NewVersionCheck; import io.github.mzmine.main.NewVersionCheck.CheckType; +import javafx.application.Platform; import javafx.event.ActionEvent; import javafx.fxml.FXML; +import javafx.fxml.FXMLLoader; import javafx.scene.control.MenuItem; +import javafx.scene.layout.Pane; /** * The controller class for conf/mainmenu.fxml @@ -108,4 +112,23 @@ protected void setPreferences(ActionEvent event) { MZmineCore.getConfiguration().getPreferences().showSetupDialog(null); } + @FXML + protected void showAbout(ActionEvent event) { + // Show the about window + Platform.runLater(() -> { + try { + final String aboutWindowFXML = "file:conf/AboutWindow.fxml"; + URL fxmlFile = new URL(aboutWindowFXML); + FXMLLoader fxmlLoader = new FXMLLoader(fxmlFile); + Pane pane = fxmlLoader.load(); + + // Open the window + MZmineGUI.addWindow(pane, "About MZmine", true); + } catch (Exception e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + }); + } + }