From 8bb693d143f949aad9b5a97de8091db0ea31f7a3 Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Tue, 9 Mar 2021 12:53:01 +0300 Subject: [PATCH] Extract the "Untrusted Project" editor notification banner to platform-impl So it can be reused by other subsystems, which are not related to external systems. GitOrigin-RevId: 3a1699b8a7c41e819dc9c943ff496e3abff3a99b --- .../messages/ExternalSystemBundle.properties | 4 --- .../UntrustedProjectNotificationProvider.kt | 25 ++++++------------- .../resources/messages/IdeBundle.properties | 3 +++ ...UntrustedProjectEditorNotificationPanel.kt | 22 ++++++++++++++++ 4 files changed, 32 insertions(+), 22 deletions(-) create mode 100644 platform/platform-impl/src/com/intellij/ide/impl/UntrustedProjectEditorNotificationPanel.kt diff --git a/platform/external-system-api/resources/messages/ExternalSystemBundle.properties b/platform/external-system-api/resources/messages/ExternalSystemBundle.properties index 96bbf66d7836..e586be193f0d 100644 --- a/platform/external-system-api/resources/messages/ExternalSystemBundle.properties +++ b/platform/external-system-api/resources/messages/ExternalSystemBundle.properties @@ -17,10 +17,6 @@ unlinked.project.notification.help.text=\ untrusted.project.notification.execution.error={0} project is untrusted, so its task cannot be executed. -untrusted.project.notification.trust.link=Trust project\u2026 -untrusted.project.notification.read.more.link=Read more -untrusted.project.notification.description=Safe mode, limited functionality. Trust the project to access full IDE functionality. - untrusted.project.notification.trust.button=Trust Project untrusted.project.notification.distrust.button=Stay in Safe Mode untrusted.project.notification.title=Trust {0} {1,choice,1#Project|1 Unit) : EditorNotificationPanel(fileEditor) { + init { + text = IdeBundle.message("untrusted.project.notification.description") + createActionLabel(IdeBundle.message("untrusted.project.notification.trust.link"), { + TrustedProjectsStatistics.TRUST_PROJECT_FROM_BANNER.log() + onTrustProjectLinkClicked() + }, false) + createActionLabel(IdeBundle.message("untrusted.project.notification.read.more.link"), { + TrustedProjectsStatistics.READ_MORE_FROM_BANNER.log() + HelpManager.getInstance().invokeHelp(TRUSTED_PROJECTS_HELP_TOPIC) + }, false) + } +} \ No newline at end of file