diff --git a/resources/qml/Account/SyncState.qml b/resources/qml/Account/SyncState.qml index 8cb832a853..20c0ca9032 100644 --- a/resources/qml/Account/SyncState.qml +++ b/resources/qml/Account/SyncState.qml @@ -78,4 +78,33 @@ Row // sync state icon + message } } } + + signal syncStateChanged(string newState) + + onSyncStateChanged: { + if(newState == "syncing"){ + syncRow.iconSource = UM.Theme.getIcon("update") + syncRow.labelText = catalog.i18nc("@label", "Checking...") + } else if (newState == "success") { + syncRow.iconSource = UM.Theme.getIcon("checked") + syncRow.labelText = catalog.i18nc("@label", "You are up to date") + } else if (newState == "error") { + syncRow.iconSource = UM.Theme.getIcon("warning-light") + syncRow.labelText = catalog.i18nc("@label", "Something went wrong...") + } else { + print("Error: unexpected sync state: " + newState) + } + + if(newState == "syncing"){ + syncRow.animateIconRotation = true + syncRow.syncButtonVisible = false + } else { + syncRow.animateIconRotation = false + syncRow.syncButtonVisible = true + } + } + + Component.onCompleted: Cura.API.account.syncStateChanged.connect(syncStateChanged) + + } \ No newline at end of file diff --git a/resources/qml/Account/UserOperations.qml b/resources/qml/Account/UserOperations.qml index 2a8a84c384..f292c501f3 100644 --- a/resources/qml/Account/UserOperations.qml +++ b/resources/qml/Account/UserOperations.qml @@ -77,31 +77,4 @@ Column } } - signal syncStateChanged(string newState) - - onSyncStateChanged: { - if(newState == "syncing"){ - syncRow.iconSource = UM.Theme.getIcon("update") - syncRow.labelText = catalog.i18nc("@label", "Checking...") - } else if (newState == "success") { - syncRow.iconSource = UM.Theme.getIcon("checked") - syncRow.labelText = catalog.i18nc("@label", "You are up to date") - } else if (newState == "error") { - syncRow.iconSource = UM.Theme.getIcon("warning-light") - syncRow.labelText = catalog.i18nc("@label", "Something went wrong...") - } else { - print("Error: unexpected sync state: " + newState) - } - - if(newState == "syncing"){ - syncRow.animateIconRotation = true - syncRow.syncButtonVisible = false - } else { - syncRow.animateIconRotation = false - syncRow.syncButtonVisible = true - } - } - - Component.onCompleted: Cura.API.account.syncStateChanged.connect(syncStateChanged) - }