diff options
author | Thomas Wolf | 2016-04-05 22:13:28 +0000 |
---|---|---|
committer | Thomas Wolf | 2016-04-05 22:13:28 +0000 |
commit | fbe70bcf1fb6dfd0fbb661653d625de78e0698eb (patch) | |
tree | 8de7005f39089cbadfbd21c73ccb18e444b0e86a /org.eclipse.egit.ui | |
parent | 3a1e0791f4066352f594b0b85201546943683fdb (diff) | |
download | egit-fbe70bcf1fb6dfd0fbb661653d625de78e0698eb.tar.gz egit-fbe70bcf1fb6dfd0fbb661653d625de78e0698eb.tar.xz egit-fbe70bcf1fb6dfd0fbb661653d625de78e0698eb.zip |
For asynchronous dialogs, use the topmost modal shell
Push and fetch results are shown in dialogs that
* are shown asynchronously, and
* moreover are triggered from inside jobs.
I don't like jobs throwing dialogs at the user anyway, but I can see
the desire here to run the potentially long remote operation in a job.
Still, the PushToGerritPage does it without job...
At the very least, such asynchronous dialogs, whether or not they
themselves are modal, must use the topmost modal shell as parent. Using
a parent, like the active window's shell, that already has a modal
child may lock up the application.
Bug: 487209
Change-Id: I460e625051e48ecedab0db7191a6dd8846dacc7d
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.egit.ui')
-rw-r--r-- | org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchResultDialog.java | 19 | ||||
-rw-r--r-- | org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushResultDialog.java | 23 |
2 files changed, 16 insertions, 26 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchResultDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchResultDialog.java index 35469438c0..afecb95299 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchResultDialog.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchResultDialog.java @@ -68,16 +68,10 @@ public class FetchResultDialog extends TitleAreaDialog { PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { @Override public void run() { - PlatformUI.getWorkbench().getDisplay().asyncExec( - new Runnable() { - @Override - public void run() { - Shell shell = PlatformUI.getWorkbench() - .getActiveWorkbenchWindow().getShell(); - new FetchResultDialog(shell, repository, - result, sourceString).open(); - } - }); + Shell shell = PlatformUI.getWorkbench() + .getModalDialogShellProvider().getShell(); + new FetchResultDialog(shell, repository, result, sourceString) + .open(); } }); } @@ -117,8 +111,9 @@ public class FetchResultDialog extends TitleAreaDialog { @Override public void run() { Dialog dlg = SimpleConfigureFetchDialog.getDialog( - PlatformUI.getWorkbench().getDisplay() - .getActiveShell(), localDb); + PlatformUI.getWorkbench() + .getModalDialogShellProvider().getShell(), + localDb); dlg.open(); } }); diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushResultDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushResultDialog.java index a042c8099a..b0190f2716 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushResultDialog.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushResultDialog.java @@ -56,18 +56,12 @@ class PushResultDialog extends TitleAreaDialog { PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { @Override public void run() { - PlatformUI.getWorkbench().getDisplay().asyncExec( - new Runnable() { - @Override - public void run() { - Shell shell = PlatformUI.getWorkbench() - .getActiveWorkbenchWindow().getShell(); - PushResultDialog dialog = new PushResultDialog( - shell, repository, result, sourceString, modal); - dialog.showConfigureButton(showConfigureButton); - dialog.open(); - } - }); + Shell shell = PlatformUI.getWorkbench() + .getModalDialogShellProvider().getShell(); + PushResultDialog dialog = new PushResultDialog(shell, + repository, result, sourceString, modal); + dialog.showConfigureButton(showConfigureButton); + dialog.open(); } }); } @@ -105,8 +99,9 @@ class PushResultDialog extends TitleAreaDialog { PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { @Override public void run() { - Dialog dlg = SimpleConfigurePushDialog.getDialog(PlatformUI - .getWorkbench().getDisplay().getActiveShell(), + Dialog dlg = SimpleConfigurePushDialog.getDialog( + PlatformUI.getWorkbench() + .getModalDialogShellProvider().getShell(), localDb); dlg.open(); } |