Simplify enabled check for install button

That code was a bit wordy there.

Contributes to issue CURA-5035.
This commit is contained in:
Ruben D 2018-05-02 14:03:19 +02:00
parent 050d7ec5f1
commit 2291164a6d
No known key found for this signature in database
GPG key ID: 6B42C9465E304A62

View file

@ -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
{