Actions.qml 13 KB

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