[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [34618] trunk/blender/source/blender/ editors/animation/anim_markers.c: Bugfix [#25907] Impossible to "select all " on narrow action editors

Joshua Leung aligorith at gmail.com
Wed Feb 2 04:12:40 CET 2011


Revision: 34618
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=34618
Author:   aligorith
Date:     2011-02-02 03:12:39 +0000 (Wed, 02 Feb 2011)
Log Message:
-----------
Bugfix [#25907] Impossible to "select all" on narrow action editors

Marker selection operators now use a special poll() callback which
checks that there are some markers before trying to run them. This
means that when there are no markers, the full screen range is
available, instead of just those areas above the region masked off for
markers which can be quite slim when trying to save space by only
showing the summary channel.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/animation/anim_markers.c

Modified: trunk/blender/source/blender/editors/animation/anim_markers.c
===================================================================
--- trunk/blender/source/blender/editors/animation/anim_markers.c	2011-02-02 01:01:01 UTC (rev 34617)
+++ trunk/blender/source/blender/editors/animation/anim_markers.c	2011-02-02 03:12:39 UTC (rev 34618)
@@ -403,6 +403,19 @@
 	/* check if some marker is selected */
 	return ED_markers_get_first_selected(markers) != NULL;
 }
+
+/* special poll() which checks if there are any markers at all first */
+static int ed_markers_poll_markers_exist(bContext *C)
+{
+	ListBase *markers = ED_context_get_markers(C);
+	
+	/* first things first: markers can only exist in timeline views */
+	if (ED_operator_animview_active(C) == 0)
+		return 0;
+		
+	/* list of markers must exist, as well as some markers in it! */
+	return (markers && markers->first);
+}
  
 /* ------------------------ */ 
 
@@ -1011,7 +1024,7 @@
 	
 	/* api callbacks */
 	ot->invoke= ed_marker_select_invoke_wrapper;
-	ot->poll= ED_operator_animview_active;
+	ot->poll= ed_markers_poll_markers_exist;
 	
 	/* flags */
 	ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -1098,7 +1111,7 @@
 	ot->invoke= ed_marker_select_border_invoke_wrapper;
 	ot->modal= WM_border_select_modal;
 	
-	ot->poll= ED_operator_animview_active;
+	ot->poll= ed_markers_poll_markers_exist;
 	
 	/* flags */
 	ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -1152,7 +1165,7 @@
 	/* api callbacks */
 	ot->exec= ed_marker_select_all_exec;
 	ot->invoke = ed_markers_opwrap_invoke;
-	ot->poll= ED_operator_animview_active;
+	ot->poll= ed_markers_poll_markers_exist;
 	
 	/* flags */
 	ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -1219,12 +1232,12 @@
 {
 	TimeMarker *marker= ED_markers_get_first_selected(ED_context_get_markers(C));
 
-	if(marker) {
+	if (marker) {
 		RNA_string_get(op->ptr, "name", marker->name);
-
+		
 		WM_event_add_notifier(C, NC_SCENE|ND_MARKERS, NULL);
 		WM_event_add_notifier(C, NC_ANIMATION|ND_MARKERS, NULL);
-
+		
 		return OPERATOR_FINISHED;
 	}
 	else {




More information about the Bf-blender-cvs mailing list