From the todo:
Save or load .blend file shows cursor 'wait' again. Is clear to indicate a totally blocking operation.
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user