From 2291164a6de7eb764c192dde3df6170e1d0dae98 Mon Sep 17 00:00:00 2001 From: Ruben D Date: Wed, 2 May 2018 14:03:19 +0200 Subject: [PATCH] Simplify enabled check for install button That code was a bit wordy there. Contributes to issue CURA-5035. --- .../resources/qml/ToolboxDetailTile.qml | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml b/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml index b81e511cc6..d992f4875b 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml @@ -66,7 +66,7 @@ Item } else { - if ( toolbox.isDownloading && toolbox.activePackage == model ) + if (toolbox.isDownloading && toolbox.activePackage == model) { return catalog.i18nc("@action:button", "Cancel") } @@ -76,21 +76,7 @@ Item } } } - enabled: - { - if (installed) - { - return true - } - if ( toolbox.isDownloading ) - { - return toolbox.activePackage == model ? true : false - } - else - { - return true - } - } + enabled: installed || !(toolbox.isDownloading && toolbox.activePackage != model) //Don't allow installing while another download is running. opacity: enabled ? 1.0 : 0.5 style: ButtonStyle {