mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-06 13:34:01 -06:00
Add dialog for opening a project file
CURA-3495
This commit is contained in:
parent
70dbeaf256
commit
f3167bb84b
4 changed files with 216 additions and 2 deletions
|
@ -37,6 +37,18 @@ UM.PreferencesPage
|
|||
}
|
||||
}
|
||||
|
||||
function setDefaultOpenProjectOption(code)
|
||||
{
|
||||
for (var i = 0; i < choiceOnOpenProjectDropDownButton.model.count; ++i)
|
||||
{
|
||||
if (choiceOnOpenProjectDropDownButton.model.get(i).code == code)
|
||||
{
|
||||
choiceOnOpenProjectDropDownButton.currentIndex = i
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function reset()
|
||||
{
|
||||
UM.Preferences.resetPreference("general/language")
|
||||
|
@ -65,6 +77,9 @@ UM.PreferencesPage
|
|||
UM.Preferences.resetPreference("cura/choice_on_profile_override")
|
||||
setDefaultDiscardOrKeepProfile(UM.Preferences.getValue("cura/choice_on_profile_override"))
|
||||
|
||||
UM.Preferences.resetPreference("cura/choice_on_open_project")
|
||||
setDefaultOpenProjectOption(UM.Preferences.getValue("cura/choice_on_open_project"))
|
||||
|
||||
if (plugins.find("id", "SliceInfoPlugin") > -1) {
|
||||
UM.Preferences.resetPreference("info/send_slice_info")
|
||||
sendDataCheckbox.checked = boolCheck(UM.Preferences.getValue("info/send_slice_info"))
|
||||
|
@ -389,6 +404,56 @@ UM.PreferencesPage
|
|||
}
|
||||
}
|
||||
|
||||
UM.TooltipArea {
|
||||
width: childrenRect.width
|
||||
height: childrenRect.height
|
||||
text: catalog.i18nc("@info:tooltip", "Default behavior when opening a project file")
|
||||
|
||||
Column
|
||||
{
|
||||
spacing: 4
|
||||
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@window:text", "Default behavior when opening a project file: ")
|
||||
}
|
||||
|
||||
ComboBox
|
||||
{
|
||||
id: choiceOnOpenProjectDropDownButton
|
||||
width: 200
|
||||
|
||||
model: ListModel
|
||||
{
|
||||
id: openProjectOptionModel
|
||||
|
||||
Component.onCompleted: {
|
||||
append({ text: catalog.i18nc("@option:openProject", "Always ask"), code: "always_ask" })
|
||||
append({ text: catalog.i18nc("@option:openProject", "Always open as a project"), code: "open_as_project" })
|
||||
append({ text: catalog.i18nc("@option:openProject", "Always import models"), code: "open_as_model" })
|
||||
}
|
||||
}
|
||||
|
||||
currentIndex:
|
||||
{
|
||||
var index = 0;
|
||||
var currentChoice = UM.Preferences.getValue("cura/choice_on_open_project");
|
||||
for (var i = 0; i < model.count; ++i)
|
||||
{
|
||||
if (model.get(i).code == currentChoice)
|
||||
{
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return index;
|
||||
}
|
||||
|
||||
onActivated: UM.Preferences.setValue("cura/choice_on_open_project", model.get(index).code)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Item
|
||||
{
|
||||
//: Spacer
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue