2008-09-17 [colin] 3.5.0cvs112
authorColin Leroy <colin@colino.net>
Wed, 17 Sep 2008 10:38:36 +0000 (10:38 +0000)
committerColin Leroy <colin@colino.net>
Wed, 17 Sep 2008 10:38:36 +0000 (10:38 +0000)
* src/image_viewer.c
Fix image loading (multiple childs added to
scrolledwindow, break of the resize functionality)
* src/account.c
* src/prefs_folder_item.c
* src/prefs_spelling.c
* src/gtk/gtkaspell.c
Better fix problems with dictionaries updates

ChangeLog
PATCHSETS
configure.ac
src/account.c
src/gtk/gtkaspell.c
src/image_viewer.c
src/prefs_folder_item.c
src/prefs_spelling.c

index 109bc54..4534d25 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2008-09-17 [colin]     3.5.0cvs112
+
+       * src/image_viewer.c
+               Fix image loading (multiple childs added to 
+               scrolledwindow, break of the resize functionality)
+       * src/account.c
+       * src/prefs_folder_item.c
+       * src/prefs_spelling.c
+       * src/gtk/gtkaspell.c
+               Better fix problems with dictionaries updates
+
 2008-09-17 [colin]     3.5.0cvs111
 
        * src/common/utils.c
index 5456104..49f2eb6 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.61.2.85 -r 1.61.2.86 src/account.c;  cvs diff -u -r 1.149.2.95 -r 1.149.2.96 src/inc.c;  cvs diff -u -r 1.274.2.272 -r 1.274.2.273 src/mainwindow.c;  cvs diff -u -r 1.49.2.40 -r 1.49.2.41 src/prefs_account.h;  cvs diff -u -r 1.1.2.31 -r 1.1.2.32 src/prefs_other.c;  cvs diff -u -r 1.17.2.50 -r 1.17.2.51 src/send_message.c;  cvs diff -u -r 1.2.2.34 -r 1.2.2.35 src/gtk/inputdialog.c;  ) > 3.5.0cvs109.patchset
 ( cvs diff -u -r 1.105.2.145 -r 1.105.2.146 src/prefs_account.c;  cvs diff -u -r 1.52.2.67 -r 1.52.2.68 src/prefs_folder_item.c;  cvs diff -u -r 1.5.2.37 -r 1.5.2.38 src/prefs_spelling.c;  cvs diff -u -r 1.9.2.61 -r 1.9.2.62 src/gtk/gtkaspell.c;  ) > 3.5.0cvs110.patchset
 ( cvs diff -u -r 1.36.2.145 -r 1.36.2.146 src/common/utils.c;  ) > 3.5.0cvs111.patchset
+( cvs diff -u -r 1.61.2.86 -r 1.61.2.87 src/account.c;  cvs diff -u -r 1.1.2.25 -r 1.1.2.26 src/image_viewer.c;  cvs diff -u -r 1.52.2.68 -r 1.52.2.69 src/prefs_folder_item.c;  cvs diff -u -r 1.5.2.38 -r 1.5.2.39 src/prefs_spelling.c;  cvs diff -u -r 1.9.2.62 -r 1.9.2.63 src/gtk/gtkaspell.c;  ) > 3.5.0cvs112.patchset
index f37c65a..a38eda7 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=5
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=111
+EXTRA_VERSION=112
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 8b56953..d97b300 100644 (file)
@@ -1795,6 +1795,7 @@ gchar *account_get_signature_str(PrefsAccount *account)
 
        if (!account->sig_path)
                return NULL;
