Final UI messages fixes (for this session...).
authorBastien Montagne <montagne29@wanadoo.fr>
Wed, 17 Aug 2016 19:46:38 +0000 (21:46 +0200)
committerBastien Montagne <montagne29@wanadoo.fr>
Thu, 18 Aug 2016 12:37:48 +0000 (14:37 +0200)
source/blender/editors/gpencil/gpencil_data.c

index 876f873e5fa5fb875f001fb0c42b9f73f5ce1fc3..8733c7bf5a820d1c3552125bef689f6952d204d0 100644 (file)
@@ -1439,8 +1439,8 @@ static int gp_brush_remove_exec(bContext *C, wmOperator *op)
        if (ELEM(NULL, ts, brush))
                return OPERATOR_CANCELLED;
 
-       if (BLI_listbase_count(&ts->gp_brushes) < 2) {
-               BKE_report(op->reports, RPT_ERROR, "Grease Pencil needs a brush. Unable to delete brush");
+       if (BLI_listbase_count_ex(&ts->gp_brushes, 2) < 2) {
+               BKE_report(op->reports, RPT_ERROR, "Grease Pencil needs a brush, unable to delete the last one");
                return OPERATOR_CANCELLED;
        }
 
@@ -1466,7 +1466,7 @@ static int gp_brush_remove_exec(bContext *C, wmOperator *op)
 void GPENCIL_OT_brush_remove(wmOperatorType *ot)
 {
        /* identifiers */
-       ot->name = "Remove brush";
+       ot->name = "Remove Brush";
        ot->idname = "GPENCIL_OT_brush_remove";
        ot->description = "Remove active Grease Pencil drawing brush";
 
@@ -1797,8 +1797,8 @@ static int gp_palette_remove_exec(bContext *C, wmOperator *op)
        if (ELEM(NULL, gpd, palette))
                return OPERATOR_CANCELLED;
 
-       if (BLI_listbase_count(&gpd->palettes) < 2) {
-               BKE_report(op->reports, RPT_ERROR, "Grease Pencil needs a palette. Unable to delete palette");
+       if (BLI_listbase_count_ex(&gpd->palettes, 2) < 2) {
+               BKE_report(op->reports, RPT_ERROR, "Grease Pencil needs a palette, unable to delete the last one");
                return OPERATOR_CANCELLED;
        }