r484 - in trunk: sammoa-application/src/main/java/fr/ulr/sammoa/application sammoa-application/src/main/resources/i18n sammoa-ui-swing/src/main sammoa-ui-swing/src/main/filters sammoa-ui-swing/src/main/java/fr/ulr/sammoa/ui/swing sammoa-ui-swing/src/main/resources sammoa-ui-swing/src/main/resources/i18n
Author: fdesbois Date: 2012-08-29 12:51:15 +0200 (Wed, 29 Aug 2012) New Revision: 484 Url: http://forge.codelutin.com/repositories/revision/sammoa/484 Log: fixes #1428 : improve bottom text in about window Added: trunk/sammoa-ui-swing/src/main/filters/ trunk/sammoa-ui-swing/src/main/filters/sammoa.properties Removed: trunk/sammoa-ui-swing/src/main/resources/sammoa.properties Modified: trunk/sammoa-application/src/main/java/fr/ulr/sammoa/application/SammoaConfig.java trunk/sammoa-application/src/main/resources/i18n/sammoa-application_en_GB.properties trunk/sammoa-ui-swing/src/main/java/fr/ulr/sammoa/ui/swing/MainUIHandler.java trunk/sammoa-ui-swing/src/main/resources/i18n/sammoa-ui-swing_en_GB.properties Modified: trunk/sammoa-application/src/main/java/fr/ulr/sammoa/application/SammoaConfig.java =================================================================== --- trunk/sammoa-application/src/main/java/fr/ulr/sammoa/application/SammoaConfig.java 2012-08-29 09:08:29 UTC (rev 483) +++ trunk/sammoa-application/src/main/java/fr/ulr/sammoa/application/SammoaConfig.java 2012-08-29 10:51:15 UTC (rev 484) @@ -43,7 +43,6 @@ import java.net.URL; import java.util.Locale; -import static org.nuiton.i18n.I18n._; import static org.nuiton.i18n.I18n.n_; /** @@ -184,6 +183,16 @@ return applicationConfig.getOptionAsURL(SammoaConfigOption.SITE_URL.key); } + /** @return {@link SammoaConfigOption#ORGANIZATION_NAME} value */ + public String getOrganizationName() { + return applicationConfig.getOption(SammoaConfigOption.ORGANIZATION_NAME.key); + } + + /** @return {@link SammoaConfigOption#INCEPTION_YEAR} value */ + public int getInceptionYear() { + return applicationConfig.getOptionAsInt(SammoaConfigOption.INCEPTION_YEAR.key); + } + /** @return {@link SammoaConfigOption#LOCALE} value */ public Locale getLocale() { return applicationConfig.getOption(Locale.class, SammoaConfigOption.LOCALE.key); @@ -193,10 +202,6 @@ applicationConfig.setOption(SammoaConfigOption.LOCALE.key, locale.toString()); } - public String getCopyrightText() { - return _("sammoa.copyright.text", getVersion()); - } - /** @return {@link SammoaConfigOption#DATA_DIRECTORY} value */ public File getDataDirectory() { File result = getOrCreateDirectory(SammoaConfigOption.DATA_DIRECTORY); @@ -367,18 +372,34 @@ Locale.UK.toString(), Locale.class ), - VERSION("application.version", + VERSION("sammoa.version", n_("sammoa.config.application.version"), "", Version.class, false, true ), - SITE_URL("application.site.url", + SITE_URL("sammoa.url", n_("sammoa.config.application.site.url"), - "http://maven-site.forge.codelutin.com/sammoa/", - URL.class + "", + URL.class, + false, + true ), + ORGANIZATION_NAME("sammoa.organizationName", + n_("sammoa.config.license.organizationName"), + "", + String.class, + false, + true + ), + INCEPTION_YEAR("sammoa.inceptionYear", + n_("sammoa.config.license.organizationName"), + "2012", + Integer.class, + false, + true + ), ADMIN_EMAIL("admin.email", n_("sammoa.config.admin.email"), "fdesbois@codelutin.com", Modified: trunk/sammoa-application/src/main/resources/i18n/sammoa-application_en_GB.properties =================================================================== --- trunk/sammoa-application/src/main/resources/i18n/sammoa-application_en_GB.properties 2012-08-29 09:08:29 UTC (rev 483) +++ trunk/sammoa-application/src/main/resources/i18n/sammoa-application_en_GB.properties 2012-08-29 10:51:15 UTC (rev 484) @@ -30,7 +30,6 @@ sammoa.config.ui.stop=Stop sammoa.config.ui.validObservation=Validate the selected observation sammoa.config.ui.validRoute=Validate the selected route -sammoa.copyright.text=Copyright CRMM 2012 sammoa.datePattern=dd/MM/yyyy sammoa.dateTimePattern=dd/MM/yyyy HH\:mm\:ss sammoa.dbf.import.error.unableToReadField=impossible to read value for column %s at line %s Copied: trunk/sammoa-ui-swing/src/main/filters/sammoa.properties (from rev 483, trunk/sammoa-ui-swing/src/main/resources/sammoa.properties) =================================================================== --- trunk/sammoa-ui-swing/src/main/filters/sammoa.properties (rev 0) +++ trunk/sammoa-ui-swing/src/main/filters/sammoa.properties 2012-08-29 10:51:15 UTC (rev 484) @@ -0,0 +1,39 @@ +### +# #%L +# SAMMOA :: UI Swing +# +# $Id$ +# $HeadURL$ +# %% +# Copyright (C) 2012 UMS 3462, Code Lutin +# %% +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program. If not, see +# <http://www.gnu.org/licenses/gpl-3.0.html>. +# #L% +### +## DB Configuration +hibernate.hbm2ddl.auto=update +hibernate.show_sql=false + +hibernate.dialect=org.hibernate.dialect.H2Dialect +hibernate.connection.url=jdbc:h2:file:${data.directory}/db/sammoa +hibernate.connection.username=sa +hibernate.connection.password=sa +hibernate.connection.driver_class=org.h2.Driver +hibernate.connection.provider_class=org.nuiton.topia.framework.TopiaConnectionProvider + +sammoa.version=${project.version} +sammoa.url=${project.url} +sammoa.inceptionYear=${project.inceptionYear} +sammoa.organizationName=${license.organizationName} Property changes on: trunk/sammoa-ui-swing/src/main/filters/sammoa.properties ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: trunk/sammoa-ui-swing/src/main/java/fr/ulr/sammoa/ui/swing/MainUIHandler.java =================================================================== --- trunk/sammoa-ui-swing/src/main/java/fr/ulr/sammoa/ui/swing/MainUIHandler.java 2012-08-29 09:08:29 UTC (rev 483) +++ trunk/sammoa-ui-swing/src/main/java/fr/ulr/sammoa/ui/swing/MainUIHandler.java 2012-08-29 10:51:15 UTC (rev 484) @@ -58,6 +58,7 @@ import java.awt.Desktop; import java.io.File; import java.net.URL; +import java.util.Calendar; import static org.nuiton.i18n.I18n._; import static org.nuiton.i18n.I18n.n_; @@ -401,7 +402,18 @@ AboutPanel about = new AboutPanel(); about.setTitle(_("sammoa.title.about")); about.setAboutText(_("sammoa.about.message")); - about.setBottomText(context.getConfig().getCopyrightText()); + + SammoaConfig config = context.getConfig(); + int currentYear = Calendar.getInstance().get(Calendar.YEAR); + int inceptionYear = config.getInceptionYear(); + String years; + if (currentYear != inceptionYear) { + years = inceptionYear + "-" + currentYear; + } else { + years = inceptionYear + ""; + } + + about.setBottomText(_("sammoa.about.bottomText", config.getOrganizationName(), years, config.getVersion())); about.setIconPath(iconPath); about.setLicenseFile(licensePath); about.setThirdpartyFile(thirdPartyPath); Modified: trunk/sammoa-ui-swing/src/main/resources/i18n/sammoa-ui-swing_en_GB.properties =================================================================== --- trunk/sammoa-ui-swing/src/main/resources/i18n/sammoa-ui-swing_en_GB.properties 2012-08-29 09:08:29 UTC (rev 483) +++ trunk/sammoa-ui-swing/src/main/resources/i18n/sammoa-ui-swing_en_GB.properties 2012-08-29 10:51:15 UTC (rev 484) @@ -1,4 +1,5 @@ SAMMOA=Sammoa +sammoa.about.bottomText=Copyright %s - %s - version %s sammoa.about.message=About Sammoa sammoa.action.about=About sammoa.action.about.tip=About Deleted: trunk/sammoa-ui-swing/src/main/resources/sammoa.properties =================================================================== --- trunk/sammoa-ui-swing/src/main/resources/sammoa.properties 2012-08-29 09:08:29 UTC (rev 483) +++ trunk/sammoa-ui-swing/src/main/resources/sammoa.properties 2012-08-29 10:51:15 UTC (rev 484) @@ -1,34 +0,0 @@ -### -# #%L -# SAMMOA :: UI Swing -# -# $Id$ -# $HeadURL$ -# %% -# Copyright (C) 2012 UMS 3462, Code Lutin -# %% -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public -# License along with this program. If not, see -# <http://www.gnu.org/licenses/gpl-3.0.html>. -# #L% -### -## DB Configuration -hibernate.hbm2ddl.auto=update -hibernate.show_sql=false - -hibernate.dialect=org.hibernate.dialect.H2Dialect -hibernate.connection.url=jdbc:h2:file:${data.directory}/db/sammoa -hibernate.connection.username=sa -hibernate.connection.password=sa -hibernate.connection.driver_class=org.h2.Driver -hibernate.connection.provider_class=org.nuiton.topia.framework.TopiaConnectionProvider
participants (1)
-
fdesbois@users.forge.codelutin.com