diff options
Diffstat (limited to 'libempathy-gtk/empathy-chat.c')
-rw-r--r-- | libempathy-gtk/empathy-chat.c | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c index dea3b874c..8b69fa815 100644 --- a/libempathy-gtk/empathy-chat.c +++ b/libempathy-gtk/empathy-chat.c @@ -595,7 +595,7 @@ chat_property_changed_cb (EmpathyTpChat *tp_chat, static void chat_input_text_buffer_changed_cb (GtkTextBuffer *buffer, - EmpathyChat *chat) + EmpathyChat *chat) { EmpathyChatPriv *priv; GtkTextIter start, end; @@ -611,8 +611,8 @@ chat_input_text_buffer_changed_cb (GtkTextBuffer *buffer, } empathy_conf_get_bool (empathy_conf_get (), - EMPATHY_PREFS_CHAT_SPELL_CHECKER_ENABLED, - &spell_checker); + EMPATHY_PREFS_CHAT_SPELL_CHECKER_ENABLED, + &spell_checker); gtk_text_buffer_get_start_iter (buffer, &start); @@ -934,10 +934,10 @@ static void chat_spelling_menu_activate_cb (GtkMenuItem *menu_item, EmpathyChatSpell *chat_spell) { - empathy_chat_correct_word (chat_spell->chat, - &(chat_spell->start), - &(chat_spell->end), - gtk_menu_item_get_label(menu_item)); + empathy_chat_correct_word (chat_spell->chat, + &(chat_spell->start), + &(chat_spell->end), + gtk_menu_item_get_label (menu_item)); } static GtkWidget* @@ -946,17 +946,22 @@ chat_spelling_build_menu (EmpathyChatSpell *chat_spell) GtkWidget *menu, *menu_item; GList *suggestions, *l; - menu = gtk_menu_new(); + menu = gtk_menu_new (); suggestions = empathy_spell_get_suggestions (chat_spell->word); - for (l = suggestions; l; l=l->next) { - menu_item = gtk_menu_item_new_with_label (l->data); - g_signal_connect (G_OBJECT (menu_item), - "activate", - G_CALLBACK (chat_spelling_menu_activate_cb), - chat_spell); + if (suggestions == NULL) { + menu_item = gtk_menu_item_new_with_label (_("(No Suggestions)")); + gtk_widget_set_sensitive (menu_item, FALSE); gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item); - } - + } else { + for (l = suggestions; l; l = l->next) { + menu_item = gtk_menu_item_new_with_label (l->data); + g_signal_connect (G_OBJECT (menu_item), + "activate", + G_CALLBACK (chat_spelling_menu_activate_cb), + chat_spell); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item); + } + } empathy_spell_free_suggestions (suggestions); gtk_widget_show_all (menu); @@ -1050,7 +1055,7 @@ chat_input_populate_popup_cb (GtkTextView *view, gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), item); gtk_widget_show (item); - item = gtk_image_menu_item_new_with_mnemonic (_("_Spelling Suggestions...")); + item = gtk_image_menu_item_new_with_mnemonic (_("_Spelling Suggestions")); image = gtk_image_new_from_icon_name (GTK_STOCK_SPELL_CHECK, GTK_ICON_SIZE_MENU); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image); |