UserOperations.qml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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("narrow_margin").height
  10. Item
  11. {
  12. width: childrenRect.width
  13. height: childrenRect.height
  14. AvatarImage
  15. {
  16. id: avatar
  17. width: UM.Theme.getSize("main_window_header").height
  18. height: UM.Theme.getSize("main_window_header").height
  19. source: profile["profile_image_url"] ? profile["profile_image_url"] : ""
  20. outlineColor: "transparent"
  21. }
  22. Column
  23. {
  24. anchors.left: avatar.right
  25. anchors.leftMargin: UM.Theme.getSize("default_margin").width
  26. spacing: UM.Theme.getSize("narrow_margin").height
  27. Label
  28. {
  29. id: username
  30. renderType: Text.NativeRendering
  31. text: profile.username
  32. font: UM.Theme.getFont("large_bold")
  33. color: UM.Theme.getColor("text")
  34. }
  35. SyncState
  36. {
  37. id: syncRow
  38. }
  39. Label
  40. {
  41. id: lastSyncLabel
  42. renderType: Text.NativeRendering
  43. text: catalog.i18nc("@label The argument is a timestamp", "Last update: %1").arg(Cura.API.account.lastSyncDateTime)
  44. font: UM.Theme.getFont("default")
  45. color: UM.Theme.getColor("text_medium")
  46. }
  47. }
  48. }
  49. Rectangle
  50. {
  51. width: parent.width
  52. color: UM.Theme.getColor("lining")
  53. height: UM.Theme.getSize("default_lining").height
  54. }
  55. Cura.TertiaryButton
  56. {
  57. id: cloudButton
  58. width: UM.Theme.getSize("account_button").width
  59. height: UM.Theme.getSize("account_button").height
  60. text: catalog.i18nc("@button", "Ultimaker Digital Factory")
  61. onClicked: Qt.openUrlExternally(CuraApplication.ultimakerDigitalFactoryUrl)
  62. fixedWidthMode: false
  63. }
  64. Cura.TertiaryButton
  65. {
  66. id: accountButton
  67. width: UM.Theme.getSize("account_button").width
  68. height: UM.Theme.getSize("account_button").height
  69. text: catalog.i18nc("@button", "Ultimaker Account")
  70. onClicked: Qt.openUrlExternally(CuraApplication.ultimakerCloudAccountRootUrl)
  71. fixedWidthMode: false
  72. }
  73. Rectangle
  74. {
  75. width: parent.width
  76. color: UM.Theme.getColor("lining")
  77. height: UM.Theme.getSize("default_lining").height
  78. }
  79. Cura.TertiaryButton
  80. {
  81. id: signOutButton
  82. onClicked: Cura.API.account.logout()
  83. text: catalog.i18nc("@button", "Sign Out")
  84. }
  85. }