diff options
author | Sebastian Parborg <zeddb> | 2019-01-04 16:23:49 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-01-04 16:45:16 +0300 |
commit | e571f0255f2b045efb0525ebe104322bc331d584 (patch) | |
tree | 931d8532d9c8785cdaa52e7a50a89516104965b7 /source/blender/editors | |
parent | f2ebb7bb793308a9d222f67ef93fe2a2c014d414 (diff) |
Fix T59946: multiple quit dialogs possible.
Differential Revision: https://developer.blender.org/D4147
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/include/UI_interface.h | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_region_menu_popup.c | 16 |
2 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index c525d9cffe6..2e31a1a9ae5 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -493,6 +493,8 @@ void UI_popup_block_ex(struct bContext *C, uiBlockCreateFunc func, uiBlockHandle void UI_popup_block_close(struct bContext *C, struct wmWindow *win, uiBlock *block); +bool UI_popup_block_name_exists(struct bContext *C, const char *name); + /* Blocks * * Functions for creating, drawing and freeing blocks. A Block is a diff --git a/source/blender/editors/interface/interface_region_menu_popup.c b/source/blender/editors/interface/interface_region_menu_popup.c index bdac03de86b..e136614d30e 100644 --- a/source/blender/editors/interface/interface_region_menu_popup.c +++ b/source/blender/editors/interface/interface_region_menu_popup.c @@ -648,4 +648,20 @@ void UI_popup_block_close(bContext *C, wmWindow *win, uiBlock *block) } } +bool UI_popup_block_name_exists(bContext *C, const char *name) +{ + bScreen *sc = CTX_wm_screen(C); + uiBlock *block; + ARegion *ar; + + for (ar = sc->regionbase.first; ar; ar = ar->next) { + for (block = ar->uiblocks.first; block; block = block->next) { + if (STREQ(block->name, name)) { + return true; + } + } + } + return false; +} + /** \} */ |