From: David ‘Bombe’ Roden Date: Sun, 25 May 2008 04:31:04 +0000 (+0200) Subject: add other projects’ licenses X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=d3717de303befe6ba591106ee2b240b8a4fab243;p=jSite2.git add other projects’ licenses --- diff --git a/src/net/pterodactylus/jsite/gui/AboutDialog.java b/src/net/pterodactylus/jsite/gui/AboutDialog.java index cc337b2..153e4cf 100644 --- a/src/net/pterodactylus/jsite/gui/AboutDialog.java +++ b/src/net/pterodactylus/jsite/gui/AboutDialog.java @@ -61,9 +61,13 @@ public class AboutDialog extends JDialog implements I18nable { /** A list of all contributors. */ private static final List CONTRIBUTORS = new ArrayList(); + + /** A list of all code usages. */ + private static final List CODE_USAGES = new ArrayList(); static { CONTRIBUTORS.add(new Contributor("David ‘Bombe’ Roden", "bombe@freenetproject.org", "Main code")); + CODE_USAGES.add(new CodeUsage("Tango Desktop Project", "http://tango.freedesktop.org/", "Creative Commons Attribution-Share Alike 2.5", "Icons")); } /** The “okay” button action. */ @@ -78,6 +82,9 @@ public class AboutDialog extends JDialog implements I18nable { /** The i18n maintainer’s name label. */ private JLabel i18nMaintainerNameLabel; + /** The “other people’s code used” label. */ + private I18nLabel codeUsageLabel; + /** The license header. */ private I18nLabel licenseHeaderLabel; @@ -177,7 +184,18 @@ public class AboutDialog extends JDialog implements I18nable { i18nMaintainerNameLabel = new JLabel(I18n.get("i18n.maintainer.name") + " <" + I18n.get("i18n.maintainer.email") + ">"); textPanel.add(i18nMaintainerNameLabel); + textPanel.add(Box.createVerticalStrut(24)); + codeUsageLabel = new I18nLabel("aboutDialog.page.about.label.codeUsage"); + codeUsageLabel.setFont(codeUsageLabel.getFont().deriveFont(Font.BOLD)); + textPanel.add(codeUsageLabel); + textPanel.add(Box.createVerticalStrut(12)); + + for (CodeUsage codeUsage: CODE_USAGES) { + JLabel usageLabel = new JLabel(codeUsage.getName() + " (" + codeUsage.getURL() + ", " + codeUsage.getLicense() + ")"); + textPanel.add(usageLabel); + } + return aboutPanel; } @@ -253,6 +271,7 @@ public class AboutDialog extends JDialog implements I18nable { contributorsLabel.updateI18n(); licenseHeaderLabel.updateI18n(); i18nMaintainerLabel.updateI18n(); + codeUsageLabel.updateI18n(); i18nMaintainerNameLabel.setText(I18n.get("i18n.maintainer.name") + " <" + I18n.get("i18n.maintainer.email") + ">"); okayAction.updateI18n(); setTitle(I18n.get("aboutDialog.title")); @@ -325,4 +344,81 @@ public class AboutDialog extends JDialog implements I18nable { } + /** + * A code usage object describes code or other resources that have been + * taken from other projects. + * + * @author David ‘Bombe’ Roden <bombe@freenetproject.org> + */ + private static class CodeUsage { + + /** The name of the project. */ + private final String name; + + /** The URL of the project. */ + private final String url; + + /** The license of the project. */ + private final String license; + + /** The part that is used. */ + private final String part; + + /** + * Creates a new code usage object. + * + * @param name + * The name of the project + * @param url + * The URL of the project + * @param license + * The license of the used code + * @param part + * The part that is used + */ + public CodeUsage(String name, String url, String license, String part) { + this.name = name; + this.url = url; + this.license = license; + this.part = part; + } + + /** + * Returns the name of the project. + * + * @return The name of the project + */ + public String getName() { + return name; + } + + /** + * Returns the URL of the project. + * + * @return The URL of the project + */ + public String getURL() { + return url; + } + + /** + * Returns the license of the used part. + * + * @return The license of the used part + */ + public String getLicense() { + return license; + } + + /** + * Returns the used part. + * + * @return The used part + */ + public String getPart() { + return part; + } + + } + } diff --git a/src/net/pterodactylus/jsite/i18n/jSite.properties b/src/net/pterodactylus/jsite/i18n/jSite.properties index a4e4ad2..9a05422 100644 --- a/src/net/pterodactylus/jsite/i18n/jSite.properties +++ b/src/net/pterodactylus/jsite/i18n/jSite.properties @@ -278,6 +278,9 @@ aboutDialog.page.about.label.contributor.mnemonic: VK_UNDEFINED aboutDialog.page.about.label.i18nMaintainer.name: i18n Maintainer (English) aboutDialog.page.about.label.i18nMaintainer.mnemonic: VK_UNDEFINED +aboutDialog.page.about.label.codeUsage.name: Resources from Other Projects +aboutDialog.page.about.label.codeUsage.mnemonic: VK_UNDEFINED + aboutDialog.page.license.title: License aboutDialog.page.license.shortDescription: Shows the \u201cLicense\u201d page diff --git a/src/net/pterodactylus/jsite/i18n/jSite_de.properties b/src/net/pterodactylus/jsite/i18n/jSite_de.properties index ae53a80..ef2b8f9 100644 --- a/src/net/pterodactylus/jsite/i18n/jSite_de.properties +++ b/src/net/pterodactylus/jsite/i18n/jSite_de.properties @@ -278,6 +278,9 @@ aboutDialog.page.about.label.contributor.mnemonic: VK_UNDEFINED aboutDialog.page.about.label.i18nMaintainer.name: \u00dcbersetzung (deutsch) aboutDialog.page.about.label.i18nMaintainer.mnemonic: VK_UNDEFINED +aboutDialog.page.about.label.codeUsage.name: Ressourcen aus anderen Projekten +aboutDialog.page.about.label.codeUsage.mnemonic: VK_UNDEFINED + aboutDialog.page.license.title: Lizenz aboutDialog.page.license.shortDescription: Zeigt die Lizenz an