diff --git a/Core/src/org/sleuthkit/autopsy/timeline/Bundle.properties b/Core/src/org/sleuthkit/autopsy/timeline/Bundle.properties index 9f2e0c950c..131934652e 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/timeline/Bundle.properties @@ -1,4 +1,4 @@ -CTL_MakeTimeline="Timeline" +CTL_MakeTimeline=Timeline CTL_TimeLineTopComponentAction=TimeLineTopComponent CTL_TimeLineTopComponent=Timeline Window HINT_TimeLineTopComponent=This is a Timeline window @@ -24,7 +24,5 @@ TimelinePanel.jButton7.text=3d TimelinePanel.jButton2.text=1m TimelinePanel.jButton3.text=3m TimelinePanel.jButton4.text=2w -OpenTimelineAction.title=Timeline -OpenTimeLineAction.msgdlg.text=Could not create timeline, there are no data sources. ProgressWindow.progressHeader.text=\ diff --git a/Core/src/org/sleuthkit/autopsy/timeline/OpenTimelineAction.java b/Core/src/org/sleuthkit/autopsy/timeline/OpenTimelineAction.java index 2fed7f5c6a..b766394926 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/OpenTimelineAction.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/OpenTimelineAction.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2013 Basis Technology Corp. + * Copyright 2013-16 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -20,7 +20,6 @@ package org.sleuthkit.autopsy.timeline; import java.io.IOException; import java.util.logging.Level; -import javax.swing.JOptionPane; import org.openide.awt.ActionID; import org.openide.awt.ActionReference; import org.openide.awt.ActionReferences; @@ -28,7 +27,6 @@ import org.openide.awt.ActionRegistration; import org.openide.util.HelpCtx; import org.openide.util.NbBundle; import org.openide.util.actions.CallableSystemAction; -import org.openide.windows.WindowManager; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.core.Installer; import org.sleuthkit.autopsy.coreutils.Logger; @@ -60,39 +58,39 @@ public class OpenTimelineAction extends CallableSystemAction { return Case.isCaseOpen() && fxInited;// && Case.getCurrentCase().hasData(); } + @NbBundle.Messages({ + "OpenTimelineAction.settingsErrorMessage=Failed to initialize timeline settings.", + "OpenTimeLineAction.msgdlg.text=Could not create timeline, there are no data sources."}) @Override @ThreadConfined(type = ThreadConfined.ThreadType.AWT) public void performAction() { - //check case - if (!Case.isCaseOpen()) { - return; - } - final Case currentCase = Case.getCurrentCase(); - - if (currentCase.hasData() == false) { - JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), - NbBundle.getMessage(this.getClass(), "OpenTimeLineAction.msgdlg.text")); - LOGGER.log(Level.INFO, "Could not create timeline, there are no data sources.");// NON-NLS - return; - } - try { - if (timeLineController == null) { - timeLineController = new TimeLineController(currentCase); - } else if (timeLineController.getAutopsyCase() != currentCase) { - timeLineController.shutDownTimeLine(); - timeLineController = new TimeLineController(currentCase); + Case currentCase = Case.getCurrentCase(); + if (currentCase.hasData() == false) { + MessageNotifyUtil.Message.info(Bundle.OpenTimeLineAction_msgdlg_text()); + LOGGER.log(Level.INFO, "Could not create timeline, there are no data sources.");// NON-NLS + return; } - timeLineController.openTimeLine(); - } catch (IOException iOException) { - MessageNotifyUtil.Notify.error("Timeline", "Failed to initialize timeline settings."); - LOGGER.log(Level.SEVERE, "Failed to initialize per case timeline settings."); + try { + if (timeLineController == null) { + timeLineController = new TimeLineController(currentCase); + } else if (timeLineController.getAutopsyCase() != currentCase) { + timeLineController.shutDownTimeLine(); + timeLineController = new TimeLineController(currentCase); + } + timeLineController.openTimeLine(); + } catch (IOException iOException) { + MessageNotifyUtil.Message.error(Bundle.OpenTimelineAction_settingsErrorMessage()); + LOGGER.log(Level.SEVERE, "Failed to initialize per case timeline settings.", iOException); + } + } catch (IllegalStateException e) { + //there is no case... Do nothing. } } @Override public String getName() { - return NbBundle.getMessage(TimeLineTopComponent.class, "OpenTimelineAction.title"); + return NbBundle.getMessage(OpenTimelineAction.class, "CTL_MakeTimeline"); } @Override