]> git.0d.be Git - empathy.git/blobdiff - libempathy-gtk/empathy-spell-dialog.c
update python bindings
[empathy.git] / libempathy-gtk / empathy-spell-dialog.c
index 7f4d75a1314e83b3b940fcf1ff7925ea24add8ab..9ce80eebbee651060cf865b302c36899635127fd 100644 (file)
 
 #include <string.h>
 
-#include <glib/gi18n.h>
-#include <gtk/gtkcellrenderertext.h>
-#include <gtk/gtkdialog.h>
-#include <gtk/gtklabel.h>
-#include <gtk/gtkliststore.h>
-#include <gtk/gtktreeview.h>
-#include <gtk/gtktreeselection.h>
-#include <gtk/gtksizegroup.h>
-#include <glade/glade.h>
+#include <glib/gi18n-lib.h>
+#include <gtk/gtk.h>
+
+#include <libempathy/empathy-utils.h>
 
 #include "empathy-chat.h"
+#include "empathy-spell.h"
 #include "empathy-spell-dialog.h"
 #include "empathy-ui-utils.h"
 
@@ -205,8 +201,8 @@ spell_dialog_response_cb (GtkWidget         *widget,
                gtk_tree_model_get (model, &iter, COL_SPELL_WORD, &new_word, -1);
 
                empathy_chat_correct_word (dialog->chat,
-                                         dialog->start,
-                                         dialog->end,
+                                         &dialog->start,
+                                         &dialog->end,
                                          new_word);
 
                g_free (new_word);
@@ -217,13 +213,14 @@ spell_dialog_response_cb (GtkWidget         *widget,
 
 void
 empathy_spell_dialog_show (EmpathyChat  *chat,
-                         GtkTextIter  start,
-                         GtkTextIter  end,
+                         GtkTextIter *start,
+                         GtkTextIter *end,
                          const gchar *word)
 {
        EmpathySpellDialog *dialog;
-       GladeXML          *gui;
-       gchar             *str;
+       GtkBuilder         *gui;
+       gchar              *str;
+       gchar              *filename;
 
        g_return_if_fail (chat != NULL);
        g_return_if_fail (word != NULL);
@@ -234,27 +231,27 @@ empathy_spell_dialog_show (EmpathyChat  *chat,
 
        dialog->word = g_strdup (word);
 
-       dialog->start = start;
-       dialog->end = end;
+       dialog->start = *start;
+       dialog->end = *end;
 
-       gui = empathy_glade_get_file ("empathy-spell-dialog.glade",
-                                    "spell_dialog",
-                                    NULL,
+       filename = empathy_file_lookup ("empathy-spell-dialog.ui",
+                                       "libempathy-gtk");
+       gui = empathy_builder_get_file (filename,
                                     "spell_dialog", &dialog->window,
                                     "button_replace", &dialog->button_replace,
                                     "label_word", &dialog->label_word,
                                     "treeview_words", &dialog->treeview_words,
                                     NULL);
+       g_free (filename);
 
-       empathy_glade_connect (gui,
-                             dialog,
+       empathy_builder_connect (gui, dialog,
                              "spell_dialog", "response", spell_dialog_response_cb,
                              "spell_dialog", "destroy", spell_dialog_destroy_cb,
                              NULL);
 
        g_object_unref (gui);
 
-       str = g_strdup_printf ("%s:\n<b>%s</b>",
+       str = g_markup_printf_escaped ("%s:\n<b>%s</b>",
                               _("Suggestions for the word"),
                               word);