More UI messages and BKE_reportf<->BKE_report fixes...

This commit is contained in:
2012-10-16 07:53:10 +00:00
parent af6abc8c80
commit 64add7c9c7
12 changed files with 37 additions and 35 deletions

View File

@@ -143,7 +143,7 @@ static int wm_collada_export_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED; return OPERATOR_FINISHED;
} }
else { else {
BKE_report(op->reports, RPT_WARNING, "Export file not created."); BKE_report(op->reports, RPT_WARNING, "Export file not created");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
} }
@@ -307,7 +307,7 @@ static int wm_collada_import_exec(bContext *C, wmOperator *op)
RNA_string_get(op->ptr, "filepath", filename); RNA_string_get(op->ptr, "filepath", filename);
if (collada_import(C, filename)) return OPERATOR_FINISHED; if (collada_import(C, filename)) return OPERATOR_FINISHED;
BKE_report(op->reports, RPT_ERROR, "Errors found during parsing COLLADA document. Please see console for error log."); BKE_report(op->reports, RPT_ERROR, "Errors found during parsing COLLADA document (see console for details)");
return OPERATOR_FINISHED; return OPERATOR_FINISHED;
} }

View File

@@ -1242,7 +1242,7 @@ static int multires_reshape_exec(bContext *C, wmOperator *op)
CTX_DATA_END; CTX_DATA_END;
if (!secondob) { if (!secondob) {
BKE_report(op->reports, RPT_ERROR, "Second selected mesh object require to copy shape from"); BKE_report(op->reports, RPT_ERROR, "Second selected mesh object required to copy shape from");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }

View File

@@ -346,7 +346,6 @@ static int dynamicPaint_initBake(struct bContext *C, struct wmOperator *op)
Object *ob = ED_object_context(C); Object *ob = ED_object_context(C);
int status = 0; int status = 0;
double timer = PIL_check_seconds_timer(); double timer = PIL_check_seconds_timer();
char result_str[80];
DynamicPaintSurface *surface; DynamicPaintSurface *surface;
/* /*
@@ -354,14 +353,14 @@ static int dynamicPaint_initBake(struct bContext *C, struct wmOperator *op)
*/ */
pmd = (DynamicPaintModifierData *)modifiers_findByType(ob, eModifierType_DynamicPaint); pmd = (DynamicPaintModifierData *)modifiers_findByType(ob, eModifierType_DynamicPaint);
if (!pmd) { if (!pmd) {
BKE_report(op->reports, RPT_ERROR, "Bake Failed: No Dynamic Paint modifier found."); BKE_report(op->reports, RPT_ERROR, "Bake failed: no Dynamic Paint modifier found");
return 0; return 0;
} }
/* Make sure we're dealing with a canvas */ /* Make sure we're dealing with a canvas */
canvas = pmd->canvas; canvas = pmd->canvas;
if (!canvas) { if (!canvas) {
BKE_report(op->reports, RPT_ERROR, "Bake Failed: Invalid Canvas."); BKE_report(op->reports, RPT_ERROR, "Bake failed: invalid canvas");
return 0; return 0;
} }
surface = get_activeSurface(canvas); surface = get_activeSurface(canvas);
@@ -387,17 +386,14 @@ static int dynamicPaint_initBake(struct bContext *C, struct wmOperator *op)
BLI_timestr(time, time_str); BLI_timestr(time, time_str);
/* Show bake info */ /* Show bake info */
BLI_snprintf(result_str, sizeof(result_str), "Bake Complete! (%s)", time_str); BKE_reportf(op->reports, RPT_INFO, "Bake complete! (%s)", time_str);
BKE_report(op->reports, RPT_INFO, result_str);
} }
else { else {
if (strlen(canvas->error)) { /* If an error occured */ if (strlen(canvas->error)) { /* If an error occured */
BLI_snprintf(result_str, sizeof(result_str), "Bake Failed: %s", canvas->error); BKE_reportf(op->reports, RPT_ERROR, "Bake failed: %s", canvas->error);
BKE_report(op->reports, RPT_ERROR, result_str);
} }
else { /* User canceled the bake */ else { /* User canceled the bake */
BLI_strncpy(result_str, "Baking Cancelled!", sizeof(result_str)); BKE_report(op->reports, RPT_WARNING, "Baking cancelled!");
BKE_report(op->reports, RPT_WARNING, result_str);
} }
} }

View File

