diff --git a/src/Platform_Core/org/lobobrowser/main/PlatformInit.java b/src/Platform_Core/org/lobobrowser/main/PlatformInit.java index 7cef4c1e..d1ed5099 100644 --- a/src/Platform_Core/org/lobobrowser/main/PlatformInit.java +++ b/src/Platform_Core/org/lobobrowser/main/PlatformInit.java @@ -288,18 +288,21 @@ public void init(final boolean exitWhenAllWindowsAreClosed, final boolean initCo initExtensions(); } + public final Properties relProps = new Properties(); + public static final String RELEASE_VERSION_RELEASE_DATE = "version.releaseDate"; + public static final String RELEASE_VERSION_STRING = "version.string"; + private void checkReleaseDate() { final InputStream relStream = getClass().getResourceAsStream("/properties/release.properties"); - final Properties relProps = new Properties(); try { relProps.load(relStream); - final String dateStr = relProps.getProperty("version.releaseDate"); + final String dateStr = relProps.getProperty(RELEASE_VERSION_RELEASE_DATE); final SimpleDateFormat yyyyMMDDFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.US); final Date releaseDate = yyyyMMDDFormat.parse(dateStr); final Date releaseDatePlus30Days = new Date(releaseDate.getTime() + THIRTY_DAYS_MILLIS); final Date currDate = new Date(System.currentTimeMillis()); if (releaseDatePlus30Days.before(currDate)) { - final String version = relProps.getProperty("version.string"); + final String version = relProps.getProperty(RELEASE_VERSION_STRING); final String checkForUpdatesMessage = "

This version of gngr is old

gngr " + version + "

Released on: " diff --git a/src/Primary_Extension/org/lobobrowser/primary/ext/ActionPool.java b/src/Primary_Extension/org/lobobrowser/primary/ext/ActionPool.java index 51f653f4..175e2f34 100644 --- a/src/Primary_Extension/org/lobobrowser/primary/ext/ActionPool.java +++ b/src/Primary_Extension/org/lobobrowser/primary/ext/ActionPool.java @@ -25,6 +25,7 @@ import java.net.URLEncoder; import java.util.Collection; import java.util.LinkedList; +import java.util.Properties; import java.util.logging.Level; import java.util.logging.Logger; @@ -32,6 +33,7 @@ import javax.swing.Action; import javax.swing.JFileChooser; +import org.lobobrowser.main.PlatformInit; import org.lobobrowser.primary.gui.SearchDialog; import org.lobobrowser.primary.gui.prefs.PreferencesDialog; import org.lobobrowser.primary.settings.ToolsSettings; @@ -292,9 +294,12 @@ public void actionPerformed(final ActionEvent e) { } class AboutAction extends AbstractAction { + final Properties relProps = PlatformInit.getInstance().relProps; public void actionPerformed(final ActionEvent e) { window.getTopFrame().alert( "gngr, a pure java web browser.\r\n" + + "Version " + relProps.getProperty(PlatformInit.RELEASE_VERSION_STRING) + "\r\n" + + "Published on: " + relProps.getProperty(PlatformInit.RELEASE_VERSION_RELEASE_DATE) + "\r\n" + "copyright (c) 2014 Uproot Labs\r\n" + "copyright (c) 2005, 2008 The Lobo Project.\r\n" + window.getUserAgent().getInfoUrl()); diff --git a/src/Primary_Extension/org/lobobrowser/protocol/about/AboutURLConnection.java b/src/Primary_Extension/org/lobobrowser/protocol/about/AboutURLConnection.java index c42ab233..7edb3fce 100644 --- a/src/Primary_Extension/org/lobobrowser/protocol/about/AboutURLConnection.java +++ b/src/Primary_Extension/org/lobobrowser/protocol/about/AboutURLConnection.java @@ -35,6 +35,7 @@ import java.util.Properties; import java.util.TreeSet; +import org.lobobrowser.main.PlatformInit; import org.lobobrowser.primary.ext.BookmarkInfo; import org.lobobrowser.primary.ext.BookmarksHistory; import org.lobobrowser.primary.ext.HistoryEntry; @@ -122,11 +123,14 @@ private String getURLText(final java.net.URL url) { } private static String getWelcomeMessage() { + final Properties relProps = PlatformInit.getInstance().relProps; + return "

" + - "

Welcome to gngr

" - + + "

Welcome to gngr

" + + "

Version: " + relProps.getProperty(PlatformInit.RELEASE_VERSION_STRING) + "
" + + "Published on: " + relProps.getProperty(PlatformInit.RELEASE_VERSION_RELEASE_DATE) + "

" + "

gngr is a browser that cares deeply about privacy.

" + "

It is currently a proof-of-concept, and not very stable or secure.

"