sepinf-inc / IPED

IPED Digital Forensic Tool. It is an open source software that can be used to process and analyze digital evidence, often seized at crime scenes by law enforcement or in a corporate investigation by private examiners.
Other
941 stars 218 forks source link

"Wait..." dialog hidden behind main window #1413

Closed wladimirleite closed 1 year ago

wladimirleite commented 1 year ago

Just a minor detail, when opening a large case (or from a slow location), I noticed that the "Wait..." undecorated dialog sometimes is not visible because it is shown as another window. In Windows it is possible to switch between the dialog and the main analysis window using ALT+TAB.

I think it would be better to make the "wait dialog":

  1. Child of the main window.
  2. Always application modal.

I guess the first was the intended behavior, as when it is created an owner window is assigned (line below). But at this point SwingUtilities.windowForComponent(resultsTable) is null, so it is not working.

https://github.com/sepinf-inc/IPED/blob/22a1c38c6e38562b2d8751e3ce57d36338ff8934/iped-app/src/main/java/iped/app/ui/App.java#L735

About the modality, as this dialog is shown during operations that need to be waited and can't be cancelled, making it application modal seems better, unless there are some situation I am missing.

lfcnassif commented 1 year ago

I noticed this some days ago. I agree on both points, thank you!

lfcnassif commented 1 year ago

Closed by #1414

lfcnassif commented 1 year ago

I just remembered about a very rare issue (maybe fixed today) with the Metadata filtering panel where it sometimes throws an exception and skips the progress dialog.setVisible(false). Hitting the panel refresh button used to close the dialog, but with a modal Dialog that could freeze the UI. Maybe we should review the Dialog usage through the code to protect against this, e.g. putting the close in a finally block, when possible.

wladimirleite commented 1 year ago

I just remembered about a very rare issue (maybe fixed today) with the Metadata filtering panel where it sometimes throws an exception and skips the progress dialog.setVisible(false). Hitting the panel refresh button used to close the dialog, but with a modal Dialog that could freeze the UI. Maybe we should review the Dialog usage through the code to protect against this, e.g. putting the close in a finally block, when possible.

Makes sense! I will take a look on that.

wladimirleite commented 1 year ago

Although making the wait dialog model seems the correct approach, the PR #1414 had some flaws regarding the Metadata panel. I fixed the issues here, and it seems fine now. I am testing a bit more here and will submit a new PR when I am done. Sorry about that, @lfcnassif!

lfcnassif commented 1 year ago

Don't worry and thank you! I should have tested better before merging.

wladimirleite commented 1 year ago

Processing forensic images from a case I am working on with the master branch, I detected yet another undesired side effect of making the "wait dialog" (dialogBar in the code) application modal. When the analysis UI is opened from the processing UI, to preview the case, while "wait..." is visible, the processing UI is blocked, which is inconvenient. So I will submit a (hopefully final) PR, making that dialog "document modal", so it blocks only controls under the same main "root" window.

lfcnassif commented 1 year ago

Closed by #1422