diff options
author | Lukas Matena <lukasmatena@seznam.cz> | 2020-12-16 19:10:48 +0300 |
---|---|---|
committer | Lukas Matena <lukasmatena@seznam.cz> | 2020-12-16 19:33:55 +0300 |
commit | 20aa8d65bf2eef6e0023cd6763ef5ed281e6700b (patch) | |
tree | 5f1a370c01dd4ba570c8bffac0e58eacc7754837 /src | |
parent | 8b980d4b77bdc9429175ef3a2036981c1adea744 (diff) |
Fix through Netfabb notification - remove 'undo' hypertext for now and
refuse to fix when a gizmo is opened (because of missing updates)
This is a follow-up of 1249fdb
Diffstat (limited to 'src')
-rw-r--r-- | src/slic3r/GUI/Plater.cpp | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 35c03db26..fb7a81a4f 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -3365,7 +3365,18 @@ void Plater::priv::fix_through_netfabb(const int obj_idx, const int vol_idx/* = if (obj_idx < 0) return; - size_t snapshot_time = undo_redo_stack().active_snapshot_time(); + // Do not fix anything when a gizmo is open. There might be issues with updates + // and what is worse, the snapshot time would refer to the internal stack. + if (q->canvas3D()->get_gizmos_manager().get_current_type() != GLGizmosManager::Undefined) { + notification_manager->push_notification( + NotificationType::CustomSupportsAndSeamRemovedAfterRepair, + NotificationManager::NotificationLevel::RegularNotification, + _u8L("ERROR: Please close all manipulators available from " + "the left toolbar before fixing the mesh.")); + return; + } + + // size_t snapshot_time = undo_redo_stack().active_snapshot_time(); Plater::TakeSnapshot snapshot(q, _L("Fix through NetFabb")); ModelObject* mo = model.objects[obj_idx]; @@ -3383,16 +3394,21 @@ void Plater::priv::fix_through_netfabb(const int obj_idx, const int vol_idx/* = notification_manager->push_notification( NotificationType::CustomSupportsAndSeamRemovedAfterRepair, NotificationManager::NotificationLevel::RegularNotification, - _u8L("Custom supports and seams were removed after repairing the mesh."), - _u8L("Undo the repair"), - [this, snapshot_time](wxEvtHandler*){ - if (undo_redo_stack().has_undo_snapshot(snapshot_time)) - undo_redo_to(snapshot_time); - else - notification_manager->push_notification( - _u8L("Cannot undo to before the mesh repair!")); - return true; - }); + _u8L("Custom supports and seams were removed after repairing the mesh.")); +// _u8L("Undo the repair"), +// [this, snapshot_time](wxEvtHandler*){ +// // Make sure the snapshot is still available and that +// // we are in the main stack and not in a gizmo-stack. +// if (undo_redo_stack().has_undo_snapshot(snapshot_time) +// && q->canvas3D()->get_gizmos_manager().get_current() == nullptr) +// undo_redo_to(snapshot_time); +// else +// notification_manager->push_notification( +// NotificationType::CustomSupportsAndSeamRemovedAfterRepair, +// NotificationManager::NotificationLevel::RegularNotification, +// _u8L("Cannot undo to before the mesh repair!")); +// return true; +// }); } fix_model_by_win10_sdk_gui(*mo, vol_idx); |