diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/update/ActionInfo.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/update/ActionInfo.java index cb68498f535d..d804cb1165e4 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/update/ActionInfo.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/update/ActionInfo.java @@ -7,6 +7,7 @@ import com.intellij.openapi.vcs.AbstractVcs; import com.intellij.openapi.vcs.VcsBundle; import com.intellij.openapi.vcs.VcsConfiguration; import com.intellij.openapi.vcs.ex.ProjectLevelVcsManagerEx; +import org.jetbrains.annotations.NotNull; import java.util.LinkedHashMap; @@ -32,7 +33,13 @@ public interface ActionInfo { return new UpdateOrStatusOptionsDialog(project, VcsBundle.message("action.display.name.update.scope", scopeName), envToConfMap) { @Override protected String getActionNameForDimensions() { - return "update"; + return "update-v2"; + } + + @NotNull + @Override + protected String getDoNotShowMessage() { + return "Don't show again"; } @Override diff --git a/plugins/git4idea/src/git4idea/config/GitVcsPanel.kt b/plugins/git4idea/src/git4idea/config/GitVcsPanel.kt index 0bcfcfda31fc..951e785d7f91 100644 --- a/plugins/git4idea/src/git4idea/config/GitVcsPanel.kt +++ b/plugins/git4idea/src/git4idea/config/GitVcsPanel.kt @@ -216,7 +216,7 @@ internal class GitVcsPanel(private val project: Project, EnumComboBoxModel(UpdateMethod::class.java), { projectSettings.updateMethod }, { projectSettings.updateMethod = it!! }, - renderer = SimpleListCellRenderer.create("", UpdateMethod::asString) + renderer = SimpleListCellRenderer.create("", UpdateMethod::getName) ) } } diff --git a/plugins/git4idea/src/git4idea/config/UpdateMethod.java b/plugins/git4idea/src/git4idea/config/UpdateMethod.java index 16b6b70d0e32..b025a3768815 100644 --- a/plugins/git4idea/src/git4idea/config/UpdateMethod.java +++ b/plugins/git4idea/src/git4idea/config/UpdateMethod.java @@ -24,24 +24,31 @@ public enum UpdateMethod { /** * Use default specified in the config file for the branch */ - BRANCH_DEFAULT("Branch Default"), + BRANCH_DEFAULT("Branch Default", "Branch Default"), /** * Merge fetched commits with local branch */ - MERGE("Merge"), + MERGE("Merge", "Merge the incoming changes into the current branch"), /** * Rebase local commits upon the fetched branch */ - REBASE("Rebase"); + REBASE("Rebase", "Rebase the current branch on top of the incoming changes"); + @NotNull private final String myName; @NotNull private final String myPresentation; - UpdateMethod(@NotNull String presentation) { + UpdateMethod(@NotNull String name, @NotNull String presentation) { + myName = name; myPresentation = presentation; } @NotNull - public String asString() { + public String getName() { + return myName; + } + + @NotNull + public String getPresentation() { return myPresentation; } } diff --git a/plugins/git4idea/src/git4idea/update/GitUpdateOptionsPanel.kt b/plugins/git4idea/src/git4idea/update/GitUpdateOptionsPanel.kt index acbb56e02914..16cef740d0d7 100644 --- a/plugins/git4idea/src/git4idea/update/GitUpdateOptionsPanel.kt +++ b/plugins/git4idea/src/git4idea/update/GitUpdateOptionsPanel.kt @@ -16,7 +16,10 @@ package git4idea.update import com.intellij.openapi.ui.DialogPanel +import com.intellij.openapi.util.registry.Registry import com.intellij.ui.layout.* +import com.intellij.ui.scale.JBUIScale +import com.intellij.util.ui.JBUI import git4idea.config.GitVcsSettings import git4idea.config.UpdateMethod import git4idea.config.UpdateMethod.BRANCH_DEFAULT @@ -24,21 +27,20 @@ import git4idea.config.UpdateMethod.BRANCH_DEFAULT class GitUpdateOptionsPanel(private val settings: GitVcsSettings) { val panel = createPanel() - fun createPanel(): DialogPanel = - panel { - titledRow("Update Type") { - buttonGroup { - getUpdateMethods().forEach { method -> - row { - radioButton(method.asString()).withSelectedBinding(PropertyBinding( - get = { settings.updateMethod == method }, - set = { selected -> if (selected) settings.updateMethod = method } - )) - } + private fun createPanel(): DialogPanel = panel { + row { + buttonGroup { + getUpdateMethods().forEach { method -> + row { + radioButton(method.getPresentation()).withSelectedBinding(PropertyBinding( + get = { settings.updateMethod == method }, + set = { selected -> if (selected) settings.updateMethod = method } + )) } } } } + }.withBorder(JBUI.Borders.empty(JBUIScale.scale(16), JBUIScale.scale(5), 0, JBUIScale.scale(5))) fun isModified(): Boolean = panel.isModified()