aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2002-05-21 04:45:35 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2002-05-21 04:45:35 +0800
commit888c7ceeb83ae8a9a1cc6e3f15c27c9e1b369ac7 (patch)
tree3b07d927d2745c54cd88cc1c5754632073317c93 /widgets
parentf91f431dc4796be98f06abd2ecfad5c23212d717 (diff)
downloadgsoc2013-evolution-888c7ceeb83ae8a9a1cc6e3f15c27c9e1b369ac7.tar
gsoc2013-evolution-888c7ceeb83ae8a9a1cc6e3f15c27c9e1b369ac7.tar.gz
gsoc2013-evolution-888c7ceeb83ae8a9a1cc6e3f15c27c9e1b369ac7.tar.bz2
gsoc2013-evolution-888c7ceeb83ae8a9a1cc6e3f15c27c9e1b369ac7.tar.lz
gsoc2013-evolution-888c7ceeb83ae8a9a1cc6e3f15c27c9e1b369ac7.tar.xz
gsoc2013-evolution-888c7ceeb83ae8a9a1cc6e3f15c27c9e1b369ac7.tar.zst
gsoc2013-evolution-888c7ceeb83ae8a9a1cc6e3f15c27c9e1b369ac7.zip
Strip underscores from the menu item labels.
* e-search-bar.c (activate_by_subitems): Strip underscores from the menu item labels. svn path=/trunk/; revision=16952
Diffstat (limited to 'widgets')
-rw-r--r--widgets/misc/ChangeLog5
-rw-r--r--widgets/misc/e-filter-bar.h2
-rw-r--r--widgets/misc/e-search-bar.c42
3 files changed, 43 insertions, 6 deletions
diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog
index 7d46999e2b..2fd2e399c0 100644
--- a/widgets/misc/ChangeLog
+++ b/widgets/misc/ChangeLog
@@ -1,3 +1,8 @@
+2002-05-20 Ettore Perazzoli <ettore@ximian.com>
+
+ * e-search-bar.c (activate_by_subitems): Strip underscores from
+ the menu item labels.
+
2002-04-26 Christopher James Lahey <clahey@ximian.com>
* e-multi-config-dialog.c (fill_in_pixbufs): Don't print out the
diff --git a/widgets/misc/e-filter-bar.h b/widgets/misc/e-filter-bar.h
index f6d644ba3f..5f6163a6e4 100644
--- a/widgets/misc/e-filter-bar.h
+++ b/widgets/misc/e-filter-bar.h
@@ -96,7 +96,7 @@ enum {
const char * strings[] = {
N_("_Save Search..."),
N_("_Edit Saved Searches..."),
- N_("Advanced...")
+ N_("_Advanced search...")
};
#endif
diff --git a/widgets/misc/e-search-bar.c b/widgets/misc/e-search-bar.c
index cbf7984f05..71848b9c3c 100644
--- a/widgets/misc/e-search-bar.c
+++ b/widgets/misc/e-search-bar.c
@@ -261,6 +261,32 @@ subitem_activated_cb (GtkWidget *widget, ESearchBar *esb)
emit_search_activated (esb);
}
+static char *
+string_without_underscores (const char *s)
+{
+ char *new_string;
+ const char *sp;
+ char *dp;
+
+ new_string = g_malloc (strlen (s) + 1);
+
+ dp = new_string;
+ for (sp = s; *sp != '\0'; sp ++) {
+ if (*sp != '_') {
+ *dp = *sp;
+ dp ++;
+ } else if (sp[1] == '_') {
+ /* Translate "__" in "_". */
+ *dp = '_';
+ dp ++;
+ sp ++;
+ }
+ }
+ *dp = 0;
+
+ return new_string;
+}
+
static void
activate_by_subitems (ESearchBar *esb, gint item_id, ESearchBarSubitem *subitems)
{
@@ -339,11 +365,13 @@ activate_by_subitems (ESearchBar *esb, gint item_id, ESearchBarSubitem *subitems
char *str;
if (subitems[i].translate)
- str = _(subitems[i].text);
+ str = string_without_underscores (_(subitems[i].text));
else
- str = subitems[i].text;
+ str = string_without_underscores (subitems[i].text);
menu_item = gtk_menu_item_new_with_label (str);
+
+ g_free (str);
} else {
menu_item = gtk_menu_item_new ();
gtk_widget_set_sensitive (menu_item, FALSE);
@@ -564,12 +592,16 @@ set_option (ESearchBar *esb, ESearchBarItem *items)
if (items[i].text) {
char *str;
- str = _(items[i].text);
- if (str == items[i].text) {
+
+ str = string_without_underscores (_(items[i].text));
+ if (_(items[i].text) == items[i].text) {
/* It may be english string, or utf8 rule name */
item = e_utf8_gtk_menu_item_new_with_label (GTK_MENU (menu), str);
- } else
+ } else {
item = gtk_menu_item_new_with_label (str);
+ }
+
+ g_free (str);
} else {
item = gtk_menu_item_new ();
gtk_widget_set_sensitive (item, FALSE);