Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2010-11-29 16:14:51 +0300
committerTon Roosendaal <ton@blender.org>2010-11-29 16:14:51 +0300
commitceebc3598fd06d980fe5536c36f7d7bb8f5c78a8 (patch)
tree3ebc37f27bba3a3b7f4583bf00ae3cf53546c293 /source
parent1dd1cea06e0bb1c9cd1e08fd9f359893dc2681a3 (diff)
From the todo:
Save or load .blend file shows cursor 'wait' again. Is clear to indicate a totally blocking operation.
Diffstat (limited to 'source')
-rw-r--r--source/blender/windowmanager/intern/wm_cursors.c2
-rw-r--r--source/blender/windowmanager/intern/wm_files.c13
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;
}