GeneralPage.qml 48 KB

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