git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robin Rosenberg <robin.rosenberg@dewire.com>
To: git@vger.kernel.org
Cc: "Shawn O. Pearce" <spearce@spearce.org>,
	Marek Zawirski <marek.zawirski@gmail.com>,
	Robin Rosenberg <robin.rosenberg@dewire.com>
Subject: [PATCH] Clone: Handle cancel in clone dialog specially
Date: Sun, 22 Jun 2008 19:46:36 +0200	[thread overview]
Message-ID: <1214156797-29186-2-git-send-email-robin.rosenberg@dewire.com> (raw)
In-Reply-To: <1214156797-29186-1-git-send-email-robin.rosenberg@dewire.com>

Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
 .../src/org/spearce/egit/ui/UIText.java            |    3 +++
 .../egit/ui/internal/clone/SourceBranchPage.java   |   18 ++++++++++++------
 .../src/org/spearce/egit/ui/uitext.properties      |    2 ++
 3 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/UIText.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/UIText.java
index 9ccf606..4adb99c 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/UIText.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/UIText.java
@@ -122,6 +122,9 @@ public class UIText extends NLS {
 	public static String SourceBranchPage_cannotListBranches;
 
 	/** */
+	public static String SourceBranchPage_remoteListingCancelled;
+
+	/** */
 	public static String CloneDestinationPage_title;
 
 	/** */
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/clone/SourceBranchPage.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/clone/SourceBranchPage.java
index b2f1a18..615be32 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/clone/SourceBranchPage.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/clone/SourceBranchPage.java
@@ -20,6 +20,7 @@ import java.util.List;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.jface.dialogs.ErrorDialog;
 import org.eclipse.jface.operation.IRunnableWithProgress;
@@ -269,12 +270,17 @@ class SourceBranchPage extends WizardPage {
 			});
 		} catch (InvocationTargetException e) {
 			Throwable why = e.getCause();
-			ErrorDialog.openError(getShell(),
-					UIText.SourceBranchPage_transportError,
-					UIText.SourceBranchPage_cannotListBranches, new Status(
-							IStatus.ERROR, Activator.getPluginId(), 0, why
-									.getMessage(), why.getCause()));
-			transportError(why.getMessage());
+			if ((why instanceof OperationCanceledException)) {
+				transportError(UIText.SourceBranchPage_remoteListingCancelled);
+				return;
+			} else {
+				ErrorDialog.openError(getShell(),
+						UIText.SourceBranchPage_transportError,
+						UIText.SourceBranchPage_cannotListBranches, new Status(
+								IStatus.ERROR, Activator.getPluginId(), 0, why
+										.getMessage(), why.getCause()));
+				transportError(why.getMessage());
+			}
 			return;
 		} catch (InterruptedException e) {
 			transportError(UIText.SourceBranchPage_interrupted);
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/uitext.properties b/org.spearce.egit.ui/src/org/spearce/egit/ui/uitext.properties
index 18f8c28..9516aa0 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/uitext.properties
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/uitext.properties
@@ -55,6 +55,8 @@ SourceBranchPage_errorBranchRequired=At least one branch must be selected.
 SourceBranchPage_transportError=Transport Error
 SourceBranchPage_cannotListBranches=Cannot list the available branches.
 SourceBranchPage_interrupted=Connection attempt interrupted.
+SourceBranchPage_remoteListingCancelled=Operation cancelled
+
 
 CloneDestinationPage_title=Local Destination
 CloneDestinationPage_description=Configure the local storage location for {0}.
-- 
1.5.5.1.178.g1f811

  reply	other threads:[~2008-06-22 19:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-22  1:36 [jgit PATCH] Paper bag fix quoting for SSH transport commands Shawn O. Pearce
2008-06-22 17:46 ` [PATCH] Take care of errors reported from the server when upload command is started Robin Rosenberg
2008-06-22 17:46   ` Robin Rosenberg [this message]
2008-06-22 17:46     ` [PATCH] Clone: If url is changed was changed, forget the old value Robin Rosenberg
2008-06-22 23:01   ` [PATCH] Take care of errors reported from the server when upload command is started Shawn O. Pearce
2008-06-22 17:54 ` [jgit PATCH] Paper bag fix quoting for SSH transport commands Robin Rosenberg
2008-06-22 22:15   ` Shawn O. Pearce
2008-06-23  2:30     ` Robin Rosenberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1214156797-29186-2-git-send-email-robin.rosenberg@dewire.com \
    --to=robin.rosenberg@dewire.com \
    --cc=git@vger.kernel.org \
    --cc=marek.zawirski@gmail.com \
    --cc=spearce@spearce.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).