Applied patch #6420
authorJohn Darrington <john@darrington.wattle.id.au>
Tue, 19 Feb 2008 00:35:19 +0000 (00:35 +0000)
committerJohn Darrington <john@darrington.wattle.id.au>
Tue, 19 Feb 2008 00:35:19 +0000 (00:35 +0000)
ChangeLog
INSTALL
configure.ac
src/ui/gui/ChangeLog
src/ui/gui/dict-display.c

index 751b749497148519403c5113c8a847f30f5e98cf..06fed4f6193e8ddc157451055579c010ede44e59 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-02-19  John Darrington <john@darrington.wattle.id.au>
+
+       * configure.ac INSTALL: We now depend on GTK+ 2.12
+
 2007-12-11  John Darrington <john@darrington.wattle.id.au>
 
        * t-test-independent-samples-dialog.c: Quoted the group values, when
diff --git a/INSTALL b/INSTALL
index dd27803865ef9c166d671977a69db93c0e6343fb..4997fd52b8c57f817c4f2ceb16d01ef30ec7e191 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -48,8 +48,7 @@ use the GUI, you must run `configure' with --without-gui.
       0.18 and 0.19 have a bug that will prevent library detection,
       but other versions should be fine.
 
-    * GTK+ (http://www.gtk.org/), version 2.8.0 or later, although we
-      recommend version 2.10.2 or later.
+    * GTK+ (http://www.gtk.org/), version 2.12.0 or later.
 
     * libglade (http://www.jamesh.id.au/software/libglade/), version
       2.6 or later.
index 708911ed6cbf00d9536fecff27b6a25726035c04..9df062aeffdb1814e6d4853988a9def6af32f439 100644 (file)
@@ -39,8 +39,8 @@ AC_ARG_WITH(
   [AS_HELP_STRING([--without-gui], [don't build the PSPPIRE gui])])
 
 if test x"$with_gui" != x"no" ; then 
-  PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.8.0,,
-    [PSPP_REQUIRED_PREREQ([gtk+ 2.0 v2.8.0 or later (or use --without-gui)])])
+  PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.12.0,,
+    [PSPP_REQUIRED_PREREQ([gtk+ 2.0 v2.12.0 or later (or use --without-gui)])])
   PKG_CHECK_MODULES(GLADE, libglade-2.0 >= 2.6.0,,
     [PSPP_REQUIRED_PREREQ([libglade 2.0 (or use --without-gui)])])
 fi
index 845a2eef0f30f7ac74bcce2206f5a90b4d072d1f..23004c9ad23a1959edc4905b3a0174fd7928cd5b 100644 (file)
@@ -1,3 +1,8 @@
+2008-02-19  John Darrington <john@darrington.wattle.id.au>
+
+       * dict-display.c: Display names of variables in dialog box
+       dictionary treeviews, when the mouse hovers over the variable.
+
 2008-02-13  John Darrington <john@darrington.wattle.id.au>
 
        * variable-info-dialog.c: Fix crash when clicking "Jump" when no 
index 1c2858d65cc8c0a8904e4ccd72938c5f4805b4d8..d665edd62be1872f5cede3a2515f791344145e1f 100644 (file)
@@ -136,10 +136,9 @@ var_description_cell_data_func (GtkTreeViewColumn *col,
   if ( var_has_label (var))
     {
       gchar *text = g_strdup_printf (
-                                    "<span stretch=\"condensed\">%s</span>"
-                                    " (<span weight=\"bold\">%s</span>)",
-                                    var_get_label (var),
-                                    var_get_name (var));
+                                    "<span stretch=\"condensed\">%s</span>",
+                                    var_get_label (var));
+
 
       char *utf8 = pspp_locale_to_utf8 (text, -1, NULL);
 
@@ -153,6 +152,53 @@ var_description_cell_data_func (GtkTreeViewColumn *col,
     }
 }
 
+
+/* Sets the tooltip to be the name of the variable under the cursor */
+static gboolean
+set_tooltip_for_variable (GtkTreeView  *treeview,
+                         gint        x,
+                         gint        y,
+                         gboolean    keyboard_mode,
+                         GtkTooltip *tooltip,
+                         gpointer    user_data)
+
+{
+  gint bx, by;
+  GtkTreeIter iter;
+  GtkTreePath *path;
+  GtkTreeModel *tree_model;
+  struct variable *var = NULL;
+  gboolean ok;
+
+  gtk_tree_view_convert_widget_to_bin_window_coords (treeview,
+                                                     x, y, &bx, &by);
+
+  if (!gtk_tree_view_get_path_at_pos (treeview, bx, by,
+                                      &path, NULL, NULL, NULL))
+    return FALSE;
+
+  tree_model = gtk_tree_view_get_model (treeview);
+
+
+  gtk_tree_view_set_tooltip_row (treeview, tooltip, path);
+
+  ok = gtk_tree_model_get_iter (tree_model, &iter, path);
+
+  gtk_tree_path_free (path);
+  if (!ok)
+    return FALSE;
+
+
+  gtk_tree_model_get (tree_model, &iter, DICT_TVM_COL_VAR,  &var, -1);
+
+  if ( ! var_has_label (var))
+    return FALSE;
+
+  gtk_tooltip_set_text (tooltip, var_get_name (var));
+
+  return TRUE;
+}
+
    /* Sets up TREEVIEW to display the variables of DICT.
    MODE is the selection mode for TREEVIEW.
    PREDICATE determines which variables should be visible, or NULL if
@@ -219,6 +265,10 @@ attach_dictionary_to_treeview (GtkTreeView *treeview, PsppireDict *dict,
   gtk_tree_view_append_column (treeview, col);
 
   gtk_tree_selection_set_mode (selection, mode);
+
+  g_object_set (treeview, "has-tooltip", TRUE, NULL);
+
+  g_signal_connect (treeview, "query-tooltip", G_CALLBACK (set_tooltip_for_variable), NULL);
 }