[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: gaf.git: branch: master updated (1.5.2-20090328-58-gd3bd67e)



The branch, master has been updated
       via  d3bd67e8ccb5ed47f17603392f480f220380daa5 (commit)
      from  7253fb551e683b3c7c15c0f8595178f88129e7c5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 gschem/include/prototype.h |    1 +
 gschem/src/o_attrib.c      |   29 +++++++++++++++++++++++++++++
 gschem/src/o_select.c      |   15 ++++++++++++++-
 3 files changed, 44 insertions(+), 1 deletions(-)


=================
 Commit Messages
=================

commit d3bd67e8ccb5ed47f17603392f480f220380daa5
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    gschem: Deselect invisible attribs with their parent object (Bug #2430369)
    
    Previously, when a component was selected and you deselected it with a
    ctrl-click or ctrl-drag, the invisible attributes attached to the
    component remained selected.
    
    This has caused problems for users in the past, when trying to delete
    everything in a given area - except for a few components in the middle.
    
    Drag selecting the area, deselecting the desired components, then deleting
    would also delete the (still selected) invisible attributes belonging to
    the deselected components.
    
    To fix this, make sure that when we remove an object from the selection
    list, we also remove any invisible attributes. When invisible text is
    being shown, there is no need to do this, since the user can manually
    de-select these attributes. (And they may want the finer grained control
    afforded by the ability to do so).

:100644 100644 3504303... 3b47a29... M	gschem/include/prototype.h
:100644 100644 64f45dd... 828341d... M	gschem/src/o_attrib.c
:100644 100644 d2fba3a... e8338d6... M	gschem/src/o_select.c

=========
 Changes
=========

commit d3bd67e8ccb5ed47f17603392f480f220380daa5
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    gschem: Deselect invisible attribs with their parent object (Bug #2430369)
    
    Previously, when a component was selected and you deselected it with a
    ctrl-click or ctrl-drag, the invisible attributes attached to the
    component remained selected.
    
    This has caused problems for users in the past, when trying to delete
    everything in a given area - except for a few components in the middle.
    
    Drag selecting the area, deselecting the desired components, then deleting
    would also delete the (still selected) invisible attributes belonging to
    the deselected components.
    
    To fix this, make sure that when we remove an object from the selection
    list, we also remove any invisible attributes. When invisible text is
    being shown, there is no need to do this, since the user can manually
    de-select these attributes. (And they may want the finer grained control
    afforded by the ability to do so).

diff --git a/gschem/include/prototype.h b/gschem/include/prototype.h
index 3504303..3b47a29 100644
--- a/gschem/include/prototype.h
+++ b/gschem/include/prototype.h
@@ -488,6 +488,7 @@ void o_arc_draw_rubber(GSCHEM_TOPLEVEL *w_current);
 void o_arc_draw_grips(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current);
 /* o_attrib.c */
 void o_attrib_add_selected(GSCHEM_TOPLEVEL *w_current, SELECTION *selection, OBJECT *selected);
+void o_attrib_remove_selected_invisible(GSCHEM_TOPLEVEL *w_current, SELECTION *selection, OBJECT *selected);
 void o_attrib_toggle_visibility(GSCHEM_TOPLEVEL *w_current, OBJECT *object);
 void o_attrib_toggle_show_name_value(GSCHEM_TOPLEVEL *w_current, OBJECT *object, int new_show_name_value);
 OBJECT *o_attrib_add_attrib(GSCHEM_TOPLEVEL *w_current, const char *text_string, int visibility, int show_name_value, OBJECT *object);
diff --git a/gschem/src/o_attrib.c b/gschem/src/o_attrib.c
index 64f45dd..828341d 100644
--- a/gschem/src/o_attrib.c
+++ b/gschem/src/o_attrib.c
@@ -69,6 +69,35 @@ void o_attrib_add_selected(GSCHEM_TOPLEVEL *w_current, SELECTION *selection,
   }
 }
 
+/*! \todo Finish function documentation!!!
+ *  \brief
+ *  \par Function Description
+ *  Remove all invisible attributes from the selection list.
+ *
+ *  \todo get a better name
+ */
+void o_attrib_remove_selected_invisible (GSCHEM_TOPLEVEL *w_current,
+                                         SELECTION *selection,
+                                         OBJECT *selected)
+{
+  OBJECT *a_current;
+  GList *a_iter;
+
+  g_assert( selection != NULL );
+
+  for (a_iter = selected->attribs; a_iter != NULL;
+       a_iter = g_list_next (a_iter)) {
+    a_current = a_iter->data;
+
+    if (!w_current->toplevel->show_hidden_text &&
+        a_current->visibility == INVISIBLE &&
+        a_current->selected) {
+      o_selection_remove (selection, a_current);
+      o_invalidate (w_current, a_current);
+    }
+  }
+}
+
 /*! \brief Change visibility status of attribute object.
  *  \par Function Description
  *  This function toggles the visibility status of the attribute \a
diff --git a/gschem/src/o_select.c b/gschem/src/o_select.c
index d2fba3a..e8338d6 100644
--- a/gschem/src/o_select.c
+++ b/gschem/src/o_select.c
@@ -137,6 +137,7 @@ void o_select_object(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current,
   TOPLEVEL *toplevel = w_current->toplevel;
   int SHIFTKEY;
   int CONTROLKEY;
+  int removing_obj = 0;
 
   SHIFTKEY = w_current->SHIFTKEY;
   CONTROLKEY = w_current->CONTROLKEY;
@@ -187,6 +188,7 @@ void o_select_object(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current,
           if (type != MULTIPLE) {
             o_select_run_hooks( w_current, o_current, 0 );
             o_selection_remove( toplevel->page_current->selection_list, o_current );
+            removing_obj = 1;
           }
 
           break;
@@ -221,6 +223,7 @@ void o_select_object(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current,
           if (CONTROLKEY) {
             o_select_run_hooks(w_current, o_current, 0);
             o_selection_remove( toplevel->page_current->selection_list, o_current);
+            removing_obj = 1;
           }
 
           break;
@@ -229,7 +232,17 @@ void o_select_object(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current,
   }
 
   /* do the attributes */
-  o_attrib_add_selected(w_current, toplevel->page_current->selection_list, o_current);
+  if (removing_obj) {
+    /* Remove the invisible attributes from the object list as well,
+     * so they don't remain selected without the user knowing.
+     */
+    o_attrib_remove_selected_invisible (w_current,
+                                        toplevel->page_current->selection_list,
+                                        o_current);
+  } else {
+    o_attrib_add_selected (w_current, toplevel->page_current->selection_list,
+                           o_current);
+  }
 
   /* finally redraw object */
   o_invalidate (w_current, o_current);




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs