Actions.qml 11 KB

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