Updated documentation; moved updateConfig() to 'core' Installer.

This commit is contained in:
U-BASIS\dgrove 2017-10-31 17:14:33 -04:00
parent dd7c6d9c03
commit ae4f07c164
4 changed files with 25 additions and 27 deletions

View File

@ -71,7 +71,7 @@ public class CueBannerPanel extends javax.swing.JPanel {
ImageIcon icon = new ImageIcon(cl.getResource(welcomeLogo)); ImageIcon icon = new ImageIcon(cl.getResource(welcomeLogo));
autopsyLogo.setIcon(icon); autopsyLogo.setIcon(icon);
} }
customizeComponents(); initRecentCasesWindow();
enableComponents(); enableComponents();
} }

View File

@ -29,10 +29,9 @@ import java.util.Date;
import java.util.Objects; import java.util.Objects;
import java.util.logging.Level; import java.util.logging.Level;
import org.sleuthkit.autopsy.coreutils.Logger; 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<MultiUserCase> { class MultiUserCase implements Comparable<MultiUserCase> {
@ -44,7 +43,7 @@ class MultiUserCase implements Comparable<MultiUserCase> {
private final Date lastAccessedDate; 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. * @param caseDirectoryPath The case directory path.
* *
@ -219,7 +218,7 @@ class MultiUserCase implements Comparable<MultiUserCase> {
} }
/** /**
* Compares this AutopIngestCase object with abnother MultiUserCase object * Compares this MultiUserCase object with another MultiUserCase object
* for order. * for order.
*/ */
@Override @Override
@ -237,7 +236,7 @@ class MultiUserCase implements Comparable<MultiUserCase> {
* date (descending). * date (descending).
* *
* @param object The first MultiUserCase object * @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 * @return A negative integer, zero, or a positive integer as the first
* argument is less than, equal to, or greater than the second. * argument is less than, equal to, or greater than the second.

View File

@ -29,15 +29,15 @@ import java.util.logging.Handler;
import java.util.logging.Level; import java.util.logging.Level;
import javafx.application.Platform; import javafx.application.Platform;
import javafx.embed.swing.JFXPanel; import javafx.embed.swing.JFXPanel;
import javax.swing.SwingWorker;
import org.openide.LifecycleManager;
import org.openide.modules.ModuleInstall; import org.openide.modules.ModuleInstall;
import org.openide.util.NbBundle; import org.openide.util.NbBundle;
import org.openide.windows.WindowManager; import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.actions.IngestRunningCheck; import org.sleuthkit.autopsy.actions.IngestRunningCheck;
import org.sleuthkit.autopsy.casemodule.Case; 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.Logger;
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil; import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
import org.sleuthkit.autopsy.coreutils.PlatformUtil; import org.sleuthkit.autopsy.coreutils.PlatformUtil;
/** /**
@ -207,6 +207,9 @@ public class Installer extends ModuleInstall {
System.setProperty("sun.java2d.dpiaware", "false"); System.setProperty("sun.java2d.dpiaware", "false");
System.setProperty("prism.allowhidpi", "false"); System.setProperty("prism.allowhidpi", "false");
// Update existing configuration in case of unsupported settings
updateConfig();
packageInstallers = new ArrayList<>(); packageInstallers = new ArrayList<>();
packageInstallers.add(org.sleuthkit.autopsy.coreutils.Installer.getDefault()); packageInstallers.add(org.sleuthkit.autopsy.coreutils.Installer.getDefault());
packageInstallers.add(org.sleuthkit.autopsy.corecomponents.Installer.getDefault()); packageInstallers.add(org.sleuthkit.autopsy.corecomponents.Installer.getDefault());
@ -215,6 +218,21 @@ public class Installer extends ModuleInstall {
packageInstallers.add(org.sleuthkit.autopsy.centralrepository.eventlisteners.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 * Check if JavaFx initialized
* *

View File

@ -30,10 +30,7 @@ import org.netbeans.swing.tabcontrol.plaf.DefaultTabbedContainerUI;
import org.openide.modules.ModuleInstall; import org.openide.modules.ModuleInstall;
import org.openide.windows.WindowManager; import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.casemodule.StartupWindowProvider; 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.Logger;
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
/** /**
* Manages this module's life cycle. Opens the startup dialog during startup. * 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("ViewTabDisplayerUI", "org.sleuthkit.autopsy.corecomponents.NoTabsTabDisplayerUI");
UIManager.put(DefaultTabbedContainerUI.KEY_VIEW_CONTENT_BORDER, BorderFactory.createEmptyBorder()); UIManager.put(DefaultTabbedContainerUI.KEY_VIEW_CONTENT_BORDER, BorderFactory.createEmptyBorder());
UIManager.put("TabbedPane.contentBorderInsets", new Insets(0, 0, 0, 0)); UIManager.put("TabbedPane.contentBorderInsets", new Insets(0, 0, 0, 0));
updateConfig();
WindowManager.getDefault().invokeWhenUIReady(() -> { WindowManager.getDefault().invokeWhenUIReady(() -> {
StartupWindowProvider.getInstance().open(); StartupWindowProvider.getInstance().open();
}); });
@ -73,21 +69,6 @@ public class Installer extends ModuleInstall {
super.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() { private void setLookAndFeel() {
if (System.getProperty("os.name").toLowerCase().contains("mac")) { //NON-NLS if (System.getProperty("os.name").toLowerCase().contains("mac")) { //NON-NLS
setOSXLookAndFeel(); setOSXLookAndFeel();