~ubuntu-branches/ubuntu/hardy/xchat-gnome/hardy-updates

« back to all changes in this revision

Viewing changes to src/fe-gnome/preferences-page-spellcheck.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2006-07-20 10:46:11 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20060720104611-bo8b5e44s9b8cc9w
Tags: 1:0.13-0ubuntu1
* New upstream version, UVF granted by Colin Watson:
  - Add the ability to auto-join keyed channels (Ubuntu: #29856)
  - Add the red-line unread indicator (Ubuntu: #30642)
  - Lots and lots of major bug fixes
  - Fix a crash when saving transcript without current session
    (Ubuntu: #52692)
  - Fix crasher when using /server <servername> (Ubuntu: #45312)
* debian/control.in:
  - Build-Depends on libssl-dev instead of libssl0.9.8 (Ubuntu: #52746)
* debian/patches/03_autoconf.patch:
  - updated

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
        enabled = gtk_toggle_button_get_active (button);
47
47
        gconf_client_set_bool (client, "/apps/xchat/spellcheck/enabled", enabled, NULL);
48
48
 
49
 
        gtk_widget_set_sensitive (page->vbox_langs, enabled);
 
49
        gtk_widget_set_sensitive (page->spellcheck_list, enabled);
50
50
 
51
51
        g_object_unref (client);
52
52
}
175
175
        gboolean enabled;
176
176
        GtkTreeViewColumn *column;
177
177
        GSList *languages, *l;
178
 
 
179
 
#define GW(name) ((page->name) = glade_xml_get_widget (xml, #name))
180
 
        GW(enable_spellcheck);
181
 
        GW(spellcheck_list);
182
 
        GW(vbox_langs);
183
 
#undef GW
 
178
        GtkWidget *contents_vbox, *page_vbox, *label, *swin;
 
179
        page_vbox = glade_xml_get_widget (xml, "spell check");
184
180
 
185
181
        if (g_file_test ("../../data/spellcheck.png", G_FILE_TEST_EXISTS))
186
182
                page->icon = gdk_pixbuf_new_from_file ("../../data/spellcheck.png", NULL);
189
185
        gtk_list_store_append (p->page_store, &iter);
190
186
        gtk_list_store_set (p->page_store, &iter, 0, page->icon, 1, _("Spell checking"), 2, 7, -1);
191
187
 
 
188
        languages = sexy_spell_entry_get_languages (SEXY_SPELL_ENTRY (gui.text_entry));
 
189
        if (languages == NULL) {
 
190
                label = gtk_label_new (_("In order to get spell-checking, you need to have libenchant installed with at least one dictionary."));
 
191
                gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
 
192
                gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
 
193
                gtk_widget_show (label);
 
194
                gtk_box_pack_start (GTK_BOX (page_vbox), label, FALSE, TRUE, 0);
 
195
                return page;
 
196
        }
 
197
 
 
198
        contents_vbox = gtk_vbox_new (FALSE, 6);
 
199
        gtk_box_pack_start (GTK_BOX (page_vbox), contents_vbox, TRUE, TRUE, 0);
 
200
 
 
201
        page->enable_spellcheck = gtk_check_button_new_with_mnemonic (_("_Check spelling"));
 
202
        label = gtk_label_new (_("Choose languages to use for spellcheck:"));
 
203
        gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
 
204
        swin = gtk_scrolled_window_new (NULL, NULL);
 
205
        gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swin), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
 
206
        gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (swin), GTK_SHADOW_IN);
 
207
        gtk_box_pack_start (GTK_BOX (contents_vbox), page->enable_spellcheck, FALSE, TRUE, 0);
 
208
        gtk_box_pack_start (GTK_BOX (contents_vbox), label, FALSE, TRUE, 0);
 
209
        gtk_box_pack_start (GTK_BOX (contents_vbox), swin, TRUE, TRUE, 0);
 
210
 
 
211
        page->spellcheck_list = gtk_tree_view_new ();
 
212
        gtk_container_add (GTK_CONTAINER (swin), page->spellcheck_list);
 
213
 
 
214
        gtk_widget_show_all (contents_vbox);
 
215
 
192
216
        /* spellcheck languages list */
193
217
        page->spellcheck_store = gtk_list_store_new (3, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING);
194
218
        gtk_tree_view_set_model (GTK_TREE_VIEW (page->spellcheck_list),
212
236
        page->nh[1] = gconf_client_notify_add (p->gconf, "/apps/xchat/spellcheck/languages", (GConfClientNotifyFunc) gconf_languages_changed, page->spellcheck_store, NULL, NULL);
213
237
 
214
238
        /* Populate the model */
215
 
        languages = sexy_spell_entry_get_languages (SEXY_SPELL_ENTRY (gui.text_entry));
216
239
        for (l = languages; l != NULL; l = l->next) {
217
240
                gboolean active;
218
241
 
239
262
 
240
263
        enabled = gconf_client_get_bool (p->gconf, "/apps/xchat/spellcheck/enabled", NULL);
241
264
        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (page->enable_spellcheck), enabled);
242
 
        gtk_widget_set_sensitive (page->vbox_langs, enabled);
 
265
        gtk_widget_set_sensitive (page->spellcheck_list, enabled);
243
266
 
244
267
        return page;
245
268
}
256
279
        g_object_unref (client);
257
280
 
258
281
        g_object_unref (page->icon);
259
 
        g_object_unref (page->spellcheck_store);
 
282
        if (page->spellcheck_store)
 
283
                g_object_unref (page->spellcheck_store);
260
284
        g_free (page);
261
285
}
262
286