+printf("opening %s\n", account->sig_path);
 
        if (account->sig_type == SIG_FILE) {
                if (!is_file_or_fifo_exist(account->sig_path)) {
index 2870b8a..1f62bc3 100644 (file)
@@ -393,8 +393,9 @@ GtkAspell *gtkaspell_new(const gchar *dictionary,
                dict->dictname = g_strdup(dictionary);
        }
 
-       if (strchr(dictionary, '-')) {
-               *(strchr(dictionary, '-')) = '\0';
+       if (strchr(dict->fullname, '-')) {
+               *(strchr(dict->fullname, '-')) = '\0';
+               *(strchr(dict->dictname, '-')) = '\0';
        }
        gtkaspeller    = gtkaspeller_new(dict); 
        dictionary_delete(dict);
@@ -421,8 +422,9 @@ GtkAspell *gtkaspell_new(const gchar *dictionary,
                        alt_dict->fullname = g_strdup(alt_dictionary);
                        alt_dict->dictname = g_strdup(alt_dictionary);
                }
-               if (strchr(alt_dictionary, '-')) {
-                       *(strchr(alt_dictionary, '-')) = '\0';
+               if (strchr(alt_dict->fullname, '-')) {
+                       *(strchr(alt_dict->fullname, '-')) = '\0';
+                       *(strchr(alt_dict->dictname, '-')) = '\0';
                }
 
                alt_gtkaspeller    = gtkaspeller_new(alt_dict);
@@ -2061,8 +2063,9 @@ gboolean gtkaspell_change_dict(GtkAspell *gtkaspell, const gchar *dictionary,
                dict->dictname = g_strdup(dictionary);
        }
 
-       if (strchr(dictionary, '-')) {
-               *(strchr(dictionary, '-')) = '\0';
+       if (strchr(dict->fullname, '-')) {
+               *(strchr(dict->fullname, '-')) = '\0';
+               *(strchr(dict->dictname, '-')) = '\0';
        }
 
        gtkaspeller = gtkaspeller_new(dict);
@@ -2111,8 +2114,9 @@ gboolean gtkaspell_change_alt_dict(GtkAspell *gtkaspell, const gchar *alt_dictio
                dict->dictname = g_strdup(alt_dictionary);
        }
 
-       if (strchr(alt_dictionary, '-')) {
-               *(strchr(alt_dictionary, '-')) = '\0';
+       if (strchr(dict->fullname, '-')) {
+               *(strchr(dict->fullname, '-')) = '\0';
+               *(strchr(dict->dictname, '-')) = '\0';
        }
 
        gtkaspeller = gtkaspeller_new(dict);
index b615079..73120d4 100644 (file)
@@ -69,7 +69,8 @@ static GtkWidget *image_viewer_get_widget(MimeViewer *_mimeviewer)
 
 static void image_viewer_load_file(ImageViewer *imageviewer, const gchar *imgfile)
 {
-       GdkPixbuf *pixbuf;
+       GdkPixbufAnimation *animation = NULL;
+       GdkPixbuf *pixbuf = NULL;
        gint avail_width;
        gint avail_height;
        GError *error = NULL;
@@ -77,7 +78,7 @@ static void image_viewer_load_file(ImageViewer *imageviewer, const gchar *imgfil
        debug_print("image_viewer_show_mimepart\n");
 
        if (!imageviewer->resize_img) {
-               pixbuf = gdk_pixbuf_new_from_file(imgfile, &error);
+               animation = gdk_pixbuf_animation_new_from_file(imgfile, &error);
        } else {
                gint w, h;
                gdk_pixbuf_get_file_info(imgfile, &w, &h);
@@ -86,40 +87,31 @@ static void image_viewer_load_file(ImageViewer *imageviewer, const gchar *imgfil
                if (avail_width > 8) avail_width -= 8;
                if (avail_height > 8) avail_height -= 8;
                if (avail_width - 100 > 0 &&
-                   (w > avail_width || h > avail_height))
+                   (w > avail_width || h > avail_height)) {
                        pixbuf = gdk_pixbuf_new_from_file_at_scale(imgfile, avail_width,
                                avail_height, TRUE, &error);
-               else
-                       pixbuf = gdk_pixbuf_new_from_file(imgfile, &error);
+               } else {
+                       animation = gdk_pixbuf_animation_new_from_file(imgfile, &error);
+               }
        }
 
-       if (error) {
+       if (error && !pixbuf && !animation) {
                gtk_label_set_text(GTK_LABEL(imageviewer->error_lbl), _("Error:"));
                gtk_label_set_text(GTK_LABEL(imageviewer->error_msg), error->message);
                gtk_notebook_set_current_page(GTK_NOTEBOOK(imageviewer->notebook), 0);
                gtk_widget_hide(imageviewer->load_button);
                g_error_free(error);
        }
-       if (!pixbuf) {
+       if (!pixbuf && !animation) {
                g_warning("Can't load the image.");     
                return;
        }
 
-       if (!imageviewer->image && !imageviewer->resize_img) {
-               imageviewer->image = gtk_image_new();
-
-               gtk_scrolled_window_add_with_viewport
-                       (GTK_SCROLLED_WINDOW(imageviewer->scrolledwin),
-                        imageviewer->image);
+       if (animation)
+               gtk_image_set_from_animation(GTK_IMAGE(imageviewer->image), animation);
+       else
                gtk_image_set_from_pixbuf(GTK_IMAGE(imageviewer->image), pixbuf);
-       }
-       else {
-               imageviewer->image = gtk_image_new_from_file(imgfile);
-               gtk_scrolled_window_add_with_viewport
-                       (GTK_SCROLLED_WINDOW(imageviewer->scrolledwin),
-                        imageviewer->image);
-       }
-       
+
        g_signal_handlers_block_by_func(G_OBJECT(imageviewer->scrolledwin), 
                         G_CALLBACK(scrolledwin_resize_cb), imageviewer);
 
@@ -129,7 +121,10 @@ static void image_viewer_load_file(ImageViewer *imageviewer, const gchar *imgfil
        g_signal_handlers_unblock_by_func(G_OBJECT(imageviewer->scrolledwin), 
                         G_CALLBACK(scrolledwin_resize_cb), imageviewer);
 
-       g_object_unref(pixbuf);
+       if (pixbuf)
+               g_object_unref(pixbuf);
+       if (animation)
+               g_object_unref(animation);
 }
 
 static void image_viewer_set_notebook_page(MimeViewer *_mimeviewer)
@@ -189,11 +184,6 @@ static void image_viewer_clear_viewer(MimeViewer *_mimeviewer)
 
        image_viewer_set_notebook_page(_mimeviewer);
 
-       if (imageviewer->image != NULL) {
-               gtk_widget_destroy(imageviewer->image);
-               imageviewer->image = NULL;
-       }
-
        if (imageviewer->scrolledwin) {
                hadj = gtk_scrolled_window_get_hadjustment
                        (GTK_SCROLLED_WINDOW(imageviewer->scrolledwin));
@@ -390,7 +380,10 @@ static MimeViewer *image_viewer_create(void)
        imageviewer->resize_img   = prefs_common.resize_img;
 
        imageviewer->scrolledwin  = scrolledwin;
-       imageviewer->image        = NULL;
+       imageviewer->image = gtk_image_new();
+       gtk_scrolled_window_add_with_viewport
+               (GTK_SCROLLED_WINDOW(imageviewer->scrolledwin),
+                imageviewer->image);
        imageviewer->notebook     = notebook;
        imageviewer->filename     = filename;
        imageviewer->filesize     = filesize;
index f4ef920..652d536 100644 (file)
@@ -939,7 +939,8 @@ static void prefs_folder_item_compose_create_widget_func(PrefsPage * page_,
                item->prefs->default_dictionary = tmp;
                dictionary = item->prefs->default_dictionary;
        }
-       if (strchr(item->prefs->default_dictionary, '-')) {
+       if (item->prefs->default_dictionary &&
+           strchr(item->prefs->default_dictionary, '-')) {
                *(strchr(item->prefs->default_dictionary, '-')) = '\0';
        }
        if (dictionary)
@@ -972,7 +973,8 @@ static void prefs_folder_item_compose_create_widget_func(PrefsPage * page_,
                item->prefs->default_alt_dictionary = tmp;
                dictionary = item->prefs->default_alt_dictionary;
        }
-       if (strchr(item->prefs->default_alt_dictionary, '-')) {
+       if (item->prefs->default_alt_dictionary &&
+           strchr(item->prefs->default_alt_dictionary, '-')) {
                *(strchr(item->prefs->default_alt_dictionary, '-')) = '\0';
        }
        if (dictionary)
index b9de1cc..5e81e2c 100644 (file)
@@ -228,20 +228,24 @@ 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 (strchr(prefs_common.dictionary, '-')) {
+       if (prefs_common.dictionary &&
+           strchr(prefs_common.dictionary, '-')) {
                *(strchr(prefs_common.dictionary, '-')) = '\0';
        }
-       if (strchr(prefs_common.alt_dictionary, '-')) {
+       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),