Actions.qml 13 KB

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