From 4006ae4e0e2cace7dd68691bcd7487ffc0e9c14b Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Tue, 12 Dec 2017 11:37:13 -0500 Subject: [PATCH 1/2] 3330 made UserPreferences.getAppName() just return the name again --- Core/src/org/sleuthkit/autopsy/casemodule/Case.java | 10 +++++++--- .../org/sleuthkit/autopsy/core/UserPreferences.java | 2 +- .../autopsy/corecomponents/AutopsyOptionsPanel.java | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java index e2e58c5b5a..d94e9a2707 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java @@ -998,6 +998,10 @@ public class Case { } } + private static String getAppNameWithVersion(){ + return String.format("%s %s", Version.getName(), Version.getVersion()); + } + /** * Update the GUI to to reflect the current case. */ @@ -1074,7 +1078,7 @@ public class Case { * * [curent case display name] - [application name]. */ - mainFrame.setTitle(newCurrentCase.getDisplayName() + " - " + UserPreferences.getAppName()); + mainFrame.setTitle(newCurrentCase.getDisplayName() + " - " + getAppNameWithVersion()); }); } } @@ -1112,7 +1116,7 @@ public class Case { * Reset the main window title to be just the application name, * instead of [curent case display name] - [application name]. */ - mainFrame.setTitle(UserPreferences.getAppName()); + mainFrame.setTitle(getAppNameWithVersion()); }); } } @@ -1592,7 +1596,7 @@ public class Case { eventPublisher.publish(new AutopsyEvent(Events.CASE_DETAILS.toString(), oldCaseDetails, caseDetails)); if (RuntimeProperties.runningWithGUI()) { SwingUtilities.invokeLater(() -> { - mainFrame.setTitle(caseDetails.getCaseDisplayName() + " - " + UserPreferences.getAppName()); + mainFrame.setTitle(caseDetails.getCaseDisplayName() + " - " + getAppNameWithVersion()); try { RecentCases.getInstance().updateRecentCase(oldCaseDetails.getCaseDisplayName(), metadata.getFilePath().toString(), caseDetails.getCaseDisplayName(), metadata.getFilePath().toString()); } catch (Exception ex) { diff --git a/Core/src/org/sleuthkit/autopsy/core/UserPreferences.java b/Core/src/org/sleuthkit/autopsy/core/UserPreferences.java index 86f68e1df5..78de67766b 100755 --- a/Core/src/org/sleuthkit/autopsy/core/UserPreferences.java +++ b/Core/src/org/sleuthkit/autopsy/core/UserPreferences.java @@ -357,7 +357,7 @@ public final class UserPreferences { * @return Name of this program */ public static String getAppName() { - return preferences.get(APP_NAME, String.format("%s %s", Version.getName(), Version.getVersion())); + return preferences.get(APP_NAME, "Autopsy"); } /** diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/AutopsyOptionsPanel.java b/Core/src/org/sleuthkit/autopsy/corecomponents/AutopsyOptionsPanel.java index a62ae4400c..c3caf3d026 100755 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/AutopsyOptionsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/AutopsyOptionsPanel.java @@ -173,7 +173,7 @@ final class AutopsyOptionsPanel extends javax.swing.JPanel { * @throws IOException when the file does not exist. */ private static File getInstallFolderConfFile() throws IOException { - String confFileName = Version.getName() + CONFIG_FILE_EXTENSION; + String confFileName = UserPreferences.getAppName() + CONFIG_FILE_EXTENSION; String installFolder = PlatformUtil.getInstallPath(); File installFolderEtc = new File(installFolder, ETC_FOLDER_NAME); File installFolderConfigFile = new File(installFolderEtc, confFileName); From fac49ca862bce2d087bdc6c670bf211544c4162f Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Tue, 12 Dec 2017 15:01:23 -0500 Subject: [PATCH 2/2] 3330 fix version number for other applications --- .../org/sleuthkit/autopsy/casemodule/Case.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java index d94e9a2707..3e287b81b6 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java @@ -998,8 +998,14 @@ public class Case { } } - private static String getAppNameWithVersion(){ - return String.format("%s %s", Version.getName(), Version.getVersion()); + private static String getNameForTitle(){ + if (UserPreferences.getAppName().equals(Version.getName())){ + //Available version number is version number for this application + return String.format("%s %s", UserPreferences.getAppName(), Version.getVersion()); + } + else { + return UserPreferences.getAppName(); + } } /** @@ -1078,7 +1084,7 @@ public class Case { * * [curent case display name] - [application name]. */ - mainFrame.setTitle(newCurrentCase.getDisplayName() + " - " + getAppNameWithVersion()); + mainFrame.setTitle(newCurrentCase.getDisplayName() + " - " + getNameForTitle()); }); } } @@ -1116,7 +1122,7 @@ public class Case { * Reset the main window title to be just the application name, * instead of [curent case display name] - [application name]. */ - mainFrame.setTitle(getAppNameWithVersion()); + mainFrame.setTitle(getNameForTitle()); }); } } @@ -1596,7 +1602,7 @@ public class Case { eventPublisher.publish(new AutopsyEvent(Events.CASE_DETAILS.toString(), oldCaseDetails, caseDetails)); if (RuntimeProperties.runningWithGUI()) { SwingUtilities.invokeLater(() -> { - mainFrame.setTitle(caseDetails.getCaseDisplayName() + " - " + getAppNameWithVersion()); + mainFrame.setTitle(caseDetails.getCaseDisplayName() + " - " + getNameForTitle()); try { RecentCases.getInstance().updateRecentCase(oldCaseDetails.getCaseDisplayName(), metadata.getFilePath().toString(), caseDetails.getCaseDisplayName(), metadata.getFilePath().toString()); } catch (Exception ex) {