cleanup and internationalize OpenTimelineAction

This commit is contained in:
jmillman 2016-03-18 16:25:27 -04:00
parent fa0fc5f396
commit 1e6673bbee
2 changed files with 25 additions and 29 deletions

View File

@ -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=\

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2013 Basis Technology Corp.
* Copyright 2013-16 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> 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,22 +58,19 @@ 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();
try {
Case currentCase = Case.getCurrentCase();
if (currentCase.hasData() == false) {
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
NbBundle.getMessage(this.getClass(), "OpenTimeLineAction.msgdlg.text"));
MessageNotifyUtil.Message.info(Bundle.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);
@ -85,14 +80,17 @@ public class OpenTimelineAction extends CallableSystemAction {
}
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.");
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