Actions.qml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463
  1. // Copyright (c) 2018 Ultimaker B.V.
  2. // Cura is released under the terms of the LGPLv3 or higher.
  3. pragma Singleton
  4. import QtQuick 2.10
  5. import QtQuick.Controls 1.1
  6. import QtQuick.Controls 2.3 as Controls2
  7. import UM 1.1 as UM
  8. import Cura 1.0 as Cura
  9. Item
  10. {
  11. property alias newProject: newProjectAction;
  12. property alias open: openAction;
  13. property alias quit: quitAction;
  14. property alias undo: undoAction;
  15. property alias redo: redoAction;
  16. property alias view3DCamera: view3DCameraAction;
  17. property alias viewFrontCamera: viewFrontCameraAction;
  18. property alias viewTopCamera: viewTopCameraAction;
  19. property alias viewBottomCamera: viewBottomCameraAction;
  20. property alias viewLeftSideCamera: viewLeftSideCameraAction;
  21. property alias viewRightSideCamera: viewRightSideCameraAction;
  22. property alias deleteSelection: deleteSelectionAction;
  23. property alias centerSelection: centerSelectionAction;
  24. property alias multiplySelection: multiplySelectionAction;
  25. property alias deleteObject: deleteObjectAction;
  26. property alias centerObject: centerObjectAction;
  27. property alias groupObjects: groupObjectsAction;
  28. property alias unGroupObjects:unGroupObjectsAction;
  29. property alias mergeObjects: mergeObjectsAction;
  30. //property alias unMergeObjects: unMergeObjectsAction;
  31. property alias multiplyObject: multiplyObjectAction;
  32. property alias selectAll: selectAllAction;
  33. property alias deleteAll: deleteAllAction;
  34. property alias reloadAll: reloadAllAction;
  35. property alias arrangeAllBuildPlates: arrangeAllBuildPlatesAction;
  36. property alias arrangeAll: arrangeAllAction;
  37. property alias arrangeSelection: arrangeSelectionAction;
  38. property alias resetAllTranslation: resetAllTranslationAction;
  39. property alias resetAll: resetAllAction;
  40. property alias addMachine: addMachineAction;
  41. property alias configureMachines: settingsAction;
  42. property alias addProfile: addProfileAction;
  43. property alias updateProfile: updateProfileAction;
  44. property alias resetProfile: resetProfileAction;
  45. property alias manageProfiles: manageProfilesAction;
  46. property alias manageMaterials: manageMaterialsAction;
  47. property alias marketplaceMaterials: marketplaceMaterialsAction;
  48. property alias preferences: preferencesAction;
  49. property alias showProfileFolder: showProfileFolderAction;
  50. property alias documentation: documentationAction;
  51. property alias showTroubleshooting: showTroubleShootingAction
  52. property alias reportBug: reportBugAction;
  53. property alias whatsNew: whatsNewAction
  54. property alias about: aboutAction;
  55. property alias toggleFullScreen: toggleFullScreenAction;
  56. property alias exitFullScreen: exitFullScreenAction
  57. property alias configureSettingVisibility: configureSettingVisibilityAction
  58. property alias browsePackages: browsePackagesAction
  59. UM.I18nCatalog{id: catalog; name: "cura"}
  60. Action
  61. {
  62. id: showTroubleShootingAction
  63. onTriggered: Qt.openUrlExternally("https://ultimaker.com/en/troubleshooting")
  64. text: catalog.i18nc("@action:inmenu", "Show Online Troubleshooting Guide");
  65. }
  66. Action
  67. {
  68. id: toggleFullScreenAction
  69. shortcut: StandardKey.FullScreen
  70. text: catalog.i18nc("@action:inmenu", "Toggle Full Screen")
  71. iconName: "view-fullscreen"
  72. }
  73. Action
  74. {
  75. id: exitFullScreenAction
  76. shortcut: StandardKey.Cancel
  77. text: catalog.i18nc("@action:inmenu", "Exit Full Screen")
  78. iconName: "view-fullscreen"
  79. }
  80. Action
  81. {
  82. id: undoAction;
  83. text: catalog.i18nc("@action:inmenu menubar:edit", "&Undo");
  84. iconName: "edit-undo";
  85. shortcut: StandardKey.Undo;
  86. onTriggered: UM.OperationStack.undo();
  87. enabled: UM.OperationStack.canUndo;
  88. }
  89. Action
  90. {
  91. id: redoAction;
  92. text: catalog.i18nc("@action:inmenu menubar:edit", "&Redo");
  93. iconName: "edit-redo";
  94. shortcut: StandardKey.Redo;
  95. onTriggered: UM.OperationStack.redo();
  96. enabled: UM.OperationStack.canRedo;
  97. }
  98. Action
  99. {
  100. id: quitAction
  101. text: catalog.i18nc("@action:inmenu menubar:file","&Quit")
  102. iconName: "application-exit"
  103. shortcut: StandardKey.Quit
  104. }
  105. Action
  106. {
  107. id: view3DCameraAction
  108. text: catalog.i18nc("@action:inmenu menubar:view", "3D View")
  109. onTriggered: UM.Controller.setCameraRotation("3d", 0)
  110. }
  111. Action
  112. {
  113. id: viewFrontCameraAction
  114. text: catalog.i18nc("@action:inmenu menubar:view", "Front View")
  115. onTriggered: UM.Controller.setCameraRotation("home", 0)
  116. }
  117. Action
  118. {
  119. id: viewTopCameraAction
  120. text: catalog.i18nc("@action:inmenu menubar:view", "Top View")
  121. onTriggered: UM.Controller.setCameraRotation("y", 90)
  122. }
  123. Action
  124. {
  125. id: viewBottomCameraAction
  126. text: catalog.i18nc("@action:inmenu menubar:view", "Bottom View")
  127. onTriggered: UM.Controller.setCameraRotation("y", -90)
  128. }
  129. Action
  130. {
  131. id: viewLeftSideCameraAction
  132. text: catalog.i18nc("@action:inmenu menubar:view", "Left Side View")
  133. onTriggered: UM.Controller.setCameraRotation("x", 90)
  134. }
  135. Action
  136. {
  137. id: viewRightSideCameraAction
  138. text: catalog.i18nc("@action:inmenu menubar:view", "Right Side View")
  139. onTriggered: UM.Controller.setCameraRotation("x", -90)
  140. }
  141. Action
  142. {
  143. id: preferencesAction
  144. text: catalog.i18nc("@action:inmenu", "Configure Cura...")
  145. iconName: "configure"
  146. }
  147. Action
  148. {
  149. id: addMachineAction
  150. text: catalog.i18nc("@action:inmenu menubar:printer", "&Add Printer...")
  151. }
  152. Action
  153. {
  154. id: settingsAction
  155. text: catalog.i18nc("@action:inmenu menubar:printer", "Manage Pr&inters...")
  156. iconName: "configure"
  157. }
  158. Action
  159. {
  160. id: manageMaterialsAction
  161. text: catalog.i18nc("@action:inmenu", "Manage Materials...")
  162. iconName: "configure"
  163. shortcut: "Ctrl+K"
  164. }
  165. Action
  166. {
  167. id: marketplaceMaterialsAction
  168. text: catalog.i18nc("@action:inmenu", "Add more materials from Marketplace")
  169. }
  170. Action
  171. {
  172. id: updateProfileAction;
  173. enabled: !Cura.MachineManager.stacksHaveErrors && Cura.MachineManager.hasUserSettings && Cura.MachineManager.activeQualityChangesGroup != null
  174. text: catalog.i18nc("@action:inmenu menubar:profile","&Update profile with current settings/overrides");
  175. onTriggered: Cura.ContainerManager.updateQualityChanges();
  176. }
  177. Action
  178. {
  179. id: resetProfileAction;
  180. enabled: Cura.MachineManager.hasUserSettings
  181. text: catalog.i18nc("@action:inmenu menubar:profile", "&Discard current changes");
  182. onTriggered:
  183. {
  184. forceActiveFocus();
  185. Cura.ContainerManager.clearUserContainers();
  186. }
  187. }
  188. Action
  189. {
  190. id: addProfileAction;
  191. enabled: !Cura.MachineManager.stacksHaveErrors && Cura.MachineManager.hasUserSettings
  192. text: catalog.i18nc("@action:inmenu menubar:profile", "&Create profile from current settings/overrides...");
  193. }
  194. Action
  195. {
  196. id: manageProfilesAction
  197. text: catalog.i18nc("@action:inmenu menubar:profile", "Manage Profiles...")
  198. iconName: "configure"
  199. shortcut: "Ctrl+J"
  200. }
  201. Action
  202. {
  203. id: documentationAction;
  204. text: catalog.i18nc("@action:inmenu menubar:help", "Show Online &Documentation");
  205. iconName: "help-contents";
  206. shortcut: StandardKey.Help;
  207. onTriggered: CuraActions.openDocumentation();
  208. }
  209. Action {
  210. id: reportBugAction;
  211. text: catalog.i18nc("@action:inmenu menubar:help", "Report a &Bug");
  212. iconName: "tools-report-bug";
  213. onTriggered: CuraActions.openBugReportPage();
  214. }
  215. Action
  216. {
  217. id: whatsNewAction;
  218. text: catalog.i18nc("@action:inmenu menubar:help", "What's New");
  219. }
  220. Action
  221. {
  222. id: aboutAction;
  223. text: catalog.i18nc("@action:inmenu menubar:help", "About...");
  224. iconName: "help-about";
  225. }
  226. Action
  227. {
  228. id: deleteSelectionAction;
  229. text: catalog.i18nc("@action:inmenu menubar:edit", "Delete Selected");
  230. enabled: UM.Controller.toolsEnabled && UM.Selection.hasSelection;
  231. iconName: "edit-delete";
  232. shortcut: StandardKey.Delete | "Backspace"
  233. onTriggered: CuraActions.deleteSelection();
  234. }
  235. Action
  236. {
  237. id: centerSelectionAction;
  238. text: catalog.i18nc("@action:inmenu menubar:edit", "Center Selected");
  239. enabled: UM.Controller.toolsEnabled && UM.Selection.hasSelection;
  240. iconName: "align-vertical-center";
  241. onTriggered: CuraActions.centerSelection();
  242. }
  243. Action
  244. {
  245. id: multiplySelectionAction;
  246. text: catalog.i18nc("@action:inmenu menubar:edit", "Multiply Selected");
  247. enabled: UM.Controller.toolsEnabled && UM.Selection.hasSelection;
  248. iconName: "edit-duplicate";
  249. shortcut: "Ctrl+M"
  250. }
  251. Action
  252. {
  253. id: deleteObjectAction;
  254. text: catalog.i18nc("@action:inmenu","Delete Model");
  255. enabled: UM.Controller.toolsEnabled;
  256. iconName: "edit-delete";
  257. }
  258. Action
  259. {
  260. id: centerObjectAction;
  261. text: catalog.i18nc("@action:inmenu","Ce&nter Model on Platform");
  262. }
  263. Action
  264. {
  265. id: groupObjectsAction
  266. text: catalog.i18nc("@action:inmenu menubar:edit","&Group Models");
  267. enabled: UM.Selection.selectionCount > 1 ? true: false
  268. iconName: "object-group"
  269. shortcut: "Ctrl+G";
  270. onTriggered: CuraApplication.groupSelected();
  271. }
  272. Action
  273. {
  274. id: reloadQmlAction
  275. onTriggered:
  276. {
  277. CuraApplication.reloadQML()
  278. }
  279. shortcut: "Shift+F5"
  280. }
  281. Action
  282. {
  283. id: unGroupObjectsAction
  284. text: catalog.i18nc("@action:inmenu menubar:edit","Ungroup Models");
  285. enabled: UM.Selection.isGroupSelected
  286. iconName: "object-ungroup"
  287. shortcut: "Ctrl+Shift+G";
  288. onTriggered: CuraApplication.ungroupSelected();
  289. }
  290. Action
  291. {
  292. id: mergeObjectsAction
  293. text: catalog.i18nc("@action:inmenu menubar:edit","&Merge Models");
  294. enabled: UM.Selection.selectionCount > 1 ? true: false
  295. iconName: "merge";
  296. shortcut: "Ctrl+Alt+G";
  297. onTriggered: CuraApplication.mergeSelected();
  298. }
  299. Action
  300. {
  301. id: multiplyObjectAction;
  302. text: catalog.i18nc("@action:inmenu","&Multiply Model...");
  303. iconName: "edit-duplicate"
  304. }
  305. Action
  306. {
  307. id: selectAllAction;
  308. text: catalog.i18nc("@action:inmenu menubar:edit","Select All Models");
  309. enabled: UM.Controller.toolsEnabled;
  310. iconName: "edit-select-all";
  311. shortcut: "Ctrl+A";
  312. onTriggered: CuraApplication.selectAll();
  313. }
  314. Action
  315. {
  316. id: deleteAllAction;
  317. text: catalog.i18nc("@action:inmenu menubar:edit","Clear Build Plate");
  318. enabled: UM.Controller.toolsEnabled;
  319. iconName: "edit-delete";
  320. shortcut: "Ctrl+D";
  321. onTriggered: CuraApplication.deleteAll();
  322. }
  323. Action
  324. {
  325. id: reloadAllAction;
  326. text: catalog.i18nc("@action:inmenu menubar:file","Reload All Models");
  327. iconName: "document-revert";
  328. shortcut: "F5"
  329. onTriggered: CuraApplication.reloadAll();
  330. }
  331. Action
  332. {
  333. id: arrangeAllBuildPlatesAction;
  334. text: catalog.i18nc("@action:inmenu menubar:edit","Arrange All Models To All Build Plates");
  335. onTriggered: Printer.arrangeObjectsToAllBuildPlates();
  336. }
  337. Action
  338. {
  339. id: arrangeAllAction;
  340. text: catalog.i18nc("@action:inmenu menubar:edit","Arrange All Models");
  341. onTriggered: Printer.arrangeAll();
  342. shortcut: "Ctrl+R";
  343. }
  344. Action
  345. {
  346. id: arrangeSelectionAction;
  347. text: catalog.i18nc("@action:inmenu menubar:edit","Arrange Selection");
  348. onTriggered: Printer.arrangeSelection();
  349. }
  350. Action
  351. {
  352. id: resetAllTranslationAction;
  353. text: catalog.i18nc("@action:inmenu menubar:edit","Reset All Model Positions");
  354. onTriggered: CuraApplication.resetAllTranslation();
  355. }
  356. Action
  357. {
  358. id: resetAllAction;
  359. text: catalog.i18nc("@action:inmenu menubar:edit","Reset All Model Transformations");
  360. onTriggered: CuraApplication.resetAll();
  361. }
  362. Action
  363. {
  364. id: openAction;
  365. property var fileProviderModel: CuraApplication.getFileProviderModel()
  366. text: catalog.i18nc("@action:inmenu menubar:file","&Open File(s)...");
  367. iconName: "document-open";
  368. // Unassign the shortcut when there are more than one file providers, since then the file provider's shortcut is
  369. // enabled instead, and Ctrl+O is assigned to the local file provider
  370. shortcut: fileProviderModel.count == 1 ? StandardKey.Open : "";
  371. }
  372. Action
  373. {
  374. id: newProjectAction
  375. text: catalog.i18nc("@action:inmenu menubar:file","&New Project...");
  376. shortcut: StandardKey.New
  377. }
  378. Action
  379. {
  380. id: showProfileFolderAction;
  381. text: catalog.i18nc("@action:inmenu menubar:help","Show Configuration Folder");
  382. }
  383. Action
  384. {
  385. id: configureSettingVisibilityAction
  386. text: catalog.i18nc("@action:menu", "Configure setting visibility...");
  387. iconName: "configure"
  388. }
  389. Action
  390. {
  391. id: browsePackagesAction
  392. text: catalog.i18nc("@action:menu", "&Marketplace")
  393. iconName: "plugins_browse"
  394. }
  395. }