GeneralPage.qml 47 KB

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