mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-20 05:07:50 -06:00
introducing drop to buildplate per model
CURA-10542
This commit is contained in:
parent
578057f16a
commit
e8bdca3dd9
3 changed files with 79 additions and 4 deletions
|
@ -63,6 +63,18 @@ UM.PreferencesPage
|
|||
}
|
||||
}
|
||||
|
||||
function setDefaultDropDown(code)
|
||||
{
|
||||
for (var i = 0; i < choiceOnDropDown.model.count; ++i)
|
||||
{
|
||||
if (choiceOnDropDown.model.get(i).code == code)
|
||||
{
|
||||
choiceOnDropDown.currentIndex = i
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function reset()
|
||||
{
|
||||
UM.Preferences.resetPreference("general/language")
|
||||
|
@ -513,6 +525,60 @@ UM.PreferencesPage
|
|||
}
|
||||
}
|
||||
|
||||
UM.TooltipArea
|
||||
{
|
||||
width: childrenRect.width
|
||||
height: childrenRect.height
|
||||
text: catalog.i18nc("@info:tooltip", "This setting will set a default (or not) for the Per Model Drop to buildplate feature (Either Always, Never, decide every time")
|
||||
|
||||
Column
|
||||
{
|
||||
spacing: UM.Theme.getSize("narrow_margin").height
|
||||
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18nc("@window:text", " Default per model setting for drop to build plate when importing a model: ")
|
||||
}
|
||||
|
||||
Cura.ComboBox
|
||||
{
|
||||
id: choiceOnDropDown
|
||||
width: UM.Theme.getSize("combobox").width
|
||||
height: UM.Theme.getSize("combobox").height
|
||||
|
||||
model: ListModel
|
||||
{
|
||||
id: dropDownOptions
|
||||
|
||||
Component.onCompleted:
|
||||
{
|
||||
append({ text: catalog.i18nc("@option:openProject", "Always"), code: "always" })
|
||||
append({ text: catalog.i18nc("@option:openProject", "Never"), code: "never" })
|
||||
append({ text: catalog.i18nc("@option:openProject", "Always ask me this"), code: "always_ask" })
|
||||
}
|
||||
}
|
||||
textRole: "text"
|
||||
|
||||
currentIndex:
|
||||
{
|
||||
var index = 0;
|
||||
var currentChoice = UM.Preferences.getValue("physics/automatic_drop_down_per_model");
|
||||
for (var i = 0; i < model.count; ++i)
|
||||
{
|
||||
if (model.get(i).code == currentChoice)
|
||||
{
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return index;
|
||||
}
|
||||
|
||||
onActivated: UM.Preferences.setValue("physics/automatic_drop_down_per_model", model.get(index).code)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
UM.TooltipArea
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue