empathy r1942 - in trunk: . libempathy-gtk python/pyempathygtk src



Author: xclaesse
Date: Mon Dec  1 21:01:54 2008
New Revision: 1942
URL: http://svn.gnome.org/viewvc/empathy?rev=1942&view=rev

Log:
Use GTK+ 2.14.0 and gtk_show_uri (Cosimo Cecchi).

Modified:
   trunk/configure.ac
   trunk/libempathy-gtk/empathy-chat-view.c
   trunk/libempathy-gtk/empathy-ui-utils.c
   trunk/libempathy-gtk/empathy-ui-utils.h
   trunk/python/pyempathygtk/pyempathygtk.defs
   trunk/src/empathy-about-dialog.c
   trunk/src/empathy-accounts-dialog.c
   trunk/src/empathy-chat-window.c
   trunk/src/empathy-ft-manager.c
   trunk/src/empathy-main-window.c

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Mon Dec  1 21:01:54 2008
@@ -26,7 +26,7 @@
 
 # Minimal version required
 GLIB_REQUIRED=2.16.0
-GTK_REQUIRED=2.12.0
+GTK_REQUIRED=2.14.0
 GCONF_REQUIRED=1.2.0
 LIBGLADE_REQUIRED=2.0.0
 LIBPANELAPPLET_REQUIRED=2.10.0

Modified: trunk/libempathy-gtk/empathy-chat-view.c
==============================================================================
--- trunk/libempathy-gtk/empathy-chat-view.c	(original)
+++ trunk/libempathy-gtk/empathy-chat-view.c	Mon Dec  1 21:01:54 2008
@@ -113,7 +113,7 @@
 						      GObject                  *object,
 						      GdkEvent                 *event,
 						      GtkTextIter              *iter,
-						      GtkTextBuffer            *buffer);
+						      EmpathyChatView          *view);
 static void     chat_view_open_address_cb            (GtkMenuItem              *menuitem,
 						      const gchar              *url);
 static void     chat_view_copy_address_cb            (GtkMenuItem              *menuitem,
@@ -289,7 +289,7 @@
 	g_signal_connect (tag,
 			  "event",
 			  G_CALLBACK (chat_view_url_event_cb),
-			  priv->buffer);
+			  view);
 
 	g_signal_connect (view,
 			  "motion-notify-event",
@@ -497,17 +497,20 @@
 }
 
 static gboolean
-chat_view_url_event_cb (GtkTextTag    *tag,
-			GObject       *object,
-			GdkEvent      *event,
-			GtkTextIter   *iter,
-			GtkTextBuffer *buffer)
+chat_view_url_event_cb (GtkTextTag      *tag,
+			GObject         *object,
+			GdkEvent        *event,
+			GtkTextIter     *iter,
+			EmpathyChatView *view)
 {
-	GtkTextIter  start, end;
-	gchar       *str;
+	GtkTextIter          start, end;
+	gchar               *str;
+	EmpathyChatViewPriv *priv;
+
+	priv = GET_PRIV (view);
 
 	/* If the link is being selected, don't do anything. */
-	gtk_text_buffer_get_selection_bounds (buffer, &start, &end);
+	gtk_text_buffer_get_selection_bounds (priv->buffer, &start, &end);
 	if (gtk_text_iter_get_offset (&start) != gtk_text_iter_get_offset (&end)) {
 		return FALSE;
 	}
@@ -517,12 +520,12 @@
 
 		if (gtk_text_iter_backward_to_tag_toggle (&start, tag) &&
 		    gtk_text_iter_forward_to_tag_toggle (&end, tag)) {
-			str = gtk_text_buffer_get_text (buffer,
+			str = gtk_text_buffer_get_text (priv->buffer,
 							&start,
 							&end,
 							FALSE);
 
-			empathy_url_show (str);
+			empathy_url_show (GTK_WIDGET (view), str);
 			g_free (str);
 		}
 	}
@@ -533,7 +536,7 @@
 static void
 chat_view_open_address_cb (GtkMenuItem *menuitem, const gchar *url)
 {
-	empathy_url_show (url);
+	empathy_url_show (GTK_WIDGET (menuitem), url);
 }
 
 static void

Modified: trunk/libempathy-gtk/empathy-ui-utils.c
==============================================================================
--- trunk/libempathy-gtk/empathy-ui-utils.c	(original)
+++ trunk/libempathy-gtk/empathy-ui-utils.c	Mon Dec  1 21:01:54 2008
@@ -1332,7 +1332,8 @@
 }
 
 void
-empathy_url_show (const char *url)
+empathy_url_show (GtkWidget *parent,
+		  const char *url)
 {
 	gchar  *real_url;
 	GError *error = NULL;
@@ -1342,10 +1343,9 @@
 		url = real_url;
 	}
 
