GeneralPage.qml 45 KB

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