diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java index 7677b5be68..016c842155 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java @@ -46,7 +46,6 @@ import java.util.stream.Collectors; import java.util.stream.Stream; import javax.swing.JOptionPane; import javax.swing.SwingUtilities; -import org.apache.commons.io.FileUtils; import org.openide.util.NbBundle; import org.openide.util.NbBundle.Messages; import org.openide.util.actions.CallableSystemAction; @@ -76,6 +75,7 @@ import org.sleuthkit.autopsy.events.AutopsyEventException; import org.sleuthkit.autopsy.events.AutopsyEventPublisher; import org.sleuthkit.autopsy.ingest.IngestJob; import org.sleuthkit.autopsy.ingest.IngestManager; +import org.sleuthkit.autopsy.timeline.OpenTimelineAction; import org.sleuthkit.datamodel.BlackboardArtifactTag; import org.sleuthkit.datamodel.Content; import org.sleuthkit.datamodel.ContentTag; @@ -1519,28 +1519,22 @@ public class Case implements SleuthkitCase.ErrorObserver { if (RuntimeProperties.coreComponentsAreActive()) { // enable these menus - CallableSystemAction.get(AddImageAction.class).setEnabled(true); - CallableSystemAction.get(CaseCloseAction.class).setEnabled(true); - CallableSystemAction.get(CasePropertiesAction.class).setEnabled(true); - CallableSystemAction.get(CaseDeleteAction.class).setEnabled(true); // Delete Case menu - - if (toChangeTo.hasData()) { - // open all top components - SwingUtilities.invokeLater(() -> { - CoreComponentControl.openCoreWindows(); - }); - } else { - // close all top components - SwingUtilities.invokeLater(() -> { - CoreComponentControl.closeCoreWindows(); - }); - } - } - - if (RuntimeProperties.coreComponentsAreActive()) { SwingUtilities.invokeLater(() -> { - updateMainWindowTitle(currentCase.getName()); + CallableSystemAction.get(AddImageAction.class).setEnabled(true); + CallableSystemAction.get(CaseCloseAction.class).setEnabled(true); + CallableSystemAction.get(CasePropertiesAction.class).setEnabled(true); + CallableSystemAction.get(CaseDeleteAction.class).setEnabled(true); // Delete Case menu + CallableSystemAction.get(OpenTimelineAction.class).setEnabled(true); + + if (toChangeTo.hasData()) { + // open all top components + CoreComponentControl.openCoreWindows(); + } else { + // close all top components + CoreComponentControl.closeCoreWindows(); + } }); + updateMainWindowTitle(currentCase.getName()); } else { SwingUtilities.invokeLater(() -> { Frame f = WindowManager.getDefault().getMainWindow(); @@ -1549,9 +1543,9 @@ public class Case implements SleuthkitCase.ErrorObserver { } } else { // case is closed - if (RuntimeProperties.coreComponentsAreActive()) { + SwingUtilities.invokeLater(() -> { + if (RuntimeProperties.coreComponentsAreActive()) { - SwingUtilities.invokeLater(() -> { // close all top components first CoreComponentControl.closeCoreWindows(); @@ -1560,15 +1554,11 @@ public class Case implements SleuthkitCase.ErrorObserver { CallableSystemAction.get(CaseCloseAction.class).setEnabled(false); // Case Close menu CallableSystemAction.get(CasePropertiesAction.class).setEnabled(false); // Case Properties menu CallableSystemAction.get(CaseDeleteAction.class).setEnabled(false); // Delete Case menu - }); - } + CallableSystemAction.get(OpenTimelineAction.class).setEnabled(false); + } - //clear pending notifications - SwingUtilities.invokeLater(() -> { + //clear pending notifications MessageNotifyUtil.Notify.clear(); - }); - - SwingUtilities.invokeLater(() -> { Frame f = WindowManager.getDefault().getMainWindow(); f.setTitle(Case.getAppName()); // set the window name to just application name }); @@ -1664,7 +1654,7 @@ public class Case implements SleuthkitCase.ErrorObserver { * Deletes reports from the case. * * @param reports Collection of Report to be deleted from the case. - * @param deleteFromDisk No longer supported - ignored. + * @param deleteFromDisk No longer supported - ignored. * * @throws TskCoreException * @deprecated Use deleteReports(Collection reports) @@ -1674,5 +1664,5 @@ public class Case implements SleuthkitCase.ErrorObserver { public void deleteReports(Collection reports, boolean deleteFromDisk) throws TskCoreException { deleteReports(reports); } - + } diff --git a/Core/src/org/sleuthkit/autopsy/core/layer.xml b/Core/src/org/sleuthkit/autopsy/core/layer.xml index b2852f6069..cd72a061f9 100644 --- a/Core/src/org/sleuthkit/autopsy/core/layer.xml +++ b/Core/src/org/sleuthkit/autopsy/core/layer.xml @@ -387,11 +387,11 @@ - + - + diff --git a/Core/src/org/sleuthkit/autopsy/timeline/OpenTimelineAction.java b/Core/src/org/sleuthkit/autopsy/timeline/OpenTimelineAction.java index b766394926..47d7f6940d 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/OpenTimelineAction.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/OpenTimelineAction.java @@ -18,8 +18,13 @@ */ package org.sleuthkit.autopsy.timeline; +import java.awt.Component; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; import java.io.IOException; import java.util.logging.Level; +import javax.swing.ImageIcon; +import javax.swing.JButton; import org.openide.awt.ActionID; import org.openide.awt.ActionReference; import org.openide.awt.ActionReferences; @@ -27,6 +32,7 @@ import org.openide.awt.ActionRegistration; import org.openide.util.HelpCtx; import org.openide.util.NbBundle; import org.openide.util.actions.CallableSystemAction; +import org.openide.util.actions.Presenter; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.core.Installer; import org.sleuthkit.autopsy.coreutils.Logger; @@ -36,8 +42,9 @@ import org.sleuthkit.autopsy.coreutils.ThreadConfined; @ActionID(category = "Tools", id = "org.sleuthkit.autopsy.timeline.Timeline") @ActionRegistration(displayName = "#CTL_MakeTimeline", lazy = false) @ActionReferences(value = { - @ActionReference(path = "Menu/Tools", position = 100)}) -public class OpenTimelineAction extends CallableSystemAction { + @ActionReference(path = "Menu/Tools", position = 100), + @ActionReference(path = "Toolbars/Case", position = 102)}) +public class OpenTimelineAction extends CallableSystemAction implements Presenter.Toolbar { private static final Logger LOGGER = Logger.getLogger(OpenTimelineAction.class.getName()); @@ -45,10 +52,22 @@ public class OpenTimelineAction extends CallableSystemAction { private static TimeLineController timeLineController = null; + private JButton toolbarButton = new JButton(); + synchronized static void invalidateController() { timeLineController = null; } + public OpenTimelineAction() { + toolbarButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + performAction(); + } + }); + this.setEnabled(false); + } + @Override public boolean isEnabled() { /** @@ -102,4 +121,29 @@ public class OpenTimelineAction extends CallableSystemAction { public boolean asynchronous() { return false; // run on edt } + + /** + * Set this action to be enabled/disabled + * + * @param value whether to enable this action or not + */ + @Override + public void setEnabled(boolean value) { + super.setEnabled(value); + toolbarButton.setEnabled(value); + } + + /** + * Returns the toolbar component of this action + * + * @return component the toolbar button + */ + @Override + public Component getToolbarPresenter() { + ImageIcon icon = new ImageIcon("Core/src/org/sleuthkit/autopsy/timeline/images/btn_icon_timeline_colorized_26.png"); //NON-NLS + toolbarButton.setIcon(icon); + toolbarButton.setText(this.getName()); + + return toolbarButton; + } } diff --git a/Core/src/org/sleuthkit/autopsy/timeline/images/20140521121247760_easyicon_net_32.png b/Core/src/org/sleuthkit/autopsy/timeline/images/btn_icon_timeline_32.png similarity index 100% rename from Core/src/org/sleuthkit/autopsy/timeline/images/20140521121247760_easyicon_net_32.png rename to Core/src/org/sleuthkit/autopsy/timeline/images/btn_icon_timeline_32.png diff --git a/Core/src/org/sleuthkit/autopsy/timeline/images/btn_icon_timeline_colorized_26.png b/Core/src/org/sleuthkit/autopsy/timeline/images/btn_icon_timeline_colorized_26.png new file mode 100755 index 0000000000..f44034ff01 Binary files /dev/null and b/Core/src/org/sleuthkit/autopsy/timeline/images/btn_icon_timeline_colorized_26.png differ diff --git a/Core/src/org/sleuthkit/autopsy/timeline/images/20140521121247760_easyicon_net_32_colorized.png b/Core/src/org/sleuthkit/autopsy/timeline/images/btn_icon_timeline_colorized_32.png similarity index 100% rename from Core/src/org/sleuthkit/autopsy/timeline/images/20140521121247760_easyicon_net_32_colorized.png rename to Core/src/org/sleuthkit/autopsy/timeline/images/btn_icon_timeline_colorized_32.png diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryOptionsPanelController.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryOptionsPanelController.java index 28d507619e..3d893fa88a 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryOptionsPanelController.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryOptionsPanelController.java @@ -31,7 +31,7 @@ import org.openide.util.Lookup; */ @OptionsPanelController.TopLevelRegistration( categoryName = "#OptionsCategory_Name_Options", - iconBase = "org/sleuthkit/autopsy/imagegallery/images/polaroid_32_silhouette.png", + iconBase = "org/sleuthkit/autopsy/imagegallery/images/btn_icon_image_gallery_32.png", keywords = "#OptionsCategory_Keywords_Options", keywordsCategory = "Options", position = 10 diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java old mode 100644 new mode 100755 diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/images/btn_icon_image_gallery_26.png b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/images/btn_icon_image_gallery_26.png new file mode 100755 index 0000000000..eea6d50835 Binary files /dev/null and b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/images/btn_icon_image_gallery_26.png differ diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/images/polaroid_32_silhouette.png b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/images/btn_icon_image_gallery_32.png similarity index 100% rename from ImageGallery/src/org/sleuthkit/autopsy/imagegallery/images/polaroid_32_silhouette.png rename to ImageGallery/src/org/sleuthkit/autopsy/imagegallery/images/btn_icon_image_gallery_32.png diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/images/polaroid_48_silhouette.png b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/images/btn_icon_image_gallery_48.png similarity index 100% rename from ImageGallery/src/org/sleuthkit/autopsy/imagegallery/images/polaroid_48_silhouette.png rename to ImageGallery/src/org/sleuthkit/autopsy/imagegallery/images/btn_icon_image_gallery_48.png