Actions.qml 12 KB

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