GeneralPage.qml 42 KB

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