Merge pull request #362 from raman-bt/flexiwizard

Display the error message prominently on the Progress Panel, in case of ...
This commit is contained in:
Brian Carrier 2013-11-26 06:05:58 -08:00
commit a91b9fd92e
5 changed files with 39 additions and 45 deletions

View File

@ -150,7 +150,7 @@ public class AddImageTask implements Runnable {
addImageProcess.run(new String[]{this.imagePath}); addImageProcess.run(new String[]{this.imagePath});
} catch (TskCoreException ex) { } catch (TskCoreException ex) {
logger.log(Level.WARNING, "Core errors occurred while running add image. ", ex); logger.log(Level.SEVERE, "Core errors occurred while running add image. ", ex);
//critical core/system error and process needs to be interrupted //critical core/system error and process needs to be interrupted
hasCritError = true; hasCritError = true;
errorList.add(ex.getMessage()); errorList.add(ex.getMessage());
@ -221,13 +221,15 @@ public class AddImageTask implements Runnable {
// attempt actions that might fail and force the process to stop // attempt actions that might fail and force the process to stop
if (cancelled || hasCritError) { if (cancelled || hasCritError) {
logger.log(Level.INFO, "Handling errors or interruption that occured in add image process"); logger.log(Level.WARNING, "Critical errors or interruption in add image process. Image will not be comitted.");
revert(); revert();
} }
if (!errorList.isEmpty()) { if (!errorList.isEmpty()) {
logger.log(Level.INFO, "Handling non-critical errors that occured in add image process"); logger.log(Level.INFO, "There were errors that occured in add image process");
} }
// When everything happens without an error: // When everything happens without an error:
if (!(cancelled || hasCritError)) { if (!(cancelled || hasCritError)) {

View File

@ -40,7 +40,7 @@
<Component id="inProgressPanel" alignment="0" min="-2" max="-2" attributes="0"/> <Component id="inProgressPanel" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="donePanel" alignment="0" min="-2" max="-2" attributes="0"/> <Component id="donePanel" alignment="0" min="-2" max="-2" attributes="0"/>
</Group> </Group>
<EmptySpace min="0" pref="69" max="32767" attributes="0"/> <EmptySpace min="0" pref="67" max="32767" attributes="0"/>
</Group> </Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
@ -136,16 +136,19 @@
<Layout> <Layout>
<DimensionLayout dim="0"> <DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0"> <Group type="102" alignment="1" attributes="0">
<EmptySpace min="-2" max="-2" attributes="0"/> <EmptySpace max="32767" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0"> <Component id="progressBar" min="-2" pref="475" max="-2" attributes="1"/>
<Component id="subTitle2Label" alignment="0" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" max="-2" attributes="0">
<Component id="progressTextArea" max="32767" attributes="0"/>
<Component id="progressLabel" alignment="0" min="-2" max="-2" attributes="0"/> <Component id="progressLabel" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="subTitle1Label" alignment="0" max="32767" attributes="1"/> <Component id="subTitle1Label" alignment="0" max="32767" attributes="1"/>
<Component id="progressTextArea" alignment="0" max="32767" attributes="0"/>
<Component id="progressBar" alignment="0" max="32767" attributes="1"/>
</Group> </Group>
<EmptySpace min="0" pref="8" max="32767" attributes="0"/> <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group> </Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
@ -153,11 +156,9 @@
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0"> <Group type="102" attributes="0">
<Component id="subTitle1Label" min="-2" max="-2" attributes="0"/> <Component id="subTitle1Label" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" min="-2" max="-2" attributes="0"/> <EmptySpace min="-2" pref="19" max="-2" attributes="0"/>
<Component id="subTitle2Label" min="-2" pref="14" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="progressBar" min="-2" pref="23" max="-2" attributes="1"/> <Component id="progressBar" min="-2" pref="23" max="-2" attributes="1"/>
<EmptySpace max="-2" attributes="0"/> <EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="progressTextArea" min="-2" pref="91" max="-2" attributes="0"/> <Component id="progressTextArea" min="-2" pref="91" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/> <EmptySpace max="32767" attributes="0"/>
<Component id="progressLabel" min="-2" pref="23" max="-2" attributes="0"/> <Component id="progressLabel" min="-2" pref="23" max="-2" attributes="0"/>
@ -213,16 +214,6 @@
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="4"/> <AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="4"/>
</AuxValues> </AuxValues>
</Component> </Component>
<Component class="javax.swing.JLabel" name="subTitle2Label">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="AddImageWizardAddingProgressVisual.subTitle2Label.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="4"/>
</AuxValues>
</Component>
<Component class="javax.swing.JLabel" name="subTitle1Label"> <Component class="javax.swing.JLabel" name="subTitle1Label">
<Properties> <Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">

View File

@ -114,8 +114,10 @@ public class AddImageWizardAddingProgressVisual extends javax.swing.JPanel {
//progressBar.setValue(100); //always invoked when process completed //progressBar.setValue(100); //always invoked when process completed
if (hasCriticalErrors) { if (hasCriticalErrors) {
statusLabel.setText("*Failed to add image (critical errors encountered). Click below to view the log."); statusLabel.setForeground(Color.RED);
statusLabel.setText("*Failed to add data source (critical errors encountered). Click below to view the log.");
} else { } else {
statusLabel.setForeground(Color.BLACK);
statusLabel.setText("*Data Source added (non-critical errors encountered). Click below to view the log."); statusLabel.setText("*Data Source added (non-critical errors encountered). Click below to view the log.");
} }
@ -141,7 +143,6 @@ public class AddImageWizardAddingProgressVisual extends javax.swing.JPanel {
progressBar = new javax.swing.JProgressBar(); progressBar = new javax.swing.JProgressBar();
progressLabel = new javax.swing.JLabel(); progressLabel = new javax.swing.JLabel();
progressTextArea = new javax.swing.JTextArea(); progressTextArea = new javax.swing.JTextArea();
subTitle2Label = new javax.swing.JLabel();
subTitle1Label = new javax.swing.JLabel(); subTitle1Label = new javax.swing.JLabel();
javax.swing.GroupLayout loadingPanelLayout = new javax.swing.GroupLayout(loadingPanel); javax.swing.GroupLayout loadingPanelLayout = new javax.swing.GroupLayout(loadingPanel);
@ -202,33 +203,31 @@ public class AddImageWizardAddingProgressVisual extends javax.swing.JPanel {
progressTextArea.setCursor(new java.awt.Cursor(java.awt.Cursor.TEXT_CURSOR)); progressTextArea.setCursor(new java.awt.Cursor(java.awt.Cursor.TEXT_CURSOR));
progressTextArea.setFocusable(false); progressTextArea.setFocusable(false);
org.openide.awt.Mnemonics.setLocalizedText(subTitle2Label, org.openide.util.NbBundle.getMessage(AddImageWizardAddingProgressVisual.class, "AddImageWizardAddingProgressVisual.subTitle2Label.text")); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(subTitle1Label, org.openide.util.NbBundle.getMessage(AddImageWizardAddingProgressVisual.class, "AddImageWizardAddingProgressVisual.subTitle1Label.text")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(subTitle1Label, org.openide.util.NbBundle.getMessage(AddImageWizardAddingProgressVisual.class, "AddImageWizardAddingProgressVisual.subTitle1Label.text")); // NOI18N
javax.swing.GroupLayout inProgressPanelLayout = new javax.swing.GroupLayout(inProgressPanel); javax.swing.GroupLayout inProgressPanelLayout = new javax.swing.GroupLayout(inProgressPanel);
inProgressPanel.setLayout(inProgressPanelLayout); inProgressPanel.setLayout(inProgressPanelLayout);
inProgressPanelLayout.setHorizontalGroup( inProgressPanelLayout.setHorizontalGroup(
inProgressPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) inProgressPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, inProgressPanelLayout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, 475, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
.addGroup(inProgressPanelLayout.createSequentialGroup() .addGroup(inProgressPanelLayout.createSequentialGroup()
.addContainerGap() .addContainerGap()
.addGroup(inProgressPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(inProgressPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(subTitle2Label)
.addComponent(progressLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(subTitle1Label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(progressTextArea) .addComponent(progressTextArea)
.addComponent(progressBar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addComponent(progressLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 8, Short.MAX_VALUE)) .addComponent(subTitle1Label, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(0, 0, Short.MAX_VALUE))
); );
inProgressPanelLayout.setVerticalGroup( inProgressPanelLayout.setVerticalGroup(
inProgressPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) inProgressPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(inProgressPanelLayout.createSequentialGroup() .addGroup(inProgressPanelLayout.createSequentialGroup()
.addComponent(subTitle1Label) .addComponent(subTitle1Label)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGap(19, 19, 19)
.addComponent(subTitle2Label, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGap(18, 18, 18)
.addComponent(progressTextArea, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(progressTextArea, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(progressLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(progressLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
@ -245,7 +244,7 @@ public class AddImageWizardAddingProgressVisual extends javax.swing.JPanel {
.addComponent(titleLabel) .addComponent(titleLabel)
.addComponent(inProgressPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(inProgressPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(donePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(donePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(0, 69, Short.MAX_VALUE)) .addGap(0, 67, Short.MAX_VALUE))
); );
layout.setVerticalGroup( layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@ -276,7 +275,6 @@ public class AddImageWizardAddingProgressVisual extends javax.swing.JPanel {
protected javax.swing.JTextArea progressTextArea; protected javax.swing.JTextArea progressTextArea;
protected javax.swing.JLabel statusLabel; protected javax.swing.JLabel statusLabel;
protected javax.swing.JLabel subTitle1Label; protected javax.swing.JLabel subTitle1Label;
protected javax.swing.JLabel subTitle2Label;
protected javax.swing.JLabel titleLabel; protected javax.swing.JLabel titleLabel;
protected javax.swing.JButton viewLogButton; protected javax.swing.JButton viewLogButton;
// End of variables declaration//GEN-END:variables // End of variables declaration//GEN-END:variables

View File

@ -281,9 +281,13 @@ class AddImageWizardIngestConfigPanel implements WizardDescriptor.Panel<WizardDe
//if errors, display them on the progress panel //if errors, display them on the progress panel
boolean critErr = false;
if (result == DSPCallback.DSP_Result.CRITICAL_ERRORS) {
critErr = true;
}
for ( String err: errList ) { for ( String err: errList ) {
// TBD: there probably should be an error level for each error // TBD: there probably should be an error level for each error
progressPanel.addErrors(err, false); progressPanel.addErrors(err, critErr);
} }
newContents.clear(); newContents.clear();

View File

@ -132,7 +132,7 @@ LocalFilesPanel.localFileChooser.approveButtonToolTipText=
LocalFilesPanel.selectButton.actionCommand=Add LocalFilesPanel.selectButton.actionCommand=Add
AddImageWizardIngestConfigVisual.subtitleLabel.text=Configure the ingest modules you would like to run on this data source. AddImageWizardIngestConfigVisual.subtitleLabel.text=Configure the ingest modules you would like to run on this data source.
AddImageWizardIngestConfigVisual.titleLabel.text=Configure Ingest Modules AddImageWizardIngestConfigVisual.titleLabel.text=Configure Ingest Modules
AddImageWizardAddingProgressVisual.statusLabel.text=File system has been added to the local database. Files are being analyzed. AddImageWizardAddingProgressVisual.statusLabel.text=Data source has been added to the local database. Files are being analyzed.
AddImageWizardChooseDataSourceVisual.typeTabel.text=Select source type to add: AddImageWizardChooseDataSourceVisual.typeTabel.text=Select source type to add:
AddImageWizardChooseDataSourceVisual.jLabel2.text=jLabel2 AddImageWizardChooseDataSourceVisual.jLabel2.text=jLabel2
AddImageWizardChooseDataSourceVisual.nextLabel.text=<html> Press 'Next' to analyze the input data, extract volume and file system data, and populate a local database.</html> AddImageWizardChooseDataSourceVisual.nextLabel.text=<html> Press 'Next' to analyze the input data, extract volume and file system data, and populate a local database.</html>
@ -140,8 +140,7 @@ AddImageWizardChooseDataSourceVisual.imgInfoLabel.text=Enter Data Source Informa
AddImageWizardAddingProgressVisual.progressLabel.text=<progress> AddImageWizardAddingProgressVisual.progressLabel.text=<progress>
AddImageWizardAddingProgressVisual.viewLogButton.text=View Log AddImageWizardAddingProgressVisual.viewLogButton.text=View Log
AddImageWizardAddingProgressVisual.titleLabel.text=Adding Data Source AddImageWizardAddingProgressVisual.titleLabel.text=Adding Data Source
AddImageWizardAddingProgressVisual.subTitle1Label.text=File system information is being added to a local database. File analysis will start when this finishes. AddImageWizardAddingProgressVisual.subTitle1Label.text=Processing data source and adding it to a local database. File analysis will start when this finishes.
AddImageWizardAddingProgressVisual.subTitle2Label.text=Processing Data Source and Adding to Database
ImageFilePanel.timeZoneLabel.text=Please select the input timezone: ImageFilePanel.timeZoneLabel.text=Please select the input timezone:
ImageFilePanel.noFatOrphansCheckbox.text=Ignore orphan files in FAT file systems ImageFilePanel.noFatOrphansCheckbox.text=Ignore orphan files in FAT file systems
ImageFilePanel.noFatOrphansCheckbox.toolTipText= ImageFilePanel.noFatOrphansCheckbox.toolTipText=