diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-03-21 18:00:18 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-03-21 18:04:01 +0300 |
commit | 5ba5254ec1ebba6c1e89b663592d716b92e13165 (patch) | |
tree | b8f74acaf2ec5ba374235bbf811f412ad8b1f7e3 /source/blender/windowmanager/intern/wm_files.c | |
parent | 23ffd4ec394011cec26879cba946501b245020fd (diff) |
UI: Optional prompt to quit for non win32 systems
D566 by @januz
Use Blender native dialog when OS dialog's aren't supported.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_files.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_files.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 16cc1d44923..551b17302fe 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -2075,6 +2075,10 @@ static int wm_save_as_mainfile_exec(bContext *C, wmOperator *op) WM_event_add_notifier(C, NC_WM | ND_FILESAVE, NULL); + if (RNA_boolean_get(op->ptr, "exit")) { + WM_exit(C); + } + return OPERATOR_FINISHED; } @@ -2174,12 +2178,16 @@ void WM_OT_save_mainfile(wmOperatorType *ot) ot->check = blend_save_check; /* omit window poll so this can work in background mode */ + PropertyRNA *prop; WM_operator_properties_filesel( ot, FILE_TYPE_FOLDER | FILE_TYPE_BLENDER, FILE_BLENDER, FILE_SAVE, WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY, FILE_SORT_ALPHA); RNA_def_boolean(ot->srna, "compress", false, "Compress", "Write compressed .blend file"); RNA_def_boolean(ot->srna, "relative_remap", false, "Remap Relative", "Remap relative paths when saving in a different directory"); + + prop = RNA_def_boolean(ot->srna, "exit", false, "Exit", "Exit Blender after saving"); + RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); } /** \} */ |