mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
Added "Access User Files" in the Help menu that takes you to logs,
backup and config file location
This commit is contained in:
@@ -2946,6 +2946,10 @@
|
||||
<changeType>NEW_FEATURE</changeType>
|
||||
<description>Added "Duo-Diode" tube symbol</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>NEW_FEATURE</changeType>
|
||||
<description>Added "Access User Files" in the Help menu that takes you to logs, backup and config file location</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>NEW_FEATURE</changeType>
|
||||
<description>Transistor components can display pinout instead of name or value</description>
|
||||
|
||||
@@ -65,7 +65,7 @@ public enum IconLoader {
|
||||
"splash_electrolytic.png"), SplashFilm("splash_film.png"), Splash("splash.png"), Help("help2.png"), ScrollInformation("scroll_information.png"),
|
||||
Node("node.png"), Web("web.png"), Guitar("guitar.png"), Scientist("scientist.png"), StarGrey("star_grey.png"), StarBlue("star_blue.png"),
|
||||
JarBeanInto("jar_bean_into.png"), GraphEdgeDirected("graph_edge_directed.png"), LaserPointer("laserpointer.png"), TapeMeasure("tape_measure1.png"),
|
||||
Elements("elements1.png"), GraphNodes("graph_nodes.png");
|
||||
Elements("elements1.png"), GraphNodes("graph_nodes.png"), User("user1.png");
|
||||
|
||||
protected String name;
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 828 B |
@@ -21,7 +21,9 @@
|
||||
*/
|
||||
package org.diylc.swing.plugins.help;
|
||||
|
||||
import java.awt.Desktop;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.io.File;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
@@ -71,6 +73,7 @@ public class HelpMenuPlugin implements IPlugIn {
|
||||
HELP_TITLE);
|
||||
swingUI.injectMenuAction(new NavigateURLAction("Plugin API", IconLoader.ApplicationEdit.getIcon(), PLUGIN_URL), HELP_TITLE);
|
||||
swingUI.injectMenuAction(new NavigateURLAction("Submit a Bug", IconLoader.Bug.getIcon(), BUG_URL), HELP_TITLE);
|
||||
swingUI.injectMenuAction(new NavigateFolderAction("Access User Files", IconLoader.User.getIcon(), System.getProperty("user.home") + "/.diylc"), HELP_TITLE);
|
||||
swingUI.injectMenuAction(null, HELP_TITLE);
|
||||
swingUI.injectMenuAction(new RecentUpdatesAction(), HELP_TITLE);
|
||||
swingUI.injectMenuAction(null, HELP_TITLE);
|
||||
@@ -174,4 +177,27 @@ public class HelpMenuPlugin implements IPlugIn {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class NavigateFolderAction extends AbstractAction {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String url;
|
||||
|
||||
public NavigateFolderAction(String name, Icon icon, String url) {
|
||||
super();
|
||||
this.url = url;
|
||||
putValue(AbstractAction.NAME, name);
|
||||
putValue(AbstractAction.SMALL_ICON, icon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
try {
|
||||
Desktop.getDesktop().open(new File((url)));
|
||||
} catch (Exception e1) {
|
||||
Logger.getLogger(LinkLabel.class).error("Could not launch desktop", e1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user