Esempio n. 1
0
static void
about_dialog_activate_link_cb (GtkAboutDialog *about,
			       const gchar    *link,
			       gpointer        data)
{
	empathy_url_show (GTK_WIDGET (about), link);
}
Esempio n. 2
0
static void
ft_manager_open (EmpathyFTManager *manager)
{
  GtkTreeSelection *selection;
  GtkTreeIter iter;
  GtkTreeModel *model;
  EmpathyFTHandler *handler;
  EmpathyFTManagerPriv *priv = GET_PRIV (manager);

  selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->treeview));

  if (!gtk_tree_selection_get_selected (selection, &model, &iter))
    return;

  gtk_tree_model_get (model, &iter, COL_FT_OBJECT, &handler, -1);

  if (empathy_ft_handler_is_completed (handler)){
    char *uri;
    GFile *file;

    file = empathy_ft_handler_get_gfile (handler);
    uri = g_file_get_uri (file);

    DEBUG ("Opening URI: %s", uri);
    empathy_url_show (GTK_WIDGET (priv->window), uri);
    g_free (uri);
  }

  g_object_unref (handler);
}
static void
empathy_webkit_open_address_cb (GtkMenuItem *menuitem,
    gpointer     user_data)
{
  WebKitHitTestResult   *hit_test_result = WEBKIT_HIT_TEST_RESULT (user_data);
  gchar                 *uri;

  g_object_get (G_OBJECT (hit_test_result),
      "link-uri", &uri,
      NULL);

  empathy_url_show (GTK_WIDGET (menuitem), uri);

  g_free (uri);
}
static gboolean
chat_text_view_url_event_cb (GtkTextTag          *tag,
			     GObject             *object,
			     GdkEvent            *event,
			     GtkTextIter         *iter,
			     EmpathyChatTextView *view)
{
	EmpathyChatTextViewPriv *priv;
	GtkTextIter              start, end;
	gchar                   *str;

	priv = GET_PRIV (view);

	/* If the link is being selected, don't do anything. */
	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 (event->type == GDK_BUTTON_RELEASE && event->button.button == 1) {
		start = end = *iter;
		
		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 (priv->buffer,
							    &start,
							    &end,
							    FALSE);

			    empathy_url_show (GTK_WIDGET (view), str);
			    g_free (str);
		    }
	}
	
	return FALSE;
}
Esempio n. 5
0
static void
chat_window_help_contents_cb (GtkWidget         *menuitem,
			      EmpathyChatWindow *window)
{
	empathy_url_show ("ghelp:empathy?chat");
}
static void
chat_text_view_open_address_cb (GtkMenuItem *menuitem, const gchar *url)
{
	empathy_url_show (GTK_WIDGET (menuitem), url);
}
Esempio n. 7
0
static void
main_window_help_contents_cb (GtkAction         *action,
			      EmpathyMainWindow *window)
{
	empathy_url_show (window->window, "ghelp:empathy");
}