Skip to content

Commit

Permalink
Wiki button (#1755)
Browse files Browse the repository at this point in the history
* Added a wiki button

* Removed commented code

* Updated SCP image

---------

Co-authored-by: Pherring04 <[email protected]>
  • Loading branch information
Pherring04 and Pherring04 authored Aug 27, 2024
1 parent de1cb67 commit d2ec14d
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 3 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.Desktop;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.BufferedReader;
Expand All @@ -30,6 +31,7 @@
import java.net.MulticastSocket;
import java.net.UnknownHostException;
import java.net.SocketTimeoutException;
import java.net.URI;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.channels.NotYetConnectedException;
Expand Down Expand Up @@ -240,6 +242,18 @@ public void startMTV() {
launchTrickApplication("mtv", host + " " + port);
}

@Action
public void openWiki() {
if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) {
try {
Desktop.getDesktop().browse(new URI("https://nasa.github.io/trick/index"));
}
catch(Exception e) {
System.out.println("Exception occurred while opening wiki: " + e.getMessage());
}
}
}

@Action
public void freezeAt() {
actionController.handleFreezeAt(simState.getExecOutTime(), getMainFrame());
Expand Down Expand Up @@ -979,9 +993,11 @@ protected JToolBar createToolBar() {
"---",
"startMTV",
"---",
"throttle"
"throttle",
"---",
"openWiki"
};
JToolBar toolBar = new JToolBar();
JToolBar toolBar = new JToolBar();
for (String actionName : toolbarActionNames) {
if (actionName.equals("---")) {
toolBar.addSeparator();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public void actionPerformed(ActionEvent e) {
}
}
}

/**
* Invoked when the users presses the Step button.
* @param debug_flag single step the sim
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ startMTV.Action.text = Start &Event/Malfunction Trick View
startMTV.Action.shortDescription = Start Event/Malfunction Trick View (MTV)
startMTV.Action.icon = mtv_22x22.png

openWiki.Action.text = Open Trick Wiki
openWiki.Action.shortDescription = Open Trick Wiki in default browser
openWiki.Action.icon = question_22x22.png

freezeAt.Action.text = Freeze &At...
freezeAt.Action.shortDescription = Freeze At

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d2ec14d

Please sign in to comment.