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

gEDA-cvs: gaf.git: branch: master updated (1.5.1-20081221-46-gb6e8608)



The branch, master has been updated
       via  b6e8608d5642912ce10bf29119e5c86eb91634f7 (commit)
      from  52df0d861e880e019c7aeea71f1ed448bbed47db (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 |    2 +-
 gschem/src/a_pan.c         |    2 ++
 gschem/src/i_basic.c       |   13 +++++++++----
 gschem/src/i_callbacks.c   |    4 ++++
 gschem/src/x_dialog.c      |    1 +
 5 files changed, 17 insertions(+), 5 deletions(-)


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

commit b6e8608d5642912ce10bf29119e5c86eb91634f7
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Fri Dec 26 00:36:49 2008 +0000

    gschem: Add status bar info updates when altering grid / snap settings
    
    Changes mistakenly missed from index at last commit:
    
    commit 52df0d861e880e019c7aeea71f1ed448bbed47db
    Author: Peter Clifton <pcjc2@xxxxxxxxx>
    Date:   Fri Dec 26 00:18:13 2008 +0000
    
        gschem: Move update of status bar information out of the grid drawing code.
    
        For now, and in the absence of any better place to hook, just trigger this
        update explicitly when we pan or alter the grid settings.
    
    The code removing the status bar update from the grid redraw functions
    was staged and committed, but not that which re-added the updates
    elsewhere. This commit adds those updates.

:100644 100644 cfba290... 49d3d83... M	gschem/include/prototype.h
:100644 100644 acb4c1b... 9497cef... M	gschem/src/a_pan.c
:100644 100644 e750b0e... 46ce380... M	gschem/src/i_basic.c
:100644 100644 601b568... dd41528... M	gschem/src/i_callbacks.c
:100644 100644 b678a16... af6a02c... M	gschem/src/x_dialog.c

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

commit b6e8608d5642912ce10bf29119e5c86eb91634f7
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Fri Dec 26 00:36:49 2008 +0000

    gschem: Add status bar info updates when altering grid / snap settings
    
    Changes mistakenly missed from index at last commit:
    
    commit 52df0d861e880e019c7aeea71f1ed448bbed47db
    Author: Peter Clifton <pcjc2@xxxxxxxxx>
    Date:   Fri Dec 26 00:18:13 2008 +0000
    
        gschem: Move update of status bar information out of the grid drawing code.
    
        For now, and in the absence of any better place to hook, just trigger this
        update explicitly when we pan or alter the grid settings.
    
    The code removing the status bar update from the grid redraw functions
    was staged and committed, but not that which re-added the updates
    elsewhere. This commit adds those updates.

diff --git a/gschem/include/prototype.h b/gschem/include/prototype.h
index cfba290..49d3d83 100644
--- a/gschem/include/prototype.h
+++ b/gschem/include/prototype.h
@@ -292,7 +292,7 @@ void i_update_middle_button(GSCHEM_TOPLEVEL *w_current, void (*func_ptr)(), cons
 void i_update_toolbar(GSCHEM_TOPLEVEL *w_current);
 void i_update_menus(GSCHEM_TOPLEVEL *w_current);
 void i_set_filename(GSCHEM_TOPLEVEL *w_current, const gchar *string);
-void i_set_grid(GSCHEM_TOPLEVEL *w_current, int visible_grid);
+void i_update_grid_info(GSCHEM_TOPLEVEL *w_current);
 /* i_callbacks.c */
 void i_callback_file_new(gpointer data, guint callback_action, GtkWidget *widget);
 void i_callback_toolbar_file_new(GtkWidget *widget, gpointer data);
diff --git a/gschem/src/a_pan.c b/gschem/src/a_pan.c
index acb4c1b..9497cef 100644
--- a/gschem/src/a_pan.c
+++ b/gschem/src/a_pan.c
@@ -159,6 +159,8 @@ void a_pan_general(GSCHEM_TOPLEVEL *w_current, double world_cx, double world_cy,
              toplevel->page_current->top   ,
              toplevel->page_current->bottom);
 
+  i_update_grid_info (w_current);
+
   /* redraw */
   if (!(flags & A_PAN_DONT_REDRAW)) {
     x_scrollbars_update(w_current);
diff --git a/gschem/src/i_basic.c b/gschem/src/i_basic.c
index e750b0e..46ce380 100644
--- a/gschem/src/i_basic.c
+++ b/gschem/src/i_basic.c
@@ -517,7 +517,7 @@ void i_set_filename(GSCHEM_TOPLEVEL *w_current, const gchar *string)
  *  \param [in] w_current GSCHEM_TOPLEVEL structure
  *  \param [in] visible_grid Visible grid size
  */
-void i_set_grid(GSCHEM_TOPLEVEL *w_current, int visible_grid)
+void i_update_grid_info (GSCHEM_TOPLEVEL *w_current)
 {
   TOPLEVEL *toplevel = w_current->toplevel;
   gchar *print_string=NULL;
@@ -532,10 +532,15 @@ void i_set_grid(GSCHEM_TOPLEVEL *w_current, int visible_grid)
   else
     snap = g_strdup_printf("%d", toplevel->snap_size);
 
-  if (!w_current->grid)
+  if (w_current->grid == GRID_NONE) {
     grid = g_strdup(_("OFF"));
-  else
-    grid = g_strdup_printf("%d", visible_grid);
+  } else {
+    int visible_grid = x_grid_query_drawn_spacing (w_current);
+    if (visible_grid == -1)
+      grid = g_strdup (_("NONE"));
+    else
+      grid = g_strdup_printf("%d", visible_grid);
+  }
 
   print_string = g_strdup_printf(_("Grid(%s, %s)"), snap, grid);
   gtk_label_set(GTK_LABEL(w_current->grid_label), print_string);
diff --git a/gschem/src/i_callbacks.c b/gschem/src/i_callbacks.c
index 601b568..dd41528 100644
--- a/gschem/src/i_callbacks.c
+++ b/gschem/src/i_callbacks.c
@@ -3270,6 +3270,7 @@ DEFINE_I_CALLBACK(options_scale_up_snap_size)
   w_current->toplevel->page_current->CHANGED=1;  /* maybe remove those two lines */
   o_undo_savestate(w_current, UNDO_ALL);
 
+  i_update_grid_info (w_current);
   o_invalidate_all (w_current);
 }
 
@@ -3289,6 +3290,7 @@ DEFINE_I_CALLBACK(options_scale_down_snap_size)
   w_current->toplevel->page_current->CHANGED=1;  /* maybe remove those two lines */
   o_undo_savestate(w_current, UNDO_ALL);
 
+  i_update_grid_info (w_current);
   o_invalidate_all (w_current);
 
 }
@@ -3339,6 +3341,7 @@ DEFINE_I_CALLBACK(options_grid)
     case GRID_MESH: s_log_message (_("Mesh grid selected\n")); break;
   }
 
+  i_update_grid_info (w_current);
   o_invalidate_all (w_current);
 }
 
@@ -3359,6 +3362,7 @@ DEFINE_I_CALLBACK(options_snap)
     s_log_message(_("Snap ON\n"));
   }
   i_show_state(w_current, NULL); /* update status on screen */
+  i_update_grid_info (w_current);
 }
 
 /*! \todo Finish function documentation!!!
diff --git a/gschem/src/x_dialog.c b/gschem/src/x_dialog.c
index b678a16..af6a02c 100644
--- a/gschem/src/x_dialog.c
+++ b/gschem/src/x_dialog.c
@@ -1795,6 +1795,7 @@ void snap_size_dialog_response(GtkWidget *w, gint response,
     size = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON(spin_size));
 
     w_current->toplevel->snap_size = size;
+    i_update_grid_info (w_current);
     o_invalidate_all (w_current);
     w_current->toplevel->page_current->CHANGED=1;  /* maybe remove those two lines */
     o_undo_savestate(w_current, UNDO_ALL);




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