Using NbBundle.getMessage for error dialogs

This commit is contained in:
Eugene Livis 2015-07-07 09:51:50 -04:00
parent 9bb0a4d8bd
commit a99d4eed11
5 changed files with 20 additions and 21 deletions

View File

@ -242,13 +242,5 @@ LocalFilesPanel.errorLabel.text=Error Label
NewCaseVisualPanel1.errorLabel.text=Error Label
CollaborationMonitor.addingDataSourceStatus.msg={0} adding data source
CollaborationMonitor.analyzingDataSourceStatus.msg={0} analyzing {1}
CollaborationMonitor.failedService.notify.title=Collaboration Service Failed
CollaborationMonitor.failedDbService.notify.msg=Lost connection to database server
CollaborationMonitor.failedSolrService.notify.msg=Lost connection to keyword search server
CollaborationMonitor.failedMessageService.notify.msg=Lost connection to messaging server
CollaborationMonitor.restoredService.notify.title=Collaboration Service Restored
CollaborationMonitor.restoredDbService.notify.msg=Connection to database server restored
CollaborationMonitor.restoredSolrService.notify.msg=Connection to keyword search server restored
CollaborationMonitor.restoredMessageService.notify.msg=Connection to messaging server restored
MissingImageDialog.lbWarning.text=
MissingImageDialog.lbWarning.toolTipText=

View File

@ -12,3 +12,11 @@ org_sleuthkit_autopsy_core_update_center=http://sleuthkit.org/autopsy/updates.xm
Services/AutoupdateType/org_sleuthkit_autopsy_core_update_center.settings=Autopsy Update Center
Installer.errorInitJavafx.msg=Error initializing JavaFX.
Installer.errorInitJavafx.details=\ Some features will not be available. Check that you have the right JRE installed (Oracle JRE > 1.7.10).
ServicesMonitor.failedService.notify.title=Collaboration Service Failed
ServicesMonitor.failedDbService.notify.msg=Lost connection to remote database server
ServicesMonitor.failedSolrService.notify.msg=Lost connection to remote keyword search server
ServicesMonitor.failedMessageService.notify.msg=Lost connection to messaging server
ServicesMonitor.restoredService.notify.title=Collaboration Service Restored
ServicesMonitor.restoredDbService.notify.msg=Connection to remote database server restored
ServicesMonitor.restoredSolrService.notify.msg=Connection to remote keyword search server restored
ServicesMonitor.restoredMessageService.notify.msg=Connection to messaging server restored

View File

