|
Lines 108-113
static void document_tile_class_init (DocumentTileClass *this_class)
Link Here
|
| 108 |
g_type_class_add_private (this_class, sizeof (DocumentTilePrivate)); |
108 |
g_type_class_add_private (this_class, sizeof (DocumentTilePrivate)); |
| 109 |
} |
109 |
} |
| 110 |
|
110 |
|
|
|
111 |
static void |
| 112 |
show_cb (GtkWidget *widget, gpointer data) |
| 113 |
{ |
| 114 |
DocumentTile *tile; |
| 115 |
|
| 116 |
tile = DOCUMENT_TILE (widget); |
| 117 |
|
| 118 |
printf ("Tile for %s shown\n", TILE (tile)->uri); |
| 119 |
} |
| 120 |
|
| 111 |
GtkWidget * |
121 |
GtkWidget * |
| 112 |
document_tile_new (const gchar *in_uri, const gchar *mime_type, time_t modified) |
122 |
document_tile_new (const gchar *in_uri, const gchar *mime_type, time_t modified) |
| 113 |
{ |
123 |
{ |
|
Lines 164-169
document_tile_new (const gchar *in_uri, const gchar *mime_type, time_t modified)
Link Here
|
| 164 |
"nameplate-header", header, "nameplate-subheader", subheader, |
174 |
"nameplate-header", header, "nameplate-subheader", subheader, |
| 165 |
"nameplate-tooltip", tooltip_text, "context-menu", context_menu, NULL); |
175 |
"nameplate-tooltip", tooltip_text, "context-menu", context_menu, NULL); |
| 166 |
|
176 |
|
|
|
177 |
g_signal_connect (this, "show", |
| 178 |
G_CALLBACK (show_cb), NULL); |
| 179 |
|
| 167 |
g_free (uri); |
180 |
g_free (uri); |
| 168 |
if (tooltip_text) |
181 |
if (tooltip_text) |
| 169 |
g_free (tooltip_text); |
182 |
g_free (tooltip_text); |
|
Lines 415-420
load_image (DocumentTile *tile)
Link Here
|
| 415 |
|
428 |
|
| 416 |
gchar *icon_id = NULL; |
429 |
gchar *icon_id = NULL; |
| 417 |
gboolean free_icon_id = TRUE; |
430 |
gboolean free_icon_id = TRUE; |
|
|
431 |
const char *uri; |
| 418 |
|
432 |
|
| 419 |
if (! priv->mime_type || ! strstr (TILE (tile)->uri, "file://")) { |
433 |
if (! priv->mime_type || ! strstr (TILE (tile)->uri, "file://")) { |
| 420 |
icon_id = "gnome-fs-regular"; |
434 |
icon_id = "gnome-fs-regular"; |
|
Lines 426-431
load_image (DocumentTile *tile)
Link Here
|
| 426 |
if (! thumbnail_factory) |
440 |
if (! thumbnail_factory) |
| 427 |
thumbnail_factory = gnome_thumbnail_factory_new (GNOME_THUMBNAIL_SIZE_NORMAL); |
441 |
thumbnail_factory = gnome_thumbnail_factory_new (GNOME_THUMBNAIL_SIZE_NORMAL); |
| 428 |
|
442 |
|
|
|
443 |
uri = TILE (tile)->uri; |
| 444 |
|
| 429 |
thumb_path = gnome_thumbnail_factory_lookup (thumbnail_factory, TILE (tile)->uri, priv->modified); |
445 |
thumb_path = gnome_thumbnail_factory_lookup (thumbnail_factory, TILE (tile)->uri, priv->modified); |
| 430 |
|
446 |
|
| 431 |
if (!thumb_path) { |
447 |
if (!thumb_path) { |
|
Lines 433-438
load_image (DocumentTile *tile)
Link Here
|
| 433 |
gnome_thumbnail_factory_can_thumbnail ( |
449 |
gnome_thumbnail_factory_can_thumbnail ( |
| 434 |
thumbnail_factory, TILE (tile)->uri, priv->mime_type, priv->modified) |
450 |
thumbnail_factory, TILE (tile)->uri, priv->mime_type, priv->modified) |
| 435 |
) { |
451 |
) { |
|
|
452 |
printf ("THUMBNAILING %s\n", uri); |
| 436 |
thumb = gnome_thumbnail_factory_generate_thumbnail ( |
453 |
thumb = gnome_thumbnail_factory_generate_thumbnail ( |
| 437 |
thumbnail_factory, TILE (tile)->uri, priv->mime_type); |
454 |
thumbnail_factory, TILE (tile)->uri, priv->mime_type); |
| 438 |
|
455 |
|
|
Lines 460-465
load_image (DocumentTile *tile)
Link Here
|
| 460 |
|
477 |
|
| 461 |
exit: |
478 |
exit: |
| 462 |
|
479 |
|
|
|
480 |
printf ("Loading image thumbnail for %s\n", uri); |
| 463 |
priv->image_is_broken = slab_load_image ( |
481 |
priv->image_is_broken = slab_load_image ( |
| 464 |
GTK_IMAGE (NAMEPLATE_TILE (tile)->image), GTK_ICON_SIZE_DND, icon_id); |
482 |
GTK_IMAGE (NAMEPLATE_TILE (tile)->image), GTK_ICON_SIZE_DND, icon_id); |
| 465 |
|
483 |
|