pspp-cvs
[Top][All Lists]
Advanced

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

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


From: John Darrington
Subject: [Pspp-cvs] pspp/src/ui/gui data-editor.c data-editor.h
Date: Wed, 04 Jul 2007 03:21:29 +0000

CVSROOT:        /sources/pspp
Module name:    pspp
Changes by:     John Darrington <jmd>   07/07/04 03:21:29

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

Log message:
        Enabled the insert-variable button

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/data-editor.c?cvsroot=pspp&r1=1.29&r2=1.30
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/data-editor.h?cvsroot=pspp&r1=1.11&r2=1.12

Patches:
Index: data-editor.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/data-editor.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- data-editor.c       3 Jul 2007 05:49:53 -0000       1.29
+++ data-editor.c       4 Jul 2007 03:21:29 -0000       1.30
@@ -59,7 +59,7 @@
 
 static void register_data_editor_actions (struct data_editor *de);
 
-static void insert_variable (GtkCheckMenuItem *m, gpointer data);
+static void insert_variable (GtkAction *, gpointer data);
 
 
 /* Switch between the VAR SHEET and the DATA SHEET */
@@ -241,6 +241,24 @@
 
   register_data_editor_actions (de);
 
+  de->insert_variable =
+    gtk_action_new ("insert-variable",
+                   _("Insert Variable"),
+                   _("Create a new variable at the current position"),
+                   "pspp-insert-variable");
+
+  g_signal_connect (de->insert_variable, "activate",
+                   G_CALLBACK (insert_variable), de);
+
+
+  gtk_action_connect_proxy (de->insert_variable,
+                           get_widget_assert (de->xml, 
"button-insert-variable")
+                           );
+
+  gtk_action_connect_proxy (de->insert_variable,
+                           get_widget_assert (de->xml, "data_insert-variable")
+                           );
+
   de->invoke_weight_cases_dialog =
     gtk_action_new ("weight-cases-dialog",
                    _("Weights"),
@@ -389,10 +407,6 @@
                    de);
 
 
-  g_signal_connect (get_widget_assert (de->xml,"data_insert-variable"),
-                   "activate",
-                   G_CALLBACK (insert_variable),
-                   de);
 
   gtk_action_connect_proxy (de->invoke_weight_cases_dialog,
                            get_widget_assert (de->xml, "data_weight-cases")
@@ -828,10 +842,10 @@
 /* Insert a new variable before the current row in the variable sheet,
    or before the current column in the data sheet, whichever is selected */
 static void
-insert_variable (GtkCheckMenuItem *m, gpointer data)
+insert_variable (GtkAction *action, gpointer data)
 {
   struct data_editor *de = data;
-  gint posn;
+  gint posn = -1;
 
   GtkWidget *notebook = get_widget_assert (de->xml, "notebook");
 
@@ -861,6 +875,8 @@
       g_assert_not_reached ();
     }
 
+  if ( posn == -1 ) posn = 0;
+
   psppire_dict_insert_variable (vs->dict, posn, NULL);
 }
 

Index: data-editor.h
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/data-editor.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- data-editor.h       7 May 2007 00:40:56 -0000       1.11
+++ data-editor.h       4 Jul 2007 03:21:29 -0000       1.12
@@ -43,6 +43,9 @@
 
   GtkAction *invoke_variable_info_dialog;
 
+
+  GtkAction *insert_variable;
+
   GladeXML *xml;
 
   gboolean save_as_portable;




reply via email to

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