Actions.qml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443
  1. // Copyright (c) 2015 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 expandSidebar: expandSidebarAction;
  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 showEngineLog: showEngineLogAction;
  48. property alias showProfileFolder: showProfileFolderAction;
  49. property alias documentation: documentationAction;
  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:toggleFullScreenAction
  59. text: catalog.i18nc("@action:inmenu","Toggle Fu&ll Screen");
  60. iconName: "view-fullscreen";
  61. }
  62. Action
  63. {
  64. id: undoAction;
  65. text: catalog.i18nc("@action:inmenu menubar:edit","&Undo");
  66. iconName: "edit-undo";
  67. shortcut: StandardKey.Undo;
  68. onTriggered: UM.OperationStack.undo();
  69. enabled: UM.OperationStack.canUndo;
  70. }
  71. Action
  72. {
  73. id: redoAction;
  74. text: catalog.i18nc("@action:inmenu menubar:edit","&Redo");
  75. iconName: "edit-redo";
  76. shortcut: StandardKey.Redo;
  77. onTriggered: UM.OperationStack.redo();
  78. enabled: UM.OperationStack.canRedo;
  79. }
  80. Action
  81. {
  82. id: quitAction;
  83. text: catalog.i18nc("@action:inmenu menubar:file","&Quit");
  84. iconName: "application-exit";
  85. shortcut: StandardKey.Quit;
  86. }
  87. Action
  88. {
  89. id: view3DCameraAction;
  90. text: catalog.i18nc("@action:inmenu menubar:view","&3D View");
  91. onTriggered: UM.Controller.rotateView("3d", 0);
  92. }
  93. Action
  94. {
  95. id: viewFrontCameraAction;
  96. text: catalog.i18nc("@action:inmenu menubar:view","&Front View");
  97. onTriggered: UM.Controller.rotateView("home", 0);
  98. }
  99. Action
  100. {
  101. id: viewTopCameraAction;
  102. text: catalog.i18nc("@action:inmenu menubar:view","&Top View");
  103. onTriggered: UM.Controller.rotateView("y", 90);
  104. }
  105. Action
  106. {
  107. id: viewLeftSideCameraAction;
  108. text: catalog.i18nc("@action:inmenu menubar:view","&Left Side View");
  109. onTriggered: UM.Controller.rotateView("x", 90);
  110. }
  111. Action
  112. {
  113. id: viewRightSideCameraAction;
  114. text: catalog.i18nc("@action:inmenu menubar:view","&Right Side View");
  115. onTriggered: UM.Controller.rotateView("x", -90);
  116. }
  117. Action
  118. {
  119. id: preferencesAction;
  120. text: catalog.i18nc("@action:inmenu","Configure Cura...");
  121. iconName: "configure";
  122. }
  123. Action
  124. {
  125. id: addMachineAction;
  126. text: catalog.i18nc("@action:inmenu menubar:printer","&Add Printer...");
  127. }
  128. Action
  129. {
  130. id: settingsAction;
  131. text: catalog.i18nc("@action:inmenu menubar:printer","Manage Pr&inters...");
  132. iconName: "configure";
  133. }
  134. Action
  135. {
  136. id: manageMaterialsAction
  137. text: catalog.i18nc("@action:inmenu", "Manage Materials...")
  138. iconName: "configure"
  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. }
  170. Action
  171. {
  172. id: documentationAction;
  173. text: catalog.i18nc("@action:inmenu menubar:help","Show Online &Documentation");
  174. iconName: "help-contents";
  175. shortcut: StandardKey.Help;
  176. onTriggered: CuraActions.openDocumentation();
  177. }
  178. Action {
  179. id: reportBugAction;
  180. text: catalog.i18nc("@action:inmenu menubar:help","Report a &Bug");
  181. iconName: "tools-report-bug";
  182. onTriggered: CuraActions.openBugReportPage();
  183. }
  184. Action
  185. {
  186. id: aboutAction;
  187. text: catalog.i18nc("@action:inmenu menubar:help","&About...");
  188. iconName: "help-about";
  189. }
  190. Action
  191. {
  192. id: deleteSelectionAction;
  193. text: catalog.i18ncp("@action:inmenu menubar:edit", "Delete &Selected Model", "Delete &Selected Models", UM.Selection.selectionCount);
  194. enabled: UM.Controller.toolsEnabled && UM.Selection.hasSelection;
  195. iconName: "edit-delete";
  196. shortcut: StandardKey.Delete;
  197. onTriggered: CuraActions.deleteSelection();
  198. }
  199. Action //Also add backspace as the same function as delete because on Macintosh keyboards the button called "delete" is actually a backspace, and the user expects it to function as a delete.
  200. {
  201. id: backspaceSelectionAction
  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.Backspace
  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","Re&load 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: showEngineLogAction;
  351. text: catalog.i18nc("@action:inmenu menubar:help","Show Engine &Log...");
  352. iconName: "view-list-text";
  353. shortcut: StandardKey.WhatsThis;
  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", "Browse packages...")
  370. iconName: "plugins_browse"
  371. }
  372. Action
  373. {
  374. id: expandSidebarAction;
  375. text: catalog.i18nc("@action:inmenu menubar:view","Expand/Collapse Sidebar");
  376. shortcut: "Ctrl+E";
  377. }
  378. }