Skip to content

Commit

Permalink
sepinf-inc#1631: fixes in dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
aberenguel committed Aug 13, 2024
1 parent 0139309 commit c9b0415
Showing 1 changed file with 27 additions and 24 deletions.
51 changes: 27 additions & 24 deletions iped-app/src/main/java/iped/app/ui/ResultTableListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ public void keyPressed(KeyEvent evt) {
}

private ProgressDialog createProgressDialog() {
ProgressDialog d = new ProgressDialog(App.get(), null, true, 200, Dialog.ModalityType.APPLICATION_MODAL);
ProgressDialog d = new ProgressDialog(App.get(), null, false, 200, Dialog.ModalityType.APPLICATION_MODAL);
d.setNote(Messages.getString("App.Wait")); //$NON-NLS-1$
return d;
}
Expand Down Expand Up @@ -367,6 +367,7 @@ public void itemSelectionAndParent(boolean value) {
BookmarksController.get().setMultiSetting(true);
App.get().resultsTable.setUpdateSelectionOnSort(false);
int[] selectedRows = App.get().resultsTable.getSelectedRows();
dialog.setMaximum(selectedRows.length);
for (int i = 0; i < selectedRows.length; i++) {
if (i == selectedRows.length - 1) {
BookmarksController.get().setMultiSetting(false);
Expand Down Expand Up @@ -399,6 +400,7 @@ public void itemSelectionAndReferences(boolean value) {
BookmarksController.get().setMultiSetting(true);
App.get().resultsTable.setUpdateSelectionOnSort(false);
int[] selectedRows = App.get().resultsTable.getSelectedRows();
dialog.setMaximum(selectedRows.length);
for (int i = 0; i < selectedRows.length; i++) {
if (i == selectedRows.length - 1) {
BookmarksController.get().setMultiSetting(false);
Expand Down Expand Up @@ -427,33 +429,34 @@ public void itemSelectionAndReferencedBy(boolean value) {
ProgressDialog dialog = createProgressDialog();
executor.execute(() -> {
try {
int col = App.get().resultsTable.convertColumnIndexToView(1);
BookmarksController.get().setMultiSetting(true);
App.get().resultsTable.setUpdateSelectionOnSort(false);
int[] selectedRows = App.get().resultsTable.getSelectedRows();
for (int i = 0; i < selectedRows.length; i++) {
if (i == selectedRows.length - 1) {
BookmarksController.get().setMultiSetting(false);
App.get().resultsTable.setUpdateSelectionOnSort(true);
}
App.get().resultsTable.setValueAt(value, selectedRows[i], col);
int col = App.get().resultsTable.convertColumnIndexToView(1);
BookmarksController.get().setMultiSetting(true);
App.get().resultsTable.setUpdateSelectionOnSort(false);
int[] selectedRows = App.get().resultsTable.getSelectedRows();
dialog.setMaximum(selectedRows.length);
for (int i = 0; i < selectedRows.length; i++) {
if (i == selectedRows.length - 1) {
BookmarksController.get().setMultiSetting(false);
App.get().resultsTable.setUpdateSelectionOnSort(true);
}
App.get().resultsTable.setValueAt(value, selectedRows[i], col);

int modelIndex = App.get().resultsTable.convertRowIndexToModel(selectedRows[i]);
selectReferencedByItems(value, App.get().ipedResult.getItem(modelIndex));
dialog.setProgress(i);
if (dialog.isCanceled()) {
return;
int modelIndex = App.get().resultsTable.convertRowIndexToModel(selectedRows[i]);
selectReferencedByItems(value, App.get().ipedResult.getItem(modelIndex));
dialog.setProgress(i);
if (dialog.isCanceled()) {
return;
}
}
} finally {
SwingUtilities.invokeLater(() -> {
dialog.close();
BookmarksController.get().updateUI();
App.get().subItemTable.repaint();
});
}
}
} finally {
SwingUtilities.invokeLater(() -> {
dialog.close();
BookmarksController.get().updateUI();
App.get().subItemTable.repaint();
});
}
});
}

/**
* Perform selection of all subitems
Expand Down

0 comments on commit c9b0415

Please sign in to comment.