[git] GPA - branch, master, updated. gpa-0.10.0-5-g70858dc

by Werner Koch cvs at cvs.gnupg.org
Wed Oct 24 09:40:43 CEST 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Assistant".

The branch, master has been updated
       via  70858dcd6062f2e77956b5dd14597d38633bb09a (commit)
      from  493b02e523772c46abf3fa4c288ebe25234e4e68 (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.

- Log -----------------------------------------------------------------
commit 70858dcd6062f2e77956b5dd14597d38633bb09a
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Oct 24 09:40:30 2018 +0200

    Trim tooltips before displaying.
    
    * src/gtktools.c (gpa_add_tooltip): Strip traling LFs.
    * src/confdialog.c (create_dialog_tabs_2): Use gpa_add_tooltip.
    --
    
    GnuPG-bug-id: 4216
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/src/confdialog.c b/src/confdialog.c
index 7f83165..a7c49f0 100644
--- a/src/confdialog.c
+++ b/src/confdialog.c
@@ -1203,7 +1203,7 @@ create_dialog_tabs_2 (gpgme_conf_comp_t old_conf, gpgme_conf_comp_t new_conf)
 		  char *description = xstrdup (option->description);
 
 	          percent_unescape (description, 0);
-		  gtk_widget_set_tooltip_text (vbox, description);
+		  gpa_add_tooltip (vbox, description);
 		  xfree (description);
 		}
 #endif
diff --git a/src/gtktools.c b/src/gtktools.c
index 2116769..fe2ee39 100644
--- a/src/gtktools.c
+++ b/src/gtktools.c
@@ -169,7 +169,23 @@ gpa_add_tooltip (GtkWidget *widget, const char *text)
 {
 #if GTK_CHECK_VERSION (2, 12, 0)
   if (widget && text && *text)
-    gtk_widget_set_tooltip_text (widget, text);
+    {
+      size_t len = strlen (text);
+      if (text[len-1] == '\n')
+        {
+          /* Remove trailing line feeds.  The reason for this may be
+           * that the tooltip text is used for other purposes as
+           * well. */
+          char *buf = g_strdup (text);
+          for ( ;len && buf[len-1] == '\n'; len--)
+            buf[len-1] = 0;
+          if (*buf)
+            gtk_widget_set_tooltip_text (widget, buf);
+          g_free (buf);
+        }
+      else
+        gtk_widget_set_tooltip_text (widget, text);
+    }
 #endif
 }
 

-----------------------------------------------------------------------

Summary of changes:
 src/confdialog.c |  2 +-
 src/gtktools.c   | 18 +++++++++++++++++-
 2 files changed, 18 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
The GNU Privacy Assistant
http://git.gnupg.org




More information about the Gnupg-commits mailing list