Commit 5cd010b1 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

don't show progress for local help lookups, they are fast enough.

2008-06-11  Sven Neumann  <sven@gimp.org>

	* plug-ins/help/help.c (load_help_idle): don't show progress for
	local help lookups, they are fast enough.

	* plug-ins/help-browser/help-browser.c: added the same progress
	code here. Might want to move it to the dialog window later.


svn path=/trunk/; revision=25927
parent 01feb73b
2008-06-11 Sven Neumann <sven@gimp.org>
* plug-ins/help/help.c (load_help_idle): don't show progress for
local help lookups, they are fast enough.
* plug-ins/help-browser/help-browser.c: added the same progress
code here. Might want to move it to the dialog window later.
2008-06-11 Sven Neumann <sven@gimp.org>
* configure.in: reverted last change (use of IT_PO_SUBDIR).
......
......@@ -64,6 +64,8 @@ static gboolean help_browser_show_help (const gchar *help_domain,
const gchar *help_locales,
const gchar *help_id);
static GimpHelpProgress * help_browser_progress_new (void);
/* local variables */
......@@ -248,13 +250,25 @@ help_browser_show_help (const gchar *help_domain,
if (domain)
{
GList *locales = gimp_help_parse_locales (help_locales);
GimpHelpLocale *locale;
gchar *uri;
gboolean fatal_error;
GimpHelpProgress *progress = NULL;
GimpHelpLocale *locale;
GList *locales;
gchar *uri;
gboolean fatal_error;
locales = gimp_help_parse_locales (help_locales);
if (! g_str_has_prefix (domain->help_uri, "file:"))
progress = help_browser_progress_new ();
uri = gimp_help_domain_map (domain, locales, help_id,
progress, &locale, &fatal_error);
uri = gimp_help_domain_map (domain, locales, help_id, NULL,
&locale, &fatal_error);
if (progress)
gimp_help_progress_free (progress);
g_list_foreach (locales, (GFunc) g_free, NULL);
g_list_free (locales);
if (uri)
{
......@@ -267,10 +281,42 @@ help_browser_show_help (const gchar *help_domain,
{
success = FALSE;
}
g_list_foreach (locales, (GFunc) g_free, NULL);
g_list_free (locales);
}
return success;
}
static void
help_browser_progress_start (const gchar *message,
gboolean cancelable,
gpointer user_data)
{
gimp_progress_init (message);
}
static void
help_browser_progress_update (gdouble value,
gpointer user_data)
{
gimp_progress_update (value);
}
static void
help_browser_progress_end (gpointer user_data)
{
gimp_progress_end ();
}
static GimpHelpProgress *
help_browser_progress_new (void)
{
static const GimpHelpProgressVTable vtable =
{
help_browser_progress_start,
help_browser_progress_end,
help_browser_progress_update
};
return gimp_help_progress_new (&vtable, NULL);
}
......@@ -265,43 +265,48 @@ load_help_idle (gpointer data)
if (domain)
{
GimpHelpProgress *progress = load_help_progress_new ();
GimpHelpProgress *progress = NULL;
GList *locales;
gchar *full_uri;
gchar *uri;
gboolean fatal_error;
locales = gimp_help_parse_locales (idle_help->help_locales);
full_uri = gimp_help_domain_map (domain, locales, idle_help->help_id,
progress, NULL, &fatal_error);
locales = gimp_help_parse_locales (idle_help->help_locales);
if (! g_str_has_prefix (domain->help_uri, "file:"))
progress = load_help_progress_new ();
uri = gimp_help_domain_map (domain, locales, idle_help->help_id,
progress, NULL, &fatal_error);
if (progress)
gimp_help_progress_free (progress);
g_list_foreach (locales, (GFunc) g_free, NULL);
g_list_free (locales);
if (full_uri)
if (uri)
{
GimpParam *return_vals;
gint n_return_vals;
#ifdef GIMP_HELP_DEBUG
g_printerr ("help: calling '%s' for '%s'\n",
idle_help->procedure, full_uri);
idle_help->procedure, uri);
#endif
return_vals = gimp_run_procedure (idle_help->procedure,
&n_return_vals,
GIMP_PDB_STRING, full_uri,
GIMP_PDB_STRING, uri,
GIMP_PDB_END);
gimp_destroy_params (return_vals, n_return_vals);
g_free (full_uri);
g_free (uri);
}
else if (fatal_error)
{
g_main_loop_quit (main_loop);
}
gimp_help_progress_free (progress);
}
g_free (idle_help->procedure);
......
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