mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-28 13:21:10 -07:00
Merge branch '2.5' of github.com:Ultimaker/Cura
This commit is contained in:
commit
70dbeaf256
3 changed files with 65 additions and 36 deletions
|
|
@ -25,6 +25,18 @@ UM.PreferencesPage
|
|||
}
|
||||
}
|
||||
|
||||
function setDefaultDiscardOrKeepProfile(code)
|
||||
{
|
||||
for (var i = 0; i < choiceOnProfileOverrideDropDownButton.model.count; i++)
|
||||
{
|
||||
if (choiceOnProfileOverrideDropDownButton.model.get(i).code == code)
|
||||
{
|
||||
choiceOnProfileOverrideDropDownButton.currentIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function reset()
|
||||
{
|
||||
UM.Preferences.resetPreference("general/language")
|
||||
|
|
@ -49,8 +61,9 @@ UM.PreferencesPage
|
|||
invertZoomCheckbox.checked = boolCheck(UM.Preferences.getValue("view/invert_zoom"))
|
||||
UM.Preferences.resetPreference("view/top_layer_count");
|
||||
topLayerCountCheckbox.checked = boolCheck(UM.Preferences.getValue("view/top_layer_count"))
|
||||
|
||||
UM.Preferences.resetPreference("cura/choice_on_profile_override")
|
||||
choiceOnProfileOverrideDropDownButton.currentIndex = UM.Preferences.getValue("cura/choice_on_profile_override")
|
||||
setDefaultDiscardOrKeepProfile(UM.Preferences.getValue("cura/choice_on_profile_override"))
|
||||
|
||||
if (plugins.find("id", "SliceInfoPlugin") > -1) {
|
||||
UM.Preferences.resetPreference("info/send_slice_info")
|
||||
|
|
@ -399,15 +412,34 @@ UM.PreferencesPage
|
|||
ComboBox
|
||||
{
|
||||
id: choiceOnProfileOverrideDropDownButton
|
||||
|
||||
model: [
|
||||
catalog.i18nc("@option:discardOrKeep", "Always ask me this"),
|
||||
catalog.i18nc("@option:discardOrKeep", "Discard and never ask again"),
|
||||
catalog.i18nc("@option:discardOrKeep", "Keep and never ask again")
|
||||
]
|
||||
width: 300
|
||||
currentIndex: UM.Preferences.getValue("cura/choice_on_profile_override")
|
||||
onCurrentIndexChanged: UM.Preferences.setValue("cura/choice_on_profile_override", currentIndex)
|
||||
|
||||
model: ListModel
|
||||
{
|
||||
id: discardOrKeepProfileListModel
|
||||
|
||||
Component.onCompleted: {
|
||||
append({ text: catalog.i18nc("@option:discardOrKeep", "Always ask me this"), code: "always_ask" })
|
||||
append({ text: catalog.i18nc("@option:discardOrKeep", "Discard and never ask again"), code: "always_discard" })
|
||||
append({ text: catalog.i18nc("@option:discardOrKeep", "Keep and never ask again"), code: "always_keep" })
|
||||
}
|
||||
}
|
||||
|
||||
currentIndex:
|
||||
{
|
||||
var index = 0;
|
||||
var code = UM.Preferences.getValue("cura/choice_on_profile_override");
|
||||
for (var i = 0; i < model.count; ++i)
|
||||
{
|
||||
if (model.get(i).code == code)
|
||||
{
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return index;
|
||||
}
|
||||
onActivated: UM.Preferences.setValue("cura/choice_on_profile_override", model.get(index).code)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue