GeneralPage.qml 41 KB

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