diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/windowmanager/intern/wm_cursors.c | 2 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_files.c | 13 |
2 files changed, 13 insertions, 2 deletions
diff --git a/source/blender/windowmanager/intern/wm_cursors.c b/source/blender/windowmanager/intern/wm_cursors.c index ab49c8a34bf..966bc8b3285 100644 --- a/source/blender/windowmanager/intern/wm_cursors.c +++ b/source/blender/windowmanager/intern/wm_cursors.c @@ -156,7 +156,7 @@ void WM_cursor_restore(wmWindow *win) void WM_cursor_wait(int val) { wmWindowManager *wm= G.main->wm.first; - wmWindow *win= wm->windows.first; + wmWindow *win= wm?wm->windows.first:NULL; for(; win; win= win->next) { if(val) { diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index d2c1a2dc0dc..c4cd0fe99d6 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -269,6 +269,8 @@ void WM_read_file(bContext *C, const char *name, ReportList *reports) /* so we can get the error message */ errno = 0; + WM_cursor_wait(1); + /* first try to append data from exotic file formats... */ /* it throws error box when file doesnt exist and returns -1 */ /* note; it should set some error message somewhere... (ton) */ @@ -330,6 +332,9 @@ void WM_read_file(bContext *C, const char *name, ReportList *reports) if(reports) BKE_reportf(reports, RPT_ERROR, "Can't read file: \"%s\", %s.", name, errno ? strerror(errno) : "Incompatible file format"); } + + WM_cursor_wait(0); + } @@ -627,6 +632,9 @@ int WM_write_file(bContext *C, const char *target, int fileflags, ReportList *re /* operator now handles overwrite checks */ + /* don't forget not to return without! */ + WM_cursor_wait(1); + if (G.fileflags & G_AUTOPACK) { packAll(G.main, reports); } @@ -667,10 +675,13 @@ int WM_write_file(bContext *C, const char *target, int fileflags, ReportList *re else { if(ibuf_thumb) IMB_freeImBuf(ibuf_thumb); if(thumb) MEM_freeN(thumb); + + WM_cursor_wait(0); return -1; } -// XXX waitcursor(0); + WM_cursor_wait(0); + return 0; } |