Actions.qml 10 KB

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