UserOperations.qml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // Copyright (c) 2018 Ultimaker B.V.
  2. // Cura is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.10
  4. import QtQuick.Controls 2.3
  5. import UM 1.4 as UM
  6. import Cura 1.1 as Cura
  7. Column
  8. {
  9. spacing: UM.Theme.getSize("default_margin").height
  10. Label
  11. {
  12. id: title
  13. anchors.horizontalCenter: parent.horizontalCenter
  14. horizontalAlignment: Text.AlignHCenter
  15. renderType: Text.NativeRendering
  16. text: catalog.i18nc("@label The argument is a username.", "Hi %1").arg(profile.username)
  17. font: UM.Theme.getFont("large_bold")
  18. color: UM.Theme.getColor("text")
  19. }
  20. SyncState
  21. {
  22. id: syncRow
  23. }
  24. Label
  25. {
  26. id: lastSyncLabel
  27. anchors.horizontalCenter: parent.horizontalCenter
  28. horizontalAlignment: Text.AlignHCenter
  29. renderType: Text.NativeRendering
  30. text: catalog.i18nc("@label The argument is a timestamp", "Last update: %1").arg(Cura.API.account.lastSyncDateTime)
  31. font: UM.Theme.getFont("default")
  32. color: UM.Theme.getColor("text_medium")
  33. }
  34. Cura.SecondaryButton
  35. {
  36. id: accountButton
  37. anchors.horizontalCenter: parent.horizontalCenter
  38. width: UM.Theme.getSize("account_button").width
  39. height: UM.Theme.getSize("account_button").height
  40. text: catalog.i18nc("@button", "Ultimaker account")
  41. onClicked: Qt.openUrlExternally(CuraApplication.ultimakerCloudAccountRootUrl)
  42. fixedWidthMode: false
  43. }
  44. Label
  45. {
  46. id: signOutButton
  47. anchors.horizontalCenter: parent.horizontalCenter
  48. text: catalog.i18nc("@button", "Sign out")
  49. color: UM.Theme.getColor("secondary_button_text")
  50. font: UM.Theme.getFont("medium")
  51. renderType: Text.NativeRendering
  52. MouseArea
  53. {
  54. anchors.fill: parent
  55. onClicked: Cura.API.account.logout()
  56. hoverEnabled: true
  57. onEntered: signOutButton.font.underline = true
  58. onExited: signOutButton.font.underline = false
  59. }
  60. }
  61. }