Made animation-editor copy/paste operators use reports-api for reporting errors inste...
authorJoshua Leung <aligorith@gmail.com>
Tue, 24 Feb 2009 11:23:04 +0000 (11:23 +0000)
committerJoshua Leung <aligorith@gmail.com>
Tue, 24 Feb 2009 11:23:04 +0000 (11:23 +0000)
source/blender/editors/space_action/action_edit.c
source/blender/editors/space_graph/graph_edit.c

index 99f18a2e653398633bec12d7bdec21862d1ea65b..b576447702d52543349830b4bbd84ab6d23e2616 100644 (file)
@@ -68,6 +68,7 @@
 #include "BKE_material.h"
 #include "BKE_object.h"
 #include "BKE_context.h"
 #include "BKE_material.h"
 #include "BKE_object.h"
 #include "BKE_context.h"
+#include "BKE_report.h"
 #include "BKE_utildefines.h"
 
 #include "UI_view2d.h"
 #include "BKE_utildefines.h"
 
 #include "UI_view2d.h"
@@ -290,8 +291,8 @@ static int actkeys_copy_exec(bContext *C, wmOperator *op)
        }
        else {
                if (copy_action_keys(&ac)) {    
        }
        else {
                if (copy_action_keys(&ac)) {    
-                       // XXX errors - need a way to inform the user 
-                       printf("Action Copy: No keyframes copied to copy-paste buffer\n");
+                       BKE_report(op->reports, RPT_ERROR, "No keyframes copied to keyframes copy/paste buffer");
+                       return OPERATOR_CANCELLED;
                }
        }
        
                }
        }
        
@@ -331,8 +332,8 @@ static int actkeys_paste_exec(bContext *C, wmOperator *op)
        }
        else {
                if (paste_action_keys(&ac)) {
        }
        else {
                if (paste_action_keys(&ac)) {
-                       // XXX errors - need a way to inform the user 
-                       printf("Action Paste: Nothing to paste, as Copy-Paste buffer was empty.\n");
+                       BKE_report(op->reports, RPT_ERROR, "No keyframes to paste");
+                       return OPERATOR_CANCELLED;
                }
        }
        
                }
        }
        
index 132beec85c97c43ef73109d266001a2c1f4933f4..f1ff9f3970178e4f2bc92f672401e424f00c6b90 100644 (file)
@@ -68,6 +68,7 @@
 #include "BKE_material.h"
 #include "BKE_object.h"
 #include "BKE_context.h"
 #include "BKE_material.h"
 #include "BKE_object.h"
 #include "BKE_context.h"
+#include "BKE_report.h"
 #include "BKE_utildefines.h"
 
 #include "UI_view2d.h"
 #include "BKE_utildefines.h"
 
 #include "UI_view2d.h"
@@ -294,8 +295,8 @@ static int graphkeys_copy_exec(bContext *C, wmOperator *op)
        
        /* copy keyframes */
        if (copy_graph_keys(&ac)) {     
        
        /* copy keyframes */
        if (copy_graph_keys(&ac)) {     
-               // XXX errors - need a way to inform the user 
-               printf("Graph Copy: No keyframes copied to copy-paste buffer\n");
+               BKE_report(op->reports, RPT_ERROR, "No keyframes copied to keyframes copy/paste buffer");
+               return OPERATOR_CANCELLED;
        }
        
        /* set notifier tha things have changed */
        }
        
        /* set notifier tha things have changed */
@@ -330,8 +331,8 @@ static int graphkeys_paste_exec(bContext *C, wmOperator *op)
        
        /* paste keyframes */
        if (paste_graph_keys(&ac)) {
        
        /* paste keyframes */
        if (paste_graph_keys(&ac)) {
-               // XXX errors - need a way to inform the user 
-               printf("Graph Paste: Nothing to paste, as Copy-Paste buffer was empty.\n");
+               BKE_report(op->reports, RPT_ERROR, "No keyframes to paste");
+               return OPERATOR_CANCELLED;
        }
        
        /* validate keyframes after editing */
        }
        
        /* validate keyframes after editing */