[python] add actions for advertising PRO features in PyCharm CE PY-62397

GitOrigin-RevId: 24dd0c41ccf669feb0b03fcb8274caa239d45ecd
This commit is contained in:
Vladimir Koshelev
2023-10-30 22:57:59 +01:00
committed by intellij-monorepo-bot
parent f4b1196c7e
commit c5e2faf55b
6 changed files with 239 additions and 3 deletions

View File

@@ -63,9 +63,9 @@ sealed interface PluginAdvertiserService {
"https://www.jetbrains.com/idea/download/download-thanks.html?platform={type}")
@Suppress("HardCodedStringLiteral", "DialogTitleCapitalization")
private val pyCharmProfessional = SuggestedIde("PyCharm Professional",
"https://www.jetbrains.com/pycharm/download/",
"https://www.jetbrains.com/pycharm/download/download-thanks.html?platform={type}")
val pyCharmProfessional = SuggestedIde("PyCharm Professional",
"https://www.jetbrains.com/pycharm/download/",
"https://www.jetbrains.com/pycharm/download/download-thanks.html?platform={type}")
@Suppress("HardCodedStringLiteral")
internal val ides: Map<String, SuggestedIde> = linkedMapOf(

View File

@@ -38,6 +38,7 @@ public final class PythonIcons {
/** 16x16 */ public static final @NotNull Icon NumPy = load("icons/com/jetbrains/python/numPy.svg", -950957593, 2);
/** 16x16 */ public static final @NotNull Icon Pandas = load("icons/com/jetbrains/python/pandas.svg", -1432595650, 2);
/** 16x16 */ public static final @NotNull Icon Polars = load("icons/com/jetbrains/python/polars.svg", 1244997887, 2);
/** 16x16 */ public static final @NotNull Icon Pycharm = load("icons/com/jetbrains/python/pycharm.svg", -650470949, 0);
/** 16x16 */ public static final @NotNull Icon Pypy = load("icons/com/jetbrains/python/pypy.svg", 1053979015, 0);
/** 16x16 */ public static final @NotNull Icon Python = load("icons/com/jetbrains/python/python.svg", 2008591516, 8);
/** 16x16 */ public static final @NotNull Icon PythonClosed = load("icons/com/jetbrains/python/pythonClosed.svg", -1358730690, 0);

View File

@@ -101,4 +101,45 @@
<add-to-group group-id="WelcomeScreen.QuickStart" anchor="first"/>
</group>
</actions>
<actions resource-bundle="messages.PyCharmCommunityCustomizationBundle">
<action class="com.jetbrains.python.promotion.PromoAiCodeCompletion"
id="PromoAiCodeCompletion"
icon="AllIcons.Ultimate.PycharmLock" />
<action class="com.jetbrains.python.promotion.PromoDatabaseAction"
id="PromoDatabaseAction"
icon="AllIcons.Ultimate.PycharmLock" />
<action class="com.jetbrains.python.promotion.PromoDataFrameAction"
id="PromoDataFrameAction"
icon="AllIcons.Ultimate.PycharmLock" />
<action class="com.jetbrains.python.promotion.PromoDjangoAction"
id="PromoDjangoAction"
icon="AllIcons.Ultimate.PycharmLock" />
<action class="com.jetbrains.python.promotion.PromoDockerAction"
id="PromoDockerAction"
icon="AllIcons.Ultimate.PycharmLock" />
<action class="com.jetbrains.python.promotion.PromoEndpointsAction"
id="PromoEndpointsAction"
icon="AllIcons.Ultimate.PycharmLock" />
<action class="com.jetbrains.python.promotion.PromoJavaScriptAction"
id="PromoJavaScriptAction"
icon="AllIcons.Ultimate.PycharmLock" />
<action class="com.jetbrains.python.promotion.PromoSshRemoteToolsAction"
id="PromoSshRemoteToolsAction"
icon="AllIcons.Ultimate.PycharmLock" />
<action class="com.jetbrains.python.promotion.PromoPlotsAction"
id="PromoPlotsAction"
icon="AllIcons.Ultimate.PycharmLock" />
<action class="com.jetbrains.python.promotion.PromoJupyterAction"
id="PromoJupyterAction"
icon="AllIcons.Ultimate.PycharmLock" />
</actions>
</idea-plugin>

View File

@@ -5,6 +5,16 @@ pro.advertiser.notification.title.jupyter.notebook=You are using Jupyter noteboo
pro.advertiser.notification.title.pyramid.framework=You are using the Pyramid framework
pro.advertiser.notification.pycharm.pro.has.support.for.it=<a href="prof">PyCharm Professional Edition</a> has special support for it.
action.PromoAiCodeCompletion.text=Ai Completion
action.PromoDatabaseAction.text=Databases
action.PromoDjangoAction.text=Django
action.PromoDataFrameAction.text=DataFrames
action.PromoDockerAction.text=Docker
action.PromoEndpointsAction.text=Endpoints
action.PromoJavaScriptAction.text=Web Development
action.PromoJupyterAction.text=Jupyter
action.PromoPlotsAction=Plots
action.PromoSshRemoteToolsAction=SSH Remote Tools
temporarily.ignored.file.provider.description=Temporarily ignored files

View File

@@ -0,0 +1,45 @@
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.jetbrains.python.promotion
import javax.swing.Icon
import com.intellij.ide.IdeBundle
import com.intellij.ide.actions.searcheverywhere.PromoAction
import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.extensions.PluginId
import com.intellij.openapi.updateSettings.impl.pluginsAdvertisement.FUSEventSource
import com.intellij.openapi.updateSettings.impl.pluginsAdvertisement.PluginAdvertiserService
import com.intellij.openapi.util.registry.Registry
import icons.PythonIcons
internal abstract class ProPromoAction(private val pluginId: String?): AnAction(), PromoAction {
override fun getPromotedProductIcon(): Icon = PythonIcons.Python.Pycharm
override fun getPromotedProductTitle(): String = PluginAdvertiserService.pyCharmProfessional.name
override fun getCallToAction(): String = IdeBundle.message("plugin.advertiser.free.trial.action")
override fun getActionUpdateThread(): ActionUpdateThread = ActionUpdateThread.BGT
override fun update(e: AnActionEvent) {
e.presentation.isEnabledAndVisible = true
}
override fun actionPerformed(e: AnActionEvent) {
FUSEventSource.ACTIONS.openDownloadPageAndLog(e.project,
PluginAdvertiserService.pyCharmProfessional.downloadUrl,
pluginId?.let { PluginId.getId(it) })
}
}
internal class PromoJupyterAction : ProPromoAction(pluginId = null)
internal class PromoDjangoAction : ProPromoAction(pluginId = null)
internal class PromoEndpointsAction : ProPromoAction(pluginId = null)
internal class PromoDatabaseAction : ProPromoAction(pluginId = null)
internal class PromoDataFrameAction : ProPromoAction(pluginId = null)
internal class PromoPlotsAction : ProPromoAction(pluginId = null)
internal class PromoJavaScriptAction : ProPromoAction(pluginId = null)
internal class PromoSshRemoteToolsAction : ProPromoAction(pluginId = null)
internal class PromoDockerAction : ProPromoAction(pluginId = null)
internal class PromoAiCodeCompletion : ProPromoAction(pluginId = null)

View File

@@ -0,0 +1,139 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7.20003 8.86666L5.73337 9.73333L5.6667 11.2667L3.53337 12.2L0.866699 12.4L1.40003 2.79999L6.93337 0.533325L12.8667 5.93332L7.20003 8.86666Z" fill="url(#paint0_linear)"/>
<path d="M10.6667 3.06667L15.4 6.2L13.8 9.73333L11.2 9H8.8667L10.6667 3.06667Z" fill="url(#paint1_linear)"/>
<path d="M8.13335 11.6L4.20001 2.39999L6.93335 0.533325L15.4 6.19999L8.13335 11.6Z" fill="url(#paint2_linear)"/>
<path d="M1.40002 2.79999L6.93336 0.533325L4.20002 2.39999L1.40002 2.79999Z" fill="url(#paint3_linear)"/>
<path d="M1.40002 2.79999L6.93336 0.533325L4.20002 2.39999L0.533356 12.5333L1.40002 2.79999Z" fill="url(#paint4_linear)"/>
<path d="M6.13336 5.46666L8.53336 13.3333L5.66669 15.4667L0.533356 12.5333L1.86669 8.73333L6.00002 4.46666L6.13336 5.46666Z" fill="#21D789"/>
<path d="M5.06669 11.6L0.533356 12.5333L5.66669 15.4667L8.53336 13.3333L5.06669 11.6Z" fill="url(#paint5_linear)"/>
<path d="M5.06669 11.6L0.533356 12.5333L1.86669 8.73333L6.00002 4.46666L5.06669 11.6Z" fill="url(#paint6_linear)"/>
<path d="M6.33335 11.2667L8.53335 13.3333L5.66669 15.4667L6.33335 11.2667Z" fill="url(#paint7_linear)"/>
<path d="M15.4667 13.9333L10.9334 15.4667L4.80002 13.7333L6.00002 4.46666L11.6667 0.533325L12.2 4.66666L10.6667 7.99999L13.6 6.86666L14.2 9.13333L15.4667 13.9333Z" fill="url(#paint8_linear)"/>
<path d="M15.4667 13.9333L10.9333 15.4667L13.6 6.86665L15.4667 13.9333Z" fill="url(#paint9_linear)"/>
<path d="M11.6667 0.533325L9.53335 5.26666L7.80002 8.99999L10.6667 7.99999L12.2667 4.59999L11.6667 0.533325Z" fill="url(#paint10_linear)"/>
<path d="M1.40002 2.79999L6.93336 0.533325L4.20002 2.39999L1.40002 2.79999Z" fill="url(#paint11_linear)"/>
<path d="M15.4667 13.9333L10.9334 15.4667L4.80002 13.7333L8.53335 13.4L15.4667 13.9333Z" fill="url(#paint12_linear)"/>
<path d="M11.5333 13.6L10.9333 15.4667L15.4667 13.9333L11.5333 13.6Z" fill="url(#paint13_linear)"/>
<path d="M12.6667 3.33333H3.33334V12.6667H12.6667V3.33333Z" fill="url(#paint14_linear)"/>
<path d="M8.00003 6.66664C8.00003 5.53331 8.8667 4.59998 10.0667 4.59998C10.8 4.59998 11.2667 4.86664 11.6667 5.19998L11.1334 5.86664C10.8 5.59998 10.4667 5.39998 10.0667 5.39998C9.40003 5.39998 8.93336 5.93331 8.93336 6.66664C8.93336 7.33331 9.40003 7.93331 10.0667 7.93331C10.5334 7.93331 10.8 7.73331 11.1334 7.46664L11.6667 7.99998C11.2667 8.46664 10.8 8.73331 10.0667 8.73331C8.8667 8.73331 8.00003 7.79998 8.00003 6.66664Z" fill="white"/>
<path d="M4.66669 4.66663H6.26669C7.20002 4.66663 7.73335 5.19996 7.73335 6.06663C7.73335 6.99996 7.00002 7.46663 6.13335 7.46663H5.46669V8.66663H4.66669V4.66663ZM6.20002 6.66663C6.60002 6.66663 6.86669 6.39996 6.86669 6.06663C6.86669 5.66663 6.60002 5.46663 6.20002 5.46663H5.53335V6.66663H6.20002Z" fill="white"/>
<path d="M8.66669 10.6667H4.66669V11.3333H8.66669V10.6667Z" fill="white"/>
<defs>
<linearGradient id="paint0_linear" x1="-4.44043" y1="12.9335" x2="13.6869" y2="-0.448073" gradientUnits="userSpaceOnUse">
<stop offset="0.0107527" stop-color="#FCF84A"/>
<stop offset="0.1116" stop-color="#A7EB62"/>
<stop offset="0.2056" stop-color="#5FE077"/>
<stop offset="0.2727" stop-color="#32DA84"/>
<stop offset="0.3065" stop-color="#21D789"/>
<stop offset="0.5768" stop-color="#21D789"/>
<stop offset="0.5968" stop-color="#21D789"/>
<stop offset="0.686" stop-color="#20D68C"/>
<stop offset="0.7627" stop-color="#1ED497"/>
<stop offset="0.8348" stop-color="#19D1A9"/>
<stop offset="0.904" stop-color="#13CCC2"/>
<stop offset="0.9707" stop-color="#0BC6E1"/>
<stop offset="1" stop-color="#07C3F2"/>
</linearGradient>
<linearGradient id="paint1_linear" x1="11.1082" y1="4.3246" x2="13.2958" y2="11.2421" gradientUnits="userSpaceOnUse">
<stop stop-color="#009AE5"/>
<stop offset="1" stop-color="#07C3F2"/>
</linearGradient>
<linearGradient id="paint2_linear" x1="2.39108" y1="3.71873" x2="13.8083" y2="8.88739" gradientUnits="userSpaceOnUse">
<stop offset="0.0344093" stop-color="#10E899"/>
<stop offset="0.1745" stop-color="#13E596"/>
<stop offset="0.2947" stop-color="#1EDA8C"/>
<stop offset="0.3185" stop-color="#21D789"/>
<stop offset="0.3975" stop-color="#20D68C"/>
<stop offset="0.4653" stop-color="#1ED497"/>
<stop offset="0.529" stop-color="#19D1A9"/>
<stop offset="0.5903" stop-color="#13CCC2"/>
<stop offset="0.6492" stop-color="#0BC6E1"/>
<stop offset="0.6752" stop-color="#07C3F2"/>
<stop offset="0.9215" stop-color="#07EBFF"/>
</linearGradient>
<linearGradient id="paint3_linear" x1="4.81116" y1="2.61126" x2="3.80982" y2="1.11719" gradientUnits="userSpaceOnUse">
<stop stop-color="#07C3F2"/>
<stop offset="0.1949" stop-color="#0BC6E2"/>
<stop offset="0.5746" stop-color="#15CEB8"/>
<stop offset="0.9463" stop-color="#21D789"/>
</linearGradient>
<linearGradient id="paint4_linear" x1="-1.15278" y1="4.07119" x2="4.68469" y2="6.98993" gradientUnits="userSpaceOnUse">
<stop offset="0.030218" stop-color="#C1EF5B"/>
<stop offset="0.2486" stop-color="#9DEA65"/>
<stop offset="0.7318" stop-color="#41DC80"/>
<stop offset="0.896" stop-color="#21D789"/>
</linearGradient>
<linearGradient id="paint5_linear" x1="6.25529" y1="8.70619" x2="2.89689" y2="16.886" gradientUnits="userSpaceOnUse">
<stop offset="0.1026" stop-color="#087CFA"/>
<stop offset="0.2273" stop-color="#0C89EA" stop-opacity="0.8064"/>
<stop offset="0.4716" stop-color="#15ABC0" stop-opacity="0.427"/>
<stop offset="0.7466" stop-color="#21D789" stop-opacity="0"/>
</linearGradient>
<linearGradient id="paint6_linear" x1="3.13882" y1="4.10466" x2="3.33349" y2="12.5028" gradientUnits="userSpaceOnUse">
<stop offset="0.0108126" stop-color="#FCF84A"/>
<stop offset="0.0924045" stop-color="#ECF64F"/>
<stop offset="0.2525" stop-color="#C1EF5B"/>
<stop offset="0.4754" stop-color="#7DE56F"/>
<stop offset="0.7466" stop-color="#21D789"/>
</linearGradient>
<linearGradient id="paint7_linear" x1="5.64442" y1="13.3867" x2="8.52875" y2="13.3867" gradientUnits="userSpaceOnUse">
<stop stop-color="#13A5C7"/>
<stop offset="1" stop-color="#21D789"/>
</linearGradient>
<linearGradient id="paint8_linear" x1="18.579" y1="14.5285" x2="3.18855" y2="3.50793" gradientUnits="userSpaceOnUse">
<stop offset="0.4732" stop-color="#FCF84A"/>
<stop offset="0.5319" stop-color="#ECF74C"/>
<stop offset="0.647" stop-color="#C1F451"/>
<stop offset="0.8056" stop-color="#7EEF5A"/>
<stop offset="0.9489" stop-color="#3BEA62"/>
</linearGradient>
<linearGradient id="paint9_linear" x1="18.1667" y1="10.1551" x2="5.88355" y2="12.2393" gradientUnits="userSpaceOnUse">
<stop offset="0.2756" stop-color="#FCF84A"/>
<stop offset="0.3649" stop-color="#ECF74C"/>
<stop offset="0.5402" stop-color="#C1F451"/>
<stop offset="0.7817" stop-color="#7EEF5A"/>
<stop offset="1" stop-color="#3BEA62"/>
</linearGradient>
<linearGradient id="paint10_linear" x1="13.3726" y1="9.80359" x2="8.73135" y2="3.35899" gradientUnits="userSpaceOnUse">
<stop offset="0.1216" stop-color="#FCF84A"/>
<stop offset="0.2021" stop-color="#F3F74B"/>
<stop offset="0.3351" stop-color="#DAF350"/>
<stop offset="0.5044" stop-color="#B1ED56"/>
<stop offset="0.7031" stop-color="#78E55F"/>
<stop offset="0.9242" stop-color="#30DB6B"/>
<stop offset="1" stop-color="#16D76F"/>
</linearGradient>
<linearGradient id="paint11_linear" x1="1.80322" y1="1.41386" x2="5.98342" y2="1.83439" gradientUnits="userSpaceOnUse">
<stop stop-color="#FCF84A"/>
<stop offset="0.1636" stop-color="#D8F957"/>
<stop offset="0.529" stop-color="#7BFC79"/>
<stop offset="0.9855" stop-color="#00FFA6"/>
</linearGradient>
<linearGradient id="paint12_linear" x1="15.2464" y1="13.3643" x2="3.63395" y2="15.3347" gradientUnits="userSpaceOnUse">
<stop offset="0.0899703" stop-color="#3BEA62"/>
<stop offset="0.1675" stop-color="#67ED5C"/>
<stop offset="0.25" stop-color="#8FF058"/>
<stop offset="0.3382" stop-color="#B1F353"/>
<stop offset="0.4319" stop-color="#CCF550"/>
<stop offset="0.5329" stop-color="#E1F64D"/>
<stop offset="0.6448" stop-color="#F0F74B"/>
<stop offset="0.776" stop-color="#F9F84A"/>
<stop offset="0.9744" stop-color="#FCF84A"/>
</linearGradient>
<linearGradient id="paint13_linear" x1="12.0265" y1="13.0829" x2="14.4258" y2="16.3479" gradientUnits="userSpaceOnUse">
<stop stop-color="#3BEA62"/>
<stop offset="0.0877078" stop-color="#67ED5C"/>
<stop offset="0.1809" stop-color="#8FF058"/>
<stop offset="0.2807" stop-color="#B1F353"/>
<stop offset="0.3866" stop-color="#CCF550"/>
<stop offset="0.5008" stop-color="#E1F64D"/>
<stop offset="0.6273" stop-color="#F0F74B"/>
<stop offset="0.7757" stop-color="#F9F84A"/>
<stop offset="1" stop-color="#FCF84A"/>
</linearGradient>
<linearGradient id="paint14_linear" x1="3.17971" y1="4.0702" x2="12.7531" y2="11.875" gradientUnits="userSpaceOnUse">
<stop stop-color="#1D510B"/>
<stop offset="0.535772"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 8.6 KiB