mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 10:17:41 +00:00
Merge pull request #306 from jawallace/timezoneOption
Added option to display times in GMT
This commit is contained in:
commit
e9fe943669
@ -4,6 +4,8 @@
|
|||||||
<NonVisualComponents>
|
<NonVisualComponents>
|
||||||
<Component class="javax.swing.ButtonGroup" name="buttonGroup1">
|
<Component class="javax.swing.ButtonGroup" name="buttonGroup1">
|
||||||
</Component>
|
</Component>
|
||||||
|
<Component class="javax.swing.ButtonGroup" name="buttonGroup3">
|
||||||
|
</Component>
|
||||||
</NonVisualComponents>
|
</NonVisualComponents>
|
||||||
<AuxValues>
|
<AuxValues>
|
||||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
|
||||||
@ -24,11 +26,14 @@
|
|||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||||
<Group type="102" alignment="0" attributes="0">
|
<Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Group type="102" attributes="0">
|
||||||
<EmptySpace min="10" pref="10" max="-2" attributes="0"/>
|
<EmptySpace min="10" pref="10" max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="useLocalTimeRB" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="keepCurrentViewerRB" min="-2" max="-2" attributes="0"/>
|
<Component id="keepCurrentViewerRB" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="useBestViewerRB" min="-2" max="-2" attributes="0"/>
|
<Component id="useBestViewerRB" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="useGMTTimeRB" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
@ -44,7 +49,13 @@
|
|||||||
<Component id="useBestViewerRB" min="-2" max="-2" attributes="0"/>
|
<Component id="useBestViewerRB" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Component id="keepCurrentViewerRB" min="-2" max="-2" attributes="0"/>
|
<Component id="keepCurrentViewerRB" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace pref="18" max="32767" attributes="0"/>
|
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="useLocalTimeRB" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="useGMTTimeRB" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace pref="26" max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
@ -87,5 +98,33 @@
|
|||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel2">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
|
<ResourceString bundle="org/sleuthkit/autopsy/corecomponents/Bundle.properties" key="GeneralPanel.jLabel2.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JRadioButton" name="useLocalTimeRB">
|
||||||
|
<Properties>
|
||||||
|
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
|
||||||
|
<ComponentRef name="buttonGroup3"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="selected" type="boolean" value="true"/>
|
||||||
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
|
<ResourceString bundle="org/sleuthkit/autopsy/corecomponents/Bundle.properties" key="GeneralPanel.useLocalTimeRB.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JRadioButton" name="useGMTTimeRB">
|
||||||
|
<Properties>
|
||||||
|
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
|
||||||
|
<ComponentRef name="buttonGroup3"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
|
<ResourceString bundle="org/sleuthkit/autopsy/corecomponents/Bundle.properties" key="GeneralPanel.useGMTTimeRB.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
</SubComponents>
|
</SubComponents>
|
||||||
</Form>
|
</Form>
|
||||||
|
@ -10,6 +10,7 @@ final class GeneralPanel extends javax.swing.JPanel {
|
|||||||
|
|
||||||
private final GeneralOptionsPanelController controller;
|
private final GeneralOptionsPanelController controller;
|
||||||
private final static String KEEP_PREFERRED_VIEWER = "keepPreferredViewer";
|
private final static String KEEP_PREFERRED_VIEWER = "keepPreferredViewer";
|
||||||
|
private final static String USE_LOCAL_TIME = "useLocalTime";
|
||||||
|
|
||||||
GeneralPanel(GeneralOptionsPanelController controller) {
|
GeneralPanel(GeneralOptionsPanelController controller) {
|
||||||
this.controller = controller;
|
this.controller = controller;
|
||||||
@ -26,9 +27,13 @@ final class GeneralPanel extends javax.swing.JPanel {
|
|||||||
private void initComponents() {
|
private void initComponents() {
|
||||||
|
|
||||||
buttonGroup1 = new javax.swing.ButtonGroup();
|
buttonGroup1 = new javax.swing.ButtonGroup();
|
||||||
|
buttonGroup3 = new javax.swing.ButtonGroup();
|
||||||
useBestViewerRB = new javax.swing.JRadioButton();
|
useBestViewerRB = new javax.swing.JRadioButton();
|
||||||
keepCurrentViewerRB = new javax.swing.JRadioButton();
|
keepCurrentViewerRB = new javax.swing.JRadioButton();
|
||||||
jLabel1 = new javax.swing.JLabel();
|
jLabel1 = new javax.swing.JLabel();
|
||||||
|
jLabel2 = new javax.swing.JLabel();
|
||||||
|
useLocalTimeRB = new javax.swing.JRadioButton();
|
||||||
|
useGMTTimeRB = new javax.swing.JRadioButton();
|
||||||
|
|
||||||
buttonGroup1.add(useBestViewerRB);
|
buttonGroup1.add(useBestViewerRB);
|
||||||
useBestViewerRB.setSelected(true);
|
useBestViewerRB.setSelected(true);
|
||||||
@ -46,6 +51,15 @@ final class GeneralPanel extends javax.swing.JPanel {
|
|||||||
|
|
||||||
org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(GeneralPanel.class, "GeneralPanel.jLabel1.text")); // NOI18N
|
org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(GeneralPanel.class, "GeneralPanel.jLabel1.text")); // NOI18N
|
||||||
|
|
||||||
|
org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(GeneralPanel.class, "GeneralPanel.jLabel2.text")); // NOI18N
|
||||||
|
|
||||||
|
buttonGroup3.add(useLocalTimeRB);
|
||||||
|
useLocalTimeRB.setSelected(true);
|
||||||
|
org.openide.awt.Mnemonics.setLocalizedText(useLocalTimeRB, org.openide.util.NbBundle.getMessage(GeneralPanel.class, "GeneralPanel.useLocalTimeRB.text")); // NOI18N
|
||||||
|
|
||||||
|
buttonGroup3.add(useGMTTimeRB);
|
||||||
|
org.openide.awt.Mnemonics.setLocalizedText(useGMTTimeRB, org.openide.util.NbBundle.getMessage(GeneralPanel.class, "GeneralPanel.useGMTTimeRB.text")); // NOI18N
|
||||||
|
|
||||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
||||||
this.setLayout(layout);
|
this.setLayout(layout);
|
||||||
layout.setHorizontalGroup(
|
layout.setHorizontalGroup(
|
||||||
@ -54,11 +68,14 @@ final class GeneralPanel extends javax.swing.JPanel {
|
|||||||
.addContainerGap()
|
.addContainerGap()
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addComponent(jLabel1)
|
.addComponent(jLabel1)
|
||||||
|
.addComponent(jLabel2)
|
||||||
.addGroup(layout.createSequentialGroup()
|
.addGroup(layout.createSequentialGroup()
|
||||||
.addGap(10, 10, 10)
|
.addGap(10, 10, 10)
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addComponent(useLocalTimeRB)
|
||||||
.addComponent(keepCurrentViewerRB)
|
.addComponent(keepCurrentViewerRB)
|
||||||
.addComponent(useBestViewerRB))))
|
.addComponent(useBestViewerRB)
|
||||||
|
.addComponent(useGMTTimeRB))))
|
||||||
.addGap(0, 112, Short.MAX_VALUE))
|
.addGap(0, 112, Short.MAX_VALUE))
|
||||||
);
|
);
|
||||||
layout.setVerticalGroup(
|
layout.setVerticalGroup(
|
||||||
@ -69,7 +86,13 @@ final class GeneralPanel extends javax.swing.JPanel {
|
|||||||
.addComponent(useBestViewerRB)
|
.addComponent(useBestViewerRB)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addComponent(keepCurrentViewerRB)
|
.addComponent(keepCurrentViewerRB)
|
||||||
.addContainerGap(18, Short.MAX_VALUE))
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||||
|
.addComponent(jLabel2)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(useLocalTimeRB)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(useGMTTimeRB)
|
||||||
|
.addContainerGap(26, Short.MAX_VALUE))
|
||||||
);
|
);
|
||||||
}// </editor-fold>//GEN-END:initComponents
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
@ -81,10 +104,14 @@ final class GeneralPanel extends javax.swing.JPanel {
|
|||||||
boolean keepPreferredViewer = NbPreferences.forModule(GeneralPanel.class).getBoolean(KEEP_PREFERRED_VIEWER, false);
|
boolean keepPreferredViewer = NbPreferences.forModule(GeneralPanel.class).getBoolean(KEEP_PREFERRED_VIEWER, false);
|
||||||
keepCurrentViewerRB.setSelected(keepPreferredViewer);
|
keepCurrentViewerRB.setSelected(keepPreferredViewer);
|
||||||
useBestViewerRB.setSelected(!keepPreferredViewer);
|
useBestViewerRB.setSelected(!keepPreferredViewer);
|
||||||
|
boolean useLocalTime = NbPreferences.forModule(GeneralPanel.class).getBoolean(USE_LOCAL_TIME, true);
|
||||||
|
useLocalTimeRB.setSelected(useLocalTime);
|
||||||
|
useGMTTimeRB.setSelected(!useLocalTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
void store() {
|
void store() {
|
||||||
NbPreferences.forModule(GeneralPanel.class).putBoolean(KEEP_PREFERRED_VIEWER, keepCurrentViewerRB.isSelected());
|
NbPreferences.forModule(GeneralPanel.class).putBoolean(KEEP_PREFERRED_VIEWER, keepCurrentViewerRB.isSelected());
|
||||||
|
NbPreferences.forModule(GeneralPanel.class).putBoolean(USE_LOCAL_TIME, useLocalTimeRB.isSelected());
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean valid() {
|
boolean valid() {
|
||||||
@ -93,8 +120,12 @@ final class GeneralPanel extends javax.swing.JPanel {
|
|||||||
}
|
}
|
||||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
private javax.swing.ButtonGroup buttonGroup1;
|
private javax.swing.ButtonGroup buttonGroup1;
|
||||||
|
private javax.swing.ButtonGroup buttonGroup3;
|
||||||
private javax.swing.JLabel jLabel1;
|
private javax.swing.JLabel jLabel1;
|
||||||
|
private javax.swing.JLabel jLabel2;
|
||||||
private javax.swing.JRadioButton keepCurrentViewerRB;
|
private javax.swing.JRadioButton keepCurrentViewerRB;
|
||||||
private javax.swing.JRadioButton useBestViewerRB;
|
private javax.swing.JRadioButton useBestViewerRB;
|
||||||
|
private javax.swing.JRadioButton useGMTTimeRB;
|
||||||
|
private javax.swing.JRadioButton useLocalTimeRB;
|
||||||
// End of variables declaration//GEN-END:variables
|
// End of variables declaration//GEN-END:variables
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,6 @@ import org.sleuthkit.datamodel.BlackboardArtifact;
|
|||||||
import org.sleuthkit.datamodel.BlackboardAttribute;
|
import org.sleuthkit.datamodel.BlackboardAttribute;
|
||||||
import org.sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE;
|
import org.sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE;
|
||||||
import org.sleuthkit.datamodel.Content;
|
import org.sleuthkit.datamodel.Content;
|
||||||
import org.sleuthkit.datamodel.Image;
|
|
||||||
import org.sleuthkit.datamodel.TskCoreException;
|
import org.sleuthkit.datamodel.TskCoreException;
|
||||||
import org.sleuthkit.datamodel.TskException;
|
import org.sleuthkit.datamodel.TskException;
|
||||||
|
|
||||||
@ -164,17 +163,7 @@ public class ArtifactStringContent implements StringContent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static TimeZone getTimeZone(BlackboardArtifact artifact) {
|
private static TimeZone getTimeZone(BlackboardArtifact artifact) {
|
||||||
try {
|
return ContentUtils.getTimeZone(getAssociatedContent(artifact));
|
||||||
final Content content = getAssociatedContent(artifact);
|
|
||||||
final Image image = content.getImage();
|
|
||||||
if (image != null) {
|
|
||||||
return TimeZone.getTimeZone(image.getTimeZone());
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return TimeZone.getDefault();
|
|
||||||
}
|
|
||||||
} catch(TskException ex) {
|
|
||||||
return TimeZone.getDefault();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,9 +24,11 @@ import java.io.InputStream;
|
|||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
import java.util.prefs.Preferences;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import javax.swing.SwingWorker;
|
import javax.swing.SwingWorker;
|
||||||
import org.netbeans.api.progress.ProgressHandle;
|
import org.netbeans.api.progress.ProgressHandle;
|
||||||
|
import org.openide.util.NbPreferences;
|
||||||
import org.sleuthkit.datamodel.AbstractFile;
|
import org.sleuthkit.datamodel.AbstractFile;
|
||||||
import org.sleuthkit.datamodel.Content;
|
import org.sleuthkit.datamodel.Content;
|
||||||
import org.sleuthkit.datamodel.ContentVisitor;
|
import org.sleuthkit.datamodel.ContentVisitor;
|
||||||
@ -104,8 +106,10 @@ public final class ContentUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static TimeZone getTimeZone(Content c) {
|
public static TimeZone getTimeZone(Content c) {
|
||||||
|
Preferences generalPanelPrefs = NbPreferences.root().node("/org/sleuthkit/autopsy/core");
|
||||||
|
boolean useLocalTime = generalPanelPrefs.getBoolean("useLocalTime", true);
|
||||||
try {
|
try {
|
||||||
if (false) {
|
if (!useLocalTime) {
|
||||||
return TimeZone.getTimeZone("GMT");
|
return TimeZone.getTimeZone("GMT");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user