Skip to content

Commit

Permalink
Added Edison and Galileo help menus
Browse files Browse the repository at this point in the history
  • Loading branch information
Federico Fissore committed Mar 27, 2015
1 parent 5ff7b35 commit 65f285f
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 15 deletions.
12 changes: 10 additions & 2 deletions app/src/processing/app/Base.java
Original file line number Diff line number Diff line change
Expand Up @@ -2006,14 +2006,22 @@ static public void registerWindowCloseKeys(JRootPane root,


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()) {
Expand Down
70 changes: 57 additions & 13 deletions app/src/processing/app/Editor.java
Original file line number Diff line number Diff line change
Expand Up @@ -1090,35 +1090,79 @@ public void actionPerformed(ActionEvent e) {
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) {
Expand Down

0 comments on commit 65f285f

Please sign in to comment.