From 21d112c36f661f3ce8648f4eadfe1325929e9184 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Thu, 3 Jun 2010 07:27:55 +0000 Subject: Reworked the non-blocking reports display in the info header: * Now it displays the last report from the global list, not just from operators * Rather than disappearing when a new operator is run, it stays until it times out or a new report is added * Fun animated transitions ;) http://mke3.net/blender/devel/2.5/reports_header.mov Now need to investigate report usage with popups. Ideally we can have most reports non-blocking, so they're less intrusive, only popping up for dire errors. Problem is many things in Blender right now are marked as RPT_ERROR when probably RPT_WARNING is more appropriate. Should probably keep RPT_ERROR for things that demand immediate attention. --- source/blender/windowmanager/intern/wm.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'source/blender/windowmanager/intern/wm.c') diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c index 452c37dbe77..fcf8951d796 100644 --- a/source/blender/windowmanager/intern/wm.c +++ b/source/blender/windowmanager/intern/wm.c @@ -98,13 +98,18 @@ void WM_operator_free(wmOperator *op) MEM_freeN(op); } +static void wm_reports_free(wmWindowManager *wm) +{ + BKE_reports_clear(&wm->reports); + WM_event_remove_timer(wm, NULL, wm->reports.reporttimer); +} + /* all operations get registered in the windowmanager here */ /* called on event handling by event_system.c */ void wm_operator_register(bContext *C, wmOperator *op) { wmWindowManager *wm= CTX_wm_manager(C); int tot; - char *buf; BLI_addtail(&wm->operators, op); tot= BLI_countlist(&wm->operators); @@ -116,12 +121,6 @@ void wm_operator_register(bContext *C, wmOperator *op) tot--; } - - /* Report the string representation of the operator */ - buf = WM_operator_pystring(C, op->type, op->ptr, 1); - BKE_report(CTX_wm_reports(C), RPT_OPERATOR, buf); - MEM_freeN(buf); - /* so the console is redrawn */ WM_event_add_notifier(C, NC_SPACE|ND_SPACE_CONSOLE_REPORT, NULL); WM_event_add_notifier(C, NC_WM|ND_HISTORY, NULL); @@ -309,7 +308,8 @@ void wm_close_and_free(bContext *C, wmWindowManager *wm) BLI_freelistN(&wm->paintcursors); BLI_freelistN(&wm->drags); - BKE_reports_clear(&wm->reports); + + wm_reports_free(wm); if(C && CTX_wm_manager(C)==wm) CTX_wm_manager_set(C, NULL); } -- cgit v1.2.3