diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d32b6c..a29d15d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] (compatibility: 2024.1 - 2024.3.*) +### Added +- Added download option to Ahk runner-setup notification + ### Changed - Dependencies updated to support IntelliJ 2024.* diff --git a/src/main/kotlin/com/autohotkey/ide/notifications/MissingAhkSdkNotificationProvider.kt b/src/main/kotlin/com/autohotkey/ide/notifications/MissingAhkSdkNotificationProvider.kt index 9d89283..c2924d6 100644 --- a/src/main/kotlin/com/autohotkey/ide/notifications/MissingAhkSdkNotificationProvider.kt +++ b/src/main/kotlin/com/autohotkey/ide/notifications/MissingAhkSdkNotificationProvider.kt @@ -2,8 +2,10 @@ package com.autohotkey.ide.notifications import com.autohotkey.lang.core.isAhkFile import com.autohotkey.project.configurable.AhkProjectConfigurable +import com.autohotkey.sdk.AhkSdkTypeInstance import com.autohotkey.sdk.getAhkSdks import com.autohotkey.util.AhkBundle +import com.intellij.ide.BrowserUtil import com.intellij.openapi.fileEditor.FileEditor import com.intellij.openapi.options.ShowSettingsUtil import com.intellij.openapi.project.DumbAware @@ -27,11 +29,14 @@ class MissingAhkSdkNotificationProvider : EditorNotificationProvider, DumbAware ): Function? { if (!file.isAhkFile() || getAhkSdks().isNotEmpty()) return null return Function { fileEditor -> - EditorNotificationPanel(fileEditor).apply { + EditorNotificationPanel(fileEditor, EditorNotificationPanel.Status.Warning).apply { text = AhkBundle.msg("ahksdktype.projectsetup.noahksdksfound.message") - createActionLabel(AhkBundle.msg("ahksdktype.projectsetup.noahksdksfound.actionlabel")) { + createActionLabel(AhkBundle.msg("ahksdktype.projectsetup.noahksdksfound.configurelabel")) { ShowSettingsUtil.getInstance().showSettingsDialog(proj, AhkProjectConfigurable::class.java) } + createActionLabel(AhkBundle.msg("ahksdktype.projectsetup.noahksdksfound.downloadlabel")) { + BrowserUtil.browse(AhkSdkTypeInstance.downloadSdkUrl) + } } } } diff --git a/src/main/kotlin/com/autohotkey/sdk/AhkSdkType.kt b/src/main/kotlin/com/autohotkey/sdk/AhkSdkType.kt index f37248e..ee0a005 100644 --- a/src/main/kotlin/com/autohotkey/sdk/AhkSdkType.kt +++ b/src/main/kotlin/com/autohotkey/sdk/AhkSdkType.kt @@ -56,6 +56,8 @@ class AhkSdkType : SdkType("AutoHotkeySDK") { override fun suggestHomePath() = """C:\Program Files\AutoHotkey""" + override fun getDownloadSdkUrl(): String = "https://www.autohotkey.com/download/" + override fun getDefaultDocumentationUrl(sdk: Sdk): String = when { sdk.versionString?.startsWith("1") == true -> AHK_DOCUMENTATION_URL_V1 diff --git a/src/main/resources/localization/AhkBundle.properties b/src/main/resources/localization/AhkBundle.properties index 1028a13..0b51cb4 100644 --- a/src/main/resources/localization/AhkBundle.properties +++ b/src/main/resources/localization/AhkBundle.properties @@ -27,7 +27,8 @@ ahksdktype.createsdk.error.noexeselected=You must specify an AutoHotkey executab ahksdktype.createsdk.dialogselecthomepath.description=Please select the home directory containing the AutoHotkey installation ahksdktype.createsdk.dialogexeselect.title=Select AutoHotkey Executable ahksdktype.projectsetup.noahksdksfound.message=No AutoHotkey runners are configured to be able to run this file -ahksdktype.projectsetup.noahksdksfound.actionlabel=Configure AutoHotkey runner... +ahksdktype.projectsetup.noahksdksfound.configurelabel=Configure from disk... +ahksdktype.projectsetup.noahksdksfound.downloadlabel=Download... settings.ahksdktable.general.sdkcolumn.label=AutoHotkey runners settings.ahksdktable.general.defaultcolumn.label=Default