]> gitweb.fperrin.net Git - GpsPrune.git/blob - tim/prune/function/HelpScreen.java
Version 19, May 2018
[GpsPrune.git] / tim / prune / function / HelpScreen.java
1 package tim.prune.function;
2
3 import javax.swing.JOptionPane;
4
5 import tim.prune.App;
6 import tim.prune.GenericFunction;
7 import tim.prune.I18nManager;
8 import tim.prune.function.browser.BrowserLauncher;
9
10 /**
11  * Class to show a simple help screen
12  */
13 public class HelpScreen extends GenericFunction
14 {
15         /**
16          * Constructor
17          * @param inApp app object
18          */
19         public HelpScreen(App inApp)
20         {
21                 super(inApp);
22         }
23
24         /**
25          * Get the name key
26          */
27         public String getNameKey() {
28                 return "function.help";
29         }
30
31         /**
32          * Show the help screen
33          */
34         public void begin()
35         {
36                 // show the dialog and offer to open home page
37                 Object[] buttonTexts = {I18nManager.getText("button.showwebpage"), I18nManager.getText("button.cancel")};
38                 if (JOptionPane.showOptionDialog(_parentFrame, I18nManager.getText("dialog.help.help"),
39                                 I18nManager.getText("function.help"), JOptionPane.YES_NO_OPTION,
40                                 JOptionPane.INFORMATION_MESSAGE, null, buttonTexts, buttonTexts[1])
41                         == JOptionPane.YES_OPTION)
42                 {
43                         // User selected to launch home page
44                         BrowserLauncher.launchBrowser("https://activityworkshop.net/software/gpsprune/index.html");
45                 }
46         }
47 }