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 helper.c helper.h...


From: John Darrington
Subject: [Pspp-cvs] pspp/src/ui/gui data-editor.c helper.c helper.h...
Date: Wed, 27 Dec 2006 09:04:36 +0000

CVSROOT:        /sources/pspp
Module name:    pspp
Changes by:     John Darrington <jmd>   06/12/27 09:04:35

Modified files:
        src/ui/gui     : data-editor.c helper.c helper.h 
                         message-dialog.c missing-val-dialog.c psppire.c 
                         syntax-editor.c val-labs-dialog.c 

Log message:
        Re-added the help button callbacks

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/data-editor.c?cvsroot=pspp&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/helper.c?cvsroot=pspp&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/helper.h?cvsroot=pspp&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/message-dialog.c?cvsroot=pspp&r1=1.23&r2=1.24
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/missing-val-dialog.c?cvsroot=pspp&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/psppire.c?cvsroot=pspp&r1=1.31&r2=1.32
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/syntax-editor.c?cvsroot=pspp&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/val-labs-dialog.c?cvsroot=pspp&r1=1.10&r2=1.11

Patches:
Index: data-editor.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/data-editor.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- data-editor.c       26 Dec 2006 21:32:09 -0000      1.3
+++ data-editor.c       27 Dec 2006 09:04:35 -0000      1.4
@@ -114,6 +114,8 @@
 
   de->xml = glade_xml_new (PKGDATADIR "/data-editor.glade", NULL, NULL);
 
+  connect_help (de->xml);
+
   e->window = get_widget_assert (de->xml, "data_editor");
 
   g_signal_connect (get_widget_assert (de->xml,"file_new_data"),

Index: helper.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/helper.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- helper.c    24 Dec 2006 22:49:18 -0000      1.11
+++ helper.c    27 Dec 2006 09:04:35 -0000      1.12
@@ -82,3 +82,34 @@
   return recode_string (CONV_PSPP_TO_UTF8, text, len);
 }
 
+#define _(msgid) gettext (msgid)
+#define N_(msgid) msgid
+
+
+static void
+give_help (void)
+{
+  static struct msg m = {
+    MSG_GENERAL,
+    MSG_NOTE,
+    {0, -1},
+    0,
+  };
+
+  if (! m.text)
+    m.text=g_strdup (_("Sorry. The help system hasn't yet been implemented."));
+
+  popup_message (&m);
+}
+
+void
+connect_help (GladeXML *xml)
+{
+  GList *helps = glade_xml_get_widget_prefix (xml, "help_button_");
+
+  GList *i;
+  for ( i = g_list_first (helps); i ; i = g_list_next (i))
+    g_signal_connect (GTK_WIDGET (i->data), "clicked", give_help, 0);
+}
+
+

Index: helper.h
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/helper.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- helper.h    24 Dec 2006 22:49:18 -0000      1.7
+++ helper.h    27 Dec 2006 09:04:35 -0000      1.8
@@ -41,4 +41,6 @@
 char * pspp_locale_to_utf8 (const gchar *text, gssize len, GError **err);
 
 
+void connect_help (GladeXML *xml);
+
 #endif

Index: message-dialog.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/message-dialog.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- message-dialog.c    24 Dec 2006 23:08:25 -0000      1.23
+++ message-dialog.c    27 Dec 2006 09:04:35 -0000      1.24
@@ -98,6 +98,7 @@
 popup_message (const struct msg *m)
 {
   GtkWidget *dialog;
+  gchar *location = NULL;
 
   gint message_type;
   const char *msg;
@@ -137,12 +138,22 @@
                                  message_type,
                                  GTK_BUTTONS_CLOSE,
                                  msg);
+  if ( m->where.line_number != -1)
+    {
+      location = g_strdup_printf (_("%s (line %d)"),
+                                 m->where.file_name ? m->where.file_name : "",
+                                 m->where.line_number);
+    }
+  else
+    {
+      location = g_strdup_printf (_("%s"),
+                                 m->where.file_name ? m->where.file_name : 
"");    }
 
   gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
