mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 20:19:13 +08:00
Simplify enabled check for install button
That code was a bit wordy there. Contributes to issue CURA-5035.
This commit is contained in:
parent
050d7ec5f1
commit
2291164a6d
@ -66,7 +66,7 @@ Item
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( toolbox.isDownloading && toolbox.activePackage == model )
|
if (toolbox.isDownloading && toolbox.activePackage == model)
|
||||||
{
|
{
|
||||||
return catalog.i18nc("@action:button", "Cancel")
|
return catalog.i18nc("@action:button", "Cancel")
|
||||||
}
|
}
|
||||||
@ -76,21 +76,7 @@ Item
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
enabled:
|
enabled: installed || !(toolbox.isDownloading && toolbox.activePackage != model) //Don't allow installing while another download is running.
|
||||||
{
|
|
||||||
if (installed)
|
|
||||||
{
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
if ( toolbox.isDownloading )
|
|
||||||
{
|
|
||||||
return toolbox.activePackage == model ? true : false
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
opacity: enabled ? 1.0 : 0.5
|
opacity: enabled ? 1.0 : 0.5
|
||||||
style: ButtonStyle
|
style: ButtonStyle
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user