GeneralPage.qml 33 KB

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