Skip to content

Commit 2bcd323

Browse files
committed
Add links to Github and ScreenSteps to the about dialog
1 parent bdea85f commit 2bcd323

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

ui/src/main/java/edu/wpi/grip/ui/AboutDialogController.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package edu.wpi.grip.ui;
22

3+
import javafx.event.ActionEvent;
34
import javafx.fxml.FXML;
45
import javafx.scene.text.Text;
56

@@ -8,6 +9,16 @@ public class AboutDialogController {
89
@FXML
910
private Text versionNumberText;
1011

12+
@FXML
13+
void githubButtonAction(ActionEvent event) {
14+
Main.getInstance().getHostServices().showDocument("https://github.com/WPIRoboticsProjects/GRIP");
15+
}
16+
17+
@FXML
18+
void screenstepsButtonAction(ActionEvent event) {
19+
Main.getInstance().getHostServices().showDocument("http://wpilib.screenstepslive.com/s/4485/m/50711");
20+
}
21+
1122
@FXML
1223
void initialize() {
1324
assert versionNumberText != null : "fx:id=\"versionNumberText\" was not injected: check your FXML file 'AboutDialog.fxml'.";

ui/src/main/java/edu/wpi/grip/ui/Main.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535

3636
public class Main extends Application {
3737

38+
private static Main instance;
39+
3840
@Inject private EventBus eventBus;
3941
@Inject private PipelineRunner pipelineRunner;
4042
@Inject private Project project;
@@ -55,6 +57,15 @@ public static void main(String[] args) {
5557
launch(args);
5658
}
5759

60+
public static Main getInstance() {
61+
return instance;
62+
}
63+
64+
public Main() {
65+
super();
66+
instance = this;
67+
}
68+
5869
@Override
5970
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
6071
public void start(Stage stage) throws Exception {

ui/src/main/resources/edu/wpi/grip/ui/AboutDialog.fxml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

33
<?import javafx.geometry.Insets?>
4+
<?import javafx.scene.control.Button?>
45
<?import javafx.scene.image.Image?>
56
<?import javafx.scene.image.ImageView?>
67
<?import javafx.scene.layout.HBox?>
@@ -33,6 +34,23 @@
3334
<Font name="Roboto Regular" size="14.0" />
3435
</font>
3536
</Text>
37+
<Pane VBox.vgrow="ALWAYS" />
38+
<HBox>
39+
<children>
40+
<Button mnemonicParsing="false" onAction="#githubButtonAction" text="Github...">
41+
<font>
42+
<Font size="14.0" />
43+
</font>
44+
</Button>
45+
<Pane HBox.hgrow="ALWAYS" />
46+
<Button mnemonicParsing="false" onAction="#screenstepsButtonAction" text="ScreenSteps...">
47+
<font>
48+
<Font name="Roboto Regular" size="14.0" />
49+
</font>
50+
</Button>
51+
<Pane HBox.hgrow="ALWAYS" />
52+
</children>
53+
</HBox>
3654
</children>
3755
</VBox>
3856
<Pane HBox.hgrow="ALWAYS" />

0 commit comments

Comments
 (0)