More UI messages and BKE_reportf<->BKE_report fixes...
authorBastien Montagne <montagne29@wanadoo.fr>
Tue, 16 Oct 2012 07:53:10 +0000 (07:53 +0000)
committerBastien Montagne <montagne29@wanadoo.fr>
Tue, 16 Oct 2012 07:53:10 +0000 (07:53 +0000)
12 files changed:
source/blender/editors/io/io_collada.c
source/blender/editors/object/object_modifier.c
source/blender/editors/physics/dynamicpaint_ops.c
source/blender/editors/physics/particle_edit.c
source/blender/editors/space_clip/clip_ops.c
source/blender/editors/space_clip/tracking_ops.c
source/blender/editors/space_info/info_ops.c
source/blender/editors/space_nla/nla_edit.c
source/blender/editors/space_outliner/outliner_tools.c
source/blender/editors/space_view3d/view3d_buttons.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/makesrna/intern/rna_main_api.c

index 0ec99325752f673e902d0999344c94c5db41c3eb..ba93206e63a3f19f82db41183c34cb654a9eb785 100644 (file)
@@ -143,7 +143,7 @@ static int wm_collada_export_exec(bContext *C, wmOperator *op)
                return OPERATOR_FINISHED;
        }
        else {
-               BKE_report(op->reports, RPT_WARNING, "Export file not created.");
+               BKE_report(op->reports, RPT_WARNING, "Export file not created");
                return OPERATOR_CANCELLED;
        }
 }
@@ -307,7 +307,7 @@ static int wm_collada_import_exec(bContext *C, wmOperator *op)
        RNA_string_get(op->ptr, "filepath", filename);
        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;
 }
index d75ef78fc4cdd9645d07abef1ed0e4785b4a2a7e..020705069376dd3b8f4398874c6fc22eedd840fb 100644 (file)
@@ -1242,7 +1242,7 @@ static int multires_reshape_exec(bContext *C, wmOperator *op)
        CTX_DATA_END;
 
        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;
        }
 
index 5b69e6745c0199dc2e4d747defa523daf05bc66a..91f1c0b273066ab10f91a96dcfe0da912a7efad1 100644 (file)
@@ -346,7 +346,6 @@ static int dynamicPaint_initBake(struct bContext *C, struct wmOperator *op)
        Object *ob = ED_object_context(C);
        int status = 0;
        double timer = PIL_check_seconds_timer();
-       char result_str[80];
        DynamicPaintSurface *surface;
 
        /*
@@ -354,14 +353,14 @@ static int dynamicPaint_initBake(struct bContext *C, struct wmOperator *op)
         */
        pmd = (DynamicPaintModifierData *)modifiers_findByType(ob, eModifierType_DynamicPaint);
        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;
        }
 
        /* Make sure we're dealing with a canvas */
        canvas = pmd->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;
        }
        surface = get_activeSurface(canvas);
@@ -387,17 +386,14 @@ static int dynamicPaint_initBake(struct bContext *C, struct wmOperator *op)
                BLI_timestr(time, time_str);
 
                /* Show bake info */
-               BLI_snprintf(result_str, sizeof(result_str), "Bake Complete! (%s)", time_str);
-               BKE_report(op->reports, RPT_INFO, result_str);
+               BKE_reportf(op->reports, RPT_INFO, "Bake complete! (%s)", time_str);
        }
        else {
                if (strlen(canvas->error)) { /* If an error occured */
-                       BLI_snprintf(result_str, sizeof(result_str), "Bake Failed: %s", canvas->error);
-                       BKE_report(op->reports, RPT_ERROR, result_str);
+                       BKE_reportf(op->reports, RPT_ERROR, "Bake failed: %s", canvas->error);
                }
-               else {  /* User canceled the bake */
-                       BLI_strncpy(result_str, "Baking Cancelled!", sizeof(result_str));
-                       BKE_report(op->reports, RPT_WARNING, result_str);
+               else { /* User canceled the bake */
+                       BKE_report(op->reports, RPT_WARNING, "Baking cancelled!");
                }
        }
 
index 1010c0efce4ef00133298a106f5146a94c0fdc55..7343a44470ac2df8d0cd89ee6d0606dc7e386a43 100644 (file)
@@ -2414,7 +2414,7 @@ static int remove_doubles_exec(bContext *C, wmOperator *op)
        if (totremoved == 0)
                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);
        WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_EDITED, ob);
index c67ee5c8a818e51dbeb82a74bc4b67a2d457058f..37eb0bcb7c1cb6af7dbf789465bcfb84f0c012f9 100644 (file)
@@ -41,6 +41,8 @@
 #include "BLI_math.h"
 #include "BLI_rect.h"
 
+#include "BLF_translation.h"
+
 #include "BKE_context.h"
 #include "BKE_global.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);
        }
        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;
        }
@@ -195,8 +197,8 @@ static int open_exec(bContext *C, wmOperator *op)
                if (op->customdata)
                        MEM_freeN(op->customdata);
 
-               BKE_reportf(op->reports, RPT_ERROR, "Can't read: \"%s\", %s.", str,
-                           errno ? strerror(errno) : "Unsupported movie clip format");
+               BKE_reportf(op->reports, RPT_ERROR, "Can't read \"%s\": %s", str,
+                           errno ? strerror(errno) : TIP_("Unsupported movie clip format"));
 
                return OPERATOR_CANCELLED;
        }
