vcs: use correct text for clone actions in different places

GitOrigin-RevId: 3d8ab548afe5f4a9b181dee66eca5c938408b7a8
This commit is contained in:
Aleksandr Krasilnikov
2019-08-15 20:30:27 +03:00
committed by intellij-monorepo-bot
parent 6d839e236d
commit a144bef814
3 changed files with 22 additions and 7 deletions
@@ -31,8 +31,7 @@
<action id="Vcs.ShowDiffWithLocal" class="com.intellij.openapi.vcs.history.actions.ShowDiffAfterWithLocalAction"
text="Compare with Local" description="Compare version in selected revision with current version"/>
<action id="Vcs.VcsClone" class="com.intellij.openapi.wm.impl.welcomeScreen.GetFromVersionControlAction"
text="Get from Version Control"/>
text="Get from Version Control..."/>
<group class="com.intellij.openapi.vcs.actions.VcsActionGroup" id="VcsGroup"/>
<group class="com.intellij.openapi.vcs.actions.VcsGroupsWrapper" id="VcsFileGroupPopup" popup="true"/>
@@ -11,14 +11,21 @@ import com.intellij.openapi.util.registry.Registry
import com.intellij.openapi.vcs.CheckoutProvider
import com.intellij.util.ui.cloneDialog.VcsCloneDialog
class GetFromVersionControlAction : DumbAwareAction() {
open class GetFromVersionControlAction : DumbAwareAction() {
override fun update(e: AnActionEvent) {
val isEnabled = CheckoutProvider.EXTENSION_POINT_NAME.hasAnyExtensions() && Registry.`is`("vcs.use.new.clone.dialog")
e.presentation.isEnabledAndVisible = isEnabled
val presentation = e.presentation
presentation.isEnabledAndVisible = isEnabled
if (!isEnabled)
return
e.presentation.icon = if (e.place == ActionPlaces.WELCOME_SCREEN) AllIcons.Vcs.Clone else null
if (e.place == ActionPlaces.WELCOME_SCREEN) {
presentation.icon = AllIcons.Vcs.Clone
presentation.text = "Get from Version Control"
}
else {
presentation.icon = null
presentation.text = "Get from Version Control..."
}
}
override fun actionPerformed(e: AnActionEvent) {
@@ -29,3 +36,12 @@ class GetFromVersionControlAction : DumbAwareAction() {
}
}
}
class ProjectFromVersionControlAction : GetFromVersionControlAction() {
override fun update(e: AnActionEvent) {
super.update(e)
e.presentation.text = "Project form Version Control..."
}
}
+1 -1
View File
@@ -20,7 +20,7 @@
<action id="ImportProject" class="com.intellij.ide.actions.ImportProjectAction" text="Project from Existing Sources..."/>
<group id="NewProjectFromVCS" class="com.intellij.openapi.vcs.checkout.NewProjectFromVCSGroup" text="Project from Version Control"
popup="true"/>
<action class="com.intellij.openapi.wm.impl.welcomeScreen.GetFromVersionControlAction" text="Project from Version Control..."/>
<action class="com.intellij.openapi.wm.impl.welcomeScreen.ProjectFromVersionControlAction" text="Project from Version Control..."/>
<separator/>
<action id="NewModule" class="com.intellij.openapi.roots.ui.configuration.actions.NewModuleAction" text="Module..."/>
<action id="ImportModule" class="com.intellij.ide.actions.ImportModuleAction" text="Module from Existing Sources..."/>