diff options
Diffstat (limited to 'pdf-over-gui/src')
3 files changed, 11 insertions, 10 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/Constants.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/Constants.java index a9492f0e..aae15703 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/Constants.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/Constants.java @@ -33,10 +33,17 @@ public class Constants { /** Application name */ public static final String APP_NAME = "PDF-Over"; //$NON-NLS-1$ + /** Application version */ + public static final String APP_VERSION = Constants.class.getPackage().getImplementationVersion(); + + /** Application name + version */ + public static final String APP_NAME_VERSION = (APP_VERSION == null ? APP_NAME : APP_NAME + " v" + APP_VERSION); //$NON-NLS-1$ + static { // Has to be set before (implicitly) initializing Display Display.setAppName(APP_NAME); } + /** Current display - used for Colors */ private static Display display = Display.getCurrent(); @@ -68,7 +75,7 @@ public class Constants { public static final int SIGNATURE_KEYBOARD_POSITIONING_OFFSET = 15; /** PDF-Over User Agent string */ - public static final String USER_AGENT_STRING = "PDF-Over 4.0"; //$NON-NLS-1$ + public static final String USER_AGENT_STRING = "PDF-Over " + (APP_VERSION == null ? "4.0" : APP_VERSION); //$NON-NLS-1$ //$NON-NLS-2$ /* Configuration parameters */ diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java index d994b72a..18135e3f 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java @@ -237,7 +237,7 @@ public class MainWindow { catch (SWTError e) { log.debug("Cannot get display", e); //$NON-NLS-1$ } - Display.setAppVersion(this.getClass().getPackage().getImplementationVersion()); + Display.setAppVersion(Constants.APP_VERSION); getShell().setText(Constants.APP_NAME); getShell().addShellListener(new ShellAdapter() { @@ -397,13 +397,9 @@ public class MainWindow { }, new Listener() { @Override public void handleEvent(Event arg0) { - String version = getClass().getPackage() - .getImplementationVersion(); - version = (version == null ? "" : " v" + version); //$NON-NLS-1$ //$NON-NLS-2$ - String about = Constants.APP_NAME + version; Dialog dialog = new Dialog(getShell(), String.format(Messages.getString("main.about"), Constants.APP_NAME), //$NON-NLS-1$ - about, BUTTONS.OK, ICON.INFORMATION); + Constants.APP_NAME_VERSION, BUTTONS.OK, ICON.INFORMATION); dialog.open(); } }, new Listener() { diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java index 785597ad..e7b3d1c6 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java @@ -181,9 +181,7 @@ public class ConfigurationComposite extends StateComposite { this.containerComposite.setLayout(this.compositeStack); this.compositeStack.topControl = tabFolder; - String version = getClass().getPackage().getImplementationVersion(); - version = (version == null ? "" : " v" + version); //$NON-NLS-1$ //$NON-NLS-2$ - getShell().setText(Constants.APP_NAME + version); + getShell().setText(Constants.APP_NAME_VERSION); this.doLayout(); } |