mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 18:17:43 +00:00
started on issue #174. Changed Save button to OK button. Updated default db path. Use default db path in file chooser. Use default db dir in file chooser.
This commit is contained in:
parent
a8ec3ac499
commit
cc3d21c3ca
@ -41,7 +41,7 @@ public final class SqliteEamDbSettings {
|
|||||||
|
|
||||||
private final static Logger LOGGER = Logger.getLogger(SqliteEamDbSettings.class.getName());
|
private final static Logger LOGGER = Logger.getLogger(SqliteEamDbSettings.class.getName());
|
||||||
private final String DEFAULT_DBNAME = "EnterpriseArtifacts.db"; // NON-NLS
|
private final String DEFAULT_DBNAME = "EnterpriseArtifacts.db"; // NON-NLS
|
||||||
private final String DEFAULT_DBDIRECTORY = PlatformUtil.getUserDirectory() + File.separator + "Autopsy" + File.separator + "eamdb"; // NON-NLS
|
private final String DEFAULT_DBDIRECTORY = PlatformUtil.getUserDirectory() + File.separator + "enterprise_artifacts_manager"; // NON-NLS
|
||||||
private final int DEFAULT_BULK_THRESHHOLD = 1000;
|
private final int DEFAULT_BULK_THRESHHOLD = 1000;
|
||||||
private final String DEFAULT_BAD_TAGS = "Evidence"; // NON-NLS
|
private final String DEFAULT_BAD_TAGS = "Evidence"; // NON-NLS
|
||||||
private final String JDBC_DRIVER = "org.sqlite.JDBC"; // NON-NLS
|
private final String JDBC_DRIVER = "org.sqlite.JDBC"; // NON-NLS
|
||||||
|
@ -17,7 +17,6 @@ EamPostgresSettingsDialog.bnSave.text=Save
|
|||||||
EamPostgresSettingsDialog.lbHostName.text=Host Name / IP :
|
EamPostgresSettingsDialog.lbHostName.text=Host Name / IP :
|
||||||
EamPostgresSettingsDialog.bnTestConnection.text=Test Connection
|
EamPostgresSettingsDialog.bnTestConnection.text=Test Connection
|
||||||
EamPostgresSettingsDialog.lbDatabaseName.text=Database name :
|
EamPostgresSettingsDialog.lbDatabaseName.text=Database name :
|
||||||
EamSqliteSettingsDialog.bnSave.text=Save
|
|
||||||
EamSqliteSettingsDialog.bnCancel.text=Cancel
|
EamSqliteSettingsDialog.bnCancel.text=Cancel
|
||||||
EamSqliteSettingsDialog.lbTestDatabase.text=
|
EamSqliteSettingsDialog.lbTestDatabase.text=
|
||||||
EamSqliteSettingsDialog.bnTestDatabase.text=Test Connection
|
EamSqliteSettingsDialog.bnTestDatabase.text=Test Connection
|
||||||
@ -68,3 +67,4 @@ ManageArtifactTypesDialog.cancelButton.text=Cancel
|
|||||||
ManageArtifactTypesDialog.okButton.text=OK
|
ManageArtifactTypesDialog.okButton.text=OK
|
||||||
ManageArtifactTypesDialog.lbWarningMsg.text=Warning Message
|
ManageArtifactTypesDialog.lbWarningMsg.text=Warning Message
|
||||||
ManageArtifactTypesDialog.taInstructionsMsg.text=Select one or more artifact types to store in the database and use for correlation during Ingest.
|
ManageArtifactTypesDialog.taInstructionsMsg.text=Select one or more artifact types to store in the database and use for correlation during Ingest.
|
||||||
|
EamSqliteSettingsDialog.bnOk.text=OK
|
||||||
|
@ -91,7 +91,7 @@
|
|||||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||||
<Component id="lbTestDatabase" min="-2" pref="30" max="-2" attributes="0"/>
|
<Component id="lbTestDatabase" min="-2" pref="30" max="-2" attributes="0"/>
|
||||||
<EmptySpace max="32767" attributes="0"/>
|
<EmptySpace max="32767" attributes="0"/>
|
||||||
<Component id="bnSave" min="-2" max="-2" attributes="0"/>
|
<Component id="bnOk" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||||
<Component id="bnCancel" min="-2" max="-2" attributes="0"/>
|
<Component id="bnCancel" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
@ -116,7 +116,7 @@
|
|||||||
<EmptySpace min="-2" pref="19" max="-2" attributes="0"/>
|
<EmptySpace min="-2" pref="19" max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="3" attributes="0">
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
<Component id="bnCancel" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="bnCancel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="bnSave" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="bnOk" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
<Group type="102" alignment="0" attributes="0">
|
<Group type="102" alignment="0" attributes="0">
|
||||||
@ -198,14 +198,14 @@
|
|||||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="bnCancelActionPerformed"/>
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="bnCancelActionPerformed"/>
|
||||||
</Events>
|
</Events>
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JButton" name="bnSave">
|
<Component class="javax.swing.JButton" name="bnOk">
|
||||||
<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">
|
||||||
<ResourceString bundle="org/sleuthkit/autopsy/experimental/enterpriseartifactsmanager/optionspanel/Bundle.properties" key="EamSqliteSettingsDialog.bnSave.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
<ResourceString bundle="org/sleuthkit/autopsy/experimental/enterpriseartifactsmanager/optionspanel/Bundle.properties" key="EamSqliteSettingsDialog.bnOk.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="bnSaveActionPerformed"/>
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="bnOkActionPerformed"/>
|
||||||
</Events>
|
</Events>
|
||||||
</Component>
|
</Component>
|
||||||
</SubComponents>
|
</SubComponents>
|
||||||
|
@ -87,7 +87,7 @@ public class EamSqliteSettingsDialog extends javax.swing.JDialog {
|
|||||||
lbTestDatabaseWarning.setText("");
|
lbTestDatabaseWarning.setText("");
|
||||||
hasChanged = false;
|
hasChanged = false;
|
||||||
tfDatabasePath.getDocument().addDocumentListener(textBoxChangedListener);
|
tfDatabasePath.getDocument().addDocumentListener(textBoxChangedListener);
|
||||||
bnSave.setEnabled(false);
|
bnOk.setEnabled(false);
|
||||||
bnTestDatabase.setEnabled(false);
|
bnTestDatabase.setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -135,11 +135,11 @@ public class EamSqliteSettingsDialog extends javax.swing.JDialog {
|
|||||||
private boolean valid() {
|
private boolean valid() {
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
if (tfDatabasePath.getText().trim().isEmpty()) {
|
if (tfDatabasePath.getText().trim().isEmpty()) {
|
||||||
bnSave.setEnabled(false);
|
bnOk.setEnabled(false);
|
||||||
bnTestDatabase.setEnabled(false);
|
bnTestDatabase.setEnabled(false);
|
||||||
} else {
|
} else {
|
||||||
storeDbNameAndDirectory();
|
storeDbNameAndDirectory();
|
||||||
bnSave.setEnabled(true);
|
bnOk.setEnabled(true);
|
||||||
bnTestDatabase.setEnabled(true);
|
bnTestDatabase.setEnabled(true);
|
||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
@ -182,7 +182,7 @@ public class EamSqliteSettingsDialog extends javax.swing.JDialog {
|
|||||||
bnTestDatabase = new javax.swing.JButton();
|
bnTestDatabase = new javax.swing.JButton();
|
||||||
lbTestDatabase = new javax.swing.JLabel();
|
lbTestDatabase = new javax.swing.JLabel();
|
||||||
bnCancel = new javax.swing.JButton();
|
bnCancel = new javax.swing.JButton();
|
||||||
bnSave = new javax.swing.JButton();
|
bnOk = new javax.swing.JButton();
|
||||||
|
|
||||||
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
||||||
|
|
||||||
@ -218,10 +218,10 @@ public class EamSqliteSettingsDialog extends javax.swing.JDialog {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
org.openide.awt.Mnemonics.setLocalizedText(bnSave, org.openide.util.NbBundle.getMessage(EamSqliteSettingsDialog.class, "EamSqliteSettingsDialog.bnSave.text")); // NOI18N
|
org.openide.awt.Mnemonics.setLocalizedText(bnOk, org.openide.util.NbBundle.getMessage(EamSqliteSettingsDialog.class, "EamSqliteSettingsDialog.bnOk.text")); // NOI18N
|
||||||
bnSave.addActionListener(new java.awt.event.ActionListener() {
|
bnOk.addActionListener(new java.awt.event.ActionListener() {
|
||||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
bnSaveActionPerformed(evt);
|
bnOkActionPerformed(evt);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -247,7 +247,7 @@ public class EamSqliteSettingsDialog extends javax.swing.JDialog {
|
|||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||||
.addComponent(lbTestDatabase, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
|
.addComponent(lbTestDatabase, javax.swing.GroupLayout.PREFERRED_SIZE, 30, 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(bnSave)
|
.addComponent(bnOk)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||||
.addComponent(bnCancel)
|
.addComponent(bnCancel)
|
||||||
.addContainerGap())))
|
.addContainerGap())))
|
||||||
@ -267,7 +267,7 @@ public class EamSqliteSettingsDialog extends javax.swing.JDialog {
|
|||||||
.addGap(19, 19, 19)
|
.addGap(19, 19, 19)
|
||||||
.addGroup(pnContentLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
.addGroup(pnContentLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
.addComponent(bnCancel)
|
.addComponent(bnCancel)
|
||||||
.addComponent(bnSave)))
|
.addComponent(bnOk)))
|
||||||
.addGroup(pnContentLayout.createSequentialGroup()
|
.addGroup(pnContentLayout.createSequentialGroup()
|
||||||
.addGap(18, 18, 18)
|
.addGap(18, 18, 18)
|
||||||
.addGroup(pnContentLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
.addGroup(pnContentLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
@ -311,11 +311,15 @@ public class EamSqliteSettingsDialog extends javax.swing.JDialog {
|
|||||||
|
|
||||||
@Messages({"EnterpriseArtifactsManagerSQLiteSettingsDialog.chooserPath.failedToGetDbPathMsg=Selected database path is invalid. Try again."})
|
@Messages({"EnterpriseArtifactsManagerSQLiteSettingsDialog.chooserPath.failedToGetDbPathMsg=Selected database path is invalid. Try again."})
|
||||||
private void bnDatabasePathFileOpenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnDatabasePathFileOpenActionPerformed
|
private void bnDatabasePathFileOpenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnDatabasePathFileOpenActionPerformed
|
||||||
|
fcDatabasePath.setCurrentDirectory(new File(dbSettings.getDbDirectory()));
|
||||||
|
fcDatabasePath.setSelectedFile(new File(dbSettings.getFileNameWithPath()));
|
||||||
if (fcDatabasePath.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
|
if (fcDatabasePath.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
|
||||||
File databaseFile = fcDatabasePath.getSelectedFile();
|
File databaseFile = fcDatabasePath.getSelectedFile();
|
||||||
try {
|
try {
|
||||||
tfDatabasePath.setText(databaseFile.getCanonicalPath());
|
tfDatabasePath.setText(databaseFile.getCanonicalPath());
|
||||||
valid();
|
valid();
|
||||||
|
// TODO: create the db/schema if it doesn't exist.
|
||||||
|
// TODO: set variable noting that we created a new db, so it can be removed if Cancel button is clicked.
|
||||||
|
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
LOGGER.log(Level.SEVERE, "Failed to get path of selected database file", ex); // NON-NLS
|
LOGGER.log(Level.SEVERE, "Failed to get path of selected database file", ex); // NON-NLS
|
||||||
@ -339,20 +343,21 @@ public class EamSqliteSettingsDialog extends javax.swing.JDialog {
|
|||||||
}//GEN-LAST:event_bnTestDatabaseActionPerformed
|
}//GEN-LAST:event_bnTestDatabaseActionPerformed
|
||||||
|
|
||||||
private void bnCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnCancelActionPerformed
|
private void bnCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnCancelActionPerformed
|
||||||
|
// TODO: if a new db was created, then delete it. update settings to disable this platform
|
||||||
dispose();
|
dispose();
|
||||||
}//GEN-LAST:event_bnCancelActionPerformed
|
}//GEN-LAST:event_bnCancelActionPerformed
|
||||||
|
|
||||||
private void bnSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnSaveActionPerformed
|
private void bnOkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnOkActionPerformed
|
||||||
hasChanged = true;
|
hasChanged = true;
|
||||||
dbSettings.setEnabled(true);
|
dbSettings.setEnabled(true);
|
||||||
dbSettings.saveSettings();
|
dbSettings.saveSettings();
|
||||||
dispose();
|
dispose();
|
||||||
}//GEN-LAST:event_bnSaveActionPerformed
|
}//GEN-LAST:event_bnOkActionPerformed
|
||||||
|
|
||||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
private javax.swing.JButton bnCancel;
|
private javax.swing.JButton bnCancel;
|
||||||
private javax.swing.JButton bnDatabasePathFileOpen;
|
private javax.swing.JButton bnDatabasePathFileOpen;
|
||||||
private javax.swing.JButton bnSave;
|
private javax.swing.JButton bnOk;
|
||||||
private javax.swing.JButton bnTestDatabase;
|
private javax.swing.JButton bnTestDatabase;
|
||||||
private javax.swing.JFileChooser fcDatabasePath;
|
private javax.swing.JFileChooser fcDatabasePath;
|
||||||
private javax.swing.JScrollPane jScrollPane;
|
private javax.swing.JScrollPane jScrollPane;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user