index 857d88a9a795a4e686204831bc6d6b7e34052f5b..c061125b4d569a61ddcde3907ac4b543f73afb49 100644 (file)
@@ -1400,7 +1400,7 @@ static void solve_camera_freejob(void *scv)
        if (!solved)
                BKE_report(scj->reports, RPT_WARNING, "Some data failed to reconstruct, see console for details");
        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 */
        if (scene->clip)
index fe36bc98144cf8a0f4267d37190f17f47537442c..bb2d55fa0f62b5c69bdabe42df40a7799a57fd93 100644 (file)
@@ -150,7 +150,7 @@ static int unpack_all_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)
        count = countPackedFiles(bmain);
        
        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;
                return OPERATOR_CANCELLED;
        }
index ebc4383d143410d8b0bb353a4f13afd9d0354c89..e0e5007aff0f08deb843fc15db8e92e8b53b931e 100644 (file)
@@ -405,7 +405,9 @@ static int nlaedit_add_actionclip_exec(bContext *C, wmOperator *op)
        else if (act->idroot == 0) {
                /* hopefully in this case (i.e. library of userless actions), the user knows what they're doing... */
                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);
        }
        
index 9b689c359bcd537af79662f75a651706a7a04206..e4cd971dbd587a1d8c753f13812d08375ab19dd0 100644 (file)
@@ -811,7 +811,7 @@ static int outliner_id_operation_exec(bContext *C, wmOperator *op)
                                        ED_undo_push(C, "Unlink world");
                                        break;
                                default:
-                                       BKE_report(op->reports, RPT_WARNING, "Not Yet");
+                                       BKE_report(op->reports, RPT_WARNING, "Not yet");
                                        break;
                        }
                }
@@ -844,7 +844,7 @@ static int outliner_id_operation_exec(bContext *C, wmOperator *op)
                                        break;
                                        
                                default:
-                                       BKE_report(op->reports, RPT_WARNING, "Not Yet");
+                                       BKE_report(op->reports, RPT_WARNING, "Not yet");
                                        break;
                        }
                }
@@ -980,9 +980,9 @@ static int outliner_action_set_exec(bContext *C, wmOperator *op)
        else if (act->idroot == 0) {
                /* hopefully in this case (i.e. library of userless actions), the user knows what they're doing... */
                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);
        }
        
index 0a55df192ea6d5437e86c2344acc94ff06cee9e9..9755c7d1b7ce216d7c4b0fa1906cdb911ba90fcb 100644 (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:"),
                                        0, yi -= buth + but_margin, 200, buth,
                                        &(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);
                }
                /* Lattice... */
index 2ada1199cb304e629e5174cc63858653bac5a4d5..2a210ef0ee4563c46dd8e5d620eb2f07003a8e69 100644 (file)
@@ -2754,7 +2754,7 @@ static int view3d_zoom_border_exec(bContext *C, wmOperator *op)
 
                /* no depths to use, we cant do anything! */
                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;
                }
                /* convert border to 3d coordinates */
index be8f84fd2a4e84bd34ae399cd70246142a5512e8..d8f7d48a74f44efb2f6ab7c287d89693ac5a13c2 100644 (file)
@@ -97,6 +97,8 @@
 
 #include "ED_screen.h"
 
+#include "BLF_translation.h"
+
 static Camera *rna_Main_cameras_new(Main *UNUSED(bmain), const char *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);
 
        if (!ima)
-               BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s", filepath,
-                           errno ? strerror(errno) : "Unsupported image format");
+               BKE_reportf(reports, RPT_ERROR, "Can't read \"%s\": %s", filepath,
+                           errno ? strerror(errno) : TIP_("Unsupported image format"));
 
        return ima;
 }
@@ -358,8 +360,8 @@ static VFont *rna_Main_fonts_load(Main *bmain, ReportList *reports, const char *
        font = BKE_vfont_load(bmain, filepath);
 
        if (!font)
-               BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s", filepath,
-                           errno ? strerror(errno) : "Unsupported font format");
+               BKE_reportf(reports, RPT_ERROR, "Can't read \"%s\": %s", filepath,
+                           errno ? strerror(errno) : TIP_("Unsupported font format"));
 
        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);
 
        if (!txt)
-               BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s", filepath,
-                           errno ? strerror(errno) : "Unable to load text");
+               BKE_reportf(reports, RPT_ERROR, "Can't read \"%s\": %s", filepath,
+                           errno ? strerror(errno) : TIP_("Unable to load text"));
 
        return txt;
 }
@@ -534,8 +536,8 @@ static MovieClip *rna_Main_movieclip_load(Main *UNUSED(bmain), ReportList *repor
        clip = BKE_movieclip_file_add(filepath);
 
        if (!clip)
-               BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s.", filepath,
-                           errno ? strerror(errno) : "Unable to load movie clip");
+               BKE_reportf(reports, RPT_ERROR, "Can't read \"%s\": %s", filepath,
+                           errno ? strerror(errno) : TIP_("Unable to load movie clip"));
 
        return clip;
 }