use job types when checking for jobs in areas of the code that made assumptions about job types (that could be wrong)

This commit is contained in:
Campbell Barton
2012-08-15 10:23:06 +00:00
parent d4a3828630
commit 502dfcce5f
6 changed files with 9 additions and 9 deletions

View File

@@ -2615,7 +2615,7 @@ void uiTemplateRunningJobs(uiLayout *layout, bContext *C)
Scene *scene;
/* another scene can be rendering too, for example via compositor */
for (scene = CTX_data_main(C)->scene.first; scene; scene = scene->id.next)
if (WM_jobs_test(wm, scene, WM_JOB_TYPE_ANY))
if (WM_jobs_test(wm, scene, WM_JOB_TYPE_RENDER))
break;
owner = scene;
handle_event = B_STOPRENDER;
@@ -2634,7 +2634,7 @@ void uiTemplateRunningJobs(uiLayout *layout, bContext *C)
uiLayoutRow(layout, FALSE);
}
if (WM_jobs_test(wm, screen, WM_JOB_TYPE_ANY))
if (WM_jobs_test(wm, screen, WM_JOB_TYPE_SCREENCAST))
uiDefIconTextBut(block, BUT, B_STOPCAST, ICON_CANCEL, IFACE_("Capture"), 0, 0, 85, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0,
TIP_("Stop screencast"));
if (screen->animtimer)

View File

@@ -1439,7 +1439,7 @@ static void bake_freejob(void *bkv)
static int objects_bake_render_modal(bContext *C, wmOperator *UNUSED(op), wmEvent *event)
{
/* no running blender, remove handler and pass through */
if (0 == WM_jobs_test(CTX_wm_manager(C), CTX_data_scene(C), WM_JOB_TYPE_ANY))
if (0 == WM_jobs_test(CTX_wm_manager(C), CTX_data_scene(C), WM_JOB_TYPE_OBJECT_BAKE_TEXTURE))
return OPERATOR_FINISHED | OPERATOR_PASS_THROUGH;
/* running render */
@@ -1469,7 +1469,7 @@ static int objects_bake_render_invoke(bContext *C, wmOperator *op, wmEvent *UNUS
}
else {
/* only one render job at a time */
if (WM_jobs_test(CTX_wm_manager(C), scene, WM_JOB_TYPE_ANY))
if (WM_jobs_test(CTX_wm_manager(C), scene, WM_JOB_TYPE_OBJECT_BAKE_TEXTURE))
return OPERATOR_CANCELLED;
if (test_bake_internal(C, op->reports) == 0) {

View File

@@ -1131,7 +1131,7 @@ static int fluidsimBake(bContext *UNUSED(C), ReportList *UNUSED(reports), Object
static int fluid_bake_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
/* only one bake job at a time */
if (WM_jobs_test(CTX_wm_manager(C), CTX_data_scene(C), WM_JOB_TYPE_ANY))
if (WM_jobs_test(CTX_wm_manager(C), CTX_data_scene(C), WM_JOB_TYPE_OBJECT_SIM_FLUID))
return OPERATOR_CANCELLED;
if (!fluidsimBake(C, op->reports, CTX_data_active_object(C), TRUE))

View File

@@ -457,7 +457,7 @@ static int screen_render_modal(bContext *C, wmOperator *op, wmEvent *event)
Scene *scene = (Scene *) op->customdata;
/* no running blender, remove handler and pass through */
if (0 == WM_jobs_test(CTX_wm_manager(C), scene, WM_JOB_TYPE_ANY)) {
if (0 == WM_jobs_test(CTX_wm_manager(C), scene, WM_JOB_TYPE_RENDER)) {
return OPERATOR_FINISHED | OPERATOR_PASS_THROUGH;
}
@@ -489,7 +489,7 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event)
const char *name;
/* only one render job at a time */
if (WM_jobs_test(CTX_wm_manager(C), scene, WM_JOB_TYPE_ANY))
if (WM_jobs_test(CTX_wm_manager(C), scene, WM_JOB_TYPE_RENDER))
return OPERATOR_CANCELLED;
if (!RE_is_rendering_allowed(scene, camera_override, op->reports)) {

View File

@@ -309,7 +309,7 @@ static int screen_opengl_render_init(bContext *C, wmOperator *op)
}
/* only one render job at a time */
if (WM_jobs_test(CTX_wm_manager(C), scene, WM_JOB_TYPE_ANY))
if (WM_jobs_test(CTX_wm_manager(C), scene, WM_JOB_TYPE_RENDER))
return 0;
if (!is_view_context && scene->camera == NULL) {

View File

@@ -1385,5 +1385,5 @@ void thumbnails_stop(struct FileList *filelist, const struct bContext *C)
int thumbnails_running(struct FileList *filelist, const struct bContext *C)
{
return WM_jobs_test(CTX_wm_manager(C), filelist, WM_JOB_TYPE_ANY);
return WM_jobs_test(CTX_wm_manager(C), filelist, WM_JOB_TYPE_FILESEL_THUMBNAIL);
}