From 65f285fa661a8a80146b523427f23b0b9982bf5a Mon Sep 17 00:00:00 2001 From: Federico Fissore Date: Tue, 24 Mar 2015 23:54:12 +0100 Subject: [PATCH] Added Edison and Galileo help menus --- app/src/processing/app/Base.java | 12 ++++- app/src/processing/app/Editor.java | 70 ++++++++++++++++++++++++------ 2 files changed, 67 insertions(+), 15 deletions(-) diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index cb2d25d5d..62508b995 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -2006,14 +2006,22 @@ public class Base { static public void showReference(String filename) { - File referenceFolder = getContentFile("reference/arduino.cc/en"); + showReference("reference/arduino.cc/en", filename); + } + + static public void showReference(String prefix, String filename) { + File referenceFolder = getContentFile(prefix); File referenceFile = new File(referenceFolder, filename); if (!referenceFile.exists()) referenceFile = new File(referenceFolder, filename + ".html"); openURL(referenceFile.getAbsolutePath()); } - static public void showGettingStarted() { + public static void showEdisonGettingStarted() { + showReference("reference/Edison_help_files", "ArduinoIDE_guide_edison"); + } + + static public void showArduinoGettingStarted() { if (OSUtils.isMacOS()) { showReference("Guide/MacOSX"); } else if (OSUtils.isWindows()) { diff --git a/app/src/processing/app/Editor.java b/app/src/processing/app/Editor.java index 18a0027ef..c7915b37b 100644 --- a/app/src/processing/app/Editor.java +++ b/app/src/processing/app/Editor.java @@ -1090,35 +1090,79 @@ public class Editor extends JFrame implements RunnerListener { item = new JMenuItem(_("Getting Started")); item.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { - Base.showGettingStarted(); + Base.showArduinoGettingStarted(); } }); menu.add(item); item = new JMenuItem(_("Environment")); item.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - Base.showEnvironment(); - } - }); + public void actionPerformed(ActionEvent e) { + Base.showEnvironment(); + } + }); menu.add(item); item = new JMenuItem(_("Troubleshooting")); item.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - Base.showTroubleshooting(); - } - }); + public void actionPerformed(ActionEvent e) { + Base.showTroubleshooting(); + } + }); menu.add(item); item = new JMenuItem(_("Reference")); item.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - Base.showReference(); - } - }); + public void actionPerformed(ActionEvent e) { + Base.showReference(); + } + }); menu.add(item); + menu.addSeparator(); + + item = new JMenuItem(_("Galileo Help")); + item.setEnabled(false); + menu.add(item); + + item = new JMenuItem(_("Getting Started")); + item.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + Base.showReference("reference/Galileo_help_files", "ArduinoIDE_guide_galileo"); + } + }); + menu.add(item); + item = new JMenuItem(_("Troubleshooting")); + item.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + Base.showReference("reference/Galileo_help_files", "Guide_Troubleshooting_Galileo");; + } + }); + menu.add(item); + + menu.addSeparator(); + + item = new JMenuItem(_("Edison Help")); + item.setEnabled(false); + menu.add(item); + + item = new JMenuItem(_("Getting Started")); + item.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + Base.showReference("reference/Edison_help_files", "ArduinoIDE_guide_edison"); + } + }); + menu.add(item); + item = new JMenuItem(_("Troubleshooting")); + item.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + Base.showReference("reference/Edison_help_files", "Guide_Troubleshooting_Edison");; + } + }); + menu.add(item); + + menu.addSeparator(); + item = newJMenuItemShift(_("Find in Reference"), 'F'); item.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) {