GeneralPage.qml 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131
  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: "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", "Default behavior when opening a project file")
  676. Column
  677. {
  678. spacing: UM.Theme.getSize("narrow_margin").height
  679. UM.Label
  680. {
  681. text: catalog.i18nc("@window:text", "Default behavior when opening a project file: ")
  682. }
  683. Cura.ComboBox
  684. {
  685. id: choiceOnOpenProjectDropDownButton
  686. width: UM.Theme.getSize("combobox").width
  687. height: UM.Theme.getSize("combobox").height
  688. model: ListModel
  689. {
  690. id: openProjectOptionModel
  691. Component.onCompleted:
  692. {
  693. append({ text: catalog.i18nc("@option:openProject", "Always ask me this"), code: "always_ask" })
  694. append({ text: catalog.i18nc("@option:openProject", "Always open as a project"), code: "open_as_project" })
  695. append({ text: catalog.i18nc("@option:openProject", "Always import models"), code: "open_as_model" })
  696. }
  697. }
  698. textRole: "text"
  699. currentIndex:
  700. {
  701. var index = 0;
  702. var currentChoice = UM.Preferences.getValue("cura/choice_on_open_project");
  703. for (var i = 0; i < model.count; ++i)
  704. {
  705. if (model.get(i).code == currentChoice)
  706. {
  707. index = i;
  708. break;
  709. }
  710. }
  711. return index;
  712. }
  713. onActivated: UM.Preferences.setValue("cura/choice_on_open_project", model.get(index).code)
  714. }
  715. }
  716. }
  717. Item
  718. {
  719. //: Spacer
  720. height: UM.Theme.getSize("default_margin").height
  721. width: UM.Theme.getSize("default_margin").width
  722. }
  723. UM.TooltipArea
  724. {
  725. width: childrenRect.width
  726. height: childrenRect.height
  727. 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.")
  728. Column
  729. {
  730. spacing: UM.Theme.getSize("narrow_margin").height
  731. UM.Label
  732. {
  733. font: UM.Theme.getFont("medium_bold")
  734. text: catalog.i18nc("@label", "Profiles")
  735. }
  736. UM.Label
  737. {
  738. text: catalog.i18nc("@window:text", "Default behavior for changed setting values when switching to a different profile: ")
  739. }
  740. Cura.ComboBox
  741. {
  742. id: choiceOnProfileOverrideDropDownButton
  743. width: UM.Theme.getSize("combobox_wide").width
  744. height: UM.Theme.getSize("combobox_wide").height
  745. model: ListModel
  746. {
  747. id: discardOrKeepProfileListModel
  748. Component.onCompleted:
  749. {
  750. append({ text: catalog.i18nc("@option:discardOrKeep", "Always ask me this"), code: "always_ask" })
  751. append({ text: catalog.i18nc("@option:discardOrKeep", "Always discard changed settings"), code: "always_discard" })
  752. append({ text: catalog.i18nc("@option:discardOrKeep", "Always transfer changed settings to new profile"), code: "always_keep" })
  753. }
  754. }
  755. textRole: "text"
  756. currentIndex:
  757. {
  758. var index = 0;
  759. var code = UM.Preferences.getValue("cura/choice_on_profile_override");
  760. for (var i = 0; i < model.count; ++i)
  761. {
  762. if (model.get(i).code == code)
  763. {
  764. index = i;
  765. break;
  766. }
  767. }
  768. return index;
  769. }
  770. onActivated: UM.Preferences.setValue("cura/choice_on_profile_override", model.get(index).code)
  771. }
  772. }
  773. }
  774. Item
  775. {
  776. //: Spacer
  777. height: UM.Theme.getSize("default_margin").height
  778. width: UM.Theme.getSize("default_margin").height
  779. }
  780. UM.Label
  781. {
  782. font: UM.Theme.getFont("medium_bold")
  783. text: catalog.i18nc("@label", "Privacy")
  784. }
  785. UM.TooltipArea
  786. {
  787. width: childrenRect.width
  788. height: visible ? childrenRect.height : 0
  789. 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.")
  790. UM.CheckBox
  791. {
  792. id: sendEngineCrashCheckbox
  793. text: catalog.i18nc("@option:check","Send engine crash reports")
  794. checked: boolCheck(UM.Preferences.getValue("info/send_engine_crash"))
  795. onCheckedChanged: UM.Preferences.setValue("info/send_engine_crash", checked)
  796. }
  797. }
  798. ButtonGroup
  799. {
  800. id: curaCrashGroup
  801. buttons: [sendEngineCrashCheckboxAnonymous, sendEngineCrashCheckboxUser]
  802. }
  803. UM.TooltipArea
  804. {
  805. width: childrenRect.width
  806. height: visible ? childrenRect.height : 0
  807. text: catalog.i18nc("@info:tooltip", "Send crash reports without any personally identifiable information or models data to UltiMaker.")
  808. anchors.left: parent.left
  809. anchors.leftMargin: UM.Theme.getSize("default_margin").width
  810. Cura.RadioButton
  811. {
  812. id: sendEngineCrashCheckboxAnonymous
  813. text: catalog.i18nc("@option:radio", "Anonymous crash reports")
  814. enabled: sendEngineCrashCheckbox.checked && Cura.API.account.isLoggedIn
  815. checked: boolCheck(UM.Preferences.getValue("info/anonymous_engine_crash_report"))
  816. onClicked: UM.Preferences.setValue("info/anonymous_engine_crash_report", true)
  817. }
  818. }
  819. UM.TooltipArea
  820. {
  821. width: childrenRect.width
  822. height: visible ? childrenRect.height : 0
  823. text: Cura.API.account.isLoggedIn ?
  824. 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.") :
  825. catalog.i18nc("@info:tooltip", "Please sign in to your UltiMaker account to allow sending non-anonymous data.")
  826. anchors.left: parent.left
  827. anchors.leftMargin: UM.Theme.getSize("default_margin").width
  828. Cura.RadioButton
  829. {
  830. id: sendEngineCrashCheckboxUser
  831. text: catalog.i18nc("@option:radio", "Include UltiMaker account name")
  832. enabled: sendEngineCrashCheckbox.checked && Cura.API.account.isLoggedIn
  833. checked: !boolCheck(UM.Preferences.getValue("info/anonymous_engine_crash_report")) && Cura.API.account.isLoggedIn
  834. onClicked: UM.Preferences.setValue("info/anonymous_engine_crash_report", false)
  835. }
  836. }
  837. UM.TooltipArea
  838. {
  839. width: childrenRect.width
  840. height: visible ? childrenRect.height : 0
  841. 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.")
  842. UM.CheckBox
  843. {
  844. id: sendDataCheckbox
  845. text: catalog.i18nc("@option:check","Send (anonymous) print information")
  846. checked: boolCheck(UM.Preferences.getValue("info/send_slice_info"))
  847. onCheckedChanged: UM.Preferences.setValue("info/send_slice_info", checked)
  848. }
  849. UM.SimpleButton
  850. {
  851. onClicked: CuraApplication.showMoreInformationDialogForAnonymousDataCollection()
  852. iconSource: UM.Theme.getIcon("Information")
  853. anchors.left: sendDataCheckbox.right
  854. anchors.verticalCenter: sendDataCheckbox.verticalCenter
  855. hoverBackgroundColor: UM.Theme.getColor("secondary_button_hover")
  856. backgroundRadius: width / 2
  857. height: UM.Theme.getSize("small_button_icon").height
  858. color: UM.Theme.getColor("small_button_text")
  859. width: height
  860. }
  861. }
  862. Item
  863. {
  864. //: Spacer
  865. height: UM.Theme.getSize("default_margin").height
  866. width: UM.Theme.getSize("default_margin").height
  867. }
  868. UM.Label
  869. {
  870. font: UM.Theme.getFont("medium_bold")
  871. text: catalog.i18nc("@label", "Updates")
  872. }
  873. UM.TooltipArea
  874. {
  875. width: childrenRect.width
  876. height: visible ? childrenRect.height : 0
  877. text: catalog.i18nc("@info:tooltip", "Should Cura check for updates when the program is started?")
  878. UM.CheckBox
  879. {
  880. id: checkUpdatesCheckbox
  881. text: catalog.i18nc("@option:check","Check for updates on start")
  882. checked: boolCheck(UM.Preferences.getValue("info/automatic_update_check"))
  883. onCheckedChanged: UM.Preferences.setValue("info/automatic_update_check", checked)
  884. }
  885. }
  886. ButtonGroup
  887. {
  888. id: curaUpdatesGroup
  889. buttons: [checkUpdatesOptionBeta, checkUpdatesOptionStable]
  890. }
  891. UM.TooltipArea
  892. {
  893. width: childrenRect.width
  894. height: visible ? childrenRect.height : 0
  895. text: catalog.i18nc("@info:tooltip", "When checking for updates, only check for stable releases.")
  896. anchors.left: parent.left
  897. anchors.leftMargin: UM.Theme.getSize("default_margin").width
  898. Cura.RadioButton
  899. {
  900. id: checkUpdatesOptionStable
  901. text: catalog.i18nc("@option:radio", "Stable releases only")
  902. enabled: checkUpdatesCheckbox.checked
  903. checked: UM.Preferences.getValue("info/latest_update_source") == "stable"
  904. onClicked: UM.Preferences.setValue("info/latest_update_source", "stable")
  905. }
  906. }
  907. UM.TooltipArea
  908. {
  909. width: childrenRect.width
  910. height: visible ? childrenRect.height : 0
  911. text: catalog.i18nc("@info:tooltip", "When checking for updates, check for both stable and for beta releases.")
  912. anchors.left: parent.left
  913. anchors.leftMargin: UM.Theme.getSize("default_margin").width
  914. Cura.RadioButton
  915. {
  916. id: checkUpdatesOptionBeta
  917. text: catalog.i18nc("@option:radio", "Stable and Beta releases")
  918. enabled: checkUpdatesCheckbox.checked
  919. checked: UM.Preferences.getValue("info/latest_update_source") == "beta"
  920. onClicked: UM.Preferences.setValue("info/latest_update_source", "beta")
  921. }
  922. }
  923. UM.TooltipArea
  924. {
  925. width: childrenRect.width
  926. height: visible ? childrenRect.height : 0
  927. 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!")
  928. UM.CheckBox
  929. {
  930. id: pluginNotificationsUpdateCheckbox
  931. text: catalog.i18nc("@option:check", "Get notifications for plugin updates")
  932. checked: boolCheck(UM.Preferences.getValue("info/automatic_plugin_update_check"))
  933. onCheckedChanged: UM.Preferences.setValue("info/automatic_plugin_update_check", checked)
  934. }
  935. }
  936. /* Multi-buildplate functionality is disabled because it's broken. See CURA-4975 for the ticket to remove it.
  937. Item
  938. {
  939. //: Spacer
  940. height: UM.Theme.getSize("default_margin").height
  941. width: UM.Theme.getSize("default_margin").height
  942. }
  943. Label
  944. {
  945. font.bold: true
  946. text: catalog.i18nc("@label","Experimental")
  947. }
  948. UM.TooltipArea
  949. {
  950. width: childrenRect.width
  951. height: childrenRect.height
  952. text: catalog.i18nc("@info:tooltip","Use multi build plate functionality")
  953. CheckBox
  954. {
  955. id: useMultiBuildPlateCheckbox
  956. text: catalog.i18nc("@option:check","Use multi build plate functionality (restart required)")
  957. checked: boolCheck(UM.Preferences.getValue("cura/use_multi_build_plate"))
  958. onCheckedChanged: UM.Preferences.setValue("cura/use_multi_build_plate", checked)
  959. }
  960. }*/
  961. Connections
  962. {
  963. target: UM.Preferences
  964. function onPreferenceChanged(preference)
  965. {
  966. if (preference !== "info/send_slice_info")
  967. {
  968. return;
  969. }
  970. sendDataCheckbox.checked = boolCheck(UM.Preferences.getValue("info/send_slice_info"))
  971. }
  972. }
  973. }
  974. }
  975. }