From 64ce0de99b1211d2cef2b445e1d05f3c2feece80 Mon Sep 17 00:00:00 2001 From: Constantine Plotnikov Date: Mon, 18 May 2009 18:26:04 +0400 Subject: [PATCH] git4idea: IDEA-22561: renamed OK buttons to appropriate names in dialogs --- .../git4idea/src/git4idea/checkin/GitPushDialog.java | 1 + .../src/git4idea/checkout/GitCheckoutDialog.java | 1 + .../git4idea/src/git4idea/checkout/GitCloneDialog.java | 1 + plugins/git4idea/src/git4idea/i18n/GitBundle.properties | 17 ++++++++++++++++- plugins/git4idea/src/git4idea/merge/GitMergeDialog.java | 1 + plugins/git4idea/src/git4idea/merge/GitPullDialog.java | 3 ++- .../src/git4idea/rebase/GitRebaseActionDialog.java | 1 + .../git4idea/src/git4idea/rebase/GitRebaseDialog.java | 1 + .../git4idea/src/git4idea/rebase/GitRebaseEditor.java | 1 + .../git4idea/rebase/GitRebaseUnstructuredEditor.java | 1 + plugins/git4idea/src/git4idea/ui/GitFetchDialog.java | 1 + .../src/git4idea/ui/GitRefspecAddRefsDialog.java | 1 + plugins/git4idea/src/git4idea/ui/GitResetDialog.java | 9 +++++---- plugins/git4idea/src/git4idea/ui/GitStashDialog.java | 1 + plugins/git4idea/src/git4idea/ui/GitTagDialog.java | 1 + plugins/git4idea/src/git4idea/ui/GitUnstashDialog.java | 9 +++++++++ 16 files changed, 44 insertions(+), 6 deletions(-) diff --git a/plugins/git4idea/src/git4idea/checkin/GitPushDialog.java b/plugins/git4idea/src/git4idea/checkin/GitPushDialog.java index 020e334535..9665d14c4b 100644 --- a/plugins/git4idea/src/git4idea/checkin/GitPushDialog.java +++ b/plugins/git4idea/src/git4idea/checkin/GitPushDialog.java @@ -132,6 +132,7 @@ public class GitPushDialog extends DialogWrapper { public GitPushDialog(final Project project, final List roots, final VirtualFile defaultRoot) { super(project, true); setTitle(GitBundle.getString("push.title")); + setOKButtonText(GitBundle.getString("push.button")); GitUIUtil.setupRootChooser(project, roots, defaultRoot, myGitRootComboBox, myCurrentBranch); myProject = project; setupRemotes(); diff --git a/plugins/git4idea/src/git4idea/checkout/GitCheckoutDialog.java b/plugins/git4idea/src/git4idea/checkout/GitCheckoutDialog.java index f10e4b4663..d73beca33d 100644 --- a/plugins/git4idea/src/git4idea/checkout/GitCheckoutDialog.java +++ b/plugins/git4idea/src/git4idea/checkout/GitCheckoutDialog.java @@ -118,6 +118,7 @@ public class GitCheckoutDialog extends DialogWrapper { GitUIUtil.setupRootChooser(myProject, roots, defaultRoot, myGitRoot, myCurrentBranch); setupIncludeTags(); setupBranches(); + setOKButtonText(GitBundle.getString("checkout.branch")); myBranchToCkeckoutValidator = new GitReferenceValidator(project, myGitRoot, getBranchToCheckoutTextField(), myValidateButton, new Runnable() { public void run() { diff --git a/plugins/git4idea/src/git4idea/checkout/GitCloneDialog.java b/plugins/git4idea/src/git4idea/checkout/GitCloneDialog.java index a57ee7a779..9928064482 100644 --- a/plugins/git4idea/src/git4idea/checkout/GitCloneDialog.java +++ b/plugins/git4idea/src/git4idea/checkout/GitCloneDialog.java @@ -107,6 +107,7 @@ public class GitCloneDialog extends DialogWrapper { init(); initListeners(); setTitle(GitBundle.getString("clone.title")); + setOKButtonText(GitBundle.getString("clone.button")); } /** diff --git a/plugins/git4idea/src/git4idea/i18n/GitBundle.properties b/plugins/git4idea/src/git4idea/i18n/GitBundle.properties index 070f2de3de..da61fe252b 100644 --- a/plugins/git4idea/src/git4idea/i18n/GitBundle.properties +++ b/plugins/git4idea/src/git4idea/i18n/GitBundle.properties @@ -1,5 +1,6 @@ action.text.show.all.submitted=Show all files changed by this commit add.action.name=Add +addrefspec.button=Add addrefspec.get.references.tooltip=Get remote tag and branch references (depending on checkbox state). addrefspec.get.references=&Get References addrefspec.getting.references.title=Getting remote references for {0} @@ -34,6 +35,7 @@ checkout.track.tooltip=If checked, the newly created branch will track original checkout.validate.tooltip=Use this button to validate reference expression if entered manually. checkout.validate=&Validate checkout.validation.failed=Source revision validation failed +clone.button=Clone clone.destination.directory.description=Select a parent directory destination directory for clone clone.destination.directory.title=Parent Directory clone.destination.exists.error=The path {0} exists. The Git cannot clone to existing directory. @@ -85,6 +87,7 @@ error.dialog.title=Error error.list.title={0} Error: error.occurred.during=Error occurred during ''{0}'' fetch.action.name=Fetch +fetch.button=Fetch fetch.force.references.update.tooltip=Forces update of branch references for which update is not forced in refrence mapping. fetch.force.references.update=Force references &update fetch.remote.label=Re&mote: @@ -119,6 +122,7 @@ init.error.title=git init Error merge.action.name=Merge merge.add.log.information.tooltip=Add log information to the commit message (\"--log\" option) merge.add.log.information=Add &log information +merge.branch.button=Merge merge.branch.message=Select branch to merge into this one ({0}) merge.branch.title=Merge Branches merge.branches.tooltip=The chooser for braches. Select one or more braches to merge (already merged branches are not shown). @@ -146,6 +150,7 @@ merging.branch=Merging branch {0} merging.title=Merging changes to {0} paths.affected.title=Paths affected in commit {0} pull.action.name=Pull +pull.button=Pull pull.force.reference.update=Force reference &update pull.get.branches.tooltip=Get branch names from remote repository. Otherwise a locally cached information is used. pull.get.branches=&Get Branches @@ -160,6 +165,7 @@ pulling.title=Pulling changes from {0} push.action.name=Push push.branches.tooltip=Select branches to push push.branches=&Branches: +push.button=Push push.force.update.tooltip=If selected remote ref is updated even if they are is not an ancestor of the local ref. push.force.update=&Force update push.policy.all=All @@ -185,8 +191,10 @@ rebase.action.name=Rebase rebase.action.no.root=There is no rebase operation in progress in the project rebase.branch.tooltip=Select branch to rebase (if branch is different from the current branch, it will be checked out first) rebase.branch=&Branch: +rebase.button=Rebase rebase.continue.action.name=Continue Rebasing rebase.editor.action.column=Action +rebase.editor.button=Start Rebasing rebase.editor.comment.column=Comment rebase.editor.commit.column=Commit rebase.editor.invalid.entryset=No commits found to rebase @@ -228,6 +236,7 @@ rebase.show.remote.branches=Show Re&mote Branches rebase.show.tags.tooltip=Show tags in \"from\" and \"onto\" dropdowns. rebase.skip.action.name=Skip Commit in Rebasing rebase.title=Rebase branch +rebase.unstructured.editor.button=Resume Rebasing rebase.unstructured.editor.git.root=Git Root: rebase.unstructured.editor.message=Git rebase operation requested additional &information through the editor: rebase.unstructured.editor.title=Addtional Rebase Input @@ -259,6 +268,7 @@ repository.action.missing.roots.misconfigured=Neither of configured git roots ar repository.action.missing.roots.title=No git roots repository.action.missing.roots.unconfigured.message=No git roots are configured for the project. reset.action.name=Reset Head ... +reset.button=Reset reset.commit.invalid=The specified commit expression did not pass validation. reset.commit.label=To &Commit: reset.commit.tooltip=The commit that will become the current HEAD\n as result of reset operation. @@ -274,6 +284,7 @@ resetting.title=Resetting HEAD... revert.action.name=Revert revision.graph=RevisionGraph select.branch.to.checkout=Select branch to checkout +show.all.paths.affected.action.name=Show All Affected Paths ssh.ask.passphrase.title=SSH Key Passphrase ssh.askPassphrase.message=Please enter passphrase for the private key {0} (the user name is {1}) ssh.changed.host.key=The server host key for the host {0}:{1} has changed to {2} (type {3}).\nDo you want to accept the changed key? @@ -294,6 +305,7 @@ sshmain.password.failed=Invalid user or password. sshmain.pk.authenitication.failed=Authentication using key {0} failed. sshmain.too.mush.passphrase.guesses=Invalid passphrase for the key {0}({1} attempts) stash.action.name=Stash +stash.button=Create Stash stash.keep.index.tooltip=If this checkbox is selected, indexed changes are kept in the index. stash.keep.index=Keep &index stash.message.tooltip=Enter stash message here. @@ -301,6 +313,7 @@ stash.message=&Message: stash.title=Stash stashing.title=Stashing changes... tag.action.name=Tag +tag.button=Create Tag tag.commit.label=&Commit: tag.commit.tooltip=Enter name of commit or object to tag or leave blank to use HEAD. tag.error.creating.message.file.message=Unable to create message file: {0} @@ -325,6 +338,9 @@ unindexed.files.changlelist.name=Unindexed Files unstash.action.name=UnStash unstash.branch.label\:=As new &branch: unstash.branch.tooltip=If non-empty name is entered, the stash is checked out as a new branch. +unstash.button.apply=Apply Stash +unstash.button.branch=Branch +unstash.button.pop=Pop Stash unstash.clear.tooltip=Delete all stashes in the repository. unstash.clear=&Clear unstash.clearing.stashes=Clearing stashes... @@ -356,4 +372,3 @@ vfs.listener.add.title=Add files to Git vfs.listener.delete.single.prompt=Do you want to delete the following file from Git?\n{0}\n\nIf you say NO, you can still delete it later manually. vfs.listener.delete.single.title=Delete file from Git vfs.listener.delete.title=Delete files from Git -show.all.paths.affected.action.name=Show All Affected Paths diff --git a/plugins/git4idea/src/git4idea/merge/GitMergeDialog.java b/plugins/git4idea/src/git4idea/merge/GitMergeDialog.java index a64a72c0df..959f45e976 100644 --- a/plugins/git4idea/src/git4idea/merge/GitMergeDialog.java +++ b/plugins/git4idea/src/git4idea/merge/GitMergeDialog.java @@ -103,6 +103,7 @@ public class GitMergeDialog extends DialogWrapper { initBranchChooser(); GitMergeUtil.setupNoCommitCheckbox(myAddLogInformationCheckBox, myCommitMessage, myNoCommitCheckBox); setOKActionEnabled(false); + setOKButtonText(GitBundle.getString("merge.branch.button")); GitUIUtil.setupRootChooser(myProject, roots, defaultRoot, myGitRoot, myCurrentBranchText); myGitRoot.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent e) { diff --git a/plugins/git4idea/src/git4idea/merge/GitPullDialog.java b/plugins/git4idea/src/git4idea/merge/GitPullDialog.java index 27309847ad..7b7420ab1f 100644 --- a/plugins/git4idea/src/git4idea/merge/GitPullDialog.java +++ b/plugins/git4idea/src/git4idea/merge/GitPullDialog.java @@ -108,6 +108,7 @@ public class GitPullDialog extends DialogWrapper { updateRemotes(); } }); + setOKButtonText(GitBundle.getString("pull.button")); updateRemotes(); setupBranches(); setupGetBranches(); @@ -301,7 +302,7 @@ public class GitPullDialog extends DialogWrapper { protected String getHelpId() { return "reference.VersionControl.Git.Pull"; } - + /** * @return remote key */ diff --git a/plugins/git4idea/src/git4idea/rebase/GitRebaseActionDialog.java b/plugins/git4idea/src/git4idea/rebase/GitRebaseActionDialog.java index 709584c02f..7d8d8b8575 100644 --- a/plugins/git4idea/src/git4idea/rebase/GitRebaseActionDialog.java +++ b/plugins/git4idea/src/git4idea/rebase/GitRebaseActionDialog.java @@ -49,6 +49,7 @@ public class GitRebaseActionDialog extends DialogWrapper { super(project, true); GitUIUtil.setupRootChooser(project, roots, defaultRoot, myGitRootComboBox, null); setTitle(title); + setOKButtonText(title); init(); } diff --git a/plugins/git4idea/src/git4idea/rebase/GitRebaseDialog.java b/plugins/git4idea/src/git4idea/rebase/GitRebaseDialog.java index 3cc5029071..448de80d93 100644 --- a/plugins/git4idea/src/git4idea/rebase/GitRebaseDialog.java +++ b/plugins/git4idea/src/git4idea/rebase/GitRebaseDialog.java @@ -132,6 +132,7 @@ public class GitRebaseDialog extends DialogWrapper { public GitRebaseDialog(Project project, List roots, VirtualFile defaultRoot) { super(project, true); setTitle(GitBundle.getString("rebase.title")); + setOKButtonText(GitBundle.getString("rebase.button")); init(); myProject = project; final Runnable validateRunnable = new Runnable() { diff --git a/plugins/git4idea/src/git4idea/rebase/GitRebaseEditor.java b/plugins/git4idea/src/git4idea/rebase/GitRebaseEditor.java index a4bc1b080d..4122c0b2ca 100644 --- a/plugins/git4idea/src/git4idea/rebase/GitRebaseEditor.java +++ b/plugins/git4idea/src/git4idea/rebase/GitRebaseEditor.java @@ -101,6 +101,7 @@ public class GitRebaseEditor extends DialogWrapper { myProject = project; myGitRoot = gitRoot; setTitle(GitBundle.getString("rebase.editor.title")); + setOKButtonText(GitBundle.getString("rebase.editor.button")); if (SystemInfo.isWindows && file.startsWith(CYGDRIVE_PREFIX)) { final int prefixSize = CYGDRIVE_PREFIX.length(); file = file.substring(prefixSize, prefixSize + 1) + ":" + file.substring(prefixSize + 1); diff --git a/plugins/git4idea/src/git4idea/rebase/GitRebaseUnstructuredEditor.java b/plugins/git4idea/src/git4idea/rebase/GitRebaseUnstructuredEditor.java index 02826e530a..ec2129bf53 100644 --- a/plugins/git4idea/src/git4idea/rebase/GitRebaseUnstructuredEditor.java +++ b/plugins/git4idea/src/git4idea/rebase/GitRebaseUnstructuredEditor.java @@ -47,6 +47,7 @@ public class GitRebaseUnstructuredEditor extends DialogWrapper { protected GitRebaseUnstructuredEditor(Project project, VirtualFile root, String path) throws IOException { super(project, true); setTitle(GitBundle.message("rebase.unstructured.editor.title")); + setOKButtonText(GitBundle.message("rebase.unstructured.editor.button")); myGitRootLabel.setText(root.getPresentableUrl()); encoding = GitConfigUtil.getCommitEncoding(project, root); myFile = new File(path); diff --git a/plugins/git4idea/src/git4idea/ui/GitFetchDialog.java b/plugins/git4idea/src/git4idea/ui/GitFetchDialog.java index a3fcebb62c..0b28f51fb0 100644 --- a/plugins/git4idea/src/git4idea/ui/GitFetchDialog.java +++ b/plugins/git4idea/src/git4idea/ui/GitFetchDialog.java @@ -84,6 +84,7 @@ public class GitFetchDialog extends DialogWrapper { public GitFetchDialog(final Project project, final List roots, final VirtualFile defaultRoot) { super(project, true); setTitle(GitBundle.getString("fetch.title")); + setOKButtonText(GitBundle.getString("fetch.button")); GitUIUtil.setupRootChooser(project, roots, defaultRoot, myGitRoot, null); myProject = project; myRefspecs.setProject(project); diff --git a/plugins/git4idea/src/git4idea/ui/GitRefspecAddRefsDialog.java b/plugins/git4idea/src/git4idea/ui/GitRefspecAddRefsDialog.java index 1efb750ebb..eab4402ae9 100644 --- a/plugins/git4idea/src/git4idea/ui/GitRefspecAddRefsDialog.java +++ b/plugins/git4idea/src/git4idea/ui/GitRefspecAddRefsDialog.java @@ -112,6 +112,7 @@ public class GitRefspecAddRefsDialog extends DialogWrapper { @NotNull SortedSet branches) { super(project, true); setTitle(GitBundle.getString("addrefspec.title")); + setOKButtonText(GitBundle.getString("addrefspec.button")); myProject = project; myRoot = root; myRemote = remote; diff --git a/plugins/git4idea/src/git4idea/ui/GitResetDialog.java b/plugins/git4idea/src/git4idea/ui/GitResetDialog.java index 87b0de7739..0e8d1869e7 100644 --- a/plugins/git4idea/src/git4idea/ui/GitResetDialog.java +++ b/plugins/git4idea/src/git4idea/ui/GitResetDialog.java @@ -86,6 +86,7 @@ public class GitResetDialog extends DialogWrapper { super(project, true); myProject = project; setTitle(GitBundle.getString("reset.title")); + setOKButtonText(GitBundle.getString("reset.button")); myResetTypeComboBox.addItem(MIXED); myResetTypeComboBox.addItem(SOFT); myResetTypeComboBox.addItem(HARD); @@ -118,17 +119,17 @@ public class GitResetDialog extends DialogWrapper { GitLineHandler handler = new GitLineHandler(myProject, getGitRoot(), GitHandler.RESET); handler.setNoSSH(true); String type = (String)myResetTypeComboBox.getSelectedItem(); - if(SOFT.equals(type)) { + if (SOFT.equals(type)) { handler.addParameters("--soft"); } - else if(HARD.equals(type)) { + else if (HARD.equals(type)) { handler.addParameters("--hard"); } - else if(MIXED.equals(type)) { + else if (MIXED.equals(type)) { handler.addParameters("--mixed"); } final String commit = myCommitTextField.getText().trim(); - if(commit.length() != 0) { + if (commit.length() != 0) { handler.addParameters(commit); } return handler; diff --git a/plugins/git4idea/src/git4idea/ui/GitStashDialog.java b/plugins/git4idea/src/git4idea/ui/GitStashDialog.java index 6651d4fac9..dd2145cb17 100644 --- a/plugins/git4idea/src/git4idea/ui/GitStashDialog.java +++ b/plugins/git4idea/src/git4idea/ui/GitStashDialog.java @@ -65,6 +65,7 @@ public class GitStashDialog extends DialogWrapper { super(project, true); myProject = project; setTitle(GitBundle.getString("stash.title")); + setOKButtonText(GitBundle.getString("stash.button")); GitUIUtil.setupRootChooser(project, roots, defaultRoot, myGitRootComboBox, myCurrentBranch); init(); } diff --git a/plugins/git4idea/src/git4idea/ui/GitTagDialog.java b/plugins/git4idea/src/git4idea/ui/GitTagDialog.java index 41fefd661a..88d227dc19 100644 --- a/plugins/git4idea/src/git4idea/ui/GitTagDialog.java +++ b/plugins/git4idea/src/git4idea/ui/GitTagDialog.java @@ -108,6 +108,7 @@ public class GitTagDialog extends DialogWrapper { public GitTagDialog(Project project, List roots, VirtualFile defaultRoot) { super(project, true); setTitle(GitBundle.getString("tag.title")); + setOKButtonText(GitBundle.getString("tag.button")); myProject = project; GitUIUtil.setupRootChooser(myProject, roots, defaultRoot, myGitRootComboBox, myCurrentBranch); myGitRootComboBox.addActionListener(new ActionListener() { diff --git a/plugins/git4idea/src/git4idea/ui/GitUnstashDialog.java b/plugins/git4idea/src/git4idea/ui/GitUnstashDialog.java index 9426951076..0e582d0b0d 100644 --- a/plugins/git4idea/src/git4idea/ui/GitUnstashDialog.java +++ b/plugins/git4idea/src/git4idea/ui/GitUnstashDialog.java @@ -104,6 +104,7 @@ public class GitUnstashDialog extends DialogWrapper { super(project, true); myProject = project; setTitle(GitBundle.getString("unstash.title")); + setOKButtonText(GitBundle.getString("unstash.button.apply")); GitUIUtil.setupRootChooser(project, roots, defaultRoot, myGitRootComboBox, myCurrentBranch); myStashList.setModel(new DefaultListModel()); refreshStashList(); @@ -123,6 +124,11 @@ public class GitUnstashDialog extends DialogWrapper { updateDialogState(); } }); + myPopStashCheckBox.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + updateDialogState(); + } + }); myClearButton.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent e) { GitLineHandler h = new GitLineHandler(myProject, getGitRoot(), GitHandler.STASH); @@ -217,6 +223,7 @@ public class GitUnstashDialog extends DialogWrapper { public void updateDialogState() { String branch = myBranchTextField.getText(); if (branch.length() != 0) { + setOKButtonText(GitBundle.getString("unstash.button.branch")); myPopStashCheckBox.setEnabled(false); myPopStashCheckBox.setSelected(true); myReinstateIndexCheckBox.setEnabled(false); @@ -237,6 +244,8 @@ public class GitUnstashDialog extends DialogWrapper { myPopStashCheckBox.setSelected(false); } myPopStashCheckBox.setEnabled(true); + setOKButtonText( + myPopStashCheckBox.isSelected() ? GitBundle.getString("unstash.button.pop") : GitBundle.getString("unstash.button.apply")); if (!myReinstateIndexCheckBox.isEnabled()) { myReinstateIndexCheckBox.setSelected(false); } -- 2.11.4.GIT