Actions.qml 12 KB

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