Actions.qml 13 KB

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