From aace6ef551183a3d09635c3103a8e4cba4f9117a Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 19 Aug 2009 12:35:40 +0000 Subject: 2.5: Restored statistics in the info header. Implementation: * NC_SCENE or NC_OBJECT cause scene->stats to be cleared. * NC_INFO is sent to tag info headers for redraw. * In UI scene.statistics() creates scene->stats if it is NULLd, and then returns the string. --- source/blender/windowmanager/WM_types.h | 1 + source/blender/windowmanager/intern/wm_event_system.c | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'source/blender/windowmanager') diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index 00e9f6a2fa2..b717df8f61f 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -134,6 +134,7 @@ typedef struct wmNotifier { #define NC_ANIMATION (15<<24) #define NC_CONSOLE (16<<24) #define NC_NODE (17<<24) +#define NC_INFO (18<<24) /* data type, 256 entries is enough, it can overlap */ #define NOTE_DATA 0x00FF0000 diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index f0d9f8c0989..6c34ed6f902 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -52,6 +52,7 @@ #include "BKE_pointcache.h" #include "ED_fileselect.h" +#include "ED_info.h" #include "ED_screen.h" #include "ED_space_api.h" #include "ED_util.h" @@ -129,7 +130,7 @@ static wmNotifier *wm_notifier_next(wmWindowManager *wm) void wm_event_do_notifiers(bContext *C) { wmWindowManager *wm= CTX_wm_manager(C); - wmNotifier *note; + wmNotifier *note, *next; wmWindow *win; if(wm==NULL) @@ -141,7 +142,9 @@ void wm_event_do_notifiers(bContext *C) CTX_wm_window_set(C, win); - for(note= wm->queue.first; note; note= note->next) { + for(note= wm->queue.first; note; note= next) { + next= note->next; + if(note->category==NC_WM) { if( ELEM(note->data, ND_FILEREAD, ND_FILESAVE)) { wm->file_saved= 1; @@ -174,6 +177,10 @@ void wm_event_do_notifiers(bContext *C) do_anim= 1; } } + if(note->category == NC_SCENE || note->category == NC_OBJECT) { + ED_info_stats_clear(CTX_data_scene(C)); + WM_event_add_notifier(C, NC_INFO, NULL); + } } if(do_anim) { /* depsgraph gets called, might send more notifiers */ -- cgit v1.2.3