@@ -2414,7 +2414,7 @@ static int remove_doubles_exec(bContext *C, wmOperator *op)
if (totremoved == 0) if (totremoved == 0)
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
BKE_reportf(op->reports, RPT_INFO, "Remove %d double particles", totremoved); BKE_reportf(op->reports, RPT_INFO, "Removed %d double particles", totremoved);
DAG_id_tag_update(&ob->id, OB_RECALC_DATA); DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_EDITED, ob); WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_EDITED, ob);

View File

@@ -41,6 +41,8 @@
#include "BLI_math.h" #include "BLI_math.h"
#include "BLI_rect.h" #include "BLI_rect.h"
#include "BLF_translation.h"
#include "BKE_context.h" #include "BKE_context.h"
#include "BKE_global.h" #include "BKE_global.h"
#include "BKE_report.h" #include "BKE_report.h"
@@ -180,7 +182,7 @@ static int open_exec(bContext *C, wmOperator *op)
BLI_join_dirfile(str, sizeof(str), dir_only, file_only); BLI_join_dirfile(str, sizeof(str), dir_only, file_only);
} }
else { else {
BKE_reportf(op->reports, RPT_ERROR, "No files selected to be opened"); BKE_report(op->reports, RPT_ERROR, "No files selected to be opened");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
@@ -195,8 +197,8 @@ static int open_exec(bContext *C, wmOperator *op)
if (op->customdata) if (op->customdata)
MEM_freeN(op->customdata); MEM_freeN(op->customdata);
BKE_reportf(op->reports, RPT_ERROR, "Can't read: \"%s\", %s.", str, BKE_reportf(op->reports, RPT_ERROR, "Can't read \"%s\": %s", str,
errno ? strerror(errno) : "Unsupported movie clip format"); errno ? strerror(errno) : TIP_("Unsupported movie clip format"));
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }

View File

@@ -1400,7 +1400,7 @@ static void solve_camera_freejob(void *scv)
if (!solved) if (!solved)
BKE_report(scj->reports, RPT_WARNING, "Some data failed to reconstruct, see console for details"); BKE_report(scj->reports, RPT_WARNING, "Some data failed to reconstruct, see console for details");
else else
BKE_reportf(scj->reports, RPT_INFO, "Average re-projection error %.3f", tracking->reconstruction.error); BKE_reportf(scj->reports, RPT_INFO, "Average re-projection error: %.3f", tracking->reconstruction.error);
/* set currently solved clip as active for scene */ /* set currently solved clip as active for scene */
if (scene->clip) if (scene->clip)

View File

@@ -150,7 +150,7 @@ static int unpack_all_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)
count = countPackedFiles(bmain); count = countPackedFiles(bmain);
if (!count) { if (!count) {
BKE_report(op->reports, RPT_WARNING, "No packed files. Auto-pack disabled"); BKE_report(op->reports, RPT_WARNING, "No packed files (auto-pack disabled)");
G.fileflags &= ~G_AUTOPACK; G.fileflags &= ~G_AUTOPACK;
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }

View File

@@ -405,7 +405,9 @@ static int nlaedit_add_actionclip_exec(bContext *C, wmOperator *op)
else if (act->idroot == 0) { else if (act->idroot == 0) {
/* hopefully in this case (i.e. library of userless actions), the user knows what they're doing... */ /* hopefully in this case (i.e. library of userless actions), the user knows what they're doing... */
BKE_reportf(op->reports, RPT_WARNING, BKE_reportf(op->reports, RPT_WARNING,
"Action '%s' does not specify what datablocks it can be used on. Try setting the 'ID Root Type' setting from the Datablocks Editor for this Action to avoid future problems", "Action '%s' does not specify what datablocks it can be used on "
"(try setting the 'ID Root Type' setting from the Datablocks Editor "
"for this Action to avoid future problems)",
act->id.name + 2); act->id.name + 2);
} }

View File

@@ -811,7 +811,7 @@ static int outliner_id_operation_exec(bContext *C, wmOperator *op)
ED_undo_push(C, "Unlink world"); ED_undo_push(C, "Unlink world");
break; break;
default: default:
BKE_report(op->reports, RPT_WARNING, "Not Yet"); BKE_report(op->reports, RPT_WARNING, "Not yet");
break; break;
} }
} }
@@ -844,7 +844,7 @@ static int outliner_id_operation_exec(bContext *C, wmOperator *op)
break; break;
default: default:
BKE_report(op->reports, RPT_WARNING, "Not Yet"); BKE_report(op->reports, RPT_WARNING, "Not yet");
break; break;
} }
} }
@@ -980,9 +980,9 @@ static int outliner_action_set_exec(bContext *C, wmOperator *op)
else if (act->idroot == 0) { else if (act->idroot == 0) {
/* hopefully in this case (i.e. library of userless actions), the user knows what they're doing... */ /* hopefully in this case (i.e. library of userless actions), the user knows what they're doing... */
BKE_reportf(op->reports, RPT_WARNING, BKE_reportf(op->reports, RPT_WARNING,
"Action '%s' does not specify what datablocks it can be used on. " "Action '%s' does not specify what datablocks it can be used on "
"Try setting the 'ID Root Type' setting from the Datablocks Editor " "(try setting the 'ID Root Type' setting from the Datablocks Editor "
"for this Action to avoid future problems", "for this Action to avoid future problems)",
act->id.name + 2); act->id.name + 2);
} }

