mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 18:17:43 +00:00
7471 adjust messages and add pop up on start up if unable to open case
This commit is contained in:
parent
63e3e1d372
commit
bfd7701d11
@ -1,4 +1,4 @@
|
||||
CTL_ResetWindowsAction=Reset Windows
|
||||
ResetWindowAction.caseCloseFailure.text=Unable to close the current case, the software will restart and the windows locations will reset the next time the software is closed.
|
||||
ResetWindowAction.caseSaveMetadata.text=Unable to save current case path, the software will restart and the windows locations will reset but the current case will not be opened upon restart.
|
||||
ResetWindowAction.confirm.text=In order to perform the resetting of window locations the software will close and restart. If a case is currently open it will be closed. If ingest or a search is currently running it will be terminated. Are you sure you want to restart the software to reset all window locations?
|
||||
ResetWindowAction.confirm.text=In order to perform the resetting of window locations the software will close and restart. If a case is currently open, it will be closed. If ingest or a search is currently running, it will be terminated. Are you sure you want to restart the software to reset all window locations?
|
||||
|
@ -61,7 +61,7 @@ public final class ResetWindowsAction extends CallableSystemAction {
|
||||
}
|
||||
|
||||
@NbBundle.Messages({"ResetWindowAction.confirm.text=In order to perform the resetting of window locations the software will close and restart. "
|
||||
+ "If a case is currently open it will be closed. If ingest or a search is currently running it will be terminated. "
|
||||
+ "If a case is currently open, it will be closed. If ingest or a search is currently running, it will be terminated. "
|
||||
+ "Are you sure you want to restart the software to reset all window locations?",
|
||||
"ResetWindowAction.caseCloseFailure.text=Unable to close the current case, "
|
||||
+ "the software will restart and the windows locations will reset the next time the software is closed.",
|
||||
@ -90,7 +90,7 @@ public final class ResetWindowsAction extends CallableSystemAction {
|
||||
if (Case.isCaseOpen()) {
|
||||
String caseMetadataFilePath = Case.getCurrentCase().getMetadata().getFilePath().toString();
|
||||
File caseToOpenFile = new File(ResetWindowsAction.getCaseToReopenFilePath());
|
||||
Charset encoding = null;
|
||||
Charset encoding = null; //prevents writeStringToFile from having ambiguous arguments
|
||||
FileUtils.writeStringToFile(caseToOpenFile, caseMetadataFilePath, encoding);
|
||||
Case.closeCurrentCase();
|
||||
}
|
||||
|
@ -346,6 +346,12 @@ RecentCases.getName.text=Clear Recent Cases
|
||||
RecentItems.openRecentCase.msgDlg.text=Case {0} no longer exists.
|
||||
SelectDataSourceProcessorPanel.name.text=Select Data Source Type
|
||||
StartupWindow.title.text=Welcome
|
||||
# {0} - autFilePath
|
||||
StartupWindowProvider.openCase.cantOpen=Unable to open previously open case with metadata file: {0}
|
||||
# {0} - reOpenFilePath
|
||||
StartupWindowProvider.openCase.deleteOpenFailure=Unable to open or delete file containing path {0} to previously open case. The previous case will not be opened.
|
||||
# {0} - autFilePath
|
||||
StartupWindowProvider.openCase.noFile=Unable to open previously open case because metadata file not found at: {0}
|
||||
UnpackagePortableCaseDialog.title.text=Unpackage Portable Case
|
||||
UnpackagePortableCaseDialog.UnpackagePortableCaseDialog.extensions=Portable case package (.zip, .zip.001)
|
||||
UnpackagePortableCaseDialog.validatePaths.badExtension=File extension must be .zip or .zip.001
|
||||
|
@ -25,6 +25,7 @@ import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.logging.Level;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openide.util.Lookup;
|
||||
import org.openide.util.NbBundle;
|
||||
import org.sleuthkit.autopsy.apputils.ResetWindowsAction;
|
||||
@ -65,6 +66,13 @@ public class StartupWindowProvider implements StartupWindowInterface {
|
||||
return instance;
|
||||
}
|
||||
|
||||
@NbBundle.Messages({
|
||||
"# {0} - autFilePath",
|
||||
"StartupWindowProvider.openCase.noFile=Unable to open previously open case because metadata file not found at: {0}",
|
||||
"# {0} - reOpenFilePath",
|
||||
"StartupWindowProvider.openCase.deleteOpenFailure=Unable to open or delete file containing path {0} to previously open case. The previous case will not be opened.",
|
||||
"# {0} - autFilePath",
|
||||
"StartupWindowProvider.openCase.cantOpen=Unable to open previously open case with metadata file: {0}"})
|
||||
private void init() {
|
||||
if (startupWindowToUse == null) {
|
||||
// first check whether we are running from command line
|
||||
@ -90,7 +98,9 @@ public class StartupWindowProvider implements StartupWindowInterface {
|
||||
|
||||
File openPreviousCaseFile = new File(ResetWindowsAction.getCaseToReopenFilePath());
|
||||
String caseFilePath = "";
|
||||
|
||||
if (openPreviousCaseFile.exists()) {
|
||||
String unableToOpenMessage = null;
|
||||
try {
|
||||
Charset encoding = null;
|
||||
caseFilePath = FileUtils.readFileToString(openPreviousCaseFile, encoding);
|
||||
@ -100,12 +110,18 @@ public class StartupWindowProvider implements StartupWindowInterface {
|
||||
//the case is now open we do not want to display the start up windows
|
||||
return;
|
||||
} else {
|
||||
logger.log(Level.WARNING, "Unable to open previously open case because metadata file not found at: {0}", caseFilePath);
|
||||
unableToOpenMessage = Bundle.StartupWindowProvider_openCase_noFile(caseFilePath);
|
||||
logger.log(Level.WARNING, unableToOpenMessage);
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
logger.log(Level.WARNING, "Unable to open or delete file containing path " + ResetWindowsAction.getCaseToReopenFilePath() + " to previously open case, will not open previous case.", ex);
|
||||
unableToOpenMessage = Bundle.StartupWindowProvider_openCase_deleteOpenFailure(ResetWindowsAction.getCaseToReopenFilePath());
|
||||
logger.log(Level.WARNING, unableToOpenMessage, ex);
|
||||
} catch (CaseActionException ex) {
|
||||
logger.log(Level.WARNING, "Unable to open previously open case with metadata file: " + caseFilePath, ex);
|
||||
unableToOpenMessage = Bundle.StartupWindowProvider_openCase_cantOpen(caseFilePath);
|
||||
logger.log(Level.WARNING, unableToOpenMessage, ex);
|
||||
}
|
||||
if (RuntimeProperties.runningWithGUI() && !StringUtils.isBlank(unableToOpenMessage)) {
|
||||
MessageNotifyUtil.Message.warn(unableToOpenMessage);
|
||||
}
|
||||
}
|
||||
//discover the registered windows
|
||||
|
Loading…
x
Reference in New Issue
Block a user