fix spacing around dictionary prefs
[claws.git] / src / prefs_spelling.c
index 6c8f9bb9c6a562edde39fcaf4ac6990e5c55c33a..02f82596d906ef37775975ce373d300aeafd3001 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 2002-2007 Hiroyuki Yamamoto & the Claws Mail team
+ * Copyright (C) 2002-2012 Hiroyuki Yamamoto & the Claws Mail team
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -19,6 +19,7 @@
 
 #ifdef HAVE_CONFIG_H
 #  include "config.h"
+#include "claws-features.h"
 #endif
 
 #if USE_ENCHANT
@@ -107,12 +108,14 @@ static void prefs_spelling_create_widget(PrefsPage *_page, GtkWindow *window, gp
 
        GtkWidget *default_alt_dict_label;
        GtkWidget *default_alt_dict_combo;
-
        GtkWidget *both_dict_check;
+#ifdef WIN32
+       GtkWidget *get_dictionaries_btn;
+#endif
+
        GtkWidget *misspelled_label;
        GtkWidget *misspelled_hbox;
        GtkWidget *misspelled_colorbtn;
-       CLAWS_TIP_DECL();
 
        vbox1 = gtk_vbox_new (FALSE, VSPACING);
        gtk_widget_show (vbox1);
@@ -151,7 +154,7 @@ static void prefs_spelling_create_widget(PrefsPage *_page, GtkWindow *window, gp
        
        table = gtk_table_new(6, 4, FALSE);
        gtk_widget_show(table);
-       gtk_container_set_border_width(GTK_CONTAINER(table), 8);
+       gtk_container_set_border_width(GTK_CONTAINER(table), 0);
        gtk_table_set_row_spacings(GTK_TABLE(table), 4);
        gtk_table_set_col_spacings(GTK_TABLE(table), 8);
 
@@ -189,6 +192,14 @@ static void prefs_spelling_create_widget(PrefsPage *_page, GtkWindow *window, gp
        gtk_table_attach (GTK_TABLE (table), both_dict_check, 1, 2, 2, 3,
                          GTK_SHRINK, 0, 0, 0);
 
+#ifdef WIN32
+       get_dictionaries_btn = gtkut_get_link_btn(GTK_WIDGET(window), 
+                               DICTS_URI, _("Get more dictionaries..."));
+
+       gtk_widget_show(get_dictionaries_btn);
+       gtk_table_attach (GTK_TABLE (table), get_dictionaries_btn, 1, 2, 3, 4,
+                         GTK_SHRINK, 0, 0, 0);
+#endif
        misspelled_hbox = gtk_hbox_new(FALSE, 10);
        gtk_widget_show(misspelled_hbox);
        gtk_box_pack_start(GTK_BOX(vbox1), misspelled_hbox, FALSE, FALSE, 0);
@@ -228,16 +239,26 @@ static void prefs_spelling_create_widget(PrefsPage *_page, GtkWindow *window, gp
                        prefs_common.recheck_when_changing_dict);
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(use_alternate_checkbtn),
                        prefs_common.use_alternate);
-       if (strrchr(prefs_common.dictionary, '/')) {
+       if (prefs_common.dictionary && 
+           strrchr(prefs_common.dictionary, '/')) {
                gchar *tmp = g_strdup(strrchr(prefs_common.dictionary, '/')+1);
                g_free(prefs_common.dictionary);
                prefs_common.dictionary = tmp;
        }
-       if (strrchr(prefs_common.alt_dictionary, '/')) {
+       if (prefs_common.alt_dictionary &&
+           strrchr(prefs_common.alt_dictionary, '/')) {
                gchar *tmp = g_strdup(strrchr(prefs_common.alt_dictionary, '/')+1);
                g_free(prefs_common.alt_dictionary);
                prefs_common.alt_dictionary = tmp;
        }
+       if (prefs_common.dictionary &&
+           strchr(prefs_common.dictionary, '-')) {
+               *(strchr(prefs_common.dictionary, '-')) = '\0';
+       }
+       if (prefs_common.alt_dictionary &&
+           strchr(prefs_common.alt_dictionary, '-')) {
+               *(strchr(prefs_common.alt_dictionary, '-')) = '\0';
+       }
        gtkaspell_set_dictionary_menu_active_item(GTK_COMBO_BOX(default_dict_combo),
                                                prefs_common.dictionary);