Commit cac593f9 authored by John Sullivan's avatar John Sullivan

Checked in to fix silly problem from previous checkin:

	I had left the sense of a check reversed for testing
	purposes, and no permissions would ever appear in the
	Properties window.

	I've also got some new changes that have no visible
	effect yet.

	* libnautilus-extensions/nautilus-icon-factory.h,
	* libnautilus-extensions/nautilus-icon-factory.c:
	(nautilus_icon_factory_get_emblem_icon_by_name):
	New function, gets a single emblem icon.
	(add_emblem): Calls _get_emblem_icon_by_name now.
	* src/file-manager/fm-properties-window.c:
	(create_image_widget_for_emblem), (create_emblems_page):
	Some preliminary work towards making emblem images appear.
	(create_permissions_page): Took out a "!" so permissions
	show up.
parent ef1ff4c9
2000-05-09 John Sullivan <sullivan@eazel.com>
Checked in to fix silly problem from previous checkin:
I had left the sense of a check reversed for testing
purposes, and no permissions would ever appear in the
Properties window.
I've also got some new changes that have no visible
effect yet.
* libnautilus-extensions/nautilus-icon-factory.h,
* libnautilus-extensions/nautilus-icon-factory.c:
(nautilus_icon_factory_get_emblem_icon_by_name):
New function, gets a single emblem icon.
(add_emblem): Calls _get_emblem_icon_by_name now.
* src/file-manager/fm-properties-window.c:
(create_image_widget_for_emblem), (create_emblems_page):
Some preliminary work towards making emblem images appear.
(create_permissions_page): Took out a "!" so permissions
show up.
2000-05-09 J Shane Culpepper <pepper@eazel.com>
* components/services/ ALL
......
......@@ -808,13 +808,26 @@ nautilus_icon_factory_get_icon_for_file (NautilusFile *file, const char* modifie
return scalable_icon;
}
NautilusScalableIcon *
nautilus_icon_factory_get_emblem_icon_by_name (const char *emblem_name)
{
NautilusScalableIcon *scalable_icon;
char *name_with_prefix;
name_with_prefix = g_strconcat (EMBLEM_NAME_PREFIX, emblem_name, NULL);
scalable_icon = nautilus_scalable_icon_get (NULL, name_with_prefix, NULL);
g_free (name_with_prefix);
return scalable_icon;
}
static void
add_emblem (GList **icons, const char *name)
{
char *name_with_prefix;
name_with_prefix = g_strconcat (EMBLEM_NAME_PREFIX, name, NULL);
*icons = g_list_prepend (*icons, nautilus_scalable_icon_get (NULL, name_with_prefix, NULL));
*icons = g_list_prepend (*icons, nautilus_icon_factory_get_emblem_icon_by_name (name));
g_free (name_with_prefix);
}
......
......@@ -95,6 +95,7 @@ guint nautilus_get_icon_size_for_zoom_level (Nautil
NautilusScalableIcon *nautilus_icon_factory_get_icon_for_file (NautilusFile *file,
const char *modifier);
NautilusScalableIcon *nautilus_icon_factory_get_icon_by_name (const char *icon_name);
NautilusScalableIcon *nautilus_icon_factory_get_emblem_icon_by_name (const char *emblem_name);
GList * nautilus_icon_factory_get_emblem_icons_for_file (NautilusFile *file);
/* Render an icon to a particular size.
......
......@@ -808,13 +808,26 @@ nautilus_icon_factory_get_icon_for_file (NautilusFile *file, const char* modifie
return scalable_icon;
}
NautilusScalableIcon *
nautilus_icon_factory_get_emblem_icon_by_name (const char *emblem_name)
{
NautilusScalableIcon *scalable_icon;
char *name_with_prefix;
name_with_prefix = g_strconcat (EMBLEM_NAME_PREFIX, emblem_name, NULL);
scalable_icon = nautilus_scalable_icon_get (NULL, name_with_prefix, NULL);
g_free (name_with_prefix);
return scalable_icon;
}
static void
add_emblem (GList **icons, const char *name)
{
char *name_with_prefix;
name_with_prefix = g_strconcat (EMBLEM_NAME_PREFIX, name, NULL);
*icons = g_list_prepend (*icons, nautilus_scalable_icon_get (NULL, name_with_prefix, NULL));
*icons = g_list_prepend (*icons, nautilus_icon_factory_get_emblem_icon_by_name (name));
g_free (name_with_prefix);
}
......
......@@ -95,6 +95,7 @@ guint nautilus_get_icon_size_for_zoom_level (Nautil
NautilusScalableIcon *nautilus_icon_factory_get_icon_for_file (NautilusFile *file,
const char *modifier);
NautilusScalableIcon *nautilus_icon_factory_get_icon_by_name (const char *icon_name);
NautilusScalableIcon *nautilus_icon_factory_get_emblem_icon_by_name (const char *emblem_name);
GList * nautilus_icon_factory_get_emblem_icons_for_file (NautilusFile *file);
/* Render an icon to a particular size.
......
......@@ -608,11 +608,33 @@ create_basic_page (GtkNotebook *notebook, NautilusFile *file)
_("Date Modified:"), file, "date_modified");
}
static GtkWidget *
create_image_widget_for_emblem (const char *emblem_name) {
NautilusScalableIcon *icon;
GdkPixbuf *pixbuf;
GdkPixmap *pixmap;
GdkBitmap *mask;
icon = nautilus_icon_factory_get_emblem_icon_by_name (emblem_name);
pixbuf = nautilus_icon_factory_get_pixbuf_for_icon (icon,
NAUTILUS_ICON_SIZE_STANDARD,
NAUTILUS_ICON_SIZE_STANDARD,
NAUTILUS_ICON_SIZE_STANDARD,
NAUTILUS_ICON_SIZE_STANDARD,
NULL);
nautilus_scalable_icon_unref (icon);
gdk_pixbuf_render_pixmap_and_mask (pixbuf, &pixmap, &mask, 128);
gdk_pixbuf_unref (pixbuf);
return gtk_pixmap_new (pixmap, mask);
}
static void
create_emblems_page (GtkNotebook *notebook, NautilusFile *file)
{
GtkWidget *emblems_page_vbox, *button;
GtkWidget *check_buttons_box, *left_buttons_box, *right_buttons_box;
GtkWidget *image_widget;
int i;
emblems_page_vbox = gtk_vbox_new (FALSE, 0);
......@@ -638,6 +660,8 @@ create_emblems_page (GtkNotebook *notebook, NautilusFile *file)
/* The check buttons themselves. */
for (i = 0; i < NAUTILUS_N_ELEMENTS (property_names); i++) {
button = gtk_check_button_new_with_label (_(property_names[i]));
image_widget = create_image_widget_for_emblem (property_names[i]);
/* gtk_container_add (GTK_CONTAINER (button), image_widget); */
gtk_widget_show (button);
/* Attach parameters and signal handler. */
......@@ -877,7 +901,7 @@ create_permissions_page (GtkNotebook *notebook, NautilusFile *file)
vbox = create_page_with_vbox (notebook, _("Permissions"));
if (!nautilus_file_can_get_permissions (file)) {
if (nautilus_file_can_get_permissions (file)) {
if (!nautilus_file_can_set_permissions (file)) {
add_prompt_and_separator (
GTK_VBOX (vbox),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment