コード例 #1
0
static void
nautilus_file_management_properties_dialog_setup_icon_caption_page (GladeXML *xml_dialog)
{
	GList *columns;
	int i;
	gboolean writable;
	
	writable = eel_preferences_key_is_writable (NAUTILUS_PREFERENCES_ICON_VIEW_CAPTIONS);

	columns = nautilus_get_all_columns ();
	
	for (i = 0; icon_captions_components[i] != NULL; i++) {
		GtkWidget *combo_box;
		
		combo_box = glade_xml_get_widget (xml_dialog, 
						    icon_captions_components[i]);

		create_icon_caption_combo_box_items (GTK_COMBO_BOX (combo_box), columns);
		gtk_widget_set_sensitive (combo_box, writable);

		g_signal_connect (combo_box, "changed", 
				  G_CALLBACK (icon_captions_changed_callback),
				  xml_dialog);
	}

	nautilus_column_list_free (columns);

	update_icon_captions_from_gconf (xml_dialog);
}
コード例 #2
0
static void
nautilus_file_management_properties_dialog_setup_icon_caption_page (GtkBuilder *builder)
{
	GList *columns;
	int i;
	gboolean writable;

	writable = g_settings_is_writable (nautilus_icon_view_preferences,
					   NAUTILUS_PREFERENCES_ICON_VIEW_CAPTIONS);

	columns = nautilus_get_common_columns ();

	for (i = 0; icon_captions_components[i] != NULL; i++) {
		GtkWidget *combo_box;

		combo_box = GTK_WIDGET (gtk_builder_get_object (builder,
								icon_captions_components[i]));

		create_icon_caption_combo_box_items (GTK_COMBO_BOX_TEXT (combo_box), columns);
		gtk_widget_set_sensitive (combo_box, writable);

		g_signal_connect (combo_box, "changed",
				  G_CALLBACK (icon_captions_changed_callback),
				  builder);
	}

	nautilus_column_list_free (columns);

	update_icon_captions_from_settings (builder);
}
コード例 #3
0
static void
set_column_order (NautilusColumnChooser *chooser,
		  char **column_order)

{
	GList *columns;
	GList *l;
	GtkTreePath *path;

	columns = nautilus_get_columns_for_file (chooser->details->file);	
	columns = nautilus_sort_columns (columns, column_order);

	g_signal_handlers_block_by_func (chooser->details->store,
					 G_CALLBACK (row_deleted_callback), 
					 chooser);

	path = gtk_tree_path_new_first ();
	for (l = columns; l != NULL; l = l->next) {
		GtkTreeIter iter;
		
		if (get_column_iter (chooser, NAUTILUS_COLUMN (l->data), &iter)) {
			GtkTreeIter before;
			if (path) {
				gtk_tree_model_get_iter (GTK_TREE_MODEL (chooser->details->store),
							 &before, path);
				gtk_list_store_move_after (chooser->details->store,
							   &iter, &before);
				gtk_tree_path_next (path);
				
			} else {		
				gtk_list_store_move_after (chooser->details->store,
							   &iter, NULL);
			}
		}
	}
	gtk_tree_path_free (path);
	g_signal_handlers_unblock_by_func (chooser->details->store, 
					   G_CALLBACK (row_deleted_callback), 
					   chooser);
	
	nautilus_column_list_free (columns);
}
コード例 #4
0
static void
populate_tree (NautilusColumnChooser *chooser)
{
	GList *columns;
	GList *l;

	columns = nautilus_get_columns_for_file (chooser->details->file);

	for (l = columns; l != NULL; l = l->next) {
		GtkTreeIter iter;
		NautilusColumn *column;
		char *name;
		char *label;
		gboolean visible = FALSE;
		gboolean sensitive = TRUE;

		column = NAUTILUS_COLUMN (l->data);

		g_object_get (G_OBJECT (column),
			      "name", &name, "label", &label,
			      NULL);

		if (strcmp (name, "name") == 0) {
			visible = TRUE;
			sensitive = FALSE;
		}

		gtk_list_store_append (chooser->details->store, &iter);
		gtk_list_store_set (chooser->details->store, &iter,
				    COLUMN_VISIBLE, visible,
				    COLUMN_LABEL, label,
				    COLUMN_NAME, name,
				    COLUMN_SENSITIVE, sensitive,
				    -1);

		g_free (name);
		g_free (label);
	}

	nautilus_column_list_free (columns);
}