mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 18:17:43 +00:00
6451: Do not search for personas, if Central Repo is disabled.
This commit is contained in:
parent
747fa34ed9
commit
bc10b2657a
@ -976,7 +976,7 @@ MessageArtifactViewer.rtfbodyScrollPane.TabConstraints.tabTitle=RTF
|
||||
MessageArtifactViewer.toText.text=to list goes here
|
||||
MessageArtifactViewer.toLabel.text=To:
|
||||
MessageArtifactViewer.htmlPane.TabConstraints.tabTitle=HTML
|
||||
CallLogArtifactViewer.localAccountPersonaLabel.text=Persona:
|
||||
CallLogArtifactViewer.localAccountPersonaLabel.text=Persona
|
||||
CallLogArtifactViewer.localAccountPersonaNameLabel.text=jLabel1
|
||||
CallLogArtifactViewer.localAccountPersonaButton.text=jButton1
|
||||
ContactArtifactViewer.personasLabel.text=Personas
|
||||
|
@ -454,11 +454,8 @@ public class CallLogArtifactViewer extends javax.swing.JPanel implements Artifac
|
||||
if (callLogViewData.getLocalAccountId() != null) {
|
||||
localAccountIdLabel.setText(callLogViewData.getLocalAccountId());
|
||||
|
||||
// kick off a task to find the persona for this account
|
||||
PersonaSearcherTask task = new PersonaSearcherTask(new AccountPersonaSearcherData(callLogViewData.getLocalAccountId(), localAccountPersonaNameLabel, localAccountPersonaButton));
|
||||
personaSearchtasks.add(task);
|
||||
personatasksExecutor.submit(task);
|
||||
|
||||
// Get the persona for the local account.
|
||||
getPersona(new AccountPersonaSearcherData(callLogViewData.getLocalAccountId(), localAccountPersonaNameLabel, localAccountPersonaButton));
|
||||
} else {
|
||||
// no local account info, hide all fields.
|
||||
localAccountLabel.setVisible(false);
|
||||
@ -470,6 +467,35 @@ public class CallLogArtifactViewer extends javax.swing.JPanel implements Artifac
|
||||
}
|
||||
}
|
||||
|
||||
@NbBundle.Messages({
|
||||
"CallLogArtifactViewer_crdisbaled_persona_label=Unknown",
|
||||
"CallLogArtifactViewer_crdisbaled_persona_button_text=Create"
|
||||
})
|
||||
|
||||
/**
|
||||
* Gets the persona for the account specified. The persona name and button are
|
||||
* updated when the persona is retrieved.
|
||||
*
|
||||
* If CentralRepo is disabled, it disables the persona name & button.
|
||||
*
|
||||
* @param personaSearcherData Persona search data.
|
||||
*
|
||||
*/
|
||||
private void getPersona(AccountPersonaSearcherData personaSearcherData) {
|
||||
|
||||
if (CentralRepository.isEnabled()) {
|
||||
PersonaSearcherTask task = new PersonaSearcherTask(personaSearcherData);
|
||||
personaSearchtasks.add(task);
|
||||
personatasksExecutor.submit(task);
|
||||
} else {
|
||||
personaSearcherData.getPersonaNameLabel().setText(Bundle.CallLogArtifactViewer_crdisbaled_persona_label());
|
||||
personaSearcherData.getPersonaNameLabel().setEnabled(false);
|
||||
|
||||
personaSearcherData.getPersonaActionButton().setText(Bundle.CallLogArtifactViewer_crdisbaled_persona_button_text());
|
||||
personaSearcherData.getPersonaActionButton().setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the Call participants panel.
|
||||
*
|
||||
@ -575,13 +601,10 @@ public class CallLogArtifactViewer extends javax.swing.JPanel implements Artifac
|
||||
|
||||
constraints.insets = new java.awt.Insets(TOP_INSET, 0, 0, 0);
|
||||
|
||||
// Kick off a background thread to search for the persona
|
||||
// for this particpant account.
|
||||
PersonaSearcherTask task = new PersonaSearcherTask(new AccountPersonaSearcherData(accountIdentifier, participantPersonaNameLabel, personaButton));
|
||||
personaSearchtasks.add(task);
|
||||
personatasksExecutor.submit(task);
|
||||
// Get the persona for this party, and update the persona name & button.
|
||||
getPersona(new AccountPersonaSearcherData(accountIdentifier, participantPersonaNameLabel, personaButton));
|
||||
|
||||
// add a filler to take up rest of the space
|
||||
// Add a filler to take up rest of the space
|
||||
constraints.gridx++;
|
||||
constraints.weightx = 1.0;
|
||||
constraints.fill = GridBagConstraints.HORIZONTAL;
|
||||
|
@ -42,6 +42,7 @@ import javax.swing.SwingWorker;
|
||||
import org.openide.util.NbBundle;
|
||||
import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoAccount;
|
||||
import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoException;
|
||||
import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository;
|
||||
import org.sleuthkit.autopsy.centralrepository.datamodel.Persona;
|
||||
import org.sleuthkit.autopsy.centralrepository.datamodel.PersonaAccount;
|
||||
import org.sleuthkit.autopsy.centralrepository.persona.PersonaDetailsDialog;
|
||||
@ -424,12 +425,17 @@ public class ContactArtifactViewer extends javax.swing.JPanel implements Artifac
|
||||
* @throws CentralRepoException
|
||||
*/
|
||||
@NbBundle.Messages({
|
||||
"ContactArtifactViewer_persona_searching= Searching..."
|
||||
"ContactArtifactViewer_persona_searching= Searching...",
|
||||
"ContactArtifactViewer_persona_unknown=Unknown"
|
||||
})
|
||||
private void initiatePersonasSearch(List<BlackboardAttribute> accountAttributesList) throws CentralRepoException {
|
||||
|
||||
personasLabel.setVisible(true);
|
||||
|
||||
String personaStatusLabelText = CentralRepository.isEnabled()
|
||||
? Bundle.ContactArtifactViewer_persona_searching()
|
||||
: Bundle.ContactArtifactViewer_persona_unknown();
|
||||
|
||||
// create a gridbag layout to show each participant on one line
|
||||
GridBagLayout gridBagLayout = new GridBagLayout();
|
||||
GridBagConstraints constraints = new GridBagConstraints();
|
||||
@ -451,19 +457,27 @@ public class ContactArtifactViewer extends javax.swing.JPanel implements Artifac
|
||||
personasPanel.add(personaLabel);
|
||||
|
||||
constraints.gridy++;
|
||||
javax.swing.JLabel primaryPersonaNameLabel = new javax.swing.JLabel();
|
||||
primaryPersonaNameLabel.setText(Bundle.ContactArtifactViewer_persona_searching());
|
||||
gridBagLayout.setConstraints(primaryPersonaNameLabel, constraints);
|
||||
personasPanel.add(primaryPersonaNameLabel);
|
||||
javax.swing.JLabel personaStatusLabel = new javax.swing.JLabel();
|
||||
personaStatusLabel.setText(personaStatusLabelText);
|
||||
gridBagLayout.setConstraints(personaStatusLabel, constraints);
|
||||
personasPanel.add(personaStatusLabel);
|
||||
|
||||
personasPanel.setLayout(gridBagLayout);
|
||||
personasPanel.revalidate();
|
||||
personasPanel.repaint();
|
||||
|
||||
if (CentralRepository.isEnabled() ) {
|
||||
personasLabel.setEnabled(true);
|
||||
|
||||
// Kick off a background task to serach for personas for the contact
|
||||
ContactPersonaSearcherTask personaSearchTask = new ContactPersonaSearcherTask(accountAttributesList);
|
||||
personaSearchTask.execute();
|
||||
} else {
|
||||
personasLabel.setEnabled(false);
|
||||
personaLabel.setEnabled(false);
|
||||
personaStatusLabel.setEnabled(false);
|
||||
}
|
||||
|
||||
personasPanel.setLayout(gridBagLayout);
|
||||
personasPanel.revalidate();
|
||||
personasPanel.repaint();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user