GeneralPage.qml 40 KB

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