GeneralPage.qml 45 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078
  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: UM.Preferences.setValue("physics/automatic_drop_down", checked)
  434. }
  435. }
  436. UM.TooltipArea
  437. {
  438. width: childrenRect.width;
  439. height: childrenRect.height;
  440. text: catalog.i18nc("@info:tooltip","Show caution message in g-code reader.")
  441. UM.CheckBox
  442. {
  443. id: gcodeShowCautionCheckbox
  444. checked: boolCheck(UM.Preferences.getValue("gcodereader/show_caution"))
  445. onClicked: UM.Preferences.setValue("gcodereader/show_caution", checked)
  446. text: catalog.i18nc("@option:check","Caution message in g-code reader");
  447. }
  448. }
  449. UM.TooltipArea
  450. {
  451. width: childrenRect.width
  452. height: childrenRect.height
  453. text: catalog.i18nc("@info:tooltip", "Should layer be forced into compatibility mode?")
  454. UM.CheckBox
  455. {
  456. id: forceLayerViewCompatibilityModeCheckbox
  457. text: catalog.i18nc("@option:check", "Force layer view compatibility mode (restart required)")
  458. checked: boolCheck(UM.Preferences.getValue("view/force_layer_view_compatibility_mode"))
  459. onCheckedChanged: UM.Preferences.setValue("view/force_layer_view_compatibility_mode", checked)
  460. }
  461. }
  462. UM.TooltipArea
  463. {
  464. width: childrenRect.width
  465. height: childrenRect.height
  466. text: catalog.i18nc("@info:tooltip", "Should Cura open at the location it was closed?")
  467. UM.CheckBox
  468. {
  469. id: restoreWindowPositionCheckbox
  470. text: catalog.i18nc("@option:check", "Restore window position on start")
  471. checked: boolCheck(UM.Preferences.getValue("general/restore_window_geometry"))
  472. onCheckedChanged: UM.Preferences.setValue("general/restore_window_geometry", checked)
  473. }
  474. }
  475. UM.TooltipArea
  476. {
  477. width: childrenRect.width
  478. height: childrenRect.height
  479. text: catalog.i18nc("@info:tooltip", "What type of camera rendering should be used?")
  480. Column
  481. {
  482. spacing: UM.Theme.getSize("narrow_margin").height
  483. UM.Label
  484. {
  485. text: catalog.i18nc("@window:text", "Camera rendering:")
  486. }
  487. ListModel
  488. {
  489. id: comboBoxList
  490. Component.onCompleted:
  491. {
  492. append({ text: catalog.i18n("Perspective"), code: "perspective" })
  493. append({ text: catalog.i18n("Orthographic"), code: "orthographic" })
  494. }
  495. }
  496. Cura.ComboBox
  497. {
  498. id: cameraComboBox
  499. model: comboBoxList
  500. textRole: "text"
  501. width: UM.Theme.getSize("combobox").width
  502. height: UM.Theme.getSize("combobox").height
  503. currentIndex:
  504. {
  505. var code = UM.Preferences.getValue("general/camera_perspective_mode");
  506. for(var i = 0; i < comboBoxList.count; ++i)
  507. {
  508. if(model.get(i).code == code)
  509. {
  510. return i
  511. }
  512. }
  513. return 0
  514. }
  515. onActivated: UM.Preferences.setValue("general/camera_perspective_mode", model.get(index).code)
  516. }
  517. }
  518. }
  519. Item
  520. {
  521. //: Spacer
  522. height: UM.Theme.getSize("default_margin").height
  523. width: UM.Theme.getSize("default_margin").height
  524. }
  525. UM.Label
  526. {
  527. font: UM.Theme.getFont("medium_bold")
  528. text: catalog.i18nc("@label","Opening and saving files")
  529. }
  530. UM.TooltipArea
  531. {
  532. width: childrenRect.width
  533. visible: Qt.platform.os !== "osx"
  534. height: childrenRect.height
  535. text: catalog.i18nc("@info:tooltip","Should opening files from the desktop or external applications open in the same instance of Cura?")
  536. UM.CheckBox
  537. {
  538. id: singleInstanceCheckbox
  539. text: catalog.i18nc("@option:check","Use a single instance of Cura")
  540. checked: boolCheck(UM.Preferences.getValue("cura/single_instance"))
  541. onCheckedChanged: UM.Preferences.setValue("cura/single_instance", checked)
  542. }
  543. }
  544. UM.TooltipArea
  545. {
  546. width: childrenRect.width
  547. height: childrenRect.height
  548. text: catalog.i18nc("@info:tooltip","Should the build plate be cleared before loading a new model in the single instance of Cura?")
  549. enabled: singleInstanceCheckbox.checked
  550. UM.CheckBox
  551. {
  552. id: singleInstanceClearBeforeLoadCheckbox
  553. text: catalog.i18nc("@option:check","Clear buildplate before loading model into the single instance")
  554. checked: boolCheck(UM.Preferences.getValue("cura/single_instance_clear_before_load"))
  555. onCheckedChanged: UM.Preferences.setValue("cura/single_instance_clear_before_load", checked)
  556. }
  557. }
  558. UM.TooltipArea
  559. {
  560. width: childrenRect.width
  561. height: childrenRect.height
  562. text: catalog.i18nc("@info:tooltip","Should models be scaled to the build volume if they are too large?")
  563. UM.CheckBox
  564. {
  565. id: scaleToFitCheckbox
  566. text: catalog.i18nc("@option:check","Scale large models")
  567. checked: boolCheck(UM.Preferences.getValue("mesh/scale_to_fit"))
  568. onCheckedChanged: UM.Preferences.setValue("mesh/scale_to_fit", checked)
  569. }
  570. }
  571. UM.TooltipArea
  572. {
  573. width: childrenRect.width
  574. height: childrenRect.height
  575. 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?")
  576. UM.CheckBox
  577. {
  578. id: scaleTinyCheckbox
  579. text: catalog.i18nc("@option:check","Scale extremely small models")
  580. checked: boolCheck(UM.Preferences.getValue("mesh/scale_tiny_meshes"))
  581. onCheckedChanged: UM.Preferences.setValue("mesh/scale_tiny_meshes", checked)
  582. }
  583. }
  584. UM.TooltipArea
  585. {
  586. width: childrenRect.width
  587. height: childrenRect.height
  588. text: catalog.i18nc("@info:tooltip","Should models be selected after they are loaded?")
  589. UM.CheckBox
  590. {
  591. id: selectModelsOnLoadCheckbox
  592. text: catalog.i18nc("@option:check","Select models when loaded")
  593. checked: boolCheck(UM.Preferences.getValue("cura/select_models_on_load"))
  594. onCheckedChanged: UM.Preferences.setValue("cura/select_models_on_load", checked)
  595. }
  596. }
  597. UM.TooltipArea
  598. {
  599. width: childrenRect.width
  600. height: childrenRect.height
  601. text: catalog.i18nc("@info:tooltip", "Should a prefix based on the printer name be added to the print job name automatically?")
  602. UM.CheckBox
  603. {
  604. id: prefixJobNameCheckbox
  605. text: catalog.i18nc("@option:check", "Add machine prefix to job name")
  606. checked: boolCheck(UM.Preferences.getValue("cura/jobname_prefix"))
  607. onCheckedChanged: UM.Preferences.setValue("cura/jobname_prefix", checked)
  608. }
  609. }
  610. UM.TooltipArea
  611. {
  612. width: childrenRect.width
  613. height: childrenRect.height
  614. text: catalog.i18nc("@info:tooltip", "Should a summary be shown when saving a project file?")
  615. UM.CheckBox
  616. {
  617. text: catalog.i18nc("@option:check", "Show summary dialog when saving project")
  618. checked: boolCheck(UM.Preferences.getValue("cura/dialog_on_project_save"))
  619. onCheckedChanged: UM.Preferences.setValue("cura/dialog_on_project_save", checked)
  620. }
  621. }
  622. UM.TooltipArea
  623. {
  624. width: childrenRect.width
  625. height: childrenRect.height
  626. text: catalog.i18nc("@info:tooltip", "Default behavior when opening a project file")
  627. Column
  628. {
  629. spacing: UM.Theme.getSize("narrow_margin").height
  630. UM.Label
  631. {
  632. text: catalog.i18nc("@window:text", "Default behavior when opening a project file: ")
  633. }
  634. Cura.ComboBox
  635. {
  636. id: choiceOnOpenProjectDropDownButton
  637. width: UM.Theme.getSize("combobox").width
  638. height: UM.Theme.getSize("combobox").height
  639. model: ListModel
  640. {
  641. id: openProjectOptionModel
  642. Component.onCompleted:
  643. {
  644. append({ text: catalog.i18nc("@option:openProject", "Always ask me this"), code: "always_ask" })
  645. append({ text: catalog.i18nc("@option:openProject", "Always open as a project"), code: "open_as_project" })
  646. append({ text: catalog.i18nc("@option:openProject", "Always import models"), code: "open_as_model" })
  647. }
  648. }
  649. textRole: "text"
  650. currentIndex:
  651. {
  652. var index = 0;
  653. var currentChoice = UM.Preferences.getValue("cura/choice_on_open_project");
  654. for (var i = 0; i < model.count; ++i)
  655. {
  656. if (model.get(i).code == currentChoice)
  657. {
  658. index = i;
  659. break;
  660. }
  661. }
  662. return index;
  663. }
  664. onActivated: UM.Preferences.setValue("cura/choice_on_open_project", model.get(index).code)
  665. }
  666. }
  667. }
  668. Item
  669. {
  670. //: Spacer
  671. height: UM.Theme.getSize("default_margin").height
  672. width: UM.Theme.getSize("default_margin").width
  673. }
  674. UM.TooltipArea
  675. {
  676. width: childrenRect.width
  677. height: childrenRect.height
  678. 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.")
  679. Column
  680. {
  681. spacing: UM.Theme.getSize("narrow_margin").height
  682. UM.Label
  683. {
  684. font: UM.Theme.getFont("medium_bold")
  685. text: catalog.i18nc("@label", "Profiles")
  686. }
  687. UM.Label
  688. {
  689. text: catalog.i18nc("@window:text", "Default behavior for changed setting values when switching to a different profile: ")
  690. }
  691. Cura.ComboBox
  692. {
  693. id: choiceOnProfileOverrideDropDownButton
  694. width: UM.Theme.getSize("combobox_wide").width
  695. height: UM.Theme.getSize("combobox_wide").height
  696. model: ListModel
  697. {
  698. id: discardOrKeepProfileListModel
  699. Component.onCompleted:
  700. {
  701. append({ text: catalog.i18nc("@option:discardOrKeep", "Always ask me this"), code: "always_ask" })
  702. append({ text: catalog.i18nc("@option:discardOrKeep", "Always discard changed settings"), code: "always_discard" })
  703. append({ text: catalog.i18nc("@option:discardOrKeep", "Always transfer changed settings to new profile"), code: "always_keep" })
  704. }
  705. }
  706. textRole: "text"
  707. currentIndex:
  708. {
  709. var index = 0;
  710. var code = UM.Preferences.getValue("cura/choice_on_profile_override");
  711. for (var i = 0; i < model.count; ++i)
  712. {
  713. if (model.get(i).code == code)
  714. {
  715. index = i;
  716. break;
  717. }
  718. }
  719. return index;
  720. }
  721. onActivated: UM.Preferences.setValue("cura/choice_on_profile_override", model.get(index).code)
  722. }
  723. }
  724. }
  725. Item
  726. {
  727. //: Spacer
  728. height: UM.Theme.getSize("default_margin").height
  729. width: UM.Theme.getSize("default_margin").height
  730. }
  731. UM.Label
  732. {
  733. font: UM.Theme.getFont("medium_bold")
  734. text: catalog.i18nc("@label", "Privacy")
  735. }
  736. UM.TooltipArea
  737. {
  738. width: childrenRect.width
  739. height: visible ? childrenRect.height : 0
  740. 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.")
  741. UM.CheckBox
  742. {
  743. id: sendEngineCrashCheckbox
  744. text: catalog.i18nc("@option:check","Send engine crash reports")
  745. checked: boolCheck(UM.Preferences.getValue("info/send_engine_crash"))
  746. onCheckedChanged: UM.Preferences.setValue("info/send_engine_crash", checked)
  747. }
  748. }
  749. ButtonGroup
  750. {
  751. id: curaCrashGroup
  752. buttons: [sendEngineCrashCheckboxAnonymous, sendEngineCrashCheckboxUser]
  753. }
  754. UM.TooltipArea
  755. {
  756. width: childrenRect.width
  757. height: visible ? childrenRect.height : 0
  758. text: catalog.i18nc("@info:tooltip", "Send crash reports without any personally identifiable information or models data to UltiMaker.")
  759. anchors.left: parent.left
  760. anchors.leftMargin: UM.Theme.getSize("default_margin").width
  761. Cura.RadioButton
  762. {
  763. id: sendEngineCrashCheckboxAnonymous
  764. text: catalog.i18nc("@option:radio", "Anonymous crash reports")
  765. enabled: sendEngineCrashCheckbox.checked && Cura.API.account.isLoggedIn
  766. checked: boolCheck(UM.Preferences.getValue("info/anonymous_engine_crash_report"))
  767. onClicked: UM.Preferences.setValue("info/anonymous_engine_crash_report", true)
  768. }
  769. }
  770. UM.TooltipArea
  771. {
  772. width: childrenRect.width
  773. height: visible ? childrenRect.height : 0
  774. text: Cura.API.account.isLoggedIn ?
  775. 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.") :
  776. catalog.i18nc("@info:tooltip", "Please sign in to your UltiMaker account to allow sending non-anonymous data.")
  777. anchors.left: parent.left
  778. anchors.leftMargin: UM.Theme.getSize("default_margin").width
  779. Cura.RadioButton
  780. {
  781. id: sendEngineCrashCheckboxUser
  782. text: catalog.i18nc("@option:radio", "Include UltiMaker account name")
  783. enabled: sendEngineCrashCheckbox.checked && Cura.API.account.isLoggedIn
  784. checked: !boolCheck(UM.Preferences.getValue("info/anonymous_engine_crash_report")) && Cura.API.account.isLoggedIn
  785. onClicked: UM.Preferences.setValue("info/anonymous_engine_crash_report", false)
  786. }
  787. }
  788. UM.TooltipArea
  789. {
  790. width: childrenRect.width
  791. height: visible ? childrenRect.height : 0
  792. 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.")
  793. UM.CheckBox
  794. {
  795. id: sendDataCheckbox
  796. text: catalog.i18nc("@option:check","Send (anonymous) print information")
  797. checked: boolCheck(UM.Preferences.getValue("info/send_slice_info"))
  798. onCheckedChanged: UM.Preferences.setValue("info/send_slice_info", checked)
  799. }
  800. UM.SimpleButton
  801. {
  802. onClicked: CuraApplication.showMoreInformationDialogForAnonymousDataCollection()
  803. iconSource: UM.Theme.getIcon("Information")
  804. anchors.left: sendDataCheckbox.right
  805. anchors.verticalCenter: sendDataCheckbox.verticalCenter
  806. hoverBackgroundColor: UM.Theme.getColor("secondary_button_hover")
  807. backgroundRadius: width / 2
  808. height: UM.Theme.getSize("small_button_icon").height
  809. color: UM.Theme.getColor("small_button_text")
  810. width: height
  811. }
  812. }
  813. Item
  814. {
  815. //: Spacer
  816. height: UM.Theme.getSize("default_margin").height
  817. width: UM.Theme.getSize("default_margin").height
  818. }
  819. UM.Label
  820. {
  821. font: UM.Theme.getFont("medium_bold")
  822. text: catalog.i18nc("@label", "Updates")
  823. }
  824. UM.TooltipArea
  825. {
  826. width: childrenRect.width
  827. height: visible ? childrenRect.height : 0
  828. text: catalog.i18nc("@info:tooltip", "Should Cura check for updates when the program is started?")
  829. UM.CheckBox
  830. {
  831. id: checkUpdatesCheckbox
  832. text: catalog.i18nc("@option:check","Check for updates on start")
  833. checked: boolCheck(UM.Preferences.getValue("info/automatic_update_check"))
  834. onCheckedChanged: UM.Preferences.setValue("info/automatic_update_check", checked)
  835. }
  836. }
  837. ButtonGroup
  838. {
  839. id: curaUpdatesGroup
  840. buttons: [checkUpdatesOptionBeta, checkUpdatesOptionStable]
  841. }
  842. UM.TooltipArea
  843. {
  844. width: childrenRect.width
  845. height: visible ? childrenRect.height : 0
  846. text: catalog.i18nc("@info:tooltip", "When checking for updates, only check for stable releases.")
  847. anchors.left: parent.left
  848. anchors.leftMargin: UM.Theme.getSize("default_margin").width
  849. Cura.RadioButton
  850. {
  851. id: checkUpdatesOptionStable
  852. text: catalog.i18nc("@option:radio", "Stable releases only")
  853. enabled: checkUpdatesCheckbox.checked
  854. checked: UM.Preferences.getValue("info/latest_update_source") == "stable"
  855. onClicked: UM.Preferences.setValue("info/latest_update_source", "stable")
  856. }
  857. }
  858. UM.TooltipArea
  859. {
  860. width: childrenRect.width
  861. height: visible ? childrenRect.height : 0
  862. text: catalog.i18nc("@info:tooltip", "When checking for updates, check for both stable and for beta releases.")
  863. anchors.left: parent.left
  864. anchors.leftMargin: UM.Theme.getSize("default_margin").width
  865. Cura.RadioButton
  866. {
  867. id: checkUpdatesOptionBeta
  868. text: catalog.i18nc("@option:radio", "Stable and Beta releases")
  869. enabled: checkUpdatesCheckbox.checked
  870. checked: UM.Preferences.getValue("info/latest_update_source") == "beta"
  871. onClicked: UM.Preferences.setValue("info/latest_update_source", "beta")
  872. }
  873. }
  874. UM.TooltipArea
  875. {
  876. width: childrenRect.width
  877. height: visible ? childrenRect.height : 0
  878. 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!")
  879. UM.CheckBox
  880. {
  881. id: pluginNotificationsUpdateCheckbox
  882. text: catalog.i18nc("@option:check", "Get notifications for plugin updates")
  883. checked: boolCheck(UM.Preferences.getValue("info/automatic_plugin_update_check"))
  884. onCheckedChanged: UM.Preferences.setValue("info/automatic_plugin_update_check", checked)
  885. }
  886. }
  887. /* Multi-buildplate functionality is disabled because it's broken. See CURA-4975 for the ticket to remove it.
  888. Item
  889. {
  890. //: Spacer
  891. height: UM.Theme.getSize("default_margin").height
  892. width: UM.Theme.getSize("default_margin").height
  893. }
  894. Label
  895. {
  896. font.bold: true
  897. text: catalog.i18nc("@label","Experimental")
  898. }
  899. UM.TooltipArea
  900. {
  901. width: childrenRect.width
  902. height: childrenRect.height
  903. text: catalog.i18nc("@info:tooltip","Use multi build plate functionality")
  904. CheckBox
  905. {
  906. id: useMultiBuildPlateCheckbox
  907. text: catalog.i18nc("@option:check","Use multi build plate functionality (restart required)")
  908. checked: boolCheck(UM.Preferences.getValue("cura/use_multi_build_plate"))
  909. onCheckedChanged: UM.Preferences.setValue("cura/use_multi_build_plate", checked)
  910. }
  911. }*/
  912. Connections
  913. {
  914. target: UM.Preferences
  915. function onPreferenceChanged(preference)
  916. {
  917. if (preference !== "info/send_slice_info")
  918. {
  919. return;
  920. }
  921. sendDataCheckbox.checked = boolCheck(UM.Preferences.getValue("info/send_slice_info"))
  922. }
  923. }
  924. }
  925. }
  926. }