Skip to content

Commit

Permalink
Merge pull request #125 from dyrlund/master
Browse files Browse the repository at this point in the history
Added initial version of the about dialog
  • Loading branch information
tomas-pluskal committed Mar 21, 2016
2 parents 5a45207 + 7c21fd8 commit 9b0eed2
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 1 deletion.
49 changes: 49 additions & 0 deletions src/main/conf/AboutWindow.fxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.text.Font?>
<?import javafx.scene.text.Text?>
<?import javafx.scene.control.Label?>
<?import java.net.URL?>

<Pane maxHeight="375" maxWidth="625" minHeight="375" minWidth="625"
prefHeight="375" prefWidth="625" xmlns="http://javafx.com/javafx/8.0.65"
xmlns:fx="http://javafx.com/fxml/1">
<stylesheets>
<URL value="@MZmine.css" />
</stylesheets>
<children>
<ImageView layoutX="10.0" layoutY="10.0">
<image>
<Image url="@../icon/mzmine-icon.png" />
</image>
</ImageView>
<Text fill="#0088cc" layoutX="146.0" layoutY="128.0" smooth="false"
text="MZmine 3">
<font>
<Font name="System Bold" size="96.0" />
</font>
</Text>
<Text layoutX="14.0" layoutY="187.0" smooth="false" text="License">
<font>
<Font name="System Bold" size="11.0" />
</font>
</Text>
<Label layoutX="14.0" layoutY="185.0" prefHeight="71.0"
prefWidth="594.0"
text="MZmine 3 is a free software; you can redistribute it and/or modify it under the terms of the GNU GeneralPublic License as published by the Free Software Foundation; either version 2 of the License, or (at youroption) any later version."
wrapText="true" />
<Label layoutX="14.0" layoutY="248.0" prefHeight="71.0"
prefWidth="594.0"
text="MZmine 3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even theimplied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU GeneralPublic License for more details."
wrapText="true" />
<Text layoutX="14.0" layoutY="356.0" smooth="false"
text="Copyright © 2006-2016 The MZmine 3 Development Team">
<font>
<Font name="System Bold" size="11.0" />
</font>
</Text>
</children>
</Pane>
2 changes: 1 addition & 1 deletion src/main/conf/MainMenu.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,6 @@
<SeparatorMenuItem />
<MenuItem text="Check for Updates" onAction="#versionCheck" />
<SeparatorMenuItem />
<MenuItem text="About" />
<MenuItem text="About" onAction="#showAbout" />
</Menu>
</MenuBar>
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down Expand Up @@ -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();
}
});
}

}

0 comments on commit 9b0eed2

Please sign in to comment.