-	/* FIXME: this does not work for multihead, we should use
-	 * GdkAppLaunchContext or gtk_show_url, see bug #514396.
-	 */
-	g_app_info_launch_default_for_uri (url, NULL, &error);
+	gtk_show_uri (gtk_widget_get_screen (parent), url,
+		      gtk_get_current_event_time (), &error);
+
 	if (error) {
 		GtkWidget *dialog;
 
@@ -1371,7 +1371,7 @@
 		  const gchar *link,
 		  gpointer user_data)
 {
-	empathy_url_show (link);
+	empathy_url_show (GTK_WIDGET (button), link);
 }
 
 GtkWidget *

Modified: trunk/libempathy-gtk/empathy-ui-utils.h
==============================================================================
--- trunk/libempathy-gtk/empathy-ui-utils.h	(original)
+++ trunk/libempathy-gtk/empathy-ui-utils.h	Mon Dec  1 21:01:54 2008
@@ -102,7 +102,8 @@
 void        empathy_window_iconify                      (GtkWindow        *window,
 							 GtkStatusIcon    *status_icon);
 GtkWindow * empathy_get_toplevel_window                 (GtkWidget        *widget);
-void        empathy_url_show                            (const char       *url);
+void        empathy_url_show                            (GtkWidget        *parent,
+							 const char       *url);
 void        empathy_toggle_button_set_state_quietly     (GtkWidget        *widget,
 							 GCallback         callback,
 							 gpointer          user_data,

Modified: trunk/python/pyempathygtk/pyempathygtk.defs
==============================================================================
--- trunk/python/pyempathygtk/pyempathygtk.defs	(original)
+++ trunk/python/pyempathygtk/pyempathygtk.defs	Mon Dec  1 21:01:54 2008
@@ -1812,6 +1812,7 @@
   (c-name "empathy_url_show")
   (return-type "none")
   (parameters
+    '("GtkWidget*" "parent")
     '("const-char*" "url")
   )
 )

Modified: trunk/src/empathy-about-dialog.c
==============================================================================
--- trunk/src/empathy-about-dialog.c	(original)
+++ trunk/src/empathy-about-dialog.c	Mon Dec  1 21:01:54 2008
@@ -99,7 +99,7 @@
 			       const gchar    *link,
 			       gpointer        data)
 {
-	empathy_url_show (link);
+	empathy_url_show (GTK_WIDGET (about), link);
 }
 
 void

Modified: trunk/src/empathy-accounts-dialog.c
==============================================================================
--- trunk/src/empathy-accounts-dialog.c	(original)
+++ trunk/src/empathy-accounts-dialog.c	Mon Dec  1 21:01:54 2008
@@ -951,7 +951,7 @@
 accounts_dialog_button_help_clicked_cb (GtkWidget             *button,
 					EmpathyAccountsDialog *dialog)
 {
-	empathy_url_show ("ghelp:empathy?empathy-create-account");
+	empathy_url_show (button, "ghelp:empathy?empathy-create-account");
 }
 
 static void

Modified: trunk/src/empathy-chat-window.c
==============================================================================
--- trunk/src/empathy-chat-window.c	(original)
+++ trunk/src/empathy-chat-window.c	Mon Dec  1 21:01:54 2008
@@ -775,7 +775,7 @@
 chat_window_help_contents_cb (GtkWidget         *menuitem,
 			      EmpathyChatWindow *window)
 {
-	empathy_url_show ("ghelp:empathy?chat");
+	empathy_url_show (menuitem, "ghelp:empathy?chat");
 }
 
 static void

Modified: trunk/src/empathy-ft-manager.c
==============================================================================
--- trunk/src/empathy-ft-manager.c	(original)
+++ trunk/src/empathy-ft-manager.c	Mon Dec  1 21:01:54 2008
@@ -556,7 +556,7 @@
 
   uri = g_object_get_data (G_OBJECT (tp_file), "uri");
   DEBUG ("Opening URI: %s", uri);
-  empathy_url_show (uri);
+  empathy_url_show (GTK_WIDGET (ft_manager->priv->window), uri);
   g_object_unref (tp_file);
 }
 

Modified: trunk/src/empathy-main-window.c
==============================================================================
--- trunk/src/empathy-main-window.c	(original)
+++ trunk/src/empathy-main-window.c	Mon Dec  1 21:01:54 2008
@@ -924,7 +924,7 @@
 main_window_help_contents_cb (GtkWidget         *widget,
 			      EmpathyMainWindow *window)
 {
-	empathy_url_show ("ghelp:empathy");
+	empathy_url_show (widget, "ghelp:empathy");
 }
 
 static gboolean



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