Actions.qml 12 KB

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