ApplicationSwitcherPopup.qml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. // Copyright (c) 2021 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 QtQuick.Layouts 1.15
  6. import UM 1.4 as UM
  7. import Cura 1.1 as Cura
  8. Popup
  9. {
  10. id: applicationSwitcherPopup
  11. closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent
  12. opacity: opened ? 1 : 0
  13. Behavior on opacity { NumberAnimation { duration: 100 } }
  14. padding: UM.Theme.getSize("wide_margin").width
  15. contentItem: Grid
  16. {
  17. id: ultimakerPlatformLinksGrid
  18. columns: 3
  19. spacing: UM.Theme.getSize("default_margin").width
  20. Repeater
  21. {
  22. model:
  23. [
  24. {
  25. displayName: catalog.i18nc("@label:button", "My printers"),
  26. thumbnail: UM.Theme.getIcon("PrinterTriple", "high"),
  27. description: catalog.i18nc("@tooltip:button", "Monitor printers in Ultimaker Digital Factory."),
  28. link: "https://digitalfactory.ultimaker.com/app/printers?utm_source=cura&utm_medium=software&utm_campaign=switcher-digital-factory-printers",
  29. DFAccessRequired: true
  30. },
  31. {
  32. displayName: "Digital Library", //Not translated, since it's a brand name.
  33. thumbnail: UM.Theme.getIcon("Library", "high"),
  34. description: catalog.i18nc("@tooltip:button", "Create print projects in Digital Library."),
  35. link: "https://digitalfactory.ultimaker.com/app/library?utm_source=cura&utm_medium=software&utm_campaign=switcher-library",
  36. DFAccessRequired: true
  37. },
  38. {
  39. displayName: catalog.i18nc("@label:button", "Print jobs"),
  40. thumbnail: UM.Theme.getIcon("FoodBeverages"),
  41. description: catalog.i18nc("@tooltip:button", "Monitor print jobs and reprint from your print history."),
  42. link: "https://digitalfactory.ultimaker.com/app/print-jobs?utm_source=cura&utm_medium=software&utm_campaign=switcher-digital-factory-printjobs",
  43. DFAccessRequired: true
  44. },
  45. {
  46. displayName: "Ultimaker Marketplace", //Not translated, since it's a brand name.
  47. thumbnail: UM.Theme.getIcon("Shop", "high"),
  48. description: catalog.i18nc("@tooltip:button", "Extend Ultimaker Cura with plugins and material profiles."),
  49. link: "https://marketplace.ultimaker.com/?utm_source=cura&utm_medium=software&utm_campaign=switcher-marketplace-materials",
  50. DFAccessRequired: false
  51. },
  52. {
  53. displayName: "Ultimaker Academy", //Not translated, since it's a brand name.
  54. thumbnail: UM.Theme.getIcon("Knowledge"),
  55. description: catalog.i18nc("@tooltip:button", "Become a 3D printing expert with Ultimaker e-learning."),
  56. link: "https://academy.ultimaker.com/?utm_source=cura&utm_medium=software&utm_campaign=switcher-academy",
  57. DFAccessRequired: false
  58. },
  59. {
  60. displayName: catalog.i18nc("@label:button", "Ultimaker support"),
  61. thumbnail: UM.Theme.getIcon("Help", "high"),
  62. description: catalog.i18nc("@tooltip:button", "Learn how to get started with Ultimaker Cura."),
  63. link: "https://support.ultimaker.com/?utm_source=cura&utm_medium=software&utm_campaign=switcher-support",
  64. DFAccessRequired: false
  65. },
  66. {
  67. displayName: catalog.i18nc("@label:button", "Ask a question"),
  68. thumbnail: UM.Theme.getIcon("Speak", "high"),
  69. description: catalog.i18nc("@tooltip:button", "Consult the Ultimaker Community."),
  70. link: "https://community.ultimaker.com/?utm_source=cura&utm_medium=software&utm_campaign=switcher-community",
  71. DFAccessRequired: false
  72. },
  73. {
  74. displayName: catalog.i18nc("@label:button", "Report a bug"),
  75. thumbnail: UM.Theme.getIcon("Bug", "high"),
  76. description: catalog.i18nc("@tooltip:button", "Let developers know that something is going wrong."),
  77. link: "https://github.com/Ultimaker/Cura/issues/new/choose",
  78. DFAccessRequired: false
  79. },
  80. {
  81. displayName: "Ultimaker.com", //Not translated, since it's a URL.
  82. thumbnail: UM.Theme.getIcon("Browser"),
  83. description: catalog.i18nc("@tooltip:button", "Visit the Ultimaker website."),
  84. link: "https://ultimaker.com/?utm_source=cura&utm_medium=software&utm_campaign=switcher-umwebsite",
  85. DFAccessRequired: false
  86. }
  87. ]
  88. delegate: ApplicationButton
  89. {
  90. displayName: modelData.displayName
  91. iconSource: modelData.thumbnail
  92. tooltipText: modelData.description
  93. isExternalLink: true
  94. visible: modelData.DFAccessRequired ? Cura.API.account.isLoggedIn & Cura.API.account.additionalRights["df_access"] : true
  95. onClicked: Qt.openUrlExternally(modelData.link)
  96. }
  97. }
  98. }
  99. background: UM.PointingRectangle
  100. {
  101. color: UM.Theme.getColor("tool_panel_background")
  102. borderColor: UM.Theme.getColor("lining")
  103. borderWidth: UM.Theme.getSize("default_lining").width
  104. // Move the target by the default margin so that the arrow isn't drawn exactly on the corner
  105. target: Qt.point(width - UM.Theme.getSize("default_margin").width - (applicationSwitcherButton.width / 2), -10)
  106. arrowSize: UM.Theme.getSize("default_arrow").width
  107. }
  108. }