mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 18:17:43 +00:00
2284 Functioning Copy button
This commit is contained in:
parent
12a98a795f
commit
a647c0bf5c
@ -391,30 +391,29 @@ public final class FilesSetDefsPanel extends IngestModuleGlobalSettingsPanel imp
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
private void doCopyFileSetsDialog(FilesSet selectedSet) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display an interesting files set definition panel in a dialog box and
|
* Display an interesting files set definition panel in a dialog box and
|
||||||
* respond to user interactions with the dialog.
|
* respond to user interactions with the dialog.
|
||||||
*
|
*
|
||||||
* @param selectedSet The currently selected files set, may be null to
|
* @param selectedSet The currently selected files set, may be null to
|
||||||
* indicate a new interesting files set definition is to
|
* indicate a new interesting files set definition is
|
||||||
* be created.
|
* to be created.
|
||||||
|
* @param shouldCreateNew Wether this should be creating a new set or
|
||||||
|
* replacing the selectedSet. False for edit, true
|
||||||
|
* for copy or new.
|
||||||
*/
|
*/
|
||||||
private void doFileSetsDialog(FilesSet selectedSet) {
|
private void doFileSetsDialog(FilesSet selectedSet, boolean shouldCreateNew) {
|
||||||
// Create a files set defintion panle.
|
// Create a files set defintion panle.
|
||||||
FilesSetPanel panel;
|
FilesSetPanel panel;
|
||||||
if (selectedSet != null) {
|
if (selectedSet != null) {
|
||||||
// Editing an existing set definition.
|
// Editing an existing set definition.
|
||||||
panel = new FilesSetPanel(selectedSet, panelType);
|
panel = new FilesSetPanel(selectedSet, panelType);
|
||||||
} else {
|
} else {
|
||||||
// Creating a new set definition.
|
// Creating a new set definition.
|
||||||
panel = new FilesSetPanel(panelType);
|
panel = new FilesSetPanel(panelType);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do a dialog box with the files set panel until the user either enters
|
// Do a dialog box with the files set panel until the user either enters
|
||||||
// a valid definition or cancels. Note that the panel gives the user
|
// a valid definition or cancels. Note that the panel gives the user
|
||||||
// feedback when isValidDefinition() is called.
|
// feedback when isValidDefinition() is called.
|
||||||
@ -425,7 +424,7 @@ public final class FilesSetDefsPanel extends IngestModuleGlobalSettingsPanel imp
|
|||||||
|
|
||||||
// While adding new ruleset(selectedSet == null), if rule set with same name already exists, do not add to the filesSets hashMap.
|
// While adding new ruleset(selectedSet == null), if rule set with same name already exists, do not add to the filesSets hashMap.
|
||||||
// In case of editing an existing ruleset(selectedSet != null), following check is not performed.
|
// In case of editing an existing ruleset(selectedSet != null), following check is not performed.
|
||||||
if (this.filesSets.containsKey(panel.getFilesSetName()) && selectedSet == null) {
|
if (this.filesSets.containsKey(panel.getFilesSetName()) && shouldCreateNew ) {
|
||||||
MessageNotifyUtil.Message.error(NbBundle.getMessage(this.getClass(),
|
MessageNotifyUtil.Message.error(NbBundle.getMessage(this.getClass(),
|
||||||
"FilesSetDefsPanel.doFileSetsDialog.duplicateRuleSet.text",
|
"FilesSetDefsPanel.doFileSetsDialog.duplicateRuleSet.text",
|
||||||
panel.getFilesSetName()));
|
panel.getFilesSetName()));
|
||||||
@ -440,7 +439,11 @@ public final class FilesSetDefsPanel extends IngestModuleGlobalSettingsPanel imp
|
|||||||
// Preserve the existing rules from the set being edited.
|
// Preserve the existing rules from the set being edited.
|
||||||
rules.putAll(selectedSet.getRules());
|
rules.putAll(selectedSet.getRules());
|
||||||
}
|
}
|
||||||
this.replaceFilesSet(selectedSet, panel.getFilesSetName(), panel.getFilesSetDescription(), panel.getFileSetIgnoresKnownFiles(), panel.getFileSetIgnoresUnallocatedSpace(), rules);
|
if (shouldCreateNew) {
|
||||||
|
this.replaceFilesSet(null, panel.getFilesSetName(), panel.getFilesSetDescription(), panel.getFileSetIgnoresKnownFiles(), panel.getFileSetIgnoresUnallocatedSpace(), rules);
|
||||||
|
} else {
|
||||||
|
this.replaceFilesSet(selectedSet, panel.getFilesSetName(), panel.getFilesSetDescription(), panel.getFileSetIgnoresKnownFiles(), panel.getFileSetIgnoresUnallocatedSpace(), rules);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1001,7 +1004,7 @@ public final class FilesSetDefsPanel extends IngestModuleGlobalSettingsPanel imp
|
|||||||
}// </editor-fold>//GEN-END:initComponents
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
private void newSetButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newSetButtonActionPerformed
|
private void newSetButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newSetButtonActionPerformed
|
||||||
this.doFileSetsDialog(null);
|
this.doFileSetsDialog(null, true);
|
||||||
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||||
}//GEN-LAST:event_newSetButtonActionPerformed
|
}//GEN-LAST:event_newSetButtonActionPerformed
|
||||||
|
|
||||||
@ -1049,7 +1052,7 @@ public final class FilesSetDefsPanel extends IngestModuleGlobalSettingsPanel imp
|
|||||||
}//GEN-LAST:event_deleteSetButtonActionPerformed
|
}//GEN-LAST:event_deleteSetButtonActionPerformed
|
||||||
|
|
||||||
private void editSetButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editSetButtonActionPerformed
|
private void editSetButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editSetButtonActionPerformed
|
||||||
this.doFileSetsDialog(this.setsList.getSelectedValue());
|
this.doFileSetsDialog(this.setsList.getSelectedValue(), false);
|
||||||
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||||
}//GEN-LAST:event_editSetButtonActionPerformed
|
}//GEN-LAST:event_editSetButtonActionPerformed
|
||||||
|
|
||||||
@ -1064,7 +1067,7 @@ public final class FilesSetDefsPanel extends IngestModuleGlobalSettingsPanel imp
|
|||||||
}//GEN-LAST:event_newRuleButtonActionPerformed
|
}//GEN-LAST:event_newRuleButtonActionPerformed
|
||||||
|
|
||||||
private void copySetButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_copySetButtonActionPerformed
|
private void copySetButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_copySetButtonActionPerformed
|
||||||
// TODO add your handling code here:
|
this.doFileSetsDialog(this.setsList.getSelectedValue(), true);
|
||||||
}//GEN-LAST:event_copySetButtonActionPerformed
|
}//GEN-LAST:event_copySetButtonActionPerformed
|
||||||
|
|
||||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
|
@ -117,7 +117,7 @@ public class FilesSetPanel extends javax.swing.JPanel {
|
|||||||
String returnValue = this.nameTextField.getText();
|
String returnValue = this.nameTextField.getText();
|
||||||
return returnValue;
|
return returnValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the description for the interesting files set defined using this
|
* Get the description for the interesting files set defined using this
|
||||||
* panel.
|
* panel.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user