Blender Git Loki

Git Commits -> Revision 687385b

Revision 687385b by Jacques Lucke (master)
May 14, 2019, 12:21 (GMT)
UI: Confirm dialog when closing an unsaved file

The complexity in this patch comes from the fact
that the current operator system does not support
multi-step user interactions well.

More specifically, for this to work, we need to show
a confirm dialog and a file browser afterwards.
We decided that it is easier to keep everything in
a single operator, instead of creating separate
operators that invoke each other.

So, now the `WM_OT_open_mainfile` operator invokes
itself in different states. It implements a simple
finite state machine to manage the states.

The dialog itself is expected to be improved in
a future commit. See D4829 for more details.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D4829

Commit Details:

Full Hash: 687385b963f4389b3d714fed264bb0ff24bc43f5
Parent Commit: 37f87ae
Lines Changed: +139, -21

6 Modified Paths:

/release/scripts/startup/bl_operators/wm.py (+4, -2) (Diff)
/source/blender/editors/interface/interface_templates.c (+11, -6) (Diff)
/source/blender/editors/space_topbar/space_topbar.c (+5, -2) (Diff)
/source/blender/windowmanager/intern/wm_files.c (+108, -5) (Diff)
/source/blender/windowmanager/intern/wm_operators.c (+9, -5) (Diff)
/source/blender/windowmanager/WM_api.h (+2, -1) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021