Remove unused aliases from SyncState.qml

CURA-7290
This commit is contained in:
Nino van Hooff 2020-05-13 16:14:21 +02:00
parent 37992e25de
commit 97d1c3200b
2 changed files with 12 additions and 21 deletions

View File

@ -7,11 +7,7 @@ import Cura 1.1 as Cura
Row // sync state icon + message Row // sync state icon + message
{ {
property alias iconSource: icon.source id: syncRow
property alias labelText: stateLabel.text
property alias syncButtonVisible: accountSyncButton.visible
property alias animateIconRotation: updateAnimator.running
width: childrenRect.width width: childrenRect.width
height: childrenRect.height height: childrenRect.height
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
@ -83,24 +79,24 @@ Row // sync state icon + message
onSyncStateChanged: { onSyncStateChanged: {
if(newState == Cura.AccountSyncState.SYNCING){ if(newState == Cura.AccountSyncState.SYNCING){
syncRow.iconSource = UM.Theme.getIcon("update") icon.source = UM.Theme.getIcon("update")
syncRow.labelText = catalog.i18nc("@label", "Checking...") stateLabel.text = catalog.i18nc("@label", "Checking...")
} else if (newState == Cura.AccountSyncState.SUCCESS) { } else if (newState == Cura.AccountSyncState.SUCCESS) {
syncRow.iconSource = UM.Theme.getIcon("checked") icon.source = UM.Theme.getIcon("checked")
syncRow.labelText = catalog.i18nc("@label", "You are up to date") stateLabel.text = catalog.i18nc("@label", "You are up to date")
} else if (newState == Cura.AccountSyncState.ERROR) { } else if (newState == Cura.AccountSyncState.ERROR) {
syncRow.iconSource = UM.Theme.getIcon("warning_light") icon.source = UM.Theme.getIcon("warning_light")
syncRow.labelText = catalog.i18nc("@label", "Something went wrong...") stateLabel.text = catalog.i18nc("@label", "Something went wrong...")
} else { } else {
print("Error: unexpected sync state: " + newState) print("Error: unexpected sync state: " + newState)
} }
if(newState == Cura.AccountSyncState.SYNCING){ if(newState == Cura.AccountSyncState.SYNCING){
syncRow.animateIconRotation = true updateAnimator.running = true
syncRow.syncButtonVisible = false accountSyncButton.visible = false
} else { } else {
syncRow.animateIconRotation = false updateAnimator.running = false
syncRow.syncButtonVisible = true accountSyncButton.visible = true
} }
} }

View File

@ -29,12 +29,7 @@ Column
color: UM.Theme.getColor("text") color: UM.Theme.getColor("text")
} }
SyncState SyncState {}
{
id: syncRow
}
Label Label
{ {