Commit cfaa3103 authored by Jehan's avatar Jehan

app: output proper info message while fonts are loading.

To this effect, I add a variable to differentiate the "no-fonts on the
system" case from "fonts still loading".
parent 2484dec7
......@@ -95,6 +95,7 @@ struct _Gimp
GimpContainer *named_buffers;
GimpContainer *fonts;
gboolean fonts_loading;
GimpDataFactory *brush_factory;
GimpDataFactory *dynamics_factory;
......
......@@ -111,11 +111,14 @@ gimp_fonts_load_async (GimpAsync *async,
}
static void
gimp_fonts_load_async_callback (GimpAsync *async,
GimpFontList *fonts)
gimp_fonts_load_async_callback (GimpAsync *async,
Gimp *gimp)
{
if (gimp_async_is_finished (async))
gimp_font_list_restore (fonts);
{
gimp_font_list_restore (GIMP_FONT_LIST (gimp->fonts));
gimp->fonts_loading = FALSE;
}
}
void
......@@ -155,6 +158,7 @@ gimp_fonts_load (Gimp *gimp,
gimp_fonts_add_directories (gimp, config, path, error);
g_list_free_full (path, (GDestroyNotify) g_object_unref);
gimp->fonts_loading = TRUE;
/* We perform font cache initialization in a separate thread, so
* in the case a cache rebuild is to be done it will not block
* the UI.
......@@ -163,7 +167,7 @@ gimp_fonts_load (Gimp *gimp,
config);
gimp_async_add_callback (async,
(GimpAsyncCallback) gimp_fonts_load_async_callback,
gimp->fonts);
gimp);
g_object_unref (async);
cleanup:
......
......@@ -628,7 +628,14 @@ gimp_text_layer_render (GimpTextLayer *layer)
item = GIMP_ITEM (layer);
image = gimp_item_get_image (item);
if (gimp_container_is_empty (image->gimp->fonts))
if (image->gimp->fonts_loading)
{
gimp_message_literal (image->gimp, NULL, GIMP_MESSAGE_ERROR,
_("Fonts are still loading (this may take a while), "
"text functionality is not available yet."));
return FALSE;
}
else if (gimp_container_is_empty (image->gimp->fonts))
{
gimp_message_literal (image->gimp, NULL, GIMP_MESSAGE_ERROR,
_("Due to lack of any fonts, "
......
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