Actions.qml 12 KB

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