diff --git a/quickshell/Modals/Greeter/GreeterPluginsPage.qml b/quickshell/Modals/Greeter/GreeterPluginsPage.qml index 4ce194349..5da707b60 100644 --- a/quickshell/Modals/Greeter/GreeterPluginsPage.qml +++ b/quickshell/Modals/Greeter/GreeterPluginsPage.qml @@ -193,7 +193,7 @@ Item { if (modelData.repo) Qt.openUrlExternally(modelData.repo); } - onInstallRequested: PluginService.installFromRegistry(modelData.name, modelData.type === "desktop") + onInstallRequested: PluginService.installFromRegistry(modelData.id, modelData.name, modelData.type === "desktop") } } } diff --git a/quickshell/Modules/Settings/PluginBrowser.qml b/quickshell/Modules/Settings/PluginBrowser.qml index 8c90025a5..5f46321df 100644 --- a/quickshell/Modules/Settings/PluginBrowser.qml +++ b/quickshell/Modules/Settings/PluginBrowser.qml @@ -434,8 +434,8 @@ DankFloatingWindow { ensureSelectedVisible(); } - function installPlugin(pluginName, enableAfterInstall) { - PluginService.installFromRegistry(pluginName, enableAfterInstall, success => { + function installPlugin(pluginId, pluginName, enableAfterInstall) { + PluginService.installFromRegistry(pluginId, pluginName, enableAfterInstall, success => { if (!success) return; refreshPlugins(); @@ -471,7 +471,7 @@ DankFloatingWindow { "message": I18n.tr("Install plugin '%1' from the DMS registry?", "plugin installation confirmation").arg(pluginId), "confirmText": I18n.tr("Install", "install action button"), "cancelText": I18n.tr("Cancel"), - "onConfirm": () => installPlugin(pluginId, true), + "onConfirm": () => installPlugin(pluginId, pluginId, true), "onCancel": () => hide() }); } @@ -952,7 +952,7 @@ DankFloatingWindow { installed: cardCell.modelData.installed || false selected: root.keyboardNavigationActive && cardCell.index === root.selectedIndex onClicked: root.openPluginDetail(cardCell.modelData) - onInstallRequested: root.installPlugin(cardCell.modelData.name, cardCell.modelData.type === "desktop") + onInstallRequested: root.installPlugin(cardCell.modelData.id, cardCell.modelData.name, cardCell.modelData.type === "desktop") } } } @@ -1236,7 +1236,7 @@ DankFloatingWindow { hoverEnabled: true cursorShape: detailInstallButton.buttonState === "available" ? Qt.PointingHandCursor : Qt.ArrowCursor enabled: detailInstallButton.buttonState === "available" - onClicked: root.installPlugin(detailPane.plugin.name, detailPane.plugin.type === "desktop") + onClicked: root.installPlugin(detailPane.plugin.id, detailPane.plugin.name, detailPane.plugin.type === "desktop") } } } diff --git a/quickshell/Modules/Settings/PluginListItem.qml b/quickshell/Modules/Settings/PluginListItem.qml index cf11712ca..62edee78e 100644 --- a/quickshell/Modules/Settings/PluginListItem.qml +++ b/quickshell/Modules/Settings/PluginListItem.qml @@ -202,7 +202,7 @@ StyledRect { onClicked: { const currentPluginName = root.pluginName; const currentPluginId = root.pluginId; - DMSService.update(currentPluginName, response => { + DMSService.update(currentPluginId, response => { if (response.error) { ToastService.showError(I18n.tr("Update failed: %1").arg(response.error)); return; @@ -244,8 +244,9 @@ StyledRect { hoverEnabled: true cursorShape: Qt.PointingHandCursor onClicked: { + const currentPluginId = root.pluginId; const currentPluginName = root.pluginName; - DMSService.uninstall(currentPluginName, response => { + DMSService.uninstall(currentPluginId, response => { if (response.error) { ToastService.showError(I18n.tr("Uninstall failed: %1").arg(response.error)); return; diff --git a/quickshell/Modules/Settings/PluginUpdatesDialog.qml b/quickshell/Modules/Settings/PluginUpdatesDialog.qml index 9ebfc65d4..e9415dc6c 100644 --- a/quickshell/Modules/Settings/PluginUpdatesDialog.qml +++ b/quickshell/Modules/Settings/PluginUpdatesDialog.qml @@ -52,7 +52,7 @@ StyledRect { isUpdating = true; currentUpdatingPlugin = plugin.name; - DMSService.update(plugin.name, response => { + DMSService.update(plugin.id, response => { isUpdating = false; currentUpdatingPlugin = ""; if (response.error) { @@ -89,7 +89,7 @@ StyledRect { var plugin = list[idx]; currentUpdatingPlugin = plugin.name; - DMSService.update(plugin.name, response => { + DMSService.update(plugin.id, response => { if (response.error) { ToastService.showError(I18n.tr("Failed to update %1: %2").arg(plugin.name).arg(response.error)); } else { diff --git a/quickshell/Services/PluginService.qml b/quickshell/Services/PluginService.qml index c24b23ee2..ffa6d4c0c 100644 --- a/quickshell/Services/PluginService.qml +++ b/quickshell/Services/PluginService.qml @@ -1281,16 +1281,17 @@ Singleton { return badges; } - function installFromRegistry(pluginName, enableAfterInstall, onDone) { - ToastService.showInfo(I18n.tr("Installing: %1", "installation progress").arg(pluginName)); - DMSService.install(pluginName, response => { + function installFromRegistry(pluginId, pluginName, enableAfterInstall, onDone) { + const displayName = pluginName || pluginId; + ToastService.showInfo(I18n.tr("Installing: %1", "installation progress").arg(displayName)); + DMSService.install(pluginId, response => { if (response.error) { ToastService.showError(I18n.tr("Install failed: %1", "installation error").arg(response.error)); if (onDone) onDone(false); return; } - ToastService.showInfo(I18n.tr("Installed: %1", "installation success").arg(pluginName)); + ToastService.showInfo(I18n.tr("Installed: %1", "installation success").arg(displayName)); scanPlugins(); if (!enableAfterInstall) { if (onDone) @@ -1298,11 +1299,11 @@ Singleton { return; } Qt.callLater(() => { - enablePlugin(pluginName); - const plugin = availablePlugins[pluginName]; + enablePlugin(pluginId); + const plugin = availablePlugins[pluginId]; if (plugin?.type === "desktop") { - const defaultConfig = DesktopWidgetRegistry.getDefaultConfig(pluginName); - SettingsData.createDesktopWidgetInstance(pluginName, plugin.name || pluginName, defaultConfig); + const defaultConfig = DesktopWidgetRegistry.getDefaultConfig(pluginId); + SettingsData.createDesktopWidgetInstance(pluginId, plugin.name || displayName, defaultConfig); } if (onDone) onDone(true);