import java.awt.BorderLayout;
import java.awt.Component;
+import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.GridBagConstraints;
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;
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;
/**
* Constructor
+ * @param inParent parent frame
*/
public AboutScreen(JFrame inParent)
{
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));
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
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));
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