GeneralPage.qml 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853
  1. // Copyright (c) 2020 Ultimaker B.V.
  2. // Cura is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.1
  4. import QtQuick.Controls 1.1
  5. import QtQuick.Layouts 1.1
  6. import QtQuick.Controls.Styles 1.1
  7. import UM 1.1 as UM
  8. import Cura 1.0 as Cura
  9. UM.PreferencesPage
  10. {
  11. //: General configuration page title
  12. title: catalog.i18nc("@title:tab", "General")
  13. id: generalPreferencesPage
  14. function setDefaultLanguage(languageCode)
  15. {
  16. //loops trough 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("physics/automatic_push_free")
  66. pushFreeCheckbox.checked = boolCheck(UM.Preferences.getValue("physics/automatic_push_free"))
  67. UM.Preferences.resetPreference("physics/automatic_drop_down")
  68. dropDownCheckbox.checked = boolCheck(UM.Preferences.getValue("physics/automatic_drop_down"))
  69. UM.Preferences.resetPreference("mesh/scale_to_fit")
  70. scaleToFitCheckbox.checked = boolCheck(UM.Preferences.getValue("mesh/scale_to_fit"))
  71. UM.Preferences.resetPreference("mesh/scale_tiny_meshes")
  72. scaleTinyCheckbox.checked = boolCheck(UM.Preferences.getValue("mesh/scale_tiny_meshes"))
  73. UM.Preferences.resetPreference("cura/select_models_on_load")
  74. selectModelsOnLoadCheckbox.checked = boolCheck(UM.Preferences.getValue("cura/select_models_on_load"))
  75. UM.Preferences.resetPreference("cura/jobname_prefix")
  76. prefixJobNameCheckbox.checked = boolCheck(UM.Preferences.getValue("cura/jobname_prefix"))
  77. UM.Preferences.resetPreference("view/show_overhang");
  78. showOverhangCheckbox.checked = boolCheck(UM.Preferences.getValue("view/show_overhang"))
  79. UM.Preferences.resetPreference("view/show_xray_warning");
  80. showXrayErrorCheckbox.checked = boolCheck(UM.Preferences.getValue("view/show_xray_warning"))
  81. UM.Preferences.resetPreference("view/center_on_select");
  82. centerOnSelectCheckbox.checked = boolCheck(UM.Preferences.getValue("view/center_on_select"))
  83. UM.Preferences.resetPreference("view/invert_zoom");
  84. invertZoomCheckbox.checked = boolCheck(UM.Preferences.getValue("view/invert_zoom"))
  85. UM.Preferences.resetPreference("view/zoom_to_mouse");
  86. zoomToMouseCheckbox.checked = boolCheck(UM.Preferences.getValue("view/zoom_to_mouse"))
  87. UM.Preferences.resetPreference("view/top_layer_count");
  88. topLayerCountCheckbox.checked = boolCheck(UM.Preferences.getValue("view/top_layer_count"))
  89. UM.Preferences.resetPreference("general/restore_window_geometry")
  90. restoreWindowPositionCheckbox.checked = boolCheck(UM.Preferences.getValue("general/restore_window_geometry"))
  91. UM.Preferences.resetPreference("general/camera_perspective_mode")
  92. var defaultCameraMode = UM.Preferences.getValue("general/camera_perspective_mode")
  93. setDefaultCameraMode(defaultCameraMode)
  94. UM.Preferences.resetPreference("cura/choice_on_profile_override")
  95. setDefaultDiscardOrKeepProfile(UM.Preferences.getValue("cura/choice_on_profile_override"))
  96. UM.Preferences.resetPreference("cura/choice_on_open_project")
  97. setDefaultOpenProjectOption(UM.Preferences.getValue("cura/choice_on_open_project"))
  98. UM.Preferences.resetPreference("info/send_slice_info")
  99. sendDataCheckbox.checked = boolCheck(UM.Preferences.getValue("info/send_slice_info"))
  100. UM.Preferences.resetPreference("info/automatic_update_check")
  101. checkUpdatesCheckbox.checked = boolCheck(UM.Preferences.getValue("info/automatic_update_check"))
  102. }
  103. ScrollView
  104. {
  105. width: parent.width
  106. height: parent.height
  107. flickableItem.flickableDirection: Flickable.VerticalFlick;
  108. Column
  109. {
  110. //: Language selection label
  111. UM.I18nCatalog{id: catalog; name: "cura"}
  112. Label
  113. {
  114. font.bold: true
  115. text: catalog.i18nc("@label", "Interface")
  116. }
  117. GridLayout
  118. {
  119. id: interfaceGrid
  120. columns: 4
  121. Label
  122. {
  123. id: languageLabel
  124. text: "Language:" //Don't translate this, to make it easier to find the language drop-down if you can't read the current language.
  125. }
  126. ComboBox
  127. {
  128. id: languageComboBox
  129. model: ListModel
  130. {
  131. id: languageList
  132. Component.onCompleted: {
  133. append({ text: "English", code: "en_US" })
  134. append({ text: "Czech", code: "cs_CZ" })
  135. append({ text: "Deutsch", code: "de_DE" })
  136. append({ text: "Español", code: "es_ES" })
  137. //Finnish is disabled for being incomplete: append({ text: "Suomi", code: "fi_FI" })
  138. append({ text: "Français", code: "fr_FR" })
  139. append({ text: "Italiano", code: "it_IT" })
  140. append({ text: "日本語", code: "ja_JP" })
  141. append({ text: "한국어", code: "ko_KR" })
  142. append({ text: "Nederlands", code: "nl_NL" })
  143. //Polish is disabled for being incomplete: append({ text: "Polski", code: "pl_PL" })
  144. append({ text: "Português do Brasil", code: "pt_BR" })
  145. append({ text: "Português", code: "pt_PT" })
  146. append({ text: "Русский", code: "ru_RU" })
  147. append({ text: "Türkçe", code: "tr_TR" })
  148. append({ text: "简体中文", code: "zh_CN" })
  149. append({ text: "正體字", code: "zh_TW" })
  150. var date_object = new Date();
  151. if (date_object.getUTCMonth() == 8 && date_object.getUTCDate() == 19) //Only add Pirate on the 19th of September.
  152. {
  153. append({ text: "Pirate", code: "en_7S" })
  154. }
  155. }
  156. }
  157. currentIndex:
  158. {
  159. var code = UM.Preferences.getValue("general/language");
  160. for(var i = 0; i < languageList.count; ++i)
  161. {
  162. if(model.get(i).code == code)
  163. {
  164. return i
  165. }
  166. }
  167. }
  168. onActivated: UM.Preferences.setValue("general/language", model.get(index).code)
  169. Component.onCompleted:
  170. {
  171. // Because ListModel is stupid and does not allow using qsTr() for values.
  172. for(var i = 0; i < languageList.count; ++i)
  173. {
  174. languageList.setProperty(i, "text", catalog.i18n(languageList.get(i).text));
  175. }
  176. // Glorious hack time. ComboBox does not update the text properly after changing the
  177. // model. So change the indices around to force it to update.
  178. currentIndex += 1;
  179. currentIndex -= 1;
  180. }
  181. }
  182. Label
  183. {
  184. id: currencyLabel
  185. text: catalog.i18nc("@label","Currency:")
  186. }
  187. TextField
  188. {
  189. id: currencyField
  190. text: UM.Preferences.getValue("cura/currency")
  191. onTextChanged: UM.Preferences.setValue("cura/currency", text)
  192. }
  193. Label
  194. {
  195. id: themeLabel
  196. text: catalog.i18nc("@label","Theme:")
  197. }
  198. ComboBox
  199. {
  200. id: themeComboBox
  201. model: ListModel
  202. {
  203. id: themeList
  204. Component.onCompleted: {
  205. var themes = UM.Theme.getThemes()
  206. for (var i = 0; i < themes.length; i++)
  207. {
  208. append({ text: themes[i].name.toString(), code: themes[i].id.toString() });
  209. }
  210. }
  211. }
  212. currentIndex:
  213. {
  214. var code = UM.Preferences.getValue("general/theme");
  215. for(var i = 0; i < themeList.count; ++i)
  216. {
  217. if(model.get(i).code == code)
  218. {
  219. return i
  220. }
  221. }
  222. return 0;
  223. }
  224. onActivated: UM.Preferences.setValue("general/theme", model.get(index).code)
  225. Component.onCompleted:
  226. {
  227. // Because ListModel is stupid and does not allow using qsTr() for values.
  228. for(var i = 0; i < themeList.count; ++i)
  229. {
  230. themeList.setProperty(i, "text", catalog.i18n(themeList.get(i).text));
  231. }
  232. // Glorious hack time. ComboBox does not update the text properly after changing the
  233. // model. So change the indices around to force it to update.
  234. currentIndex += 1;
  235. currentIndex -= 1;
  236. }
  237. }
  238. }
  239. Label
  240. {
  241. id: languageCaption
  242. //: Language change warning
  243. text: catalog.i18nc("@label", "You will need to restart the application for these changes to have effect.")
  244. wrapMode: Text.WordWrap
  245. font.italic: true
  246. }
  247. Item
  248. {
  249. //: Spacer
  250. height: UM.Theme.getSize("default_margin").height
  251. width: UM.Theme.getSize("default_margin").width
  252. }
  253. UM.TooltipArea
  254. {
  255. width: childrenRect.width;
  256. height: childrenRect.height;
  257. text: catalog.i18nc("@info:tooltip", "Slice automatically when changing settings.")
  258. CheckBox
  259. {
  260. id: autoSliceCheckbox
  261. checked: boolCheck(UM.Preferences.getValue("general/auto_slice"))
  262. onClicked: UM.Preferences.setValue("general/auto_slice", checked)
  263. text: catalog.i18nc("@option:check", "Slice automatically");
  264. }
  265. }
  266. Item
  267. {
  268. //: Spacer
  269. height: UM.Theme.getSize("default_margin").height
  270. width: UM.Theme.getSize("default_margin").width
  271. }
  272. Label
  273. {
  274. font.bold: true
  275. text: catalog.i18nc("@label", "Viewport behavior")
  276. }
  277. UM.TooltipArea
  278. {
  279. width: childrenRect.width;
  280. height: childrenRect.height;
  281. text: catalog.i18nc("@info:tooltip", "Highlight unsupported areas of the model in red. Without support these areas will not print properly.")
  282. CheckBox
  283. {
  284. id: showOverhangCheckbox
  285. checked: boolCheck(UM.Preferences.getValue("view/show_overhang"))
  286. onClicked: UM.Preferences.setValue("view/show_overhang", checked)
  287. text: catalog.i18nc("@option:check", "Display overhang");
  288. }
  289. }
  290. UM.TooltipArea
  291. {
  292. width: childrenRect.width;
  293. height: childrenRect.height;
  294. text: catalog.i18nc("@info:tooltip", "Show a message if missing or extraneous surfaces are detected. The toolpaths will often be missing parts of the intended geometry.")
  295. CheckBox
  296. {
  297. id: showXrayErrorCheckbox
  298. checked: boolCheck(UM.Preferences.getValue("view/show_xray_warning"))
  299. onClicked: UM.Preferences.setValue("view/show_xray_warning", checked)
  300. text: catalog.i18nc("@option:check", "Display message if model errors are detected");
  301. }
  302. }
  303. UM.TooltipArea
  304. {
  305. width: childrenRect.width;
  306. height: childrenRect.height;
  307. text: catalog.i18nc("@info:tooltip", "Moves the camera so the model is in the center of the view when a model is selected")
  308. CheckBox
  309. {
  310. id: centerOnSelectCheckbox
  311. text: catalog.i18nc("@action:button","Center camera when item is selected");
  312. checked: boolCheck(UM.Preferences.getValue("view/center_on_select"))
  313. onClicked: UM.Preferences.setValue("view/center_on_select", checked)
  314. }
  315. }
  316. UM.TooltipArea
  317. {
  318. width: childrenRect.width;
  319. height: childrenRect.height;
  320. text: catalog.i18nc("@info:tooltip", "Should the default zoom behavior of cura be inverted?")
  321. CheckBox
  322. {
  323. id: invertZoomCheckbox
  324. text: catalog.i18nc("@action:button", "Invert the direction of camera zoom.");
  325. checked: boolCheck(UM.Preferences.getValue("view/invert_zoom"))
  326. onClicked: {
  327. if(!checked && zoomToMouseCheckbox.checked) //Fix for Github issue Ultimaker/Cura#6490: Make sure the camera origin is in front when unchecking.
  328. {
  329. UM.Controller.setCameraOrigin("home");
  330. }
  331. UM.Preferences.setValue("view/invert_zoom", checked);
  332. }
  333. }
  334. }
  335. UM.TooltipArea
  336. {
  337. width: childrenRect.width;
  338. height: childrenRect.height;
  339. 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.")
  340. CheckBox
  341. {
  342. id: zoomToMouseCheckbox
  343. text: catalog.i18nc("@action:button", "Zoom toward mouse direction")
  344. checked: boolCheck(UM.Preferences.getValue("view/zoom_to_mouse")) && zoomToMouseCheckbox.enabled
  345. onClicked: UM.Preferences.setValue("view/zoom_to_mouse", checked)
  346. enabled: UM.Preferences.getValue("general/camera_perspective_mode") !== "orthogonal"
  347. }
  348. //Because there is no signal for individual preferences, we need to manually link to the onPreferenceChanged signal.
  349. Connections
  350. {
  351. target: UM.Preferences
  352. onPreferenceChanged:
  353. {
  354. if(preference != "general/camera_perspective_mode")
  355. {
  356. return;
  357. }
  358. zoomToMouseCheckbox.enabled = UM.Preferences.getValue("general/camera_perspective_mode") !== "orthographic";
  359. zoomToMouseCheckbox.checked = boolCheck(UM.Preferences.getValue("view/zoom_to_mouse")) && zoomToMouseCheckbox.enabled;
  360. }
  361. }
  362. }
  363. UM.TooltipArea
  364. {
  365. width: childrenRect.width
  366. height: childrenRect.height
  367. text: catalog.i18nc("@info:tooltip", "Should models on the platform be moved so that they no longer intersect?")
  368. CheckBox
  369. {
  370. id: pushFreeCheckbox
  371. text: catalog.i18nc("@option:check", "Ensure models are kept apart")
  372. checked: boolCheck(UM.Preferences.getValue("physics/automatic_push_free"))
  373. onCheckedChanged: UM.Preferences.setValue("physics/automatic_push_free", checked)
  374. }
  375. }
  376. UM.TooltipArea
  377. {
  378. width: childrenRect.width
  379. height: childrenRect.height
  380. text: catalog.i18nc("@info:tooltip", "Should models on the platform be moved down to touch the build plate?")
  381. CheckBox
  382. {
  383. id: dropDownCheckbox
  384. text: catalog.i18nc("@option:check", "Automatically drop models to the build plate")
  385. checked: boolCheck(UM.Preferences.getValue("physics/automatic_drop_down"))
  386. onCheckedChanged: UM.Preferences.setValue("physics/automatic_drop_down", checked)
  387. }
  388. }
  389. UM.TooltipArea
  390. {
  391. width: childrenRect.width;
  392. height: childrenRect.height;
  393. text: catalog.i18nc("@info:tooltip","Show caution message in g-code reader.")
  394. CheckBox
  395. {
  396. id: gcodeShowCautionCheckbox
  397. checked: boolCheck(UM.Preferences.getValue("gcodereader/show_caution"))
  398. onClicked: UM.Preferences.setValue("gcodereader/show_caution", checked)
  399. text: catalog.i18nc("@option:check","Caution message in g-code reader");
  400. }
  401. }
  402. UM.TooltipArea
  403. {
  404. width: childrenRect.width
  405. height: childrenRect.height
  406. text: catalog.i18nc("@info:tooltip", "Should layer be forced into compatibility mode?")
  407. CheckBox
  408. {
  409. id: forceLayerViewCompatibilityModeCheckbox
  410. text: catalog.i18nc("@option:check", "Force layer view compatibility mode (restart required)")
  411. checked: boolCheck(UM.Preferences.getValue("view/force_layer_view_compatibility_mode"))
  412. onCheckedChanged: UM.Preferences.setValue("view/force_layer_view_compatibility_mode", checked)
  413. }
  414. }
  415. UM.TooltipArea
  416. {
  417. width: childrenRect.width
  418. height: childrenRect.height
  419. text: catalog.i18nc("@info:tooltip", "Should Cura open at the location it was closed?")
  420. CheckBox
  421. {
  422. id: restoreWindowPositionCheckbox
  423. text: catalog.i18nc("@option:check", "Restore window position on start")
  424. checked: boolCheck(UM.Preferences.getValue("general/restore_window_geometry"))
  425. onCheckedChanged: UM.Preferences.setValue("general/restore_window_geometry", checked)
  426. }
  427. }
  428. UM.TooltipArea
  429. {
  430. width: childrenRect.width
  431. height: childrenRect.height
  432. text: catalog.i18nc("@info:tooltip", "What type of camera rendering should be used?")
  433. Column
  434. {
  435. spacing: 4 * screenScaleFactor
  436. Label
  437. {
  438. text: catalog.i18nc("@window:text", "Camera rendering:")
  439. }
  440. ComboBox
  441. {
  442. id: cameraComboBox
  443. model: ListModel
  444. {
  445. id: comboBoxList
  446. Component.onCompleted: {
  447. append({ text: catalog.i18n("Perspective"), code: "perspective" })
  448. append({ text: catalog.i18n("Orthographic"), code: "orthographic" })
  449. }
  450. }
  451. currentIndex:
  452. {
  453. var code = UM.Preferences.getValue("general/camera_perspective_mode");
  454. for(var i = 0; i < comboBoxList.count; ++i)
  455. {
  456. if(model.get(i).code == code)
  457. {
  458. return i
  459. }
  460. }
  461. return 0
  462. }
  463. onActivated: UM.Preferences.setValue("general/camera_perspective_mode", model.get(index).code)
  464. }
  465. }
  466. }
  467. Item
  468. {
  469. //: Spacer
  470. height: UM.Theme.getSize("default_margin").height
  471. width: UM.Theme.getSize("default_margin").height
  472. }
  473. Label
  474. {
  475. font.bold: true
  476. text: catalog.i18nc("@label","Opening and saving files")
  477. }
  478. UM.TooltipArea
  479. {
  480. width: childrenRect.width
  481. height: childrenRect.height
  482. text: catalog.i18nc("@info:tooltip","Should models be scaled to the build volume if they are too large?")
  483. CheckBox
  484. {
  485. id: scaleToFitCheckbox
  486. text: catalog.i18nc("@option:check","Scale large models")
  487. checked: boolCheck(UM.Preferences.getValue("mesh/scale_to_fit"))
  488. onCheckedChanged: UM.Preferences.setValue("mesh/scale_to_fit", checked)
  489. }
  490. }
  491. UM.TooltipArea
  492. {
  493. width: childrenRect.width
  494. height: childrenRect.height
  495. 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?")
  496. CheckBox
  497. {
  498. id: scaleTinyCheckbox
  499. text: catalog.i18nc("@option:check","Scale extremely small models")
  500. checked: boolCheck(UM.Preferences.getValue("mesh/scale_tiny_meshes"))
  501. onCheckedChanged: UM.Preferences.setValue("mesh/scale_tiny_meshes", checked)
  502. }
  503. }
  504. UM.TooltipArea
  505. {
  506. width: childrenRect.width
  507. height: childrenRect.height
  508. text: catalog.i18nc("@info:tooltip","Should models be selected after they are loaded?")
  509. CheckBox
  510. {
  511. id: selectModelsOnLoadCheckbox
  512. text: catalog.i18nc("@option:check","Select models when loaded")
  513. checked: boolCheck(UM.Preferences.getValue("cura/select_models_on_load"))
  514. onCheckedChanged: UM.Preferences.setValue("cura/select_models_on_load", checked)
  515. }
  516. }
  517. UM.TooltipArea
  518. {
  519. width: childrenRect.width
  520. height: childrenRect.height
  521. text: catalog.i18nc("@info:tooltip", "Should a prefix based on the printer name be added to the print job name automatically?")
  522. CheckBox
  523. {
  524. id: prefixJobNameCheckbox
  525. text: catalog.i18nc("@option:check", "Add machine prefix to job name")
  526. checked: boolCheck(UM.Preferences.getValue("cura/jobname_prefix"))
  527. onCheckedChanged: UM.Preferences.setValue("cura/jobname_prefix", checked)
  528. }
  529. }
  530. UM.TooltipArea
  531. {
  532. width: childrenRect.width
  533. height: childrenRect.height
  534. text: catalog.i18nc("@info:tooltip", "Should a summary be shown when saving a project file?")
  535. CheckBox
  536. {
  537. text: catalog.i18nc("@option:check", "Show summary dialog when saving project")
  538. checked: boolCheck(UM.Preferences.getValue("cura/dialog_on_project_save"))
  539. onCheckedChanged: UM.Preferences.setValue("cura/dialog_on_project_save", checked)
  540. }
  541. }
  542. UM.TooltipArea
  543. {
  544. width: childrenRect.width
  545. height: childrenRect.height
  546. text: catalog.i18nc("@info:tooltip", "Default behavior when opening a project file")
  547. Column
  548. {
  549. spacing: 4 * screenScaleFactor
  550. Label
  551. {
  552. text: catalog.i18nc("@window:text", "Default behavior when opening a project file: ")
  553. }
  554. ComboBox
  555. {
  556. id: choiceOnOpenProjectDropDownButton
  557. width: 200 * screenScaleFactor
  558. model: ListModel
  559. {
  560. id: openProjectOptionModel
  561. Component.onCompleted:
  562. {
  563. append({ text: catalog.i18nc("@option:openProject", "Always ask me this"), code: "always_ask" })
  564. append({ text: catalog.i18nc("@option:openProject", "Always open as a project"), code: "open_as_project" })
  565. append({ text: catalog.i18nc("@option:openProject", "Always import models"), code: "open_as_model" })
  566. }
  567. }
  568. currentIndex:
  569. {
  570. var index = 0;
  571. var currentChoice = UM.Preferences.getValue("cura/choice_on_open_project");
  572. for (var i = 0; i < model.count; ++i)
  573. {
  574. if (model.get(i).code == currentChoice)
  575. {
  576. index = i;
  577. break;
  578. }
  579. }
  580. return index;
  581. }
  582. onActivated: UM.Preferences.setValue("cura/choice_on_open_project", model.get(index).code)
  583. }
  584. }
  585. }
  586. Item
  587. {
  588. //: Spacer
  589. height: UM.Theme.getSize("default_margin").height
  590. width: UM.Theme.getSize("default_margin").width
  591. }
  592. UM.TooltipArea
  593. {
  594. width: childrenRect.width;
  595. height: childrenRect.height;
  596. 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.")
  597. Column
  598. {
  599. spacing: 4 * screenScaleFactor
  600. Label
  601. {
  602. font.bold: true
  603. text: catalog.i18nc("@label", "Profiles")
  604. }
  605. Label
  606. {
  607. text: catalog.i18nc("@window:text", "Default behavior for changed setting values when switching to a different profile: ")
  608. }
  609. ComboBox
  610. {
  611. id: choiceOnProfileOverrideDropDownButton
  612. width: 200 * screenScaleFactor
  613. model: ListModel
  614. {
  615. id: discardOrKeepProfileListModel
  616. Component.onCompleted:
  617. {
  618. append({ text: catalog.i18nc("@option:discardOrKeep", "Always ask me this"), code: "always_ask" })
  619. append({ text: catalog.i18nc("@option:discardOrKeep", "Always discard changed settings"), code: "always_discard" })
  620. append({ text: catalog.i18nc("@option:discardOrKeep", "Always transfer changed settings to new profile"), code: "always_keep" })
  621. }
  622. }
  623. currentIndex:
  624. {
  625. var index = 0;
  626. var code = UM.Preferences.getValue("cura/choice_on_profile_override");
  627. for (var i = 0; i < model.count; ++i)
  628. {
  629. if (model.get(i).code == code)
  630. {
  631. index = i;
  632. break;
  633. }
  634. }
  635. return index;
  636. }
  637. onActivated: UM.Preferences.setValue("cura/choice_on_profile_override", model.get(index).code)
  638. }
  639. }
  640. }
  641. Item
  642. {
  643. //: Spacer
  644. height: UM.Theme.getSize("default_margin").height
  645. width: UM.Theme.getSize("default_margin").height
  646. }
  647. Label
  648. {
  649. font.bold: true
  650. visible: checkUpdatesCheckbox.visible || sendDataCheckbox.visible
  651. text: catalog.i18nc("@label","Privacy")
  652. }
  653. UM.TooltipArea
  654. {
  655. width: childrenRect.width
  656. height: visible ? childrenRect.height : 0
  657. text: catalog.i18nc("@info:tooltip","Should Cura check for updates when the program is started?")
  658. CheckBox
  659. {
  660. id: checkUpdatesCheckbox
  661. text: catalog.i18nc("@option:check","Check for updates on start")
  662. checked: boolCheck(UM.Preferences.getValue("info/automatic_update_check"))
  663. onCheckedChanged: UM.Preferences.setValue("info/automatic_update_check", checked)
  664. }
  665. }
  666. UM.TooltipArea
  667. {
  668. width: childrenRect.width
  669. height: visible ? childrenRect.height : 0
  670. 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.")
  671. CheckBox
  672. {
  673. id: sendDataCheckbox
  674. text: catalog.i18nc("@option:check","Send (anonymous) print information")
  675. checked: boolCheck(UM.Preferences.getValue("info/send_slice_info"))
  676. onCheckedChanged: UM.Preferences.setValue("info/send_slice_info", checked)
  677. }
  678. Button
  679. {
  680. id: showMoreInfo
  681. anchors.top: sendDataCheckbox.bottom
  682. text: catalog.i18nc("@action:button", "More information")
  683. onClicked:
  684. {
  685. CuraApplication.showMoreInformationDialogForAnonymousDataCollection();
  686. }
  687. }
  688. }
  689. /* Multi-buildplate functionality is disabled because it's broken. See CURA-4975 for the ticket to remove it.
  690. Item
  691. {
  692. //: Spacer
  693. height: UM.Theme.getSize("default_margin").height
  694. width: UM.Theme.getSize("default_margin").height
  695. }
  696. Label
  697. {
  698. font.bold: true
  699. text: catalog.i18nc("@label","Experimental")
  700. }
  701. UM.TooltipArea
  702. {
  703. width: childrenRect.width
  704. height: childrenRect.height
  705. text: catalog.i18nc("@info:tooltip","Use multi build plate functionality")
  706. CheckBox
  707. {
  708. id: useMultiBuildPlateCheckbox
  709. text: catalog.i18nc("@option:check","Use multi build plate functionality (restart required)")
  710. checked: boolCheck(UM.Preferences.getValue("cura/use_multi_build_plate"))
  711. onCheckedChanged: UM.Preferences.setValue("cura/use_multi_build_plate", checked)
  712. }
  713. }*/
  714. Connections
  715. {
  716. target: UM.Preferences
  717. onPreferenceChanged:
  718. {
  719. if (preference !== "info/send_slice_info")
  720. {
  721. return;
  722. }
  723. sendDataCheckbox.checked = boolCheck(UM.Preferences.getValue("info/send_slice_info"))
  724. }
  725. }
  726. }
  727. }
  728. }