GeneralPage.qml 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096
  1. // Copyright (c) 2022 Ultimaker B.V.
  2. // Cura is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.10
  4. import QtQuick.Controls 2.15
  5. import QtQuick.Layouts 1.1
  6. import UM 1.5 as UM
  7. import Cura 1.1 as Cura
  8. UM.PreferencesPage
  9. {
  10. //: General configuration page title
  11. title: catalog.i18nc("@title:tab", "General")
  12. id: generalPreferencesPage
  13. width: parent ? parent.width: 0
  14. function setDefaultLanguage(languageCode)
  15. {
  16. //loops through the languageList and sets the language using the languageCode
  17. for(var i = 0; i < languageList.count; i++)
  18. {
  19. if (languageComboBox.model.get(i).code == languageCode)
  20. {
  21. languageComboBox.currentIndex = i
  22. }
  23. }
  24. }
  25. function setDefaultTheme(defaultThemeCode)
  26. {
  27. for(var i = 0; i < themeList.count; i++)
  28. {
  29. if (themeComboBox.model.get(i).code == defaultThemeCode)
  30. {
  31. themeComboBox.currentIndex = i
  32. }
  33. }
  34. }
  35. function setDefaultDiscardOrKeepProfile(code)
  36. {
  37. for (var i = 0; i < choiceOnProfileOverrideDropDownButton.model.count; i++)
  38. {
  39. if (choiceOnProfileOverrideDropDownButton.model.get(i).code == code)
  40. {
  41. choiceOnProfileOverrideDropDownButton.currentIndex = i;
  42. break;
  43. }
  44. }
  45. }
  46. function setDefaultOpenProjectOption(code)
  47. {
  48. for (var i = 0; i < choiceOnOpenProjectDropDownButton.model.count; ++i)
  49. {
  50. if (choiceOnOpenProjectDropDownButton.model.get(i).code == code)
  51. {
  52. choiceOnOpenProjectDropDownButton.currentIndex = i
  53. break;
  54. }
  55. }
  56. }
  57. function reset()
  58. {
  59. UM.Preferences.resetPreference("general/language")
  60. var defaultLanguage = UM.Preferences.getValue("general/language")
  61. setDefaultLanguage(defaultLanguage)
  62. UM.Preferences.resetPreference("general/theme")
  63. var defaultTheme = UM.Preferences.getValue("general/theme")
  64. setDefaultTheme(defaultTheme)
  65. UM.Preferences.resetPreference("general/use_tray_icon")
  66. trayIconCheckbox.checked = boolCheck(UM.Preferences.getValue("cura/use_tray_icon"))
  67. UM.Preferences.resetPreference("cura/single_instance")
  68. singleInstanceCheckbox.checked = boolCheck(UM.Preferences.getValue("cura/single_instance"))
  69. UM.Preferences.resetPreference("cura/single_instance_clear_before_load")
  70. singleInstanceClearBeforeLoadCheckbox.checked = boolCheck(UM.Preferences.getValue("cura/single_instance_clear_before_load"))
  71. UM.Preferences.resetPreference("physics/automatic_push_free")
  72. pushFreeCheckbox.checked = boolCheck(UM.Preferences.getValue("physics/automatic_push_free"))
  73. UM.Preferences.resetPreference("physics/automatic_drop_down")
  74. dropDownCheckbox.checked = boolCheck(UM.Preferences.getValue("physics/automatic_drop_down"))
  75. UM.Preferences.resetPreference("mesh/scale_to_fit")
  76. scaleToFitCheckbox.checked = boolCheck(UM.Preferences.getValue("mesh/scale_to_fit"))
  77. UM.Preferences.resetPreference("mesh/scale_tiny_meshes")
  78. scaleTinyCheckbox.checked = boolCheck(UM.Preferences.getValue("mesh/scale_tiny_meshes"))
  79. UM.Preferences.resetPreference("cura/select_models_on_load")
  80. selectModelsOnLoadCheckbox.checked = boolCheck(UM.Preferences.getValue("cura/select_models_on_load"))
  81. UM.Preferences.resetPreference("cura/jobname_prefix")
  82. prefixJobNameCheckbox.checked = boolCheck(UM.Preferences.getValue("cura/jobname_prefix"))
  83. UM.Preferences.resetPreference("view/show_overhang");
  84. showOverhangCheckbox.checked = boolCheck(UM.Preferences.getValue("view/show_overhang"))
  85. UM.Preferences.resetPreference("view/show_xray_warning");
  86. showXrayErrorCheckbox.checked = boolCheck(UM.Preferences.getValue("view/show_xray_warning"))
  87. UM.Preferences.resetPreference("view/center_on_select");
  88. centerOnSelectCheckbox.checked = boolCheck(UM.Preferences.getValue("view/center_on_select"))
  89. UM.Preferences.resetPreference("view/invert_zoom");
  90. invertZoomCheckbox.checked = boolCheck(UM.Preferences.getValue("view/invert_zoom"))
  91. UM.Preferences.resetPreference("view/zoom_to_mouse");
  92. zoomToMouseCheckbox.checked = boolCheck(UM.Preferences.getValue("view/zoom_to_mouse"))
  93. //UM.Preferences.resetPreference("view/top_layer_count");
  94. //topLayerCountCheckbox.checked = boolCheck(UM.Preferences.getValue("view/top_layer_count"))
  95. UM.Preferences.resetPreference("general/restore_window_geometry")
  96. restoreWindowPositionCheckbox.checked = boolCheck(UM.Preferences.getValue("general/restore_window_geometry"))
  97. UM.Preferences.resetPreference("general/camera_perspective_mode")
  98. //var defaultCameraMode = UM.Preferences.getValue("general/camera_perspective_mode")
  99. // /setDefaultCameraMode(defaultCameraMode)
  100. UM.Preferences.resetPreference("cura/choice_on_profile_override")
  101. setDefaultDiscardOrKeepProfile(UM.Preferences.getValue("cura/choice_on_profile_override"))
  102. UM.Preferences.resetPreference("cura/choice_on_open_project")
  103. setDefaultOpenProjectOption(UM.Preferences.getValue("cura/choice_on_open_project"))
  104. UM.Preferences.resetPreference("info/send_slice_info")
  105. sendDataCheckbox.checked = boolCheck(UM.Preferences.getValue("info/send_slice_info"))
  106. UM.Preferences.resetPreference("info/send_engine_crash")
  107. sendEngineCrashCheckbox.checked = boolCheck(UM.Preferences.getValue("info/send_engine_crash"))
  108. UM.Preferences.resetPreference("info/anonymous_engine_crash_report")
  109. sendEngineCrashCheckboxAnonymous.checked = boolCheck(UM.Preferences.getValue("info/anonymous_engine_crash_report"))
  110. UM.Preferences.resetPreference("info/automatic_update_check")
  111. checkUpdatesCheckbox.checked = boolCheck(UM.Preferences.getValue("info/automatic_update_check"))
  112. UM.Preferences.resetPreference("info/latest_update_source")
  113. UM.Preferences.resetPreference("info/automatic_plugin_update_check")
  114. pluginNotificationsUpdateCheckbox.checked = boolCheck(UM.Preferences.getValue("info/automatic_plugin_update_check"))
  115. }
  116. buttons: [
  117. Cura.SecondaryButton
  118. {
  119. text: catalog.i18nc("@action:button", "Defaults")
  120. onClicked: reset()
  121. }
  122. ]
  123. ScrollView
  124. {
  125. id: preferencesScrollView
  126. width: parent.width
  127. height: parent.height
  128. ScrollBar.vertical: UM.ScrollBar
  129. {
  130. id: preferencesScrollBar
  131. parent: preferencesScrollView.parent
  132. anchors
  133. {
  134. top: parent.top
  135. bottom: parent.bottom
  136. right: parent.right
  137. }
  138. onPositionChanged: {
  139. // This removes focus from items when scrolling.
  140. // This fixes comboboxes staying open and scrolling container
  141. if (!activeFocus) {
  142. forceActiveFocus();
  143. }
  144. }
  145. }
  146. Column
  147. {
  148. UM.I18nCatalog{id: catalog; name: "cura"}
  149. width: preferencesScrollView.width - preferencesScrollBar.width
  150. UM.Label
  151. {
  152. font: UM.Theme.getFont("medium_bold")
  153. text: catalog.i18nc("@label", "Interface")
  154. }
  155. GridLayout
  156. {
  157. id: interfaceGrid
  158. columns: 2
  159. width: parent.width
  160. UM.Label
  161. {
  162. id: languageLabel
  163. text: "Language*:" //Don't translate this, to make it easier to find the language drop-down if you can't read the current language.
  164. }
  165. ListModel
  166. {
  167. id: languageList
  168. Component.onCompleted:
  169. {
  170. append({ text: "English", code: "en_US" })
  171. append({ text: "Čeština", code: "cs_CZ" })
  172. append({ text: "Deutsch", code: "de_DE" })
  173. append({ text: "Español", code: "es_ES" })
  174. append({ text: "Français", code: "fr_FR" })
  175. append({ text: "Italiano", code: "it_IT" })
  176. append({ text: "日本語", code: "ja_JP" })
  177. append({ text: "한국어", code: "ko_KR" })
  178. append({ text: "Nederlands", code: "nl_NL" })
  179. append({ text: "Português do Brasil", code: "pt_BR" })
  180. append({ text: "Português", code: "pt_PT" })
  181. append({ text: "Русский", code: "ru_RU" })
  182. append({ text: "Türkçe", code: "tr_TR" })
  183. append({ text: "简体中文", code: "zh_CN" })
  184. var date_object = new Date();
  185. if (date_object.getUTCMonth() == 8 && date_object.getUTCDate() == 19) //Only add Pirate on the 19th of September.
  186. {
  187. append({ text: "Pirate", code: "en_7S" })
  188. }
  189. // incomplete and/or abandoned
  190. append({ text: catalog.i18nc("@heading", "-- incomplete --"), code: "" })
  191. append({ text: "正體字", code: "zh_TW" })
  192. append({ text: "Magyar", code: "hu_HU" })
  193. append({ text: "Suomi", code: "fi_FI" })
  194. append({ text: "Polski", code: "pl_PL" })
  195. }
  196. }
  197. Cura.ComboBox
  198. {
  199. id: languageComboBox
  200. textRole: "text"
  201. model: languageList
  202. implicitWidth: UM.Theme.getSize("combobox").width
  203. height: currencyField.height
  204. function setCurrentIndex() {
  205. var code = UM.Preferences.getValue("general/language");
  206. for(var i = 0; i < languageList.count; ++i)
  207. {
  208. if(model.get(i).code == code)
  209. {
  210. return i
  211. }
  212. }
  213. }
  214. currentIndex: setCurrentIndex()
  215. onActivated:
  216. {
  217. if (model.get(index).code != "")
  218. {
  219. UM.Preferences.setValue("general/language", model.get(index).code);
  220. }
  221. else
  222. {
  223. currentIndex = setCurrentIndex();
  224. }
  225. }
  226. }
  227. UM.Label
  228. {
  229. id: currencyLabel
  230. text: catalog.i18nc("@label", "Currency:")
  231. }
  232. Cura.TextField
  233. {
  234. id: currencyField
  235. selectByMouse: true
  236. text: UM.Preferences.getValue("cura/currency")
  237. implicitWidth: UM.Theme.getSize("combobox").width
  238. implicitHeight: UM.Theme.getSize("setting_control").height
  239. onTextChanged: UM.Preferences.setValue("cura/currency", text)
  240. }
  241. UM.Label
  242. {
  243. id: themeLabel
  244. text: catalog.i18nc("@label: Please keep the asterix, it's to indicate that a restart is needed.", "Theme*:")
  245. }
  246. ListModel
  247. {
  248. id: themeList
  249. Component.onCompleted: {
  250. var themes = UM.Theme.getThemes()
  251. for (var i = 0; i < themes.length; i++)
  252. {
  253. append({ text: themes[i].name.toString(), code: themes[i].id.toString() });
  254. }
  255. }
  256. }
  257. Cura.ComboBox
  258. {
  259. id: themeComboBox
  260. model: themeList
  261. textRole: "text"
  262. implicitWidth: UM.Theme.getSize("combobox").width
  263. height: currencyField.height
  264. currentIndex:
  265. {
  266. var code = UM.Preferences.getValue("general/theme");
  267. for(var i = 0; i < themeList.count; ++i)
  268. {
  269. if(model.get(i).code == code)
  270. {
  271. return i
  272. }
  273. }
  274. return 0;
  275. }
  276. onActivated: UM.Preferences.setValue("general/theme", model.get(index).code)
  277. }
  278. }
  279. UM.TooltipArea
  280. {
  281. width: childrenRect.width;
  282. height: childrenRect.height;
  283. text: catalog.i18nc("@info:tooltip", "Slice automatically when changing settings.")
  284. UM.CheckBox
  285. {
  286. id: autoSliceCheckbox
  287. checked: boolCheck(UM.Preferences.getValue("general/auto_slice"))
  288. onClicked: UM.Preferences.setValue("general/auto_slice", checked)
  289. text: catalog.i18nc("@option:check", "Slice automatically");
  290. }
  291. }
  292. UM.TooltipArea
  293. {
  294. width: childrenRect.width;
  295. height: childrenRect.height;
  296. text: catalog.i18nc("@info:tooltip", "Show an icon and notifications in the system notification area.")
  297. UM.CheckBox
  298. {
  299. id: trayIconCheckbox
  300. checked: boolCheck(UM.Preferences.getValue("general/use_tray_icon"))
  301. onClicked: UM.Preferences.setValue("general/use_tray_icon", checked)
  302. text: catalog.i18nc("@option:check", "Add icon to system tray *");
  303. }
  304. }
  305. UM.Label
  306. {
  307. id: languageCaption
  308. //: Language change warning
  309. text: catalog.i18nc("@label", "*You will need to restart the application for these changes to have effect.")
  310. wrapMode: Text.WordWrap
  311. font.italic: true
  312. }
  313. Item
  314. {
  315. //: Spacer
  316. height: UM.Theme.getSize("default_margin").height
  317. width: UM.Theme.getSize("default_margin").width
  318. }
  319. UM.Label
  320. {
  321. font: UM.Theme.getFont("medium_bold")
  322. text: catalog.i18nc("@label", "Viewport behavior")
  323. }
  324. UM.TooltipArea
  325. {
  326. width: childrenRect.width;
  327. height: childrenRect.height;
  328. text: catalog.i18nc("@info:tooltip", "Highlight unsupported areas of the model in red. Without support these areas will not print properly.")
  329. UM.CheckBox
  330. {
  331. id: showOverhangCheckbox
  332. checked: boolCheck(UM.Preferences.getValue("view/show_overhang"))
  333. onClicked: UM.Preferences.setValue("view/show_overhang", checked)
  334. text: catalog.i18nc("@option:check", "Display overhang");
  335. }
  336. }
  337. UM.TooltipArea
  338. {
  339. width: childrenRect.width;
  340. height: childrenRect.height;
  341. text: catalog.i18nc("@info:tooltip", "Highlight missing or extraneous surfaces of the model using warning signs. The toolpaths will often be missing parts of the intended geometry.")
  342. UM.CheckBox
  343. {
  344. id: showXrayErrorCheckbox
  345. checked: boolCheck(UM.Preferences.getValue("view/show_xray_warning"))
  346. onClicked: UM.Preferences.setValue("view/show_xray_warning", checked)
  347. text: catalog.i18nc("@option:check", "Display model errors");
  348. }
  349. }
  350. UM.TooltipArea
  351. {
  352. width: childrenRect.width;
  353. height: childrenRect.height;
  354. text: catalog.i18nc("@info:tooltip", "Moves the camera so the model is in the center of the view when a model is selected")
  355. UM.CheckBox
  356. {
  357. id: centerOnSelectCheckbox
  358. text: catalog.i18nc("@action:button","Center camera when item is selected");
  359. checked: boolCheck(UM.Preferences.getValue("view/center_on_select"))
  360. onClicked: UM.Preferences.setValue("view/center_on_select", checked)
  361. }
  362. }
  363. UM.TooltipArea
  364. {
  365. width: childrenRect.width;
  366. height: childrenRect.height;
  367. text: catalog.i18nc("@info:tooltip", "Should the default zoom behavior of cura be inverted?")
  368. UM.CheckBox
  369. {
  370. id: invertZoomCheckbox
  371. text: catalog.i18nc("@action:button", "Invert the direction of camera zoom.");
  372. checked: boolCheck(UM.Preferences.getValue("view/invert_zoom"))
  373. onClicked: {
  374. if(!checked && zoomToMouseCheckbox.checked) //Fix for Github issue Ultimaker/Cura#6490: Make sure the camera origin is in front when unchecking.
  375. {
  376. UM.Controller.setCameraOrigin("home");
  377. }
  378. UM.Preferences.setValue("view/invert_zoom", checked);
  379. }
  380. }
  381. }
  382. UM.TooltipArea
  383. {
  384. width: childrenRect.width;
  385. height: childrenRect.height;
  386. text: zoomToMouseCheckbox.enabled ? catalog.i18nc("@info:tooltip", "Should zooming move in the direction of the mouse?") : catalog.i18nc("@info:tooltip", "Zooming towards the mouse is not supported in the orthographic perspective.")
  387. UM.CheckBox
  388. {
  389. id: zoomToMouseCheckbox
  390. text: catalog.i18nc("@action:button", "Zoom toward mouse direction")
  391. checked: boolCheck(UM.Preferences.getValue("view/zoom_to_mouse")) && zoomToMouseCheckbox.enabled
  392. onClicked: UM.Preferences.setValue("view/zoom_to_mouse", checked)
  393. enabled: UM.Preferences.getValue("general/camera_perspective_mode") !== "orthographic"
  394. }
  395. //Because there is no signal for individual preferences, we need to manually link to the onPreferenceChanged signal.
  396. Connections
  397. {
  398. target: UM.Preferences
  399. function onPreferenceChanged(preference)
  400. {
  401. if(preference != "general/camera_perspective_mode")
  402. {
  403. return;
  404. }
  405. zoomToMouseCheckbox.enabled = UM.Preferences.getValue("general/camera_perspective_mode") !== "orthographic";
  406. zoomToMouseCheckbox.checked = boolCheck(UM.Preferences.getValue("view/zoom_to_mouse")) && zoomToMouseCheckbox.enabled;
  407. }
  408. }
  409. }
  410. UM.TooltipArea
  411. {
  412. width: childrenRect.width
  413. height: childrenRect.height
  414. text: catalog.i18nc("@info:tooltip", "Should models on the platform be moved so that they no longer intersect?")
  415. UM.CheckBox
  416. {
  417. id: pushFreeCheckbox
  418. text: catalog.i18nc("@option:check", "Ensure models are kept apart")
  419. checked: boolCheck(UM.Preferences.getValue("physics/automatic_push_free"))
  420. onCheckedChanged: UM.Preferences.setValue("physics/automatic_push_free", checked)
  421. }
  422. }
  423. UM.TooltipArea
  424. {
  425. width: childrenRect.width
  426. height: childrenRect.height
  427. text: catalog.i18nc("@info:tooltip", "Should models on the platform be moved down to touch the build plate?")
  428. UM.CheckBox
  429. {
  430. id: dropDownCheckbox
  431. text: catalog.i18nc("@option:check", "Automatically drop models to the build plate")
  432. checked: boolCheck(UM.Preferences.getValue("physics/automatic_drop_down"))
  433. onCheckedChanged:
  434. {
  435. UM.Preferences.setValue("physics/automatic_drop_down", checked)
  436. CuraApplication.getWorkplaceDropToBuildplate(checked)
  437. }
  438. }
  439. }
  440. UM.TooltipArea
  441. {
  442. width: childrenRect.width;
  443. height: childrenRect.height;
  444. text: catalog.i18nc("@info:tooltip","Show caution message in g-code reader.")
  445. UM.CheckBox
  446. {
  447. id: gcodeShowCautionCheckbox
  448. checked: boolCheck(UM.Preferences.getValue("gcodereader/show_caution"))
  449. onClicked: UM.Preferences.setValue("gcodereader/show_caution", checked)
  450. text: catalog.i18nc("@option:check","Caution message in g-code reader");
  451. }
  452. }
  453. UM.TooltipArea
  454. {
  455. width: childrenRect.width
  456. height: childrenRect.height
  457. text: catalog.i18nc("@info:tooltip", "Should layer be forced into compatibility mode?")
  458. UM.CheckBox
  459. {
  460. id: forceLayerViewCompatibilityModeCheckbox
  461. text: catalog.i18nc("@option:check", "Force layer view compatibility mode (restart required)")
  462. checked: boolCheck(UM.Preferences.getValue("view/force_layer_view_compatibility_mode"))
  463. onCheckedChanged: UM.Preferences.setValue("view/force_layer_view_compatibility_mode", checked)
  464. }
  465. }
  466. UM.TooltipArea
  467. {
  468. width: childrenRect.width
  469. height: childrenRect.height
  470. text: catalog.i18nc("@info:tooltip", "Should Cura open at the location it was closed?")
  471. UM.CheckBox
  472. {
  473. id: restoreWindowPositionCheckbox
  474. text: catalog.i18nc("@option:check", "Restore window position on start")
  475. checked: boolCheck(UM.Preferences.getValue("general/restore_window_geometry"))
  476. onCheckedChanged: UM.Preferences.setValue("general/restore_window_geometry", checked)
  477. }
  478. }
  479. UM.TooltipArea
  480. {
  481. width: childrenRect.width
  482. height: childrenRect.height
  483. text: catalog.i18nc("@info:tooltip", "What type of camera rendering should be used?")
  484. Column
  485. {
  486. spacing: UM.Theme.getSize("narrow_margin").height
  487. UM.Label
  488. {
  489. text: catalog.i18nc("@window:text", "Camera rendering:")
  490. }
  491. ListModel
  492. {
  493. id: comboBoxList
  494. Component.onCompleted:
  495. {
  496. append({ text: catalog.i18n("Perspective"), code: "perspective" })
  497. append({ text: catalog.i18n("Orthographic"), code: "orthographic" })
  498. }
  499. }
  500. Cura.ComboBox
  501. {
  502. id: cameraComboBox
  503. model: comboBoxList
  504. textRole: "text"
  505. width: UM.Theme.getSize("combobox").width
  506. height: UM.Theme.getSize("combobox").height
  507. currentIndex:
  508. {
  509. var code = UM.Preferences.getValue("general/camera_perspective_mode");
  510. for(var i = 0; i < comboBoxList.count; ++i)
  511. {
  512. if(model.get(i).code == code)
  513. {
  514. return i
  515. }
  516. }
  517. return 0
  518. }
  519. onActivated: UM.Preferences.setValue("general/camera_perspective_mode", model.get(index).code)
  520. }
  521. }
  522. }
  523. Item
  524. {
  525. //: Spacer
  526. height: UM.Theme.getSize("default_margin").height
  527. width: UM.Theme.getSize("default_margin").height
  528. }
  529. UM.Label
  530. {
  531. font: UM.Theme.getFont("medium_bold")
  532. text: catalog.i18nc("@label","Opening and saving files")
  533. }
  534. UM.TooltipArea
  535. {
  536. width: childrenRect.width
  537. // Mac only allows applications to run as a single instance, so providing the option for this os doesn't make much sense
  538. visible: Qt.platform.os !== "osx"
  539. height: childrenRect.height
  540. text: catalog.i18nc("@info:tooltip","Should opening files from the desktop or external applications open in the same instance of Cura?")
  541. UM.CheckBox
  542. {
  543. id: singleInstanceCheckbox
  544. text: catalog.i18nc("@option:check","Use a single instance of Cura")
  545. checked: boolCheck(UM.Preferences.getValue("cura/single_instance"))
  546. onCheckedChanged: UM.Preferences.setValue("cura/single_instance", checked)
  547. }
  548. }
  549. UM.TooltipArea
  550. {
  551. width: childrenRect.width
  552. height: childrenRect.height
  553. text: catalog.i18nc("@info:tooltip","Should the build plate be cleared before loading a new model in the single instance of Cura?")
  554. enabled: singleInstanceCheckbox.checked
  555. UM.CheckBox
  556. {
  557. id: singleInstanceClearBeforeLoadCheckbox
  558. text: catalog.i18nc("@option:check","Clear buildplate before loading model into the single instance")
  559. checked: boolCheck(UM.Preferences.getValue("cura/single_instance_clear_before_load"))
  560. onCheckedChanged: UM.Preferences.setValue("cura/single_instance_clear_before_load", checked)
  561. }
  562. }
  563. UM.TooltipArea
  564. {
  565. width: childrenRect.width
  566. height: childrenRect.height
  567. text: catalog.i18nc("@info:tooltip","Should models be scaled to the build volume if they are too large?")
  568. UM.CheckBox
  569. {
  570. id: scaleToFitCheckbox
  571. text: catalog.i18nc("@option:check","Scale large models")
  572. checked: boolCheck(UM.Preferences.getValue("mesh/scale_to_fit"))
  573. onCheckedChanged: UM.Preferences.setValue("mesh/scale_to_fit", checked)
  574. }
  575. }
  576. UM.TooltipArea
  577. {
  578. width: childrenRect.width
  579. height: childrenRect.height
  580. text: catalog.i18nc("@info:tooltip","An model may appear extremely small if its unit is for example in meters rather than millimeters. Should these models be scaled up?")
  581. UM.CheckBox
  582. {
  583. id: scaleTinyCheckbox
  584. text: catalog.i18nc("@option:check","Scale extremely small models")
  585. checked: boolCheck(UM.Preferences.getValue("mesh/scale_tiny_meshes"))
  586. onCheckedChanged: UM.Preferences.setValue("mesh/scale_tiny_meshes", checked)
  587. }
  588. }
  589. UM.TooltipArea
  590. {
  591. width: childrenRect.width
  592. height: childrenRect.height
  593. text: catalog.i18nc("@info:tooltip","Should models be selected after they are loaded?")
  594. UM.CheckBox
  595. {
  596. id: selectModelsOnLoadCheckbox
  597. text: catalog.i18nc("@option:check","Select models when loaded")
  598. checked: boolCheck(UM.Preferences.getValue("cura/select_models_on_load"))
  599. onCheckedChanged: UM.Preferences.setValue("cura/select_models_on_load", checked)
  600. }
  601. }
  602. UM.TooltipArea
  603. {
  604. width: childrenRect.width
  605. height: childrenRect.height
  606. text: catalog.i18nc("@info:tooltip", "Should a prefix based on the printer name be added to the print job name automatically?")
  607. UM.CheckBox
  608. {
  609. id: prefixJobNameCheckbox
  610. text: catalog.i18nc("@option:check", "Add machine prefix to job name")
  611. checked: boolCheck(UM.Preferences.getValue("cura/jobname_prefix"))
  612. onCheckedChanged: UM.Preferences.setValue("cura/jobname_prefix", checked)
  613. }
  614. }
  615. UM.TooltipArea
  616. {
  617. width: childrenRect.width
  618. height: childrenRect.height
  619. text: catalog.i18nc("@info:tooltip", "Should a summary be shown when saving a project file?")
  620. UM.CheckBox
  621. {
  622. text: catalog.i18nc("@option:check", "Show summary dialog when saving project")
  623. checked: boolCheck(UM.Preferences.getValue("cura/dialog_on_project_save"))
  624. onCheckedChanged: UM.Preferences.setValue("cura/dialog_on_project_save", checked)
  625. }
  626. }
  627. UM.TooltipArea
  628. {
  629. width: childrenRect.width
  630. height: childrenRect.height
  631. text: catalog.i18nc("@info:tooltip", "Should a summary be shown when saving a UCP project file?")
  632. UM.CheckBox
  633. {
  634. text: catalog.i18nc("@option:check", "Show summary dialog when saving a UCP project")
  635. checked: boolCheck(UM.Preferences.getValue("cura/dialog_on_ucp_project_save"))
  636. onCheckedChanged: UM.Preferences.setValue("cura/dialog_on_ucp_project_save", checked)
  637. }
  638. }
  639. UM.TooltipArea
  640. {
  641. width: childrenRect.width
  642. height: childrenRect.height
  643. text: catalog.i18nc("@info:tooltip", "Default behavior when opening a project file")
  644. Column
  645. {
  646. spacing: UM.Theme.getSize("narrow_margin").height
  647. UM.Label
  648. {
  649. text: catalog.i18nc("@window:text", "Default behavior when opening a project file: ")
  650. }
  651. Cura.ComboBox
  652. {
  653. id: choiceOnOpenProjectDropDownButton
  654. width: UM.Theme.getSize("combobox").width
  655. height: UM.Theme.getSize("combobox").height
  656. model: ListModel
  657. {
  658. id: openProjectOptionModel
  659. Component.onCompleted:
  660. {
  661. append({ text: catalog.i18nc("@option:openProject", "Always ask me this"), code: "always_ask" })
  662. append({ text: catalog.i18nc("@option:openProject", "Always open as a project"), code: "open_as_project" })
  663. append({ text: catalog.i18nc("@option:openProject", "Always import models"), code: "open_as_model" })
  664. }
  665. }
  666. textRole: "text"
  667. currentIndex:
  668. {
  669. var index = 0;
  670. var currentChoice = UM.Preferences.getValue("cura/choice_on_open_project");
  671. for (var i = 0; i < model.count; ++i)
  672. {
  673. if (model.get(i).code == currentChoice)
  674. {
  675. index = i;
  676. break;
  677. }
  678. }
  679. return index;
  680. }
  681. onActivated: UM.Preferences.setValue("cura/choice_on_open_project", model.get(index).code)
  682. }
  683. }
  684. }
  685. Item
  686. {
  687. //: Spacer
  688. height: UM.Theme.getSize("default_margin").height
  689. width: UM.Theme.getSize("default_margin").width
  690. }
  691. UM.TooltipArea
  692. {
  693. width: childrenRect.width
  694. height: childrenRect.height
  695. text: catalog.i18nc("@info:tooltip", "When you have made changes to a profile and switched to a different one, a dialog will be shown asking whether you want to keep your modifications or not, or you can choose a default behaviour and never show that dialog again.")
  696. Column
  697. {
  698. spacing: UM.Theme.getSize("narrow_margin").height
  699. UM.Label
  700. {
  701. font: UM.Theme.getFont("medium_bold")
  702. text: catalog.i18nc("@label", "Profiles")
  703. }
  704. UM.Label
  705. {
  706. text: catalog.i18nc("@window:text", "Default behavior for changed setting values when switching to a different profile: ")
  707. }
  708. Cura.ComboBox
  709. {
  710. id: choiceOnProfileOverrideDropDownButton
  711. width: UM.Theme.getSize("combobox_wide").width
  712. height: UM.Theme.getSize("combobox_wide").height
  713. model: ListModel
  714. {
  715. id: discardOrKeepProfileListModel
  716. Component.onCompleted:
  717. {
  718. append({ text: catalog.i18nc("@option:discardOrKeep", "Always ask me this"), code: "always_ask" })
  719. append({ text: catalog.i18nc("@option:discardOrKeep", "Always discard changed settings"), code: "always_discard" })
  720. append({ text: catalog.i18nc("@option:discardOrKeep", "Always transfer changed settings to new profile"), code: "always_keep" })
  721. }
  722. }
  723. textRole: "text"
  724. currentIndex:
  725. {
  726. var index = 0;
  727. var code = UM.Preferences.getValue("cura/choice_on_profile_override");
  728. for (var i = 0; i < model.count; ++i)
  729. {
  730. if (model.get(i).code == code)
  731. {
  732. index = i;
  733. break;
  734. }
  735. }
  736. return index;
  737. }
  738. onActivated: UM.Preferences.setValue("cura/choice_on_profile_override", model.get(index).code)
  739. }
  740. }
  741. }
  742. Item
  743. {
  744. //: Spacer
  745. height: UM.Theme.getSize("default_margin").height
  746. width: UM.Theme.getSize("default_margin").height
  747. }
  748. UM.Label
  749. {
  750. font: UM.Theme.getFont("medium_bold")
  751. text: catalog.i18nc("@label", "Privacy")
  752. }
  753. UM.TooltipArea
  754. {
  755. width: childrenRect.width
  756. height: visible ? childrenRect.height : 0
  757. text: catalog.i18nc("@info:tooltip", "Should slicing crashes be automatically reported to Ultimaker? Note, no models, IP addresses or other personally identifiable information is sent or stored, unless you give explicit permission.")
  758. UM.CheckBox
  759. {
  760. id: sendEngineCrashCheckbox
  761. text: catalog.i18nc("@option:check","Send engine crash reports")
  762. checked: boolCheck(UM.Preferences.getValue("info/send_engine_crash"))
  763. onCheckedChanged: UM.Preferences.setValue("info/send_engine_crash", checked)
  764. }
  765. }
  766. ButtonGroup
  767. {
  768. id: curaCrashGroup
  769. buttons: [sendEngineCrashCheckboxAnonymous, sendEngineCrashCheckboxUser]
  770. }
  771. UM.TooltipArea
  772. {
  773. width: childrenRect.width
  774. height: visible ? childrenRect.height : 0
  775. text: catalog.i18nc("@info:tooltip", "Send crash reports without any personally identifiable information or models data to UltiMaker.")
  776. anchors.left: parent.left
  777. anchors.leftMargin: UM.Theme.getSize("default_margin").width
  778. Cura.RadioButton
  779. {
  780. id: sendEngineCrashCheckboxAnonymous
  781. text: catalog.i18nc("@option:radio", "Anonymous crash reports")
  782. enabled: sendEngineCrashCheckbox.checked && Cura.API.account.isLoggedIn
  783. checked: boolCheck(UM.Preferences.getValue("info/anonymous_engine_crash_report"))
  784. onClicked: UM.Preferences.setValue("info/anonymous_engine_crash_report", true)
  785. }
  786. }
  787. UM.TooltipArea
  788. {
  789. width: childrenRect.width
  790. height: visible ? childrenRect.height : 0
  791. text: Cura.API.account.isLoggedIn ?
  792. catalog.i18nc("@info:tooltip", "Send crash reports with your registered UltiMaker account name and the project name to UltiMaker Sentry. No actual model data is being send.") :
  793. catalog.i18nc("@info:tooltip", "Please sign in to your UltiMaker account to allow sending non-anonymous data.")
  794. anchors.left: parent.left
  795. anchors.leftMargin: UM.Theme.getSize("default_margin").width
  796. Cura.RadioButton
  797. {
  798. id: sendEngineCrashCheckboxUser
  799. text: catalog.i18nc("@option:radio", "Include UltiMaker account name")
  800. enabled: sendEngineCrashCheckbox.checked && Cura.API.account.isLoggedIn
  801. checked: !boolCheck(UM.Preferences.getValue("info/anonymous_engine_crash_report")) && Cura.API.account.isLoggedIn
  802. onClicked: UM.Preferences.setValue("info/anonymous_engine_crash_report", false)
  803. }
  804. }
  805. UM.TooltipArea
  806. {
  807. width: childrenRect.width
  808. height: visible ? childrenRect.height : 0
  809. text: catalog.i18nc("@info:tooltip", "Should anonymous data about your print be sent to UltiMaker? Note, no models, IP addresses or other personally identifiable information is sent or stored.")
  810. UM.CheckBox
  811. {
  812. id: sendDataCheckbox
  813. text: catalog.i18nc("@option:check","Send (anonymous) print information")
  814. checked: boolCheck(UM.Preferences.getValue("info/send_slice_info"))
  815. onCheckedChanged: UM.Preferences.setValue("info/send_slice_info", checked)
  816. }
  817. UM.SimpleButton
  818. {
  819. onClicked: CuraApplication.showMoreInformationDialogForAnonymousDataCollection()
  820. iconSource: UM.Theme.getIcon("Information")
  821. anchors.left: sendDataCheckbox.right
  822. anchors.verticalCenter: sendDataCheckbox.verticalCenter
  823. hoverBackgroundColor: UM.Theme.getColor("secondary_button_hover")
  824. backgroundRadius: width / 2
  825. height: UM.Theme.getSize("small_button_icon").height
  826. color: UM.Theme.getColor("small_button_text")
  827. width: height
  828. }
  829. }
  830. Item
  831. {
  832. //: Spacer
  833. height: UM.Theme.getSize("default_margin").height
  834. width: UM.Theme.getSize("default_margin").height
  835. }
  836. UM.Label
  837. {
  838. font: UM.Theme.getFont("medium_bold")
  839. text: catalog.i18nc("@label", "Updates")
  840. }
  841. UM.TooltipArea
  842. {
  843. width: childrenRect.width
  844. height: visible ? childrenRect.height : 0
  845. text: catalog.i18nc("@info:tooltip", "Should Cura check for updates when the program is started?")
  846. UM.CheckBox
  847. {
  848. id: checkUpdatesCheckbox
  849. text: catalog.i18nc("@option:check","Check for updates on start")
  850. checked: boolCheck(UM.Preferences.getValue("info/automatic_update_check"))
  851. onCheckedChanged: UM.Preferences.setValue("info/automatic_update_check", checked)
  852. }
  853. }
  854. ButtonGroup
  855. {
  856. id: curaUpdatesGroup
  857. buttons: [checkUpdatesOptionBeta, checkUpdatesOptionStable]
  858. }
  859. UM.TooltipArea
  860. {
  861. width: childrenRect.width
  862. height: visible ? childrenRect.height : 0
  863. text: catalog.i18nc("@info:tooltip", "When checking for updates, only check for stable releases.")
  864. anchors.left: parent.left
  865. anchors.leftMargin: UM.Theme.getSize("default_margin").width
  866. Cura.RadioButton
  867. {
  868. id: checkUpdatesOptionStable
  869. text: catalog.i18nc("@option:radio", "Stable releases only")
  870. enabled: checkUpdatesCheckbox.checked
  871. checked: UM.Preferences.getValue("info/latest_update_source") == "stable"
  872. onClicked: UM.Preferences.setValue("info/latest_update_source", "stable")
  873. }
  874. }
  875. UM.TooltipArea
  876. {
  877. width: childrenRect.width
  878. height: visible ? childrenRect.height : 0
  879. text: catalog.i18nc("@info:tooltip", "When checking for updates, check for both stable and for beta releases.")
  880. anchors.left: parent.left
  881. anchors.leftMargin: UM.Theme.getSize("default_margin").width
  882. Cura.RadioButton
  883. {
  884. id: checkUpdatesOptionBeta
  885. text: catalog.i18nc("@option:radio", "Stable and Beta releases")
  886. enabled: checkUpdatesCheckbox.checked
  887. checked: UM.Preferences.getValue("info/latest_update_source") == "beta"
  888. onClicked: UM.Preferences.setValue("info/latest_update_source", "beta")
  889. }
  890. }
  891. UM.TooltipArea
  892. {
  893. width: childrenRect.width
  894. height: visible ? childrenRect.height : 0
  895. text: catalog.i18nc("@info:tooltip", "Should an automatic check for new plugins be done every time Cura is started? It is highly recommended that you do not disable this!")
  896. UM.CheckBox
  897. {
  898. id: pluginNotificationsUpdateCheckbox
  899. text: catalog.i18nc("@option:check", "Get notifications for plugin updates")
  900. checked: boolCheck(UM.Preferences.getValue("info/automatic_plugin_update_check"))
  901. onCheckedChanged: UM.Preferences.setValue("info/automatic_plugin_update_check", checked)
  902. }
  903. }
  904. /* Multi-buildplate functionality is disabled because it's broken. See CURA-4975 for the ticket to remove it.
  905. Item
  906. {
  907. //: Spacer
  908. height: UM.Theme.getSize("default_margin").height
  909. width: UM.Theme.getSize("default_margin").height
  910. }
  911. Label
  912. {
  913. font.bold: true
  914. text: catalog.i18nc("@label","Experimental")
  915. }
  916. UM.TooltipArea
  917. {
  918. width: childrenRect.width
  919. height: childrenRect.height
  920. text: catalog.i18nc("@info:tooltip","Use multi build plate functionality")
  921. CheckBox
  922. {
  923. id: useMultiBuildPlateCheckbox
  924. text: catalog.i18nc("@option:check","Use multi build plate functionality (restart required)")
  925. checked: boolCheck(UM.Preferences.getValue("cura/use_multi_build_plate"))
  926. onCheckedChanged: UM.Preferences.setValue("cura/use_multi_build_plate", checked)
  927. }
  928. }*/
  929. Connections
  930. {
  931. target: UM.Preferences
  932. function onPreferenceChanged(preference)
  933. {
  934. if (preference !== "info/send_slice_info")
  935. {
  936. return;
  937. }
  938. sendDataCheckbox.checked = boolCheck(UM.Preferences.getValue("info/send_slice_info"))
  939. }
  940. }
  941. }
  942. }
  943. }