static void
nautilus_mime_application_chooser_finalize (GObject *object)
{
	NautilusMimeApplicationChooser *chooser;

	chooser = NAUTILUS_MIME_APPLICATION_CHOOSER (object);

	if (chooser->details->refresh_timeout) {
		g_source_remove (chooser->details->refresh_timeout);
	}

	g_signal_handlers_disconnect_by_func (nautilus_signaller_get_current (),
					      G_CALLBACK (mime_type_data_changed_cb),
					      chooser);
	
	
	g_free (chooser->details->uri);
	g_free (chooser->details->content_type);
	g_free (chooser->details->extension);
	g_free (chooser->details->type_description);
	g_free (chooser->details->orig_mime_type);
	
	g_free (chooser->details);

	G_OBJECT_CLASS (parent_class)->finalize (object);
}
Exemplo n.º 2
0
static void
menu_provider_items_updated_handler (NautilusMenuProvider *provider, GtkWidget* parent_window, gpointer data)
{

	g_signal_emit_by_name (nautilus_signaller_get_current (),
			       "popup-menu-changed");
}
static void
remove_clicked_cb (GtkMenuItem *item, 
		   gpointer user_data)
{
	NautilusMimeApplicationChooser *chooser = user_data;
	GError *error;
	GAppInfo *info;

	info = gtk_app_chooser_get_app_info (GTK_APP_CHOOSER (chooser->details->open_with_widget));

	if (info) {
		error = NULL;
		if (!g_app_info_remove_supports_type (info,
						      chooser->details->content_type,
						      &error)) {
			eel_show_error_dialog (_("Could not forget association"),
					       error->message,
					       GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (chooser))));
			g_error_free (error);
			
		}

		gtk_app_chooser_refresh (GTK_APP_CHOOSER (chooser->details->open_with_widget));
		g_object_unref (info);
	}

	g_signal_emit_by_name (nautilus_signaller_get_current (), "mime-data-changed");
}
static void
add_clicked_cb (GtkButton *button,
		gpointer user_data)
{
	NautilusMimeApplicationChooser *chooser = user_data;
	GAppInfo *info;
	gchar *message;
	GError *error = NULL;

	info = gtk_app_chooser_get_app_info (GTK_APP_CHOOSER (chooser->details->open_with_widget));

	if (info == NULL)
		return;

	g_app_info_set_as_last_used_for_type (info, chooser->details->content_type, &error);

	if (error != NULL) {
		message = g_strdup_printf (_("Error while adding “%s”: %s"),
					   g_app_info_get_display_name (info), error->message);
		eel_show_error_dialog (_("Could not add application"),
				       message,
				       GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (chooser))));
		g_error_free (error);
		g_free (message);
	} else {		
		gtk_app_chooser_refresh (GTK_APP_CHOOSER (chooser->details->open_with_widget));
		g_signal_emit_by_name (nautilus_signaller_get_current (), "mime-data-changed");
	}

	g_object_unref (info);
}
Exemplo n.º 5
0
static gboolean
emit_user_dirs_changed_idle (gpointer data)
{
    g_signal_emit_by_name (nautilus_signaller_get_current (),
                           "user_dirs_changed");
    user_dirs_changed_tag = 0;
    return FALSE;
}
/**
 * nautilus_navigation_window_initialize_go_menu
 * 
 * Wire up signals so we'll be notified when history list changes.
 */
static void 
nautilus_navigation_window_initialize_go_menu (NautilusNavigationWindow *window)
{
	/* Recreate bookmarks part of menu if history list changes
	 */
	g_signal_connect_object (nautilus_signaller_get_current (), "history_list_changed",
				 G_CALLBACK (schedule_refresh_go_menu), window, G_CONNECT_SWAPPED);
}
static void
reset_clicked_cb (GtkButton *button,
                  gpointer   user_data)
{
	NautilusMimeApplicationChooser *chooser;
	
	chooser = NAUTILUS_MIME_APPLICATION_CHOOSER (user_data);

	g_app_info_reset_type_associations (chooser->details->content_type);
	gtk_app_chooser_refresh (GTK_APP_CHOOSER (chooser->details->open_with_widget));

	g_signal_emit_by_name (nautilus_signaller_get_current (), "mime-data-changed");
}
static void
nautilus_emblem_sidebar_init (NautilusEmblemSidebar *emblem_sidebar)
{
	GtkWidget *widget;
	
	emblem_sidebar->details = g_new0 (NautilusEmblemSidebarDetails, 1);

	emblem_sidebar->details->client = gconf_client_get_default ();

	create_popup_menu (emblem_sidebar);

	widget = nautilus_emblem_sidebar_create_container (emblem_sidebar);
	nautilus_emblem_sidebar_populate (emblem_sidebar);

	g_signal_connect_object (nautilus_signaller_get_current (),
				 "emblems_changed",
				 G_CALLBACK (emblems_changed_callback), emblem_sidebar, 0);
	
	gtk_box_pack_start (GTK_BOX (emblem_sidebar), widget,
			    TRUE, TRUE, 0);
}
static void
send_emblems_changed (void)
{
	g_signal_emit_by_name (nautilus_signaller_get_current (),
			       "emblems_changed");
}