1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-01 12:24:14 +01:00

Added Edison and Galileo help menus

This commit is contained in:
Federico Fissore 2015-03-24 23:54:12 +01:00
parent 5ff7b351d5
commit 65f285fa66
2 changed files with 67 additions and 15 deletions

View File

@ -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()) {

View File

@ -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) {