From 2f3c343219368b24973eaa867db0b0993fb685b0 Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Wed, 6 Jul 2005 01:51:17 +0000 Subject: [PATCH] set the count label in italic. 2005-07-06 Sven Neumann * libgimpwidgets/gimpbrowser.c: set the count label in italic. * plug-ins/dbbrowser/gimpprocbrowser.c * plug-ins/dbbrowser/plugin-browser.c: try to make it more obvious that the list is the result of a query by explicitely mentioning this in the summary below the list. --- ChangeLog | 12 ++++++++++ libgimp/gimpprocbrowserdialog.c | 35 ++++++++++++++++++++-------- libgimpwidgets/gimpbrowser.c | 6 +++-- plug-ins/common/plugin-browser.c | 22 ++++++++++++++--- plug-ins/dbbrowser/gimpprocbrowser.c | 35 ++++++++++++++++++++-------- plug-ins/dbbrowser/plugin-browser.c | 22 ++++++++++++++--- 6 files changed, 104 insertions(+), 28 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3719ec5b85..dc55a87c75 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,20 @@ +2005-07-06 Sven Neumann + + * libgimpwidgets/gimpbrowser.c: set the count label in italic. + + * plug-ins/dbbrowser/gimpprocbrowser.c + * plug-ins/dbbrowser/plugin-browser.c: try to make it more obvious + that the list is the result of a query by explicitely mentioning + this in the summary below the list. + 2005-07-06 Sven Neumann * app/plug-in/plug-ins-query.c (match_strings): reverted previous change, it was bogus. + * app/pdb/procedural-db-query.c: case-insensitive search for + procedures. + 2005-07-06 Sven Neumann * app/plug-in/plug-ins-query.c (match_strings): match diff --git a/libgimp/gimpprocbrowserdialog.c b/libgimp/gimpprocbrowserdialog.c index 5ab77618c7..ce037483c0 100644 --- a/libgimp/gimpprocbrowserdialog.c +++ b/libgimp/gimpprocbrowserdialog.c @@ -325,21 +325,20 @@ browser_search (GimpBrowser *gimp_browser, if (search_type == SEARCH_TYPE_NAME) { - GString *query; + GString *query = g_string_new (""); + const gchar *q = query_text; gimp_browser_show_message (GIMP_BROWSER (browser->browser), _("Searching by name - please wait")); - query = g_string_new (""); - - while (*query_text) + while (*q) { - if ((*query_text == '_') || (*query_text == '-')) + if ((*q == '_') || (*q == '-')) g_string_append (query, "[-_]"); else - g_string_append_c (query, *query_text); + g_string_append_c (query, *q); - query_text++; + q++; } gimp_procedural_db_query (query->str, ".*", ".*", ".*", ".*", ".*", ".*", @@ -404,10 +403,26 @@ browser_search (GimpBrowser *gimp_browser, &num_procs, &proc_list); } - if (num_procs == 1) - str = g_strdup (_("1 Procedure")); + if (! query_text || strlen (query_text) == 0) + { + str = g_strdup_printf (_("%d Procedures"), num_procs); + } else - str = g_strdup_printf (_("%d Procedures"), num_procs); + { + switch (num_procs) + { + case 0: + str = g_strdup (_("No matches for your query")); + break; + case 1: + str = g_strdup (_("1 procedure matches your query")); + break; + default: + str = g_strdup_printf (_("%d procedures match your query"), + num_procs); + break; + } + } gtk_label_set_text (GTK_LABEL (gimp_browser->count_label), str); g_free (str); diff --git a/libgimpwidgets/gimpbrowser.c b/libgimpwidgets/gimpbrowser.c index aa776ba510..badc7e4c0b 100644 --- a/libgimpwidgets/gimpbrowser.c +++ b/libgimpwidgets/gimpbrowser.c @@ -28,8 +28,7 @@ #include "gimpwidgetstypes.h" -#include "gimpbrowser.h" -#include "gimpintcombobox.h" +#include "gimpwidgets.h" #include "gimpwidgetsmarshal.h" #include "libgimp/libgimp-intl.h" @@ -145,6 +144,9 @@ gimp_browser_init (GimpBrowser *browser) browser->count_label = gtk_label_new ("0 Matches"); gtk_misc_set_alignment (GTK_MISC (browser->count_label), 0.0, 0.5); + gimp_label_set_attributes (GTK_LABEL (browser->count_label), + PANGO_ATTR_STYLE, PANGO_STYLE_ITALIC, + -1); gtk_box_pack_end (GTK_BOX (browser->left_vbox), browser->count_label, FALSE, FALSE, 0); gtk_widget_show (browser->count_label); diff --git a/plug-ins/common/plugin-browser.c b/plug-ins/common/plugin-browser.c index 39c6d2c65b..5ea2141491 100644 --- a/plug-ins/common/plugin-browser.c +++ b/plug-ins/common/plugin-browser.c @@ -397,10 +397,26 @@ browser_search (GimpBrowser *gimp_browser, else num_plugins = 0; - if (num_plugins == 1) - str = g_strdup (_("1 Plug-In Interface")); + if (! search_text || strlen (search_text) == 0) + { + str = g_strdup_printf (_("%d Plug-ins"), num_plugins); + } else - str = g_strdup_printf (_("%d Plug-In Interfaces"), num_plugins); + { + switch (num_plugins) + { + case 0: + str = g_strdup (_("No matches for your query")); + break; + case 1: + str = g_strdup (_("1 plug-in matches your query")); + break; + default: + str = g_strdup_printf (_("%d plug-ins match your query"), + num_plugins); + break; + } + } gtk_label_set_text (GTK_LABEL (gimp_browser->count_label), str); g_free (str); diff --git a/plug-ins/dbbrowser/gimpprocbrowser.c b/plug-ins/dbbrowser/gimpprocbrowser.c index 5ab77618c7..ce037483c0 100644 --- a/plug-ins/dbbrowser/gimpprocbrowser.c +++ b/plug-ins/dbbrowser/gimpprocbrowser.c @@ -325,21 +325,20 @@ browser_search (GimpBrowser *gimp_browser, if (search_type == SEARCH_TYPE_NAME) { - GString *query; + GString *query = g_string_new (""); + const gchar *q = query_text; gimp_browser_show_message (GIMP_BROWSER (browser->browser), _("Searching by name - please wait")); - query = g_string_new (""); - - while (*query_text) + while (*q) { - if ((*query_text == '_') || (*query_text == '-')) + if ((*q == '_') || (*q == '-')) g_string_append (query, "[-_]"); else - g_string_append_c (query, *query_text); + g_string_append_c (query, *q); - query_text++; + q++; } gimp_procedural_db_query (query->str, ".*", ".*", ".*", ".*", ".*", ".*", @@ -404,10 +403,26 @@ browser_search (GimpBrowser *gimp_browser, &num_procs, &proc_list); } - if (num_procs == 1) - str = g_strdup (_("1 Procedure")); + if (! query_text || strlen (query_text) == 0) + { + str = g_strdup_printf (_("%d Procedures"), num_procs); + } else - str = g_strdup_printf (_("%d Procedures"), num_procs); + { + switch (num_procs) + { + case 0: + str = g_strdup (_("No matches for your query")); + break; + case 1: + str = g_strdup (_("1 procedure matches your query")); + break; + default: + str = g_strdup_printf (_("%d procedures match your query"), + num_procs); + break; + } + } gtk_label_set_text (GTK_LABEL (gimp_browser->count_label), str); g_free (str); diff --git a/plug-ins/dbbrowser/plugin-browser.c b/plug-ins/dbbrowser/plugin-browser.c index 39c6d2c65b..5ea2141491 100644 --- a/plug-ins/dbbrowser/plugin-browser.c +++ b/plug-ins/dbbrowser/plugin-browser.c @@ -397,10 +397,26 @@ browser_search (GimpBrowser *gimp_browser, else num_plugins = 0; - if (num_plugins == 1) - str = g_strdup (_("1 Plug-In Interface")); + if (! search_text || strlen (search_text) == 0) + { + str = g_strdup_printf (_("%d Plug-ins"), num_plugins); + } else - str = g_strdup_printf (_("%d Plug-In Interfaces"), num_plugins); + { + switch (num_plugins) + { + case 0: + str = g_strdup (_("No matches for your query")); + break; + case 1: + str = g_strdup (_("1 plug-in matches your query")); + break; + default: + str = g_strdup_printf (_("%d plug-ins match your query"), + num_plugins); + break; + } + } gtk_label_set_text (GTK_LABEL (gimp_browser->count_label), str); g_free (str);