settings: add a link to the source code in plugin details (#3690)

* settings: add a link to the source code in plugin details

* style: remove unnecessary whitespace, add empty line

* show link to the plugin source instead of explanation

* fix: check for empty string instead of undefined
This commit is contained in:
apollo79
2026-10-04 21:36:37 -04:00
committed by GitHub
parent 18610b8972
commit 2b01926e31
@@ -22,6 +22,7 @@ FocusScope {
readonly property bool hasSettings: !!pluginData?.settings && !isDesktopPlugin
readonly property bool isSystemPlugin: pluginData?.source === "system"
readonly property string pluginName: pluginData?.name || pluginId
readonly property string pluginRepo: DMSService.installedPlugins.find(entry => entry.id === pluginId)?.repo ?? ""
readonly property string requiresDms: pluginData?.requires_dms || ""
readonly property bool meetsRequirements: requiresDms ? PluginService.checkPluginCompatibility(requiresDms) : true
readonly property var permissions: Array.isArray(pluginData?.permissions) ? pluginData.permissions : []
@@ -239,6 +240,22 @@ FocusScope {
visible: subtitle !== ""
}
SettingsRow {
iconName: "code"
title: I18n.tr("Plugin Source Code", "plugin settings page, plugin details")
subtitle: I18n.tr("Opens %1", "plugin settings page, plugin details, %1 is the link to the plugin source code").arg(root.pluginRepo)
clickable: true
visible: root.pluginRepo !== ""
onClicked: Qt.openUrlExternally(root.pluginRepo)
DankIcon {
anchors.verticalCenter: parent.verticalCenter
name: "open_in_browser"
size: Theme.iconSizeMedium
color: Theme.primary
}
}
SettingsRow {
visible: root.permissions.length > 0
body: Flow {