display_name = g_strdup_printf (_("mcen_me_toolbar_sendreceive_mailbox_n"),
modest_account_settings_get_display_name (settings));
}
+
+
/* Create action and add it to the action group. The
action name must be the account name, this way we
gchar* item_name, *refresh_action_name;
guint8 merge_id = 0;
GtkAction *view_account_action, *refresh_account_action;
+ gchar *escaped_display_name;
+
+ escaped_display_name = modest_text_utils_escape_mnemonics (display_name);
view_account_action = GTK_ACTION (gtk_radio_action_new (account_name,
- display_name, NULL, NULL, 0));
+ escaped_display_name, NULL, NULL, 0));
+ g_free (escaped_display_name);
gtk_action_group_add_action (priv->view_additions_group, view_account_action);
gtk_radio_action_set_group (GTK_RADIO_ACTION (view_account_action), radio_group);
radio_group = gtk_radio_action_get_group (GTK_RADIO_ACTION (view_account_action));
return result;
}
+
+gchar *
+modest_text_utils_escape_mnemonics (const gchar *text)
+{
+ const gchar *p;
+ GString *result = NULL;
+
+ if (text == NULL)
+ return NULL;
+
+ result = g_string_new ("");
+ for (p = text; *p != '\0'; p++) {
+ if (*p == '_')
+ result = g_string_append (result, "__");
+ else
+ result = g_string_append_c (result, *p);
+ }
+
+ return g_string_free (result, FALSE);
+}
*/
gboolean modest_text_utils_buffer_selection_is_valid (GtkTextBuffer *buffer);
+/**
+ * modest_text_utils_escape_mnemonics:
+ * @text: a string
+ *
+ * obtains the representation of text, but escaping mnemonics (we duplicate _)
+ *
+ * Returns: a newly allocated string
+ */
+gchar *modest_text_utils_escape_mnemonics (const gchar *text);
+
#endif /* __MODEST_TEXT_UTILS_H__ */