[xchat-gnome] Bug 586222 - remove libsexy dependency



commit 9bb97b00f3cb4ee895bb2e00941df83a1e3b7e99
Author: Javier Jardón <javierjc1982 gmail com>
Date:   Thu Oct 22 01:24:13 2009 +0530

    Bug 586222 -  remove libsexy dependency
    
    fixes part of the issue.
    To completely remove libsexy , need a SexySpellEntry analog.

 src/fe-gnome/topic-label.c |   26 +++++++++++++++++++++++++-
 1 files changed, 25 insertions(+), 1 deletions(-)
---
diff --git a/src/fe-gnome/topic-label.c b/src/fe-gnome/topic-label.c
index 977d29c..8850bf4 100644
--- a/src/fe-gnome/topic-label.c
+++ b/src/fe-gnome/topic-label.c
@@ -22,7 +22,9 @@
 #include <string.h>
 #include <gtk/gtk.h>
 #include <glade/glade.h>
+#if !GTK_CHECK_VERSION(2,17,1)
 #include <libsexy/sexy-url-label.h>
+#endif
 #include "gui.h"
 #include "util.h"
 #include "text-entry.h"
@@ -84,8 +86,13 @@ topic_label_init (TopicLabel *label)
 
 	priv = label->priv = TOPIC_LABEL_GET_PRIVATE (label);
 	priv->expander = gtk_expander_new (NULL);
+#if GTK_CHECK_VERSION(2,17,1)
+	priv->label = gtk_label_new (NULL);
+	priv->sizing_label = gtk_label_new (NULL);
+#else
 	priv->label = sexy_url_label_new ();
 	priv->sizing_label = sexy_url_label_new ();
+#endif
 	gtk_expander_set_expanded (GTK_EXPANDER (priv->expander), FALSE);
 	gtk_label_set_ellipsize (GTK_LABEL (priv->label), PANGO_ELLIPSIZE_END);
 	gtk_label_set_selectable (GTK_LABEL (priv->label), TRUE);
@@ -100,8 +107,11 @@ topic_label_init (TopicLabel *label)
 	gtk_box_set_spacing (GTK_BOX (label), 6);
 
 	g_signal_connect (G_OBJECT (priv->expander), "activate", G_CALLBACK (topic_label_expand_activate), (gpointer) label);
+#if GTK_CHECK_VERSION(2,17,1)
+	g_signal_connect (G_OBJECT (priv->label), "activate-link", G_CALLBACK (topic_label_url_activated), (gpointer) label);
+#else
 	g_signal_connect (G_OBJECT (priv->label), "url_activated", G_CALLBACK (topic_label_url_activated), (gpointer) label);
-
+#endif
 	priv->topics = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_free);
 }
 
@@ -131,12 +141,21 @@ topic_label_expand_activate (GtkExpander *expander, TopicLabel *label)
 }
 
 static void
+#if GTK_CHECK_VERSION(2,17,1)
+topic_label_url_activated (GtkWidget *url_label, TopicLabel *label)
+#else
 topic_label_url_activated (GtkWidget *url_label, const char *url, TopicLabel *label)
+#endif
 {
 	TopicLabelPriv *priv = label->priv;
 
 	char *command;
+#if GTK_CHECK_VERSION(2,17,1)
+	command = g_strdup_printf ("URL %s",
+				   gtk_label_get_current_uri (GTK_LABEL (url_label)));
+#else
 	command = g_strdup_printf ("URL %s", url);
+#endif
 	handle_command (priv->current, command, 1);
 	g_free (command);
 }
@@ -187,8 +206,13 @@ topic_label_set_current (TopicLabel *label, struct session *sess)
 
 
 	if (topic) {
+#if GTK_CHECK_VERSION(2,17,1)
+		gtk_label_set_markup (GTK_LABEL (priv->label), topic);
+		gtk_label_set_markup (GTK_LABEL (priv->sizing_label, topic);
+#else
 		sexy_url_label_set_markup (SEXY_URL_LABEL (priv->label), topic);
 		sexy_url_label_set_markup (SEXY_URL_LABEL (priv->sizing_label), topic);
+#endif
 	} else {
 		gtk_label_set_text (GTK_LABEL (priv->label), "");
 		gtk_label_set_text (GTK_LABEL (priv->sizing_label), "");



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