mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-19 19:14:55 +00:00
2153: Restart message is needed while Auto Ingest options changes and switch between standalone and Join AutoIngest cluster
This commit is contained in:
parent
a5902d50f5
commit
88af9d19fb
@ -204,6 +204,18 @@ public class AutoIngestSettingsPanel extends javax.swing.JPanel {
|
|||||||
* Save mode to persistent storage.
|
* Save mode to persistent storage.
|
||||||
*/
|
*/
|
||||||
void store() {
|
void store() {
|
||||||
|
boolean needsRestart = false;
|
||||||
|
AutoIngestUserPreferences.SelectedMode storedMode = AutoIngestUserPreferences.getMode();
|
||||||
|
|
||||||
|
if (AutoIngestUserPreferences.getJoinAutoModeCluster() != cbJoinAutoIngestCluster.isSelected()) {
|
||||||
|
SwingUtilities.invokeLater(() -> {
|
||||||
|
JOptionPane.showMessageDialog(null,
|
||||||
|
NbBundle.getMessage(AutoIngestSettingsPanel.class, "AutoIngestSettingsPanel.MustRestart"),
|
||||||
|
NbBundle.getMessage(AutoIngestSettingsPanel.class, "AutoIngestSettingsPanel.restartRequiredLabel.text"),
|
||||||
|
JOptionPane.WARNING_MESSAGE);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
AutoIngestUserPreferences.setJoinAutoModeCluster(cbJoinAutoIngestCluster.isSelected());
|
AutoIngestUserPreferences.setJoinAutoModeCluster(cbJoinAutoIngestCluster.isSelected());
|
||||||
if (!cbJoinAutoIngestCluster.isSelected()) {
|
if (!cbJoinAutoIngestCluster.isSelected()) {
|
||||||
AutoIngestUserPreferences.setMode(AutoIngestUserPreferences.SelectedMode.STANDALONE);
|
AutoIngestUserPreferences.setMode(AutoIngestUserPreferences.SelectedMode.STANDALONE);
|
||||||
@ -211,22 +223,16 @@ public class AutoIngestSettingsPanel extends javax.swing.JPanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (jRadioButtonAutomated.isSelected()) {
|
if (jRadioButtonAutomated.isSelected()) {
|
||||||
boolean needsSaving = false;
|
if (storedMode != AutoIngestUserPreferences.SelectedMode.AUTOMATED) {
|
||||||
|
needsRestart = true;
|
||||||
|
}
|
||||||
String thePath = AutoIngestUserPreferences.getAutoModeImageFolder();
|
String thePath = AutoIngestUserPreferences.getAutoModeImageFolder();
|
||||||
if (thePath != null && 0 != inputPathTextField.getText().compareTo(thePath)) {
|
if (thePath != null && 0 != inputPathTextField.getText().compareTo(thePath)) {
|
||||||
needsSaving = true;
|
needsRestart = true;
|
||||||
}
|
}
|
||||||
thePath = AutoIngestUserPreferences.getAutoModeResultsFolder();
|
thePath = AutoIngestUserPreferences.getAutoModeResultsFolder();
|
||||||
if (thePath != null && 0 != outputPathTextField.getText().compareTo(thePath)) {
|
if (thePath != null && 0 != outputPathTextField.getText().compareTo(thePath)) {
|
||||||
needsSaving = true;
|
needsRestart = true;
|
||||||
}
|
|
||||||
if (needsSaving) {
|
|
||||||
SwingUtilities.invokeLater(() -> {
|
|
||||||
JOptionPane.showMessageDialog(null,
|
|
||||||
NbBundle.getMessage(AutoIngestSettingsPanel.class, "AutoIngestSettingsPanel.MustRestart"),
|
|
||||||
NbBundle.getMessage(AutoIngestSettingsPanel.class, "AutoIngestSettingsPanel.restartRequiredLabel.text"),
|
|
||||||
JOptionPane.WARNING_MESSAGE);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AutoIngestUserPreferences.setMode(AutoIngestUserPreferences.SelectedMode.AUTOMATED);
|
AutoIngestUserPreferences.setMode(AutoIngestUserPreferences.SelectedMode.AUTOMATED);
|
||||||
@ -241,8 +247,19 @@ public class AutoIngestSettingsPanel extends javax.swing.JPanel {
|
|||||||
AutoIngestUserPreferences.setSharedConfigMaster(masterNodeCheckBox.isSelected());
|
AutoIngestUserPreferences.setSharedConfigMaster(masterNodeCheckBox.isSelected());
|
||||||
}
|
}
|
||||||
} else if (jRadioButtonReview.isSelected()) {
|
} else if (jRadioButtonReview.isSelected()) {
|
||||||
|
if (storedMode != AutoIngestUserPreferences.SelectedMode.REVIEW) {
|
||||||
|
needsRestart = true;
|
||||||
|
}
|
||||||
String thePath = AutoIngestUserPreferences.getAutoModeResultsFolder();
|
String thePath = AutoIngestUserPreferences.getAutoModeResultsFolder();
|
||||||
if (thePath != null && 0 != outputPathTextField.getText().compareTo(thePath)) {
|
if (thePath != null && 0 != outputPathTextField.getText().compareTo(thePath)) {
|
||||||
|
needsRestart = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
AutoIngestUserPreferences.setMode(AutoIngestUserPreferences.SelectedMode.REVIEW);
|
||||||
|
String resultsFolderPath = getNormalizedFolderPath(outputPathTextField.getText().trim());
|
||||||
|
AutoIngestUserPreferences.setAutoModeResultsFolder(resultsFolderPath);
|
||||||
|
}
|
||||||
|
if (needsRestart) {
|
||||||
SwingUtilities.invokeLater(() -> {
|
SwingUtilities.invokeLater(() -> {
|
||||||
JOptionPane.showMessageDialog(null,
|
JOptionPane.showMessageDialog(null,
|
||||||
NbBundle.getMessage(AutoIngestSettingsPanel.class, "AutoIngestSettingsPanel.MustRestart"),
|
NbBundle.getMessage(AutoIngestSettingsPanel.class, "AutoIngestSettingsPanel.MustRestart"),
|
||||||
@ -251,10 +268,6 @@ public class AutoIngestSettingsPanel extends javax.swing.JPanel {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
AutoIngestUserPreferences.setMode(AutoIngestUserPreferences.SelectedMode.REVIEW);
|
|
||||||
String resultsFolderPath = getNormalizedFolderPath(outputPathTextField.getText().trim());
|
|
||||||
AutoIngestUserPreferences.setAutoModeResultsFolder(resultsFolderPath);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void validateSettings() {
|
void validateSettings() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user