]> git.0d.be Git - empathy.git/commitdiff
Use GTK+ 2.14.0 and gtk_show_uri (Cosimo Cecchi).
authorXavier Claessens <xclaesse@src.gnome.org>
Mon, 1 Dec 2008 21:01:54 +0000 (21:01 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Mon, 1 Dec 2008 21:01:54 +0000 (21:01 +0000)
svn path=/trunk/; revision=1942

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

index 041e5a48cd12a2ce56da07124def7eabd218cc2f..a56937ca48925d19441fa167db1964966a3238d3 100644 (file)
@@ -26,7 +26,7 @@ AC_SUBST(LIBEMPATHY_GTK_REVISION)
 
 # Minimal version required
 GLIB_REQUIRED=2.16.0
 
 # 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
 GCONF_REQUIRED=1.2.0
 LIBGLADE_REQUIRED=2.0.0
 LIBPANELAPPLET_REQUIRED=2.10.0
index 2131cecb47ce4f430badb6eeca24e0d8683f13e1..367b6308d86ebf3f4f24f1e669fd685c041737f4 100644 (file)
@@ -113,7 +113,7 @@ static gboolean chat_view_url_event_cb               (GtkTextTag               *
                                                      GObject                  *object,
                                                      GdkEvent                 *event,
                                                      GtkTextIter              *iter,
                                                      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,
 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 @@ chat_view_setup_tags (EmpathyChatView *view)
        g_signal_connect (tag,
                          "event",
                          G_CALLBACK (chat_view_url_event_cb),
        g_signal_connect (tag,
                          "event",
                          G_CALLBACK (chat_view_url_event_cb),
-                         priv->buffer);
+                         view);
 
        g_signal_connect (view,
                          "motion-notify-event",
 
        g_signal_connect (view,
                          "motion-notify-event",
@@ -497,17 +497,20 @@ chat_view_event_cb (EmpathyChatView *view,
 }
 
 static gboolean
 }
 
 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. */
 
        /* 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;
        }
        if (gtk_text_iter_get_offset (&start) != gtk_text_iter_get_offset (&end)) {
                return FALSE;
        }
@@ -517,12 +520,12 @@ chat_view_url_event_cb (GtkTextTag    *tag,
 
                if (gtk_text_iter_backward_to_tag_toggle (&start, tag) &&
                    gtk_text_iter_forward_to_tag_toggle (&end, tag)) {
 
                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);
 
                                                        &start,
                                                        &end,
                                                        FALSE);
 
-                       empathy_url_show (str);
+                       empathy_url_show (GTK_WIDGET (view), str);
                        g_free (str);
                }
        }
                        g_free (str);
                }
        }
@@ -533,7 +536,7 @@ chat_view_url_event_cb (GtkTextTag    *tag,
 static void
 chat_view_open_address_cb (GtkMenuItem *menuitem, const gchar *url)
 {
 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
 }
 
 static void
index 91783d7ce71e6b9e4507f7773678a458c2acd32f..cd5cf0766a29fc7b138c8b9a94ac1f3a254fce2b 100644 (file)
@@ -1332,7 +1332,8 @@ fixup_url (const gchar *url)
 }
 
 void
 }
 
 void
-empathy_url_show (const char *url)
+empathy_url_show (GtkWidget *parent,
+                 const char *url)
 {
        gchar  *real_url;
        GError *error = NULL;
 {
        gchar  *real_url;
        GError *error = NULL;
@@ -1342,10 +1343,9 @@ empathy_url_show (const char *url)
                url = real_url;
        }
 
                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;
 
        if (error) {
                GtkWidget *dialog;
 
@@ -1371,7 +1371,7 @@ link_button_hook (GtkLinkButton *button,
                  const gchar *link,
                  gpointer user_data)
 {
                  const gchar *link,
                  gpointer user_data)
 {
-       empathy_url_show (link);
+       empathy_url_show (GTK_WIDGET (button), link);
 }
 
 GtkWidget *
 }
 
 GtkWidget *
index 9326150276016e072d46b1ef361e5072fe47c7a1..4a6efc6d03e032ad30b9a1145c7ddb0efbdc854a 100644 (file)
@@ -102,7 +102,8 @@ void        empathy_window_present                      (GtkWindow        *windo
 void        empathy_window_iconify                      (GtkWindow        *window,
                                                         GtkStatusIcon    *status_icon);
 GtkWindow * empathy_get_toplevel_window                 (GtkWidget        *widget);
 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,
 void        empathy_toggle_button_set_state_quietly     (GtkWidget        *widget,
                                                         GCallback         callback,
                                                         gpointer          user_data,
index e4044668f11697ce25c80132a0ea15c7a977f9e7..69a17d37a504d6ba7ea080a5d7ca97dc573a3678 100644 (file)
   (c-name "empathy_url_show")
   (return-type "none")
   (parameters
   (c-name "empathy_url_show")
   (return-type "none")
   (parameters
+    '("GtkWidget*" "parent")
     '("const-char*" "url")
   )
 )
     '("const-char*" "url")
   )
 )
index 14d292585346a5bb63503c9892dbe675deb58cbd..4765e6b32b66dd629662653802067c2fb82af68d 100644 (file)
@@ -99,7 +99,7 @@ about_dialog_activate_link_cb (GtkAboutDialog *about,
                               const gchar    *link,
                               gpointer        data)
 {
                               const gchar    *link,
                               gpointer        data)
 {
-       empathy_url_show (link);
+       empathy_url_show (GTK_WIDGET (about), link);
 }
 
 void
 }
 
 void
index 0cca7035f5a7d7c63b919d2bb5557678a088c310..72967cbdadb779f48d72b7030432bce1b214ddbc 100644 (file)
@@ -951,7 +951,7 @@ static void
 accounts_dialog_button_help_clicked_cb (GtkWidget             *button,
                                        EmpathyAccountsDialog *dialog)
 {
 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
 }
 
 static void
index 255c5d679a86c7e89fc5a8d0954eafa16ba45d3b..5a8cb104819178911e910524de028b7a8c2d2c41 100644 (file)
@@ -775,7 +775,7 @@ static void
 chat_window_help_contents_cb (GtkWidget         *menuitem,
                              EmpathyChatWindow *window)
 {
 chat_window_help_contents_cb (GtkWidget         *menuitem,
                              EmpathyChatWindow *window)
 {
-       empathy_url_show ("ghelp:empathy?chat");
+       empathy_url_show (menuitem, "ghelp:empathy?chat");
 }
 
 static void
 }
 
 static void
index 78308b9d0c7a1fd8039d8a840a297408a5726382..a506addec082990c6754a088f604e80e5da10219 100644 (file)
@@ -556,7 +556,7 @@ ft_manager_open (EmpathyFTManager *ft_manager)
 
   uri = g_object_get_data (G_OBJECT (tp_file), "uri");
   DEBUG ("Opening URI: %s", uri);
 
   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);
 }
 
   g_object_unref (tp_file);
 }
 
index c5437385ff0c4de8252da7f301436d9dac74ae72..49bfe3d0a3762e757760e9b8b0e2e5082682db2c 100644 (file)
@@ -924,7 +924,7 @@ static void
 main_window_help_contents_cb (GtkWidget         *widget,
                              EmpathyMainWindow *window)
 {
 main_window_help_contents_cb (GtkWidget         *widget,
                              EmpathyMainWindow *window)
 {
-       empathy_url_show ("ghelp:empathy");
+       empathy_url_show (widget, "ghelp:empathy");
 }
 
 static gboolean
 }
 
 static gboolean