Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Keppler2019-08-03 10:58:39 -0400
committerThomas Wolf2019-08-15 12:46:56 -0400
commit13ae584b2a99f56e19a10e0f1ecc3b9a07d2e9ad (patch)
tree1df09421d9b49d207bc0d1ea99d4eea9c2e0d2c6 /org.eclipse.egit.ui/src/org
parent2d7e27301cc89fe30abc392598a96fac2e8d299a (diff)
downloadegit-13ae584b2a99f56e19a10e0f1ecc3b9a07d2e9ad.tar.gz
egit-13ae584b2a99f56e19a10e0f1ecc3b9a07d2e9ad.tar.xz
egit-13ae584b2a99f56e19a10e0f1ecc3b9a07d2e9ad.zip
Show standard message box on paste to repo view error
When pasting invalid content to the git repositories view, it shows the "Problem occurred" message box due to using the status handler of eclipse. Since this is bad user input, we should only show a message box, and not handle this situation like an internal error. Changed message texts to be sentence style. Bug: 549618 Change-Id: Id6e2b4facff5deb945275e89a85d74442aa1462a Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
Diffstat (limited to 'org.eclipse.egit.ui/src/org')
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/PasteCommand.java5
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties9
3 files changed, 11 insertions, 6 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java
index 63fdde843..1df4287ec 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java
@@ -3702,6 +3702,9 @@ public class UIText extends NLS {
public static String RepositoriesView_Branches_Nodetext;
/** */
+ public static String RepositoriesView_CannotPaste;
+
+ /** */
public static String RepositoriesView_CheckoutConfirmationDefaultButtonLabel;
/** */
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/PasteCommand.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/PasteCommand.java
index 13d2e2e7e..ef6bf97cc 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/PasteCommand.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/PasteCommand.java
@@ -19,10 +19,10 @@ import java.net.URISyntaxException;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.egit.ui.Activator;
import org.eclipse.egit.ui.internal.UIText;
import org.eclipse.egit.ui.internal.components.RepositorySelectionPage.Protocol;
import org.eclipse.egit.ui.internal.repository.tree.RepositoryTreeNode;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.RepositoryCache;
import org.eclipse.jgit.transport.URIish;
@@ -100,7 +100,8 @@ public class PasteCommand extends
} finally {
clip.dispose();
if (errorMessage != null) {
- Activator.showError(errorMessage, null);
+ MessageDialog.openError(getShell(event),
+ UIText.RepositoriesView_CannotPaste, errorMessage);
}
}
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties
index 48cb05abc..a8e7b9567 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties
@@ -1309,12 +1309,13 @@ IgnoreActionHandler_manyFilesToBeIgnoredQuestion=Adding many files to .gitignore
RepositoriesView_BranchDeletionFailureMessage=Branch deletion failed
RepositoriesView_Branches_Nodetext=Branches
+RepositoriesView_CannotPaste=Cannot create git repository from clipboard content
RepositoriesView_CheckoutConfirmationMessage=Do you really want to check out ''{0}''?
RepositoriesView_CheckoutConfirmationTitle=Check Out Branch
RepositoriesView_CheckoutConfirmationDefaultButtonLabel=Check &Out
RepositoriesView_CheckoutConfirmationToggleMessage=Don't show this confirmation dialog again
-RepositoriesView_ClipboardContentNoGitRepoMessage=Path {0} does not appear to be a Git repository location
-RepositoriesView_ClipboardContentNotDirectoryOrURIMessage=Clipboard content is neither a directory path nor a valid git URI
+RepositoriesView_ClipboardContentNoGitRepoMessage=Path {0} does not appear to be a Git repository location.
+RepositoriesView_ClipboardContentNotDirectoryOrURIMessage=Clipboard content is neither a directory path nor a valid git URI.
RepositoriesView_ConfirmDeleteRemoteHeader=Confirm Remote Configuration Deletion
RepositoriesView_ConfirmDeleteRemoteMessage=Are you sure you want to remove remote configuration ''{0}''?
RepositoriesView_ConfirmProjectDeletion_Question=There {0,choice,1#is 1 project that belongs to the removed repositories, do you want to remove it|1<are {0} projects that belong to the removed repositories, do you want to remove them} from the workspace?
@@ -1326,8 +1327,8 @@ RepositoriesView_linkAdd=Add an existing local Git repository
RepositoriesView_linkClone=Clone a Git repository
RepositoriesView_linkCreate=Create a new local Git repository
RepositoriesView_messageEmpty=Select one of the following to add a repository to this view:
-RepositoriesView_NothingToPasteMessage=Clipboard contains no data to paste
-RepositoriesView_PasteRepoAlreadyThere=Repository at location {0} is already in the list
+RepositoriesView_NothingToPasteMessage=Clipboard contains no data to paste.
+RepositoriesView_PasteRepoAlreadyThere=Repository at location {0} is already in the list.
RepositoriesView_RemotesNodeText=Remotes
RepositoriesView_TagDeletionFailureMessage=Deletion of tags failed
RepositoriesView_WorkingDir_treenode=Working Tree

Back to the top