From e8491b4a8364680294b6c2e341f2fc2a234d3eec Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Fri, 23 Mar 2018 11:10:21 +0100 Subject: [PATCH 1/2] CURA-5135 Easy version This is the easy fix. When a plugin is downloading, the other plugins' download buttons are not possible to be clicked. This avoids having to write any new logic. It does detract a bit from the user experience though. The complicated version requires re-writing a big part of the plugin browser code to enable the queueing of downloads and stuff. That's sort of how it "should" be but is a lot more work. --- plugins/PluginBrowser/PluginEntry.qml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/plugins/PluginBrowser/PluginEntry.qml b/plugins/PluginBrowser/PluginEntry.qml index eff9eb8943..fab8f43e07 100644 --- a/plugins/PluginBrowser/PluginEntry.qml +++ b/plugins/PluginBrowser/PluginEntry.qml @@ -129,6 +129,28 @@ Component { return catalog.i18nc("@action:button", "Install"); } } + enabled: + { + if ( manager.isDownloading ) + { + return pluginList.activePlugin == model ? true : false + } + else + { + return true + } + } + opacity: + { + if ( pluginList.activePlugin == model ) + { + return 1.0 + } + else + { + manager.isDownloading ? 0.5 : 1.0 + } + } visible: model.external && ((model.status !== "installed") || model.can_upgrade) style: ButtonStyle { background: Rectangle { From 8a36f1e0744c6fbd85efd76ace60315bcc850056 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 23 Mar 2018 14:23:10 +0100 Subject: [PATCH 2/2] Make opacity depend on enabled Simplifies the code a bit. Contributes to issue CURA-5128. --- plugins/PluginBrowser/PluginEntry.qml | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/plugins/PluginBrowser/PluginEntry.qml b/plugins/PluginBrowser/PluginEntry.qml index fab8f43e07..9dbcb96e79 100644 --- a/plugins/PluginBrowser/PluginEntry.qml +++ b/plugins/PluginBrowser/PluginEntry.qml @@ -1,4 +1,4 @@ -// Copyright (c) 2017 Ultimaker B.V. +// Copyright (c) 2018 Ultimaker B.V. // PluginBrowser is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 @@ -140,17 +140,7 @@ Component { return true } } - opacity: - { - if ( pluginList.activePlugin == model ) - { - return 1.0 - } - else - { - manager.isDownloading ? 0.5 : 1.0 - } - } + opacity: enabled ? 1.0 : 0.5 visible: model.external && ((model.status !== "installed") || model.can_upgrade) style: ButtonStyle { background: Rectangle {