Skip to content

Commit ad3786f

Browse files
authored
Merge pull request #3438 from rishwanth1995/photorec2
modified look and feel to make timeline work on autopsy-linux
2 parents 1c682a3 + df56203 commit ad3786f

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed

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

Lines changed: 23 additions & 0 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.
@@ -72,6 +73,8 @@ public void uninstalled() {
7273
private void setLookAndFeel() {
7374
if (System.getProperty("os.name").toLowerCase().contains("mac")) { //NON-NLS
7475
setOSXLookAndFeel();
76+
}else if (System.getProperty("os.name").toLowerCase().contains("nux")){
77+
setUnixLookAndFeel();
7578
}
7679
}
7780

@@ -111,4 +114,24 @@ private void setOSXLookAndFeel() {
111114
UIManager.put(entry.getKey(), entry.getValue());
112115
});
113116
}
117+
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+
127+
private void setUnixLookAndFeel(){
128+
try {
129+
UIManager.put("swing.boldMetal", Boolean.FALSE);
130+
UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
131+
setModuleSettings("true");
132+
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) {
133+
logger.log(Level.WARNING, "Error setting crossplatform look-and-feel, setting default look-and-feel",ex);
134+
setModuleSettings("false");
135+
}
136+
}
114137
}

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import org.sleuthkit.autopsy.core.Installer;
3737
import org.sleuthkit.autopsy.coreutils.Logger;
3838
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
39+
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
3940
import org.sleuthkit.autopsy.coreutils.ThreadConfined;
4041
import org.sleuthkit.datamodel.AbstractFile;
4142
import org.sleuthkit.datamodel.BlackboardArtifact;
@@ -97,7 +98,10 @@ public void performAction() {
9798
}
9899
}
99100
setEnabled(false);
100-
} else {
101+
}else if("false".equals(ModuleSettings.getConfigSetting("timeline", "enable_timeline"))) {
102+
Platform.runLater(PromptDialogManager::showTimeLineDisabledMessage);
103+
setEnabled(false);
104+
}else {
101105
showTimeline();
102106
}
103107
}

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,5 +222,20 @@ static void showTooManyFiles() {
222222
dialog.setHeaderText(Bundle.PromptDialogManager_showTooManyFiles_headerText());
223223
dialog.showAndWait();
224224
}
225+
226+
@NbBundle.Messages({
227+
"PromptDialogManager.showTimeLineDisabledMessage.contentText="
228+
+ "Timeline functionality is not available for Linux yet."
229+
+ " Timeline will be disabled. ",
230+
"PromptDialogManager.showTimeLineDisabledMessage.headerText="})
231+
static void showTimeLineDisabledMessage() {
232+
Alert dialog = new Alert(Alert.AlertType.INFORMATION,
233+
Bundle.PromptDialogManager_showTimeLineDisabledMessage_contentText(), ButtonType.OK);
234+
dialog.initModality(Modality.APPLICATION_MODAL);
235+
dialog.setTitle(Bundle.Timeline_dialogs_title());
236+
setDialogIcons(dialog);
237+
dialog.setHeaderText(Bundle.PromptDialogManager_showTimeLineDisabledMessage_headerText());
238+
dialog.showAndWait();
239+
}
225240

226241
}

0 commit comments

Comments
 (0)