mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-13 00:16:16 +00:00
Fixed persona error message dialog
This commit is contained in:
parent
7bcc40330f
commit
9ab0a5d2b4
@ -586,6 +586,7 @@ final class MessageAccountPanel extends JPanel {
|
|||||||
// Set up each matching account. We don't know what type of account we have, so check all the types to
|
// Set up each matching account. We don't know what type of account we have, so check all the types to
|
||||||
// find any matches.
|
// find any matches.
|
||||||
try {
|
try {
|
||||||
|
boolean showErrorMessage = true;
|
||||||
for (CentralRepoAccount.CentralRepoAccountType type : CentralRepository.getInstance().getAllAccountTypes()) {
|
for (CentralRepoAccount.CentralRepoAccountType type : CentralRepository.getInstance().getAllAccountTypes()) {
|
||||||
try {
|
try {
|
||||||
// Try to load any matching accounts of this type. Throws an InvalidAccountIDException if the account is the
|
// Try to load any matching accounts of this type. Throws an InvalidAccountIDException if the account is the
|
||||||
@ -593,13 +594,15 @@ final class MessageAccountPanel extends JPanel {
|
|||||||
CentralRepoAccount account = CentralRepository.getInstance().getAccount(type, accountContainer.getAccount().getTypeSpecificID());
|
CentralRepoAccount account = CentralRepository.getInstance().getAccount(type, accountContainer.getAccount().getTypeSpecificID());
|
||||||
if (account != null) {
|
if (account != null) {
|
||||||
personaPanel.addAccount(account, Bundle.MessageAccountPanel_account_justification(), Persona.Confidence.HIGH);
|
personaPanel.addAccount(account, Bundle.MessageAccountPanel_account_justification(), Persona.Confidence.HIGH);
|
||||||
} else {
|
showErrorMessage = false;
|
||||||
createPersonaDialog.setStartupPopupMessage(Bundle.MessageAccountPanel_id_not_found_in_cr(accountContainer.getAccount().getTypeSpecificID()));
|
}
|
||||||
}
|
|
||||||
} catch (InvalidAccountIDException ex2) {
|
} catch (InvalidAccountIDException ex2) {
|
||||||
// These are expected when the account identifier doesn't match the format of the account type.
|
// These are expected when the account identifier doesn't match the format of the account type.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(showErrorMessage) {
|
||||||
|
createPersonaDialog.setStartupPopupMessage(Bundle.MessageAccountPanel_id_not_found_in_cr(accountContainer.getAccount().getTypeSpecificID()));
|
||||||
|
}
|
||||||
} catch (CentralRepoException ex) {
|
} catch (CentralRepoException ex) {
|
||||||
logger.log(Level.SEVERE, "Error looking up account types in the central repository", ex);
|
logger.log(Level.SEVERE, "Error looking up account types in the central repository", ex);
|
||||||
}
|
}
|
||||||
|
@ -200,6 +200,7 @@ class PersonaAccountFetcher extends SwingWorker<Map<String, Collection<Persona>>
|
|||||||
// Set up each matching account. We don't know what type of account we have, so check all the types to
|
// Set up each matching account. We don't know what type of account we have, so check all the types to
|
||||||
// find any matches.
|
// find any matches.
|
||||||
try {
|
try {
|
||||||
|
boolean showErrorMessage = true;
|
||||||
for (CentralRepoAccount.CentralRepoAccountType type : CentralRepository.getInstance().getAllAccountTypes()) {
|
for (CentralRepoAccount.CentralRepoAccountType type : CentralRepository.getInstance().getAllAccountTypes()) {
|
||||||
try {
|
try {
|
||||||
// Try to load any matching accounts of this type. Throws an InvalidAccountIDException if the account is the
|
// Try to load any matching accounts of this type. Throws an InvalidAccountIDException if the account is the
|
||||||
@ -207,16 +208,17 @@ class PersonaAccountFetcher extends SwingWorker<Map<String, Collection<Persona>>
|
|||||||
CentralRepoAccount account = CentralRepository.getInstance().getAccount(type, personaSearcherData.getAccountIdentifer());
|
CentralRepoAccount account = CentralRepository.getInstance().getAccount(type, personaSearcherData.getAccountIdentifer());
|
||||||
if (account != null) {
|
if (account != null) {
|
||||||
personaPanel.addAccount(account, Bundle.PersonaAccountFetcher_account_justification(), Persona.Confidence.HIGH);
|
personaPanel.addAccount(account, Bundle.PersonaAccountFetcher_account_justification(), Persona.Confidence.HIGH);
|
||||||
|
showErrorMessage = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((personaSearcherData.getAccountIdentifer() != null &&
|
|
||||||
!personaSearcherData.getAccountIdentifer().isEmpty()) && account == null) {
|
|
||||||
dialog.setStartupPopupMessage(Bundle.PersonaAccountFetcher_not_account_in_cr(personaSearcherData.getAccountIdentifer()));
|
|
||||||
}
|
|
||||||
} catch (InvalidAccountIDException ex2) {
|
} catch (InvalidAccountIDException ex2) {
|
||||||
// These are expected when the account identifier doesn't match the format of the account type.
|
// These are expected when the account identifier doesn't match the format of the account type.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ((personaSearcherData.getAccountIdentifer() != null
|
||||||
|
&& !personaSearcherData.getAccountIdentifer().isEmpty()) && showErrorMessage) {
|
||||||
|
dialog.setStartupPopupMessage(Bundle.PersonaAccountFetcher_not_account_in_cr(personaSearcherData.getAccountIdentifer()));
|
||||||
|
}
|
||||||
} catch (CentralRepoException ex) {
|
} catch (CentralRepoException ex) {
|
||||||
logger.log(Level.SEVERE, "Error looking up account types in the central repository", ex);
|
logger.log(Level.SEVERE, "Error looking up account types in the central repository", ex);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user