]> gitweb.fperrin.net Git - GpsPrune.git/blobdiff - tim/prune/gui/AboutScreen.java
Version 6, October 2008
[GpsPrune.git] / tim / prune / gui / AboutScreen.java
index 1e4f4f5bf5f98f04693f6657d5f460b29999fcc2..0d1ef5b7f3bd5cc4fb5c75f8210baf59c2922284 100644 (file)
@@ -2,6 +2,7 @@ package tim.prune.gui;
 
 import java.awt.BorderLayout;
 import java.awt.Component;
+import java.awt.Dimension;
 import java.awt.FlowLayout;
 import java.awt.Font;
 import java.awt.GridBagConstraints;
@@ -10,6 +11,7 @@ import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.awt.event.KeyEvent;
 import java.awt.event.KeyListener;
+import java.io.InputStream;
 
 import javax.swing.BorderFactory;
 import javax.swing.BoxLayout;
@@ -19,7 +21,9 @@ import javax.swing.JEditorPane;
 import javax.swing.JFrame;
 import javax.swing.JLabel;
 import javax.swing.JPanel;
+import javax.swing.JScrollPane;
 import javax.swing.JTabbedPane;
+import javax.swing.JTextArea;
 
 import tim.prune.ExternalTools;
 import tim.prune.GpsPruner;
@@ -35,6 +39,7 @@ public class AboutScreen extends JDialog
 
        /**
         * Constructor
+        * @param inParent parent frame
         */
        public AboutScreen(JFrame inParent)
        {
@@ -72,6 +77,8 @@ public class AboutScreen extends JDialog
                descBuffer.append("<p>").append(I18nManager.getText("dialog.about.summarytext1")).append("</p>");
                descBuffer.append("<p>").append(I18nManager.getText("dialog.about.summarytext2")).append("</p>");
                descBuffer.append("<p>").append(I18nManager.getText("dialog.about.summarytext3")).append("</p>");
+               descBuffer.append("<p>").append(I18nManager.getText("dialog.about.languages")).append(" : ")
+                       .append("deutsch, english, español, français, italiano, polski, schwiizerdüütsch").append("</p>");
                descBuffer.append("<p>").append(I18nManager.getText("dialog.about.translatedby")).append("</p>");
                JEditorPane descPane = new JEditorPane("text/html", descBuffer.toString());
                descPane.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));
@@ -119,6 +126,12 @@ public class AboutScreen extends JDialog
                addToGridBagPanel(sysInfoPanel, gridBag, constraints,
                        new JLabel(I18nManager.getText(ExternalTools.isExiftoolInstalled()?"dialog.about.yes":"dialog.about.no")),
                        1, 4);
+               addToGridBagPanel(sysInfoPanel, gridBag, constraints,
+                       new JLabel(I18nManager.getText("dialog.about.systeminfo.gpsbabel") + " : "),
+                       0, 5);
+               addToGridBagPanel(sysInfoPanel, gridBag, constraints,
+                       new JLabel(I18nManager.getText(ExternalTools.isGpsbabelInstalled()?"dialog.about.yes":"dialog.about.no")),
+                       1, 5);
                tabPane.add(I18nManager.getText("dialog.about.systeminfo"), sysInfoPanel);
 
                // Third pane for credits
@@ -147,31 +160,49 @@ public class AboutScreen extends JDialog
                        new JLabel("Eclipse"),
                        1, 2);
                addToGridBagPanel(creditsPanel, gridBag, constraints,
-                       new JLabel(I18nManager.getText("dialog.about.credits.translations") + " : "),
+                       new JLabel(I18nManager.getText("dialog.about.credits.translators") + " : "),
                        0, 3);
                addToGridBagPanel(creditsPanel, gridBag, constraints,
-                       new JLabel("Open Office, Gpsdrive, Babelfish, Leo"),
+                       new JLabel("Ramon, Miguel, Inés, Piotr, Petrovsk, Josatoc"),
                        1, 3);
                addToGridBagPanel(creditsPanel, gridBag, constraints,
-                       new JLabel(I18nManager.getText("dialog.about.credits.devtools") + " : "),
+                       new JLabel(I18nManager.getText("dialog.about.credits.translations") + " : "),
                        0, 4);
                addToGridBagPanel(creditsPanel, gridBag, constraints,
-                       new JLabel("Mandriva Linux, Sun Java, Eclipse, Svn, Gimp"),
+                       new JLabel("Open Office, Gpsdrive, Babelfish, Leo, Launchpad"),
                        1, 4);
                addToGridBagPanel(creditsPanel, gridBag, constraints,
-                       new JLabel(I18nManager.getText("dialog.about.credits.othertools") + " : "),
+                       new JLabel(I18nManager.getText("dialog.about.credits.devtools") + " : "),
                        0, 5);
                addToGridBagPanel(creditsPanel, gridBag, constraints,
-                       new JLabel("Garble, Kate, Povray, Inkscape, Google Earth"),
+                       new JLabel("Mandriva Linux, Sun Java, Eclipse, Svn, Gimp"),
                        1, 5);
                addToGridBagPanel(creditsPanel, gridBag, constraints,
-                       new JLabel(I18nManager.getText("dialog.about.credits.thanks") + " : "),
+                       new JLabel(I18nManager.getText("dialog.about.credits.othertools") + " : "),
                        0, 6);
                addToGridBagPanel(creditsPanel, gridBag, constraints,
-                       new JLabel("Friends and loved ones, for encouragement and support"),
+                       new JLabel("Garble, Kate, Povray, Exiftool, Inkscape, Google Earth"),
                        1, 6);
+               addToGridBagPanel(creditsPanel, gridBag, constraints,
+                       new JLabel(I18nManager.getText("dialog.about.credits.thanks") + " : "),
+                       0, 7);
+               addToGridBagPanel(creditsPanel, gridBag, constraints,
+                       new JLabel("Friends and loved ones, for encouragement and support"),
+                       1, 7);
                tabPane.add(I18nManager.getText("dialog.about.credits"), creditsPanel);
 
+               // Read me
+               JPanel readmePanel = new JPanel();
+               readmePanel.setLayout(new BorderLayout());
+               JTextArea textArea = new JTextArea(getReadmeText());
+               textArea.setEditable(false);
+               textArea.setLineWrap(true); textArea.setWrapStyleWord(true);
+               JScrollPane scrollPane = new JScrollPane(textArea);
+               scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
+               scrollPane.setPreferredSize(new Dimension(600, 130));
+               readmePanel.add(scrollPane, BorderLayout.CENTER);
+               tabPane.add(I18nManager.getText("dialog.about.readme"), readmePanel);
+
                // OK button at the bottom
                JPanel okPanel = new JPanel();
                okPanel.setLayout(new FlowLayout(FlowLayout.CENTER));
@@ -220,6 +251,26 @@ public class AboutScreen extends JDialog
                inPanel.add(inLabel);
        }
 
+       /**
+        * @return text from the readme file
+        */
+       private String getReadmeText()
+       {
+               try
+               {
+                       // For some reason using ../readme.txt doesn't work, so need absolute path
+                       InputStream in = getClass().getResourceAsStream("/tim/prune/readme.txt");
+                       if (in != null) {
+                               byte[] buffer = new byte[in.available()];
+                               in.read(buffer);
+                               return new String(buffer);
+                       }
+               }
+               catch (java.io.IOException e) {
+                       System.err.println("Exception trying to get readme : " + e.getMessage());
+               }
+               return I18nManager.getText("error.readme.notfound");
+       }
 
        /**
         * Show window