Fixes based on feedback
authorAdam Schreiber <sadam@clemson.edu>
Fri, 24 Apr 2009 00:47:45 +0000 (08:47 +0800)
committerDavyd Madeley <davyd@madeley.id.au>
Fri, 24 Apr 2009 00:47:45 +0000 (08:47 +0800)
Some cleanup still required, done by
Davyd Madeley <davyd.madeley@collabora.co.uk>

libempathy-gtk/empathy-chat.c

index dea3b874c0379b5626634053d1f4b03911ba1bc2..8b69fa815914c3c661b38b5b5211390159b10cab 100644 (file)
@@ -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);