Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wolf2016-04-05 18:13:28 -0400
committerThomas Wolf2016-04-05 18:13:28 -0400
commitfbe70bcf1fb6dfd0fbb661653d625de78e0698eb (patch)
tree8de7005f39089cbadfbd21c73ccb18e444b0e86a
parent3a1e0791f4066352f594b0b85201546943683fdb (diff)
downloadegit-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>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchResultDialog.java19
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushResultDialog.java23
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 35469438c..afecb9529 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 a042c8099..b0190f271 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();
}

Back to the top