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});
} 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
hasCritError = true;
errorList.add(ex.getMessage());
@ -221,13 +221,15 @@ public class AddImageTask implements Runnable {
// attempt actions that might fail and force the process to stop
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();
}
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:
if (!(cancelled || hasCritError)) {

View File

@ -40,7 +40,7 @@
<Component id="inProgressPanel" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="donePanel" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="0" pref="69" max="32767" attributes="0"/>
<EmptySpace min="0" pref="67" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -136,16 +136,19 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="subTitle2Label" alignment="0" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="32767" attributes="0"/>
<Component id="progressBar" min="-2" pref="475" max="-2" attributes="1"/>
<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="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>
<EmptySpace min="0" pref="8" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -153,11 +156,9 @@
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="subTitle1Label" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" min="-2" max="-2" attributes="0"/>
<Component id="subTitle2Label" min="-2" pref="14" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<EmptySpace min="-2" pref="19" max="-2" attributes="0"/>
<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"/>
<EmptySpace max="32767" 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"/>
</AuxValues>
</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">
<Properties>
<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
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 {
statusLabel.setForeground(Color.BLACK);
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();
progressLabel = new javax.swing.JLabel();
progressTextArea = new javax.swing.JTextArea();
subTitle2Label = new javax.swing.JLabel();
subTitle1Label = new javax.swing.JLabel();
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.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
javax.swing.GroupLayout inProgressPanelLayout = new javax.swing.GroupLayout(inProgressPanel);
inProgressPanel.setLayout(inProgressPanelLayout);
inProgressPanelLayout.setHorizontalGroup(
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()
.addContainerGap()
.addGroup(inProgressPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, 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)
.addGroup(inProgressPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(progressTextArea)
.addComponent(progressBar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(0, 8, 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)
.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.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(inProgressPanelLayout.createSequentialGroup()
.addComponent(subTitle1Label)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(subTitle2Label, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGap(19, 19, 19)
.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)
.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)
@ -245,7 +244,7 @@ public class AddImageWizardAddingProgressVisual extends javax.swing.JPanel {
.addComponent(titleLabel)
.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))
.addGap(0, 69, Short.MAX_VALUE))
.addGap(0, 67, Short.MAX_VALUE))
);
layout.setVerticalGroup(
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.JLabel statusLabel;
protected javax.swing.JLabel subTitle1Label;
protected javax.swing.JLabel subTitle2Label;
protected javax.swing.JLabel titleLabel;
protected javax.swing.JButton viewLogButton;
// 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
boolean critErr = false;
if (result == DSPCallback.DSP_Result.CRITICAL_ERRORS) {
critErr = true;
}
for ( String err: errList ) {
// TBD: there probably should be an error level for each error
progressPanel.addErrors(err, false);
progressPanel.addErrors(err, critErr);
}
newContents.clear();

View File

@ -132,7 +132,7 @@ LocalFilesPanel.localFileChooser.approveButtonToolTipText=
LocalFilesPanel.selectButton.actionCommand=Add
AddImageWizardIngestConfigVisual.subtitleLabel.text=Configure the ingest modules you would like to run on this data source.
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.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>
@ -140,8 +140,7 @@ AddImageWizardChooseDataSourceVisual.imgInfoLabel.text=Enter Data Source Informa
AddImageWizardAddingProgressVisual.progressLabel.text=<progress>
AddImageWizardAddingProgressVisual.viewLogButton.text=View Log
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.subTitle2Label.text=Processing Data Source and Adding to Database
AddImageWizardAddingProgressVisual.subTitle1Label.text=Processing data source and adding it to a local database. File analysis will start when this finishes.
ImageFilePanel.timeZoneLabel.text=Please select the input timezone:
ImageFilePanel.noFatOrphansCheckbox.text=Ignore orphan files in FAT file systems
ImageFilePanel.noFatOrphansCheckbox.toolTipText=