[EGIT PATCH 3/6] Handle URIs parsing errors in PushAction better

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



ErrorDialog is used instead of MessageDialog (more information), strings
are externalized.

Signed-off-by: Marek Zawirski <marek.zawirski@xxxxxxxxx>
---
 .../src/org/spearce/egit/ui/UIText.java            |    6 ++++++
 .../egit/ui/internal/actions/PushAction.java       |   13 +++++++++----
 .../src/org/spearce/egit/ui/uitext.properties      |    3 +++
 3 files changed, 18 insertions(+), 4 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 cc785f7..b45d2e9 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
@@ -464,6 +464,12 @@
 	public static String HistoryPreferencePage_title;
 
 	/** */
+	public static String PushAction_wrongURIDescription;
+
+	/** */
+	public static String PushAction_wrongURITitle;
+
+	/** */
 	public static String PushWizard_cantConnectToAny;
 
 	/** */
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/PushAction.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/PushAction.java
index 61833d0..b4af3b5 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/PushAction.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/PushAction.java
@@ -9,9 +9,13 @@
 
 import java.net.URISyntaxException;
 
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
 import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.ErrorDialog;
 import org.eclipse.jface.wizard.WizardDialog;
+import org.spearce.egit.ui.Activator;
+import org.spearce.egit.ui.UIText;
 import org.spearce.egit.ui.internal.push.PushWizard;
 import org.spearce.jgit.lib.Repository;
 
@@ -31,9 +35,10 @@ public void run(IAction action) {
 		try {
 			pushWizard = new PushWizard(repository);
 		} catch (URISyntaxException x) {
-			MessageDialog.openError(getShell(), "Corrupted configuration",
-					"Remote repositories URLs configuration is corrupted: "
-							+ x.getMessage());
+			ErrorDialog.openError(getShell(), UIText.PushAction_wrongURITitle,
+					UIText.PushAction_wrongURIDescription, new Status(
+							IStatus.ERROR, Activator.getPluginId(), x
+									.getMessage(), x));
 			return;
 		}
 		final WizardDialog dialog = new WizardDialog(getShell(), pushWizard);
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 4b0aea6..83be622 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
@@ -179,6 +179,9 @@ HistoryPage_findbar_notFound=String not found
 
 HistoryPreferencePage_title=Git
 
+PushAction_wrongURIDescription=Remote repositories URIs configuration is corrupted.
+PushAction_wrongURITitle=Corrupted Configuration
+
 PushWizard_cantConnectToAny=Can't connect to any repository: {0}
 PushWizard_cantPrepareUpdatesMessage=Can't resolve ref specifications locally (local refs changed?) or create tracking ref update.
 PushWizard_cantPrepareUpdatesTitle=Preparing Ref Updates Error
-- 
1.5.6.3

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux