pspp-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pspp-cvs] pspp/src/ui/gui ChangeLog data-editor.c data-sh...


From: John Darrington
Subject: [Pspp-cvs] pspp/src/ui/gui ChangeLog data-editor.c data-sh...
Date: Fri, 29 Jun 2007 00:52:03 +0000

CVSROOT:        /sources/pspp
Module name:    pspp
Changes by:     John Darrington <jmd>   07/06/29 00:52:03

Modified files:
        src/ui/gui     : ChangeLog data-editor.c data-sheet.c 

Log message:
        Re-enabled updates in the cell reference entry box.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/ChangeLog?cvsroot=pspp&r1=1.59&r2=1.60
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/data-editor.c?cvsroot=pspp&r1=1.26&r2=1.27
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/data-sheet.c?cvsroot=pspp&r1=1.20&r2=1.21

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/ChangeLog,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -b -r1.59 -r1.60
--- ChangeLog   7 Jun 2007 06:42:06 -0000       1.59
+++ ChangeLog   29 Jun 2007 00:52:03 -0000      1.60
@@ -1,3 +1,8 @@
+2007-06-29  John Darrington <address@hidden>
+
+       * data-editor.c data-sheet.c: Moved update_cell_ref_entry from 
+       data-sheet.c to data-editor.c and made it work again.
+
 2007-06-06  Ben Pfaff  <address@hidden>
 
        Adapt case sources, sinks, and clients of procedure code to the

Index: data-editor.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/data-editor.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -b -r1.26 -r1.27
--- data-editor.c       7 May 2007 00:40:56 -0000       1.26
+++ data-editor.c       29 Jun 2007 00:52:03 -0000      1.27
@@ -52,6 +52,11 @@
 #include "psppire-data-store.h"
 #include "psppire-var-store.h"
 
+
+/* Update the data_ref_entry with the reference of the active cell */
+static gint update_data_ref_entry (const GtkSheet *sheet,
+                                  gint row, gint col, gpointer data);
+
 static void register_data_editor_actions (struct data_editor *de);
 
 static void insert_variable (GtkCheckMenuItem *m, gpointer data);
@@ -177,6 +182,7 @@
   struct data_editor *de ;
   struct editor_window *e;
   GtkSheet *var_sheet ;
+  GtkSheet *data_sheet ;
   PsppireVarStore *vs;
 
   de = g_malloc0 (sizeof (*de));
@@ -186,11 +192,16 @@
   de->xml = XML_NEW ("data-editor.glade");
 
   var_sheet = GTK_SHEET (get_widget_assert (de->xml, "variable_sheet"));
+  data_sheet = GTK_SHEET (get_widget_assert (de->xml, "data_sheet"));
 
   vs = PSPPIRE_VAR_STORE (gtk_sheet_get_model (var_sheet));
 
   g_assert(vs); /* Traps a possible bug in win32 build */
 
+  g_signal_connect (G_OBJECT (data_sheet), "activate",
+                   G_CALLBACK (update_data_ref_entry),
+                   de->xml);
+
   g_signal_connect (vs->dict, "weight-changed",
                    G_CALLBACK (on_weight_change),
                    de);
@@ -1227,3 +1238,44 @@
 
   gtk_widget_destroy (dialog);
 }
+
+
+
+/* Update the data_ref_entry with the reference of the active cell */
+static gint
+update_data_ref_entry (const GtkSheet *sheet, gint row, gint col, gpointer 
data)
+{
+  GladeXML *data_editor_xml = data;
+
+  /* The entry where the reference to the current cell is displayed */
+  GtkEntry *cell_ref_entry;
+
+  PsppireDataStore *data_store = PSPPIRE_DATA_STORE (gtk_sheet_get_model 
(sheet));
+
+  g_return_val_if_fail (data_editor_xml, FALSE);
+
+  if (data_store)
+    {
+      const struct variable *pv =
+       psppire_dict_get_variable (data_store->dict, col);
+
+      gchar *text ;
+      gchar *s ;
+
+      text = g_strdup_printf ("%d: %s", row,
+                            pv ? var_get_name (pv) : "");
+
+      cell_ref_entry = GTK_ENTRY (get_widget_assert (data_editor_xml,
+                                                  "cell_ref_entry"));
+
+      s = pspp_locale_to_utf8 (text, -1, 0);
+
+      g_free (text);
+
+      gtk_entry_set_text (cell_ref_entry, s);
+
+      g_free (s);
+    }
+
+  return FALSE;
+}

Index: data-sheet.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/data-sheet.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- data-sheet.c        7 Feb 2007 02:12:57 -0000       1.20
+++ data-sheet.c        29 Jun 2007 00:52:03 -0000      1.21
@@ -74,49 +74,6 @@
   return TRUE;
 }
 
-
-
-/* Update the data_ref_entry with the reference of the active cell */
-gint
-update_data_ref_entry (const GtkSheet *sheet, gint row, gint col)
-{
-
-  GladeXML *data_editor_xml = NULL; /* FIXME !!!! */
-
-
-  /* The entry where the reference to the current cell is displayed */
-  GtkEntry *cell_ref_entry;
-
-  PsppireDataStore *data_store = PSPPIRE_DATA_STORE (gtk_sheet_get_model 
(sheet));
-  if (data_store)
-    {
-      const struct variable *pv =
-       psppire_dict_get_variable (data_store->dict, col);
-
-      gchar *text ;
-      gchar *s ;
-
-      if ( !data_editor_xml)
-       return FALSE;
-
-      text = g_strdup_printf ("%d: %s", row,
-                            pv ? var_get_name (pv) : "");
-
-      cell_ref_entry = GTK_ENTRY (get_widget_assert (data_editor_xml,
-                                                  "cell_ref_entry"));
-
-      s = pspp_locale_to_utf8 (text, -1, 0);
-
-      g_free (text);
-
-      gtk_entry_set_text (cell_ref_entry, s);
-
-      g_free (s);
-    }
-
-  return FALSE;
-}
-
 extern PsppireDataStore *the_data_store ;
 
 
@@ -169,10 +126,6 @@
 
   the_data_store->width_of_m = calc_m_width (sheet, the_data_store->font_desc);
 
-  g_signal_connect (G_OBJECT (sheet), "activate",
-                   G_CALLBACK (update_data_ref_entry),
-                   0);
-
   g_signal_connect (G_OBJECT (sheet), "traverse",
                    G_CALLBACK (traverse_callback), 0);
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]