From ae4f07c16461b51038fee78f942fced194197d45 Mon Sep 17 00:00:00 2001 From: "U-BASIS\\dgrove" Date: Tue, 31 Oct 2017 17:14:33 -0400 Subject: [PATCH] Updated documentation; moved updateConfig() to 'core' Installer. --- .../autopsy/casemodule/CueBannerPanel.java | 2 +- .../autopsy/casemodule/MultiUserCase.java | 9 ++++---- .../org/sleuthkit/autopsy/core/Installer.java | 22 +++++++++++++++++-- .../autopsy/corecomponents/Installer.java | 19 ---------------- 4 files changed, 25 insertions(+), 27 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CueBannerPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/CueBannerPanel.java index 9a45304c0f..24c714eb5b 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CueBannerPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CueBannerPanel.java @@ -71,7 +71,7 @@ public class CueBannerPanel extends javax.swing.JPanel { ImageIcon icon = new ImageIcon(cl.getResource(welcomeLogo)); autopsyLogo.setIcon(icon); } - customizeComponents(); + initRecentCasesWindow(); enableComponents(); } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/MultiUserCase.java b/Core/src/org/sleuthkit/autopsy/casemodule/MultiUserCase.java index 502ff260b1..e0bba29c43 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/MultiUserCase.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/MultiUserCase.java @@ -29,10 +29,9 @@ import java.util.Date; import java.util.Objects; import java.util.logging.Level; import org.sleuthkit.autopsy.coreutils.Logger; -import org.sleuthkit.autopsy.coreutils.TimeStampUtils; /** - * A representation of a case created by automated ingest. + * A representation of a multi-user case. */ class MultiUserCase implements Comparable { @@ -44,7 +43,7 @@ class MultiUserCase implements Comparable { private final Date lastAccessedDate; /** - * Constructs a representation of case created by automated ingest. + * Constructs a representation of a multi-user case * * @param caseDirectoryPath The case directory path. * @@ -219,7 +218,7 @@ class MultiUserCase implements Comparable { } /** - * Compares this AutopIngestCase object with abnother MultiUserCase object + * Compares this MultiUserCase object with another MultiUserCase object * for order. */ @Override @@ -237,7 +236,7 @@ class MultiUserCase implements Comparable { * date (descending). * * @param object The first MultiUserCase object - * @param otherObject The second AuotIngestCase object. + * @param otherObject The second MultiUserCase object. * * @return A negative integer, zero, or a positive integer as the first * argument is less than, equal to, or greater than the second. diff --git a/Core/src/org/sleuthkit/autopsy/core/Installer.java b/Core/src/org/sleuthkit/autopsy/core/Installer.java index 0b660acd2a..83250f719d 100755 --- a/Core/src/org/sleuthkit/autopsy/core/Installer.java +++ b/Core/src/org/sleuthkit/autopsy/core/Installer.java @@ -29,15 +29,15 @@ import java.util.logging.Handler; import java.util.logging.Level; import javafx.application.Platform; import javafx.embed.swing.JFXPanel; -import javax.swing.SwingWorker; -import org.openide.LifecycleManager; import org.openide.modules.ModuleInstall; import org.openide.util.NbBundle; import org.openide.windows.WindowManager; import org.sleuthkit.autopsy.actions.IngestRunningCheck; import org.sleuthkit.autopsy.casemodule.Case; +import static org.sleuthkit.autopsy.core.UserPreferences.SETTINGS_PROPERTIES; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil; +import org.sleuthkit.autopsy.coreutils.ModuleSettings; import org.sleuthkit.autopsy.coreutils.PlatformUtil; /** @@ -206,6 +206,9 @@ public class Installer extends ModuleInstall { // Prevent the Autopsy UI from shrinking on high DPI displays System.setProperty("sun.java2d.dpiaware", "false"); System.setProperty("prism.allowhidpi", "false"); + + // Update existing configuration in case of unsupported settings + updateConfig(); packageInstallers = new ArrayList<>(); packageInstallers.add(org.sleuthkit.autopsy.coreutils.Installer.getDefault()); @@ -214,6 +217,21 @@ public class Installer extends ModuleInstall { packageInstallers.add(org.sleuthkit.autopsy.ingest.Installer.getDefault()); packageInstallers.add(org.sleuthkit.autopsy.centralrepository.eventlisteners.Installer.getDefault()); } + + /** + * If the mode in the configuration file is 'REVIEW' (2, now invalid), this + * method will set it to 'STANDALONE' (0) and disable auto ingest. + */ + private void updateConfig() { + String mode = ModuleSettings.getConfigSetting(SETTINGS_PROPERTIES, "AutopsyMode"); + if(mode != null) { + int ordinal = Integer.parseInt(mode); + if(ordinal > 1) { + UserPreferences.setMode(UserPreferences.SelectedMode.STANDALONE); + ModuleSettings.setConfigSetting(UserPreferences.SETTINGS_PROPERTIES, "JoinAutoModeCluster", Boolean.toString(false)); + } + } + } /** * Check if JavaFx initialized diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/Installer.java b/Core/src/org/sleuthkit/autopsy/corecomponents/Installer.java index 060061e205..c908f3b35d 100755 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/Installer.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/Installer.java @@ -30,10 +30,7 @@ import org.netbeans.swing.tabcontrol.plaf.DefaultTabbedContainerUI; import org.openide.modules.ModuleInstall; import org.openide.windows.WindowManager; import org.sleuthkit.autopsy.casemodule.StartupWindowProvider; -import org.sleuthkit.autopsy.core.UserPreferences; -import static org.sleuthkit.autopsy.core.UserPreferences.SETTINGS_PROPERTIES; import org.sleuthkit.autopsy.coreutils.Logger; -import org.sleuthkit.autopsy.coreutils.ModuleSettings; /** * Manages this module's life cycle. Opens the startup dialog during startup. @@ -62,7 +59,6 @@ public class Installer extends ModuleInstall { UIManager.put("ViewTabDisplayerUI", "org.sleuthkit.autopsy.corecomponents.NoTabsTabDisplayerUI"); UIManager.put(DefaultTabbedContainerUI.KEY_VIEW_CONTENT_BORDER, BorderFactory.createEmptyBorder()); UIManager.put("TabbedPane.contentBorderInsets", new Insets(0, 0, 0, 0)); - updateConfig(); WindowManager.getDefault().invokeWhenUIReady(() -> { StartupWindowProvider.getInstance().open(); }); @@ -72,21 +68,6 @@ public class Installer extends ModuleInstall { public void uninstalled() { super.uninstalled(); } - - /** - * If the mode in the configuration file is 'REVIEW' (2, now invalid), this - * method will set it to 'STANDALONE' (0) and disable auto ingest. - */ - private void updateConfig() { - String mode = ModuleSettings.getConfigSetting(SETTINGS_PROPERTIES, "AutopsyMode"); - if(mode != null) { - int ordinal = Integer.parseInt(mode); - if(ordinal > 1) { - UserPreferences.setMode(UserPreferences.SelectedMode.STANDALONE); - ModuleSettings.setConfigSetting(UserPreferences.SETTINGS_PROPERTIES, "JoinAutoModeCluster", Boolean.toString(false)); - } - } - } private void setLookAndFeel() { if (System.getProperty("os.name").toLowerCase().contains("mac")) { //NON-NLS