Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wiki button #1755

Merged
merged 4 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Loading