diff --git a/ChangeLog b/ChangeLog index 770ae04f7d..5e60da03c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-10-13 Sven Neumann + + * app/widgets/gimphelp.c: improved error messages on missing help + browser plug-in. + + * libgimpthumb/gimpthumb-utils.c + * libgimpthumb/gimpthumbnail.c: improved documentation. + 2004-10-13 Sven Neumann * app/display/gimpdisplayshell-close.c diff --git a/app/widgets/gimphelp.c b/app/widgets/gimphelp.c index 219a84f703..469d1e5d3b 100644 --- a/app/widgets/gimphelp.c +++ b/app/widgets/gimphelp.c @@ -115,8 +115,9 @@ gimp_help_show (Gimp *gimp, static gboolean gimp_idle_help (gpointer data) { - GimpIdleHelp *idle_help = data; - const gchar *procedure = NULL; + GimpIdleHelp *idle_help = data; + GimpGuiConfig *config = GIMP_GUI_CONFIG (idle_help->gimp->config); + const gchar *procedure = NULL; #ifdef GIMP_HELP_DEBUG g_printerr ("Help Domain: %s\n", @@ -125,26 +126,24 @@ gimp_idle_help (gpointer data) idle_help->help_id ? idle_help->help_id : "NULL"); #endif - switch (GIMP_GUI_CONFIG (idle_help->gimp->config)->help_browser) + if (config->help_browser == GIMP_HELP_BROWSER_GIMP) { - case GIMP_HELP_BROWSER_GIMP: if (gimp_help_internal (idle_help->gimp)) - { - procedure = "extension_gimp_help_browser_temp"; - break; - } - - case GIMP_HELP_BROWSER_WEB_BROWSER: - /* FIXME: should check for procedure availability */ - procedure = "plug_in_web_browser"; - break; + procedure = "extension_gimp_help_browser_temp"; } - gimp_help_call (idle_help->gimp, - procedure, - idle_help->help_domain, - idle_help->help_locales, - idle_help->help_id); + if (config->help_browser == GIMP_HELP_BROWSER_WEB_BROWSER) + { + /* FIXME: should check for procedure availability */ + procedure = "plug_in_web_browser"; + } + + if (procedure) + gimp_help_call (idle_help->gimp, + procedure, + idle_help->help_domain, + idle_help->help_locales, + idle_help->help_id); g_free (idle_help->help_domain); g_free (idle_help->help_locales); @@ -172,9 +171,8 @@ gimp_help_internal_not_found_callback (GtkWidget *widget, static gboolean gimp_help_internal (Gimp *gimp) { - ProcRecord *proc_rec; - - static gboolean busy = FALSE; + static gboolean busy = FALSE; + ProcRecord *proc_rec; if (busy) return TRUE; @@ -184,33 +182,31 @@ gimp_help_internal (Gimp *gimp) /* Check if a help browser is already running */ proc_rec = procedural_db_lookup (gimp, "extension_gimp_help_browser_temp"); - if (proc_rec == NULL) + if (! proc_rec) { Argument *args = NULL; proc_rec = procedural_db_lookup (gimp, "extension_gimp_help_browser"); - if (proc_rec == NULL) + if (! proc_rec) { - GtkWidget *not_found = - gimp_query_boolean_box (_("Could not find GIMP Help Browser"), - NULL, NULL, NULL, FALSE, - _("Could not find the GIMP Help Browser " - "procedure. It probably was not compiled " - "because you don't have GtkHtml2 " - "installed."), - _("Use web browser instead"), + GtkWidget *dialog = + gimp_query_boolean_box (_("Help browser not found"), + NULL, NULL, NULL, GIMP_STOCK_WARNING, + _("Could not find GIMP help browser.\n\n" + "The GIMP help browser plug-in appears " + "to be missing from your installation."), + _("Use _web browser instead"), GTK_STOCK_CANCEL, NULL, NULL, gimp_help_internal_not_found_callback, gimp); - gtk_widget_show (not_found); + gtk_widget_show (dialog); gtk_main (); busy = FALSE; - return (GIMP_GUI_CONFIG (gimp->config)->help_browser - != GIMP_HELP_BROWSER_WEB_BROWSER); + return FALSE; } args = g_new (Argument, 1); @@ -227,24 +223,24 @@ gimp_help_internal (Gimp *gimp) /* Check if the help browser started properly */ proc_rec = procedural_db_lookup (gimp, "extension_gimp_help_browser_temp"); - if (proc_rec == NULL) + if (! proc_rec) { - GtkWidget *not_found = - gimp_query_boolean_box (_("Could not start GIMP Help Browser"), - NULL, NULL, NULL, FALSE, - _("Could not start the GIMP Help Browser."), + GtkWidget *dialog = + gimp_query_boolean_box (_("Help browser doesn't start"), + NULL, NULL, NULL, GIMP_STOCK_WARNING, + _("Could not start the GIMP help browser " + "plug-in."), _("Use web browser instead"), GTK_STOCK_CANCEL, NULL, NULL, gimp_help_internal_not_found_callback, gimp); - gtk_widget_show (not_found); + gtk_widget_show (dialog); gtk_main (); busy = FALSE; - return (GIMP_GUI_CONFIG (gimp->config)->help_browser - != GIMP_HELP_BROWSER_WEB_BROWSER); + return FALSE; } busy = FALSE; @@ -264,7 +260,7 @@ gimp_help_call (Gimp *gimp, /* Check if a help parser is already running */ proc_rec = procedural_db_lookup (gimp, "extension_gimp_help_temp"); - if (proc_rec == NULL) + if (! proc_rec) { Argument *args = NULL; gint n_domains = 0; @@ -273,11 +269,9 @@ gimp_help_call (Gimp *gimp, proc_rec = procedural_db_lookup (gimp, "extension_gimp_help"); - if (proc_rec == NULL) - { - /* FIXME: error msg */ - return; - } + if (! proc_rec) + /* FIXME: error msg */ + return; n_domains = plug_ins_help_domains (gimp, &help_domains, &help_uris); @@ -301,12 +295,7 @@ gimp_help_call (Gimp *gimp, /* Check if the help parser started properly */ proc_rec = procedural_db_lookup (gimp, "extension_gimp_help_temp"); - if (proc_rec == NULL) - { - /* FIXME: error msg */ - return; - } - else + if (proc_rec) { Argument *return_vals; gint n_return_vals; diff --git a/libgimpthumb/gimpthumb-utils.c b/libgimpthumb/gimpthumb-utils.c index 74096977ac..1b63801206 100644 --- a/libgimpthumb/gimpthumb-utils.c +++ b/libgimpthumb/gimpthumb-utils.c @@ -388,13 +388,14 @@ gimp_thumb_name_from_uri_local (const gchar *uri, * @size: pointer to a #GimpThumbSize * * This function attempts to locate a thumbnail for the given - * @url. First it tries the size that is stored at @size. If no + * @uri. First it tries the size that is stored at @size. If no * thumbnail of that size is found, it will look for a larger * thumbnail, then falling back to a smaller size. * * If the user's thumbnail repository doesn't provide a thumbnail but * a local thumbnail repository exists for the folder the image is - * located in, the same search is done among the local thumbnails. + * located in, the same search is done among the local thumbnails (if + * there are any). * * If a thumbnail is found, it's size is written to the variable * pointer to by @size and the file location is returned. diff --git a/libgimpthumb/gimpthumbnail.c b/libgimpthumb/gimpthumbnail.c index ba5d749300..cbe788e7c8 100644 --- a/libgimpthumb/gimpthumbnail.c +++ b/libgimpthumb/gimpthumbnail.c @@ -492,6 +492,9 @@ gimp_thumbnail_set_filename (GimpThumbnail *thumbnail, * it. This allows you to find the image file associated with a * thumbnail file. * + * This will only work with thumbnails from the global thumbnail + * directory that contain a valid Thumb::URI tag. + * * Return value: %TRUE if the pixbuf could be loaded, %FALSE otherwise **/ gboolean