Actions.qml 12 KB

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