GeneralPage.qml 35 KB

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