UserOperations.qml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. width: Math.max(title.width, accountButton.width) + 2 * UM.Theme.getSize("default_margin").width
  10. spacing: UM.Theme.getSize("default_margin").height
  11. SystemPalette
  12. {
  13. id: palette
  14. }
  15. Label
  16. {
  17. id: title
  18. anchors.horizontalCenter: parent.horizontalCenter
  19. horizontalAlignment: Text.AlignHCenter
  20. renderType: Text.NativeRendering
  21. text: catalog.i18nc("@label The argument is a username.", "Hi %1").arg(profile.username)
  22. font: UM.Theme.getFont("large_bold")
  23. color: UM.Theme.getColor("text")
  24. }
  25. SyncState
  26. {
  27. id: syncRow
  28. }
  29. Label
  30. {
  31. id: lastSyncLabel
  32. anchors.horizontalCenter: parent.horizontalCenter
  33. horizontalAlignment: Text.AlignHCenter
  34. renderType: Text.NativeRendering
  35. text: catalog.i18nc("@label The argument is a timestamp", "Last update: %1").arg(Cura.API.account.lastSyncDateTime)
  36. font: UM.Theme.getFont("default")
  37. color: UM.Theme.getColor("text_medium")
  38. }
  39. Cura.SecondaryButton
  40. {
  41. id: accountButton
  42. anchors.horizontalCenter: parent.horizontalCenter
  43. width: UM.Theme.getSize("account_button").width
  44. height: UM.Theme.getSize("account_button").height
  45. text: catalog.i18nc("@button", "Ultimaker account")
  46. onClicked: Qt.openUrlExternally(CuraApplication.ultimakerCloudAccountRootUrl)
  47. fixedWidthMode: false
  48. }
  49. Label
  50. {
  51. id: signOutButton
  52. anchors.horizontalCenter: parent.horizontalCenter
  53. text: catalog.i18nc("@button", "Sign out")
  54. color: UM.Theme.getColor("secondary_button_text")
  55. font: UM.Theme.getFont("medium")
  56. renderType: Text.NativeRendering
  57. MouseArea
  58. {
  59. anchors.fill: parent
  60. onClicked: Cura.API.account.logout()
  61. hoverEnabled: true
  62. onEntered: signOutButton.font.underline = true
  63. onExited: signOutButton.font.underline = false
  64. }
  65. }
  66. }