Actions.qml 13 KB

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