mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-12 07:56:16 +00:00
Merge pull request #2078 from BasisOlivers/ui-bugfix
Fixed file size rule ui bug.
This commit is contained in:
commit
2a099cf87d
@ -152,6 +152,7 @@ final class FilesSetRulePanel extends javax.swing.JPanel {
|
|||||||
this.mimeTypeComboBox.setSelectedItem(mimeTypeCondition.getMimeType());
|
this.mimeTypeComboBox.setSelectedItem(mimeTypeCondition.getMimeType());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void populateSizeConditionComponents(FilesSet.Rule rule) {
|
private void populateSizeConditionComponents(FilesSet.Rule rule) {
|
||||||
FilesSet.Rule.FileSizeCondition fileSizeCondition = rule.getFileSizeCondition();
|
FilesSet.Rule.FileSizeCondition fileSizeCondition = rule.getFileSizeCondition();
|
||||||
if (fileSizeCondition != null) {
|
if (fileSizeCondition != null) {
|
||||||
@ -311,14 +312,12 @@ final class FilesSetRulePanel extends javax.swing.JPanel {
|
|||||||
DialogDisplayer.getDefault().notify(notifyDesc);
|
DialogDisplayer.getDefault().notify(notifyDesc);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else if (this.nameTextField.getText().isEmpty() || !FilesSetRulePanel.containsOnlyLegalChars(this.nameTextField.getText(), FilesSetRulePanel.ILLEGAL_FILE_NAME_CHARS)) {
|
||||||
if (this.nameTextField.getText().isEmpty() || !FilesSetRulePanel.containsOnlyLegalChars(this.nameTextField.getText(), FilesSetRulePanel.ILLEGAL_FILE_NAME_CHARS)) {
|
NotifyDescriptor notifyDesc = new NotifyDescriptor.Message(
|
||||||
NotifyDescriptor notifyDesc = new NotifyDescriptor.Message(
|
NbBundle.getMessage(FilesSetPanel.class, "FilesSetRulePanel.messages.invalidCharInName"),
|
||||||
NbBundle.getMessage(FilesSetPanel.class, "FilesSetRulePanel.messages.invalidCharInName"),
|
NotifyDescriptor.WARNING_MESSAGE);
|
||||||
NotifyDescriptor.WARNING_MESSAGE);
|
DialogDisplayer.getDefault().notify(notifyDesc);
|
||||||
DialogDisplayer.getDefault().notify(notifyDesc);
|
return false;
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -342,14 +341,12 @@ final class FilesSetRulePanel extends javax.swing.JPanel {
|
|||||||
DialogDisplayer.getDefault().notify(notifyDesc);
|
DialogDisplayer.getDefault().notify(notifyDesc);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else if (this.pathTextField.getText().isEmpty() || !FilesSetRulePanel.containsOnlyLegalChars(this.pathTextField.getText(), FilesSetRulePanel.ILLEGAL_FILE_PATH_CHARS)) {
|
||||||
if (this.pathTextField.getText().isEmpty() || !FilesSetRulePanel.containsOnlyLegalChars(this.pathTextField.getText(), FilesSetRulePanel.ILLEGAL_FILE_PATH_CHARS)) {
|
NotifyDescriptor notifyDesc = new NotifyDescriptor.Message(
|
||||||
NotifyDescriptor notifyDesc = new NotifyDescriptor.Message(
|
NbBundle.getMessage(FilesSetPanel.class, "FilesSetRulePanel.messages.invalidCharInPath"),
|
||||||
NbBundle.getMessage(FilesSetPanel.class, "FilesSetRulePanel.messages.invalidCharInPath"),
|
NotifyDescriptor.WARNING_MESSAGE);
|
||||||
NotifyDescriptor.WARNING_MESSAGE);
|
DialogDisplayer.getDefault().notify(notifyDesc);
|
||||||
DialogDisplayer.getDefault().notify(notifyDesc);
|
return false;
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.mimeCheck.isSelected()) {
|
if (this.mimeCheck.isSelected()) {
|
||||||
@ -362,7 +359,7 @@ final class FilesSetRulePanel extends javax.swing.JPanel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.fileSizeCheck.isSelected()) {
|
if (this.fileSizeCheck.isSelected()) {
|
||||||
if ((Integer) this.fileSizeSpinner.getValue() == 0 && !((String)this.equalitySymbolComboBox.getSelectedItem()).equals("=")) {
|
if ((Integer) this.fileSizeSpinner.getValue() == 0 && !((String) this.equalitySymbolComboBox.getSelectedItem()).equals("=")) {
|
||||||
NotifyDescriptor notifyDesc = new NotifyDescriptor.Message(
|
NotifyDescriptor notifyDesc = new NotifyDescriptor.Message(
|
||||||
Bundle.FilesSetRulePanel_ZeroFileSizeError(),
|
Bundle.FilesSetRulePanel_ZeroFileSizeError(),
|
||||||
NotifyDescriptor.WARNING_MESSAGE);
|
NotifyDescriptor.WARNING_MESSAGE);
|
||||||
@ -407,17 +404,15 @@ final class FilesSetRulePanel extends javax.swing.JPanel {
|
|||||||
logger.log(Level.SEVERE, "Attempt to get regex name condition that does not compile", ex); // NON-NLS
|
logger.log(Level.SEVERE, "Attempt to get regex name condition that does not compile", ex); // NON-NLS
|
||||||
throw new IllegalStateException("The files set rule panel name condition is not in a valid state"); // NON-NLS
|
throw new IllegalStateException("The files set rule panel name condition is not in a valid state"); // NON-NLS
|
||||||
}
|
}
|
||||||
} else {
|
} else if (FilesSetRulePanel.containsOnlyLegalChars(this.nameTextField.getText(), FilesSetRulePanel.ILLEGAL_FILE_NAME_CHARS)) {
|
||||||
if (FilesSetRulePanel.containsOnlyLegalChars(this.nameTextField.getText(), FilesSetRulePanel.ILLEGAL_FILE_NAME_CHARS)) {
|
if (this.fullNameRadioButton.isSelected()) {
|
||||||
if (this.fullNameRadioButton.isSelected()) {
|
condition = new FilesSet.Rule.FullNameCondition(this.nameTextField.getText());
|
||||||
condition = new FilesSet.Rule.FullNameCondition(this.nameTextField.getText());
|
|
||||||
} else {
|
|
||||||
condition = new FilesSet.Rule.ExtensionCondition(this.nameTextField.getText());
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
logger.log(Level.SEVERE, "Attempt to get name condition with illegal chars"); // NON-NLS
|
condition = new FilesSet.Rule.ExtensionCondition(this.nameTextField.getText());
|
||||||
throw new IllegalStateException("The files set rule panel name condition is not in a valid state"); // NON-NLS
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
logger.log(Level.SEVERE, "Attempt to get name condition with illegal chars"); // NON-NLS
|
||||||
|
throw new IllegalStateException("The files set rule panel name condition is not in a valid state"); // NON-NLS
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return condition;
|
return condition;
|
||||||
@ -443,11 +438,13 @@ final class FilesSetRulePanel extends javax.swing.JPanel {
|
|||||||
*/
|
*/
|
||||||
FilesSet.Rule.FileSizeCondition getFileSizeCondition() {
|
FilesSet.Rule.FileSizeCondition getFileSizeCondition() {
|
||||||
FilesSet.Rule.FileSizeCondition condition = null;
|
FilesSet.Rule.FileSizeCondition condition = null;
|
||||||
if ((Integer) this.fileSizeSpinner.getValue() != 0 || ((String)this.equalitySymbolComboBox.getSelectedItem()).equals("=")) {
|
if (this.fileSizeCheck.isSelected()) {
|
||||||
FilesSet.Rule.FileSizeCondition.COMPARATOR comparator = FilesSet.Rule.FileSizeCondition.COMPARATOR.fromSymbol((String) this.equalitySymbolComboBox.getSelectedItem());
|
if ((Integer) this.fileSizeSpinner.getValue() != 0 || ((String) this.equalitySymbolComboBox.getSelectedItem()).equals("=")) {
|
||||||
FilesSet.Rule.FileSizeCondition.SIZE_UNIT unit = FilesSet.Rule.FileSizeCondition.SIZE_UNIT.fromName((String) this.fileSizeComboBox.getSelectedItem());
|
FilesSet.Rule.FileSizeCondition.COMPARATOR comparator = FilesSet.Rule.FileSizeCondition.COMPARATOR.fromSymbol((String) this.equalitySymbolComboBox.getSelectedItem());
|
||||||
int fileSizeValue = (Integer) this.fileSizeSpinner.getValue();
|
FilesSet.Rule.FileSizeCondition.SIZE_UNIT unit = FilesSet.Rule.FileSizeCondition.SIZE_UNIT.fromName((String) this.fileSizeComboBox.getSelectedItem());
|
||||||
condition = new FilesSet.Rule.FileSizeCondition(comparator, unit, fileSizeValue);
|
int fileSizeValue = (Integer) this.fileSizeSpinner.getValue();
|
||||||
|
condition = new FilesSet.Rule.FileSizeCondition(comparator, unit, fileSizeValue);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return condition;
|
return condition;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user