+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
( 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
MICRO_VERSION=0
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=111
+EXTRA_VERSION=112
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=
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)) {
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);
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);
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);
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);
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;
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);
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);
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)
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));
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;
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)
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)
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),