[#2046] Add Wiki button to help menu
This commit is contained in:
parent
c35a15a8cd
commit
cff2cf4f3c
@ -1464,6 +1464,8 @@ main.menu.help = Help
|
||||
main.menu.help.desc = Information about OpenRocket
|
||||
main.menu.help.tours = Guided tours
|
||||
main.menu.help.tours.desc = Take guided tours on OpenRocket
|
||||
main.menu.help.wiki = Wiki (Online Help)
|
||||
main.menu.help.wiki.desc = Open the OpenRocket Wiki site, containing documentation, in your default webbrowser
|
||||
main.menu.help.license = License
|
||||
main.menu.help.license.desc = OpenRocket license information
|
||||
main.menu.help.bugReport = Bug report
|
||||
|
@ -84,6 +84,7 @@ import net.sf.openrocket.gui.util.Icons;
|
||||
import net.sf.openrocket.gui.util.OpenFileWorker;
|
||||
import net.sf.openrocket.gui.util.SaveFileWorker;
|
||||
import net.sf.openrocket.gui.util.SwingPreferences;
|
||||
import net.sf.openrocket.gui.util.URLUtil;
|
||||
import net.sf.openrocket.l10n.Translator;
|
||||
import net.sf.openrocket.logging.Markers;
|
||||
import net.sf.openrocket.rocketcomponent.AxialStage;
|
||||
@ -778,6 +779,19 @@ public class BasicFrame extends JFrame {
|
||||
});
|
||||
menu.add(item);
|
||||
|
||||
//// Wiki (Online Help)
|
||||
item = new JMenuItem(trans.get("main.menu.help.wiki"));
|
||||
item.setIcon(Icons.WIKI);
|
||||
item.getAccessibleContext().setAccessibleDescription(trans.get("main.menu.help.wiki.desc"));
|
||||
item.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
log.info(Markers.USER_MARKER, "Wiki selected");
|
||||
URLUtil.openWebpage(URLUtil.WIKI_URL);
|
||||
}
|
||||
});
|
||||
menu.add(item);
|
||||
|
||||
menu.addSeparator();
|
||||
|
||||
//// Bug report
|
||||
|
@ -78,6 +78,7 @@ public class Icons {
|
||||
public static final Icon HELP_BUG_REPORT = loadImageIcon("pix/icons/help-bug.png", "Bug report");
|
||||
public static final Icon HELP_DEBUG_LOG = loadImageIcon("pix/icons/help-log.png", "Debug log");
|
||||
public static final Icon HELP_TOURS = loadImageIcon("pix/icons/help-tours.png", "Guided tours");
|
||||
public static final Icon WIKI = loadImageIcon("pix/icons/wiki.png", "Wiki (Documentation)");
|
||||
|
||||
public static final Icon ZOOM_IN = loadImageIcon("pix/icons/zoom-in.png", "Zoom in");
|
||||
public static final Icon ZOOM_OUT = loadImageIcon("pix/icons/zoom-out.png", "Zoom out");
|
||||
|
@ -7,6 +7,8 @@ import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
|
||||
public abstract class URLUtil {
|
||||
public static final String WIKI_URL = "http://wiki.openrocket.info/";
|
||||
|
||||
public static boolean openWebpage(URI uri) {
|
||||
Desktop desktop = Desktop.isDesktopSupported() ? Desktop.getDesktop() : null;
|
||||
if (desktop != null && desktop.isSupported(Desktop.Action.BROWSE)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user