Also add the login required label at the installed plugin list

CURA-6006
This commit is contained in:
Jaime van Kessel 2018-12-06 17:35:58 +01:00
parent 2c9c9d8c96
commit d4a255c9e5
2 changed files with 19 additions and 3 deletions

View File

@ -36,7 +36,6 @@ Column
visible: !updateButton.visible // Don't show when the update button is visible
}
Label
{
wrapMode: Text.WordWrap

View File

@ -6,12 +6,13 @@ import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import UM 1.1 as UM
import Cura 1.0 as Cura
import Cura 1.1 as Cura
Column
{
property bool canUpdate: false
property bool canDowngrade: false
property bool loginRequired: model.login_required && !Cura.API.account.isLoggedIn
width: UM.Theme.getSize("toolbox_action_button").width
spacing: UM.Theme.getSize("narrow_margin").height
@ -40,11 +41,27 @@ Column
onActiveAction: toolbox.cancelDownload()
// Don't allow installing while another download is running
enabled: !(toolbox.isDownloading && toolbox.activePackage != model)
enabled: !(toolbox.isDownloading && toolbox.activePackage != model) && !loginRequired
opacity: enabled ? 1.0 : 0.5
visible: canUpdate
}
Label
{
wrapMode: Text.WordWrap
text: catalog.i18nc("@label:The string between <a href=> and </a> is the highlighted link", "<a href='%1'>Log in</a> is required to update")
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
linkColor: UM.Theme.getColor("text_link")
visible: loginRequired
width: updateButton.width
MouseArea
{
anchors.fill: parent
onClicked: Cura.API.account.login()
}
}
Cura.SecondaryButton
{
id: removeButton