aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-chat.c
diff options
context:
space:
mode:
authorAdam Schreiber <sadam@clemson.edu>2009-04-24 08:47:45 +0800
committerDavyd Madeley <davyd@madeley.id.au>2009-04-24 08:47:45 +0800
commit6856c3dc3bdac6d7690d450e69ab66e3d9fa7fb4 (patch)
tree399dee611af0b2c0742fc629b2369bac5dc4043c /libempathy-gtk/empathy-chat.c
parentc2d744603dbee125894c2ea45f5931e73a270d16 (diff)
downloadgsoc2013-empathy-6856c3dc3bdac6d7690d450e69ab66e3d9fa7fb4.tar
gsoc2013-empathy-6856c3dc3bdac6d7690d450e69ab66e3d9fa7fb4.tar.gz
gsoc2013-empathy-6856c3dc3bdac6d7690d450e69ab66e3d9fa7fb4.tar.bz2
gsoc2013-empathy-6856c3dc3bdac6d7690d450e69ab66e3d9fa7fb4.tar.lz
gsoc2013-empathy-6856c3dc3bdac6d7690d450e69ab66e3d9fa7fb4.tar.xz
gsoc2013-empathy-6856c3dc3bdac6d7690d450e69ab66e3d9fa7fb4.tar.zst
gsoc2013-empathy-6856c3dc3bdac6d7690d450e69ab66e3d9fa7fb4.zip
Fixes based on feedback
Some cleanup still required, done by Davyd Madeley <davyd.madeley@collabora.co.uk>
Diffstat (limited to 'libempathy-gtk/empathy-chat.c')
-rw-r--r--libempathy-gtk/empathy-chat.c39
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);