View File

@@ -451,7 +451,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
but = uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Mean Tilt:"), but = uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Mean Tilt:"),
0, yi -= buth + but_margin, 200, buth, 0, yi -= buth + but_margin, 200, buth,
&(tfp->ve_median[C_TILT]), -M_PI * 2.0f, M_PI * 2.0f, 1, 3, &(tfp->ve_median[C_TILT]), -M_PI * 2.0f, M_PI * 2.0f, 1, 3,
TIP_("Tilt (inclination) of curve control points")); TIP_("Tilt of curve control points"));
uiButSetUnitType(but, PROP_UNIT_ROTATION); uiButSetUnitType(but, PROP_UNIT_ROTATION);
} }
/* Lattice... */ /* Lattice... */

View File

@@ -2754,7 +2754,7 @@ static int view3d_zoom_border_exec(bContext *C, wmOperator *op)
/* no depths to use, we cant do anything! */ /* no depths to use, we cant do anything! */
if (depth_close == FLT_MAX) { if (depth_close == FLT_MAX) {
BKE_report(op->reports, RPT_ERROR, "Depth Too Large"); BKE_report(op->reports, RPT_ERROR, "Depth too large");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
/* convert border to 3d coordinates */ /* convert border to 3d coordinates */

View File

@@ -97,6 +97,8 @@
#include "ED_screen.h" #include "ED_screen.h"
#include "BLF_translation.h"
static Camera *rna_Main_cameras_new(Main *UNUSED(bmain), const char *name) static Camera *rna_Main_cameras_new(Main *UNUSED(bmain), const char *name)
{ {
ID *id = BKE_camera_add(name); ID *id = BKE_camera_add(name);
@@ -289,8 +291,8 @@ static Image *rna_Main_images_load(Main *UNUSED(bmain), ReportList *reports, con
ima = BKE_image_load(filepath); ima = BKE_image_load(filepath);
if (!ima) if (!ima)
BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s", filepath, BKE_reportf(reports, RPT_ERROR, "Can't read \"%s\": %s", filepath,
errno ? strerror(errno) : "Unsupported image format"); errno ? strerror(errno) : TIP_("Unsupported image format"));
return ima; return ima;
} }
@@ -358,8 +360,8 @@ static VFont *rna_Main_fonts_load(Main *bmain, ReportList *reports, const char *
font = BKE_vfont_load(bmain, filepath); font = BKE_vfont_load(bmain, filepath);
if (!font) if (!font)
BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s", filepath, BKE_reportf(reports, RPT_ERROR, "Can't read \"%s\": %s", filepath,
errno ? strerror(errno) : "Unsupported font format"); errno ? strerror(errno) : TIP_("Unsupported font format"));
return font; return font;
@@ -468,8 +470,8 @@ static Text *rna_Main_texts_load(Main *bmain, ReportList *reports, const char *f
txt = BKE_text_load(filepath, bmain->name); txt = BKE_text_load(filepath, bmain->name);
if (!txt) if (!txt)
BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s", filepath, BKE_reportf(reports, RPT_ERROR, "Can't read \"%s\": %s", filepath,
errno ? strerror(errno) : "Unable to load text"); errno ? strerror(errno) : TIP_("Unable to load text"));
return txt; return txt;
} }
@@ -534,8 +536,8 @@ static MovieClip *rna_Main_movieclip_load(Main *UNUSED(bmain), ReportList *repor
clip = BKE_movieclip_file_add(filepath); clip = BKE_movieclip_file_add(filepath);
if (!clip) if (!clip)
BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s.", filepath, BKE_reportf(reports, RPT_ERROR, "Can't read \"%s\": %s", filepath,
errno ? strerror(errno) : "Unable to load movie clip"); errno ? strerror(errno) : TIP_("Unable to load movie clip"));
return clip; return clip;
} }