GeneralPage.qml 45 KB

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