Merge pull request #3304 from wschaeferB/3330-CorrectlyNamedConfFile

3330 made UserPreferences.getAppName() just return the name again
This commit is contained in:
Richard Cordovano 2017-12-12 15:39:08 -05:00 committed by GitHub
commit 91bd67a338
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 5 deletions

View File

@ -998,6 +998,16 @@ public class Case {
}
}
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();
}
}
/**
* Update the GUI to to reflect the current case.
*/
@ -1074,7 +1084,7 @@ public class Case {
*
* [curent case display name] - [application name].
*/
mainFrame.setTitle(newCurrentCase.getDisplayName() + " - " + UserPreferences.getAppName());
mainFrame.setTitle(newCurrentCase.getDisplayName() + " - " + getNameForTitle());
});
}
}
@ -1112,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(UserPreferences.getAppName());
mainFrame.setTitle(getNameForTitle());
});
}
}
@ -1592,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() + " - " + UserPreferences.getAppName());
mainFrame.setTitle(caseDetails.getCaseDisplayName() + " - " + getNameForTitle());
try {
RecentCases.getInstance().updateRecentCase(oldCaseDetails.getCaseDisplayName(), metadata.getFilePath().toString(), caseDetails.getCaseDisplayName(), metadata.getFilePath().toString());
} catch (Exception ex) {

View File

@ -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");
}
/**

View File

@ -188,7 +188,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);