-                                           _("%s (line %d) %s"),
-                                          m->where.file_name,
-                                          m->where.line_number,
+                                           _("%s %s"),
+                                           location,
                                           m->text);
+  free (location);
 
   gtk_window_set_keep_above (GTK_WINDOW (dialog), TRUE);
 

Index: missing-val-dialog.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/missing-val-dialog.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- missing-val-dialog.c        24 Dec 2006 23:08:25 -0000      1.11
+++ missing-val-dialog.c        27 Dec 2006 09:04:35 -0000      1.12
@@ -213,6 +213,8 @@
 {
   struct missing_val_dialog *dialog = g_malloc (sizeof (*dialog));
 
+  connect_help (xml);
+
   dialog->window = get_widget_assert (xml, "missing_values_dialog");
 
   gtk_window_set_transient_for

Index: psppire.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/psppire.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -b -r1.31 -r1.32
--- psppire.c   24 Dec 2006 23:08:25 -0000      1.31
+++ psppire.c   27 Dec 2006 09:04:35 -0000      1.32
@@ -54,25 +54,6 @@
                                gchar **filename, GError **err);
 
 
-#define _(msgid) gettext (msgid)
-#define N_(msgid) msgid
-
-static void
-give_help (void)
-{
-  static struct msg m = {
-    MSG_GENERAL,
-    MSG_NOTE,
-    {0, -1},
-    0,
-  };
-
-  if (! m.text)
-    m.text=g_strdup (_("Sorry. The help system hasn't yet been implemented."));
-
-  popup_message (&m);
-}
-
 PsppireVarStore *the_var_store = 0;
 
 void create_icon_factory (void);
@@ -144,36 +125,6 @@
 
   create_icon_factory ();
 
-#if 0
-  /* load the interface */
-  data_editor_xml = glade_xml_new (PKGDATADIR "/data-editor.glade", NULL, 
NULL);
-
-  if ( !data_editor_xml ) return 1;
-
-  data_editor = get_widget_assert (data_editor_xml, "data_editor");
-
-  /* connect the signals in the interface */
-  glade_xml_signal_autoconnect (data_editor_xml);
-
-  var_sheet  = GTK_SHEET (get_widget_assert (data_editor_xml, 
"variable_sheet"));
-  data_sheet = GTK_SHEET (get_widget_assert (data_editor_xml, "data_sheet"));
-
-  gtk_sheet_set_model (var_sheet, G_SHEET_MODEL (the_var_store));
-
-  gtk_sheet_set_model (data_sheet, G_SHEET_MODEL (the_data_store));
-
-  var_data_selection_init ();
-
-  {
-  GList *helps = glade_xml_get_widget_prefix (data_editor_xml, "help_button_");
-
-  GList *i;
-  for ( i = g_list_first (helps); i ; i = g_list_next (i))
-      g_signal_connect (GTK_WIDGET (i->data), "clicked", give_help, 0);
-  }
-
-#endif
-
   new_data_window (NULL, NULL);
 
   /* start the event loop */
@@ -280,3 +231,6 @@
 
   gtk_icon_factory_add_default (factory);
 }
+
+
+

Index: syntax-editor.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/syntax-editor.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- syntax-editor.c     26 Dec 2006 07:09:23 -0000      1.8
+++ syntax-editor.c     27 Dec 2006 09:04:35 -0000      1.9
@@ -325,6 +325,8 @@
   struct syntax_editor *se ;
   struct editor_window *e;
 
+  connect_help (xml);
+
   se = g_malloc (sizeof (*se));
 
   e = (struct editor_window *)se;

Index: val-labs-dialog.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/val-labs-dialog.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- val-labs-dialog.c   24 Dec 2006 23:50:59 -0000      1.10
+++ val-labs-dialog.c   27 Dec 2006 09:04:35 -0000      1.11
@@ -371,6 +371,8 @@
 
   struct val_labs_dialog *dialog = g_malloc (sizeof (*dialog));
 
+  connect_help (xml);
+
   dialog->window = get_widget_assert (xml,"val_labs_dialog");
   dialog->value_entry = get_widget_assert (xml,"value_entry");
   dialog->label_entry = get_widget_assert (xml,"label_entry");




reply via email to

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