@ -271,14 +271,14 @@ public class ServicesMonitor {
if (!dbServerIsRunning) {
dbServerIsRunning = true;
logger.log(Level.INFO, "Connection to PostgreSQL server restored"); //NON-NLS
//MessageNotifyUtil.Notify.info(NbBundle.getMessage(CollaborationMonitor.class, "CollaborationMonitor.restoredService.notify.title"), NbBundle.getMessage(CollaborationMonitor.class, "CollaborationMonitor.restoredDbService.notify.msg"));
MessageNotifyUtil.Notify.info(NbBundle.getMessage(ServicesMonitor.class, "ServicesMonitor.restoredService.notify.title"), NbBundle.getMessage(ServicesMonitor.class, "ServicesMonitor.restoredDbService.notify.msg"));
setServiceStatus(Service.REMOTE_CASE_DATABASE.toString(), ServiceStatus.UP.toString());
}
} else {
if (dbServerIsRunning) {
dbServerIsRunning = false;
logger.log(Level.SEVERE, "Failed to connect to PostgreSQL server"); //NON-NLS
//MessageNotifyUtil.Notify.error(NbBundle.getMessage(CollaborationMonitor.class, "CollaborationMonitor.failedService.notify.title"), NbBundle.getMessage(CollaborationMonitor.class, "CollaborationMonitor.failedDbService.notify.msg"));
MessageNotifyUtil.Notify.error(NbBundle.getMessage(ServicesMonitor.class, "ServicesMonitor.failedService.notify.title"), NbBundle.getMessage(ServicesMonitor.class, "ServicesMonitor.failedDbService.notify.msg"));
setServiceStatus(Service.REMOTE_CASE_DATABASE.toString(), ServiceStatus.DOWN.toString());
}
}
@ -289,14 +289,14 @@ public class ServicesMonitor {
if (!solrServerIsRunning) {
solrServerIsRunning = true;
logger.log(Level.INFO, "Connection to Solr server restored"); //NON-NLS
//MessageNotifyUtil.Notify.info(NbBundle.getMessage(CollaborationMonitor.class, "CollaborationMonitor.restoredService.notify.title"), NbBundle.getMessage(CollaborationMonitor.class, "CollaborationMonitor.restoredSolrService.notify.msg"));
MessageNotifyUtil.Notify.info(NbBundle.getMessage(ServicesMonitor.class, "ServicesMonitor.restoredService.notify.title"), NbBundle.getMessage(ServicesMonitor.class, "ServicesMonitor.restoredSolrService.notify.msg"));
setServiceStatus(Service.REMOTE_KEYWORD_SEARCH.toString(), ServiceStatus.UP.toString());
}
} else {
if (solrServerIsRunning) {
solrServerIsRunning = false;
logger.log(Level.SEVERE, "Failed to connect to Solr server"); //NON-NLS
//MessageNotifyUtil.Notify.error(NbBundle.getMessage(CollaborationMonitor.class, "CollaborationMonitor.failedService.notify.title"), NbBundle.getMessage(CollaborationMonitor.class, "CollaborationMonitor.failedSolrService.notify.msg"));
MessageNotifyUtil.Notify.error(NbBundle.getMessage(ServicesMonitor.class, "ServicesMonitor.failedService.notify.title"), NbBundle.getMessage(ServicesMonitor.class, "ServicesMonitor.failedSolrService.notify.msg"));
setServiceStatus(Service.REMOTE_KEYWORD_SEARCH.toString(), ServiceStatus.DOWN.toString());
}
}
@ -310,14 +310,14 @@ public class ServicesMonitor {
if (!messageServerIsRunning) {
messageServerIsRunning = true;
logger.log(Level.INFO, "Connection to ActiveMQ server restored"); //NON-NLS
//MessageNotifyUtil.Notify.info(NbBundle.getMessage(CollaborationMonitor.class, "CollaborationMonitor.restoredService.notify.title"), NbBundle.getMessage(CollaborationMonitor.class, "CollaborationMonitor.restoredMessageService.notify.msg"));
MessageNotifyUtil.Notify.info(NbBundle.getMessage(ServicesMonitor.class, "ServicesMonitor.restoredService.notify.title"), NbBundle.getMessage(ServicesMonitor.class, "ServicesMonitor.restoredMessageService.notify.msg"));
setServiceStatus(Service.MESSAGING.toString(), ServiceStatus.UP.toString());
}
} catch (URISyntaxException | JMSException ex) {
if (messageServerIsRunning) {
messageServerIsRunning = false;
logger.log(Level.SEVERE, "Failed to connect to ActiveMQ server", ex); //NON-NLS
//MessageNotifyUtil.Notify.error(NbBundle.getMessage(CollaborationMonitor.class, "CollaborationMonitor.failedService.notify.title"), NbBundle.getMessage(CollaborationMonitor.class, "CollaborationMonitor.failedMessageService.notify.msg"));
MessageNotifyUtil.Notify.error(NbBundle.getMessage(ServicesMonitor.class, "ServicesMonitor.failedService.notify.title"), NbBundle.getMessage(ServicesMonitor.class, "ServicesMonitor.failedMessageService.notify.msg"));
setServiceStatus(Service.MESSAGING.toString(), ServiceStatus.DOWN.toString());
}
}

View File

@ -103,3 +103,5 @@ IngestJobSettingsPanel.jButtonSelectAll.text=Select All
IngestJobSettingsPanel.jButtonDeselectAll.text=Deselect All
IngestJobSettingsPanel.processUnallocCheckbox.toolTipText=Processes unallocated space, such as deleted files. Produces more complete results, but it may take longer to process on large images.
IngestJobSettingsPanel.processUnallocCheckbox.text=Process Unallocated Space
IngestManager.cancellingIngest.msgDlg.text=Cancelling all currently running ingest jobs
IngestManager.serviceIsDown.msgDlg.text=Service {0} is down

View File

@ -341,13 +341,10 @@ public class IngestManager {
// display notification if running interactively
if (isRunningInteractively()){
// TODO
//MessageNotifyUtil.Notify.show(NbBundle.getMessage(this.getClass(), "LocalDiskPanel.moduleErr"),
// NbBundle.getMessage(this.getClass(), "LocalDiskPanel.moduleErr.msg"),
// MessageNotifyUtil.MessageType.ERROR);
MessageNotifyUtil.Notify.show("Service " + serviceName + " is down!",
"Service " + serviceName + " is down!",
MessageNotifyUtil.MessageType.ERROR);
JOptionPane.showMessageDialog(null,
NbBundle.getMessage(this.getClass(), "IngestManager.cancellingIngest.msgDlg.text"),
NbBundle.getMessage(this.getClass(), "IngestManager.serviceIsDown.msgDlg.text", serviceName),
JOptionPane.ERROR_MESSAGE);
}
// cancel ingest if running