Commit 10583dfe authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

app/core/gimpimagefile.c enable explicit (not automatic while browsing the

2005-02-09  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpimagefile.c
	* app/widgets/gimpthumbbox.c: enable explicit (not automatic while
	browsing the list of files) thumbnailing of remote files
parent ebb343fa
2005-02-09 Michael Natterer <mitch@gimp.org>
* app/core/gimpimagefile.c
* app/widgets/gimpthumbbox.c: enable explicit (not automatic while
browsing the list of files) thumbnailing of remote files
2005-02-08 Sven Neumann <sven@gimp.org>
* app/app_procs.[ch]
......
......@@ -243,7 +243,8 @@ gimp_imagefile_create_thumbnail (GimpImagefile *imagefile,
gint size,
gboolean replace)
{
GimpThumbnail *thumbnail;
GimpThumbnail *thumbnail;
GimpThumbState image_state;
g_return_if_fail (GIMP_IS_IMAGEFILE (imagefile));
g_return_if_fail (GIMP_IS_CONTEXT (context));
......@@ -260,7 +261,10 @@ gimp_imagefile_create_thumbnail (GimpImagefile *imagefile,
gimp_thumbnail_set_uri (thumbnail,
gimp_object_get_name (GIMP_OBJECT (imagefile)));
if (gimp_thumbnail_peek_image (thumbnail) >= GIMP_THUMB_STATE_EXISTS)
image_state = gimp_thumbnail_peek_image (thumbnail);
if (image_state == GIMP_THUMB_STATE_REMOTE ||
image_state >= GIMP_THUMB_STATE_EXISTS)
{
GimpImage *image;
gboolean success;
......@@ -279,7 +283,6 @@ gimp_imagefile_create_thumbnail (GimpImagefile *imagefile,
{
gimp_thumbnail_set_info (imagefile->thumbnail,
mime_type, width, height);
}
else
{
......@@ -564,11 +567,6 @@ gimp_imagefile_get_desc_string (GimpImagefile *imagefile)
imagefile->static_desc = TRUE;
break;
case GIMP_THUMB_STATE_REMOTE:
imagefile->description = _("Remote File");
imagefile->static_desc = TRUE;
break;
case GIMP_THUMB_STATE_FOLDER:
imagefile->description = _("Folder");
imagefile->static_desc = TRUE;
......@@ -589,6 +587,12 @@ gimp_imagefile_get_desc_string (GimpImagefile *imagefile)
{
GString *str = g_string_new (NULL);
if (thumbnail->image_state == GIMP_THUMB_STATE_REMOTE)
{
g_string_append (str, _("Remote File"));
g_string_append_c (str, '\n');
}
if (thumbnail->image_filesize > 0)
{
gchar *size = gimp_memsize_to_string (thumbnail->image_filesize);
......@@ -619,6 +623,12 @@ gimp_imagefile_get_desc_string (GimpImagefile *imagefile)
case GIMP_THUMB_STATE_OK:
{
if (thumbnail->image_state == GIMP_THUMB_STATE_REMOTE)
{
g_string_append (str, _("(Preview may be out of date)"));
g_string_append_c (str, '\n');
}
if (thumbnail->image_width > 0 && thumbnail->image_height > 0)
{
g_string_append_printf (str, _("%d x %d pixels"),
......
......@@ -676,34 +676,40 @@ gimp_thumb_box_create_thumbnail (GimpThumbBox *box,
GimpThumbnailSize size,
gboolean force)
{
gchar *filename = file_utils_filename_from_uri (uri);
gchar *filename = file_utils_filename_from_uri (uri);
GimpThumbnail *thumb;
gchar *basename;
if (filename && g_file_test (filename, G_FILE_TEST_IS_REGULAR))
if (filename)
{
GimpThumbnail *thumb = box->imagefile->thumbnail;
gchar *basename;
gboolean regular = g_file_test (filename, G_FILE_TEST_IS_REGULAR);
basename = file_utils_uri_to_utf8_basename (uri);
gtk_label_set_text (GTK_LABEL (box->filename), basename);
g_free (basename);
g_free (filename);
gimp_object_set_name (GIMP_OBJECT (box->imagefile), uri);
if (! regular)
return;
}
if (force ||
(gimp_thumbnail_peek_thumb (thumb, size) < GIMP_THUMB_STATE_FAILED &&
! gimp_thumbnail_has_failed (thumb)))
{
Gimp *gimp = box->imagefile->gimp;
thumb = box->imagefile->thumbnail;
gimp_imagefile_create_thumbnail (box->imagefile,
gimp_get_user_context (gimp),
GIMP_PROGRESS (box),
size,
!force);
}
}
basename = file_utils_uri_to_utf8_basename (uri);
gtk_label_set_text (GTK_LABEL (box->filename), basename);
g_free (basename);
gimp_object_set_name (GIMP_OBJECT (box->imagefile), uri);
g_free (filename);
if (force ||
(gimp_thumbnail_peek_thumb (thumb, size) < GIMP_THUMB_STATE_FAILED &&
! gimp_thumbnail_has_failed (thumb)))
{
Gimp *gimp = box->imagefile->gimp;
gimp_imagefile_create_thumbnail (box->imagefile,
gimp_get_user_context (gimp),
GIMP_PROGRESS (box),
size,
!force);
}
}
static gboolean
......
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