Implemented set printable state for ObjectList
This commit is contained in:
parent
885da35544
commit
f712e5fcf4
5 changed files with 74 additions and 1 deletions
src/slic3r/GUI
|
@ -2273,6 +2273,8 @@ void ObjectList::add_object_to_list(size_t obj_idx, bool call_selection_changed)
|
|||
|
||||
select_item(m_objects_model->AddInstanceChild(m_objects_model->GetItemById(obj_idx), print_idicator));
|
||||
}
|
||||
else
|
||||
m_objects_model->SetPrintableState(obj_idx, model_object->instances[0]->is_printable() ? piPrintable : piUnprintable);
|
||||
|
||||
// add settings to the object, if it has those
|
||||
add_settings_item(item, &model_object->config);
|
||||
|
@ -3632,6 +3634,25 @@ void ObjectList::update_after_undo_redo()
|
|||
m_prevent_canvas_selection_update = false;
|
||||
}
|
||||
|
||||
void ObjectList::update_printable_state(int obj_idx, int instance_idx)
|
||||
{
|
||||
ModelObject* object = (*m_objects)[obj_idx];
|
||||
PrintIndicator printable = piUndef;
|
||||
|
||||
if (object->instances.size() == 1)
|
||||
{
|
||||
printable = object->instances[0]->printable ? piPrintable : piUnprintable;
|
||||
instance_idx = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_objects_model->SetPrintableState(obj_idx, piUndef);
|
||||
printable = object->instances[instance_idx]->printable ? piPrintable : piUnprintable;
|
||||
}
|
||||
|
||||
select_item(m_objects_model->SetPrintableState(obj_idx, printable, instance_idx));
|
||||
}
|
||||
|
||||
ModelObject* ObjectList::object(const int obj_idx) const
|
||||
{
|
||||
if (obj_idx < 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue