Skip to content

Commit 8a1d4ab

Browse files
committed
added enable enable_timeline settings in a propert file
1 parent e3b05a8 commit 8a1d4ab

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

Core/src/org/sleuthkit/autopsy/corecomponents/Installer.java

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import org.openide.windows.WindowManager;
3232
import org.sleuthkit.autopsy.casemodule.StartupWindowProvider;
3333
import org.sleuthkit.autopsy.coreutils.Logger;
34+
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
3435

3536
/**
3637
* Manages this module's life cycle. Opens the startup dialog during startup.
@@ -40,7 +41,6 @@ public class Installer extends ModuleInstall {
4041
private static final long serialVersionUID = 1L;
4142
private static final Logger logger = Logger.getLogger(Installer.class.getName());
4243
private static Installer instance;
43-
public static boolean enableTimeline = true;
4444

4545
public synchronized static Installer getDefault() {
4646
if (null == instance) {
@@ -115,17 +115,23 @@ private void setOSXLookAndFeel() {
115115
});
116116
}
117117

118+
private void setModuleSettings(String value) {
119+
if (ModuleSettings.configExists("timeline")) {
120+
ModuleSettings.setConfigSetting("timeline", "enable_timeline", value);
121+
} else {
122+
ModuleSettings.makeConfigFile("timeline");
123+
ModuleSettings.setConfigSetting("timeline", "enable_timeline", value);
124+
}
125+
}
126+
118127
private void setUnixLookAndFeel(){
119128
try {
120-
UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
129+
UIManager.put("swing.boldMetal", Boolean.FALSE);
130+
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
131+
setModuleSettings("true");
121132
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) {
122133
logger.log(Level.WARNING, "Error setting crossplatform look-and-feel, setting default look-and-feel",ex);
123-
try {
124-
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
125-
enableTimeline=false;
126-
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex1) {
127-
logger.log(Level.WARNING, "Error setting native look-and-feel",ex1);
128-
}
134+
setModuleSettings("false");
129135
}
130136
}
131137
}

Core/src/org/sleuthkit/autopsy/timeline/OpenTimelineAction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
import org.openide.util.actions.CallableSystemAction;
3535
import org.sleuthkit.autopsy.casemodule.Case;
3636
import org.sleuthkit.autopsy.core.Installer;
37-
import static org.sleuthkit.autopsy.corecomponents.Installer.enableTimeline;
3837
import org.sleuthkit.autopsy.coreutils.Logger;
3938
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
39+
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
4040
import org.sleuthkit.autopsy.coreutils.ThreadConfined;
4141
import org.sleuthkit.datamodel.AbstractFile;
4242
import org.sleuthkit.datamodel.BlackboardArtifact;
@@ -98,7 +98,7 @@ public void performAction() {
9898
}
9999
}
100100
setEnabled(false);
101-
}else if(!enableTimeline) {
101+
}else if("false".equals(ModuleSettings.getConfigSetting("timeline", "enable_timeline"))) {
102102
Platform.runLater(PromptDialogManager::showTimeLineDisabledMessage);
103103
setEnabled(false);
104104
}else {

0 commit comments

Comments
 (0)