}
-/* FIXME: this is a dup from the one in gtk/ */
-
/**
* @result: A ModestPairList, which must be freed with modest_pair_list_free().
*/
GdkPixbuf *window_icon = NULL;
GError *error = NULL;
- GtkSizeGroup *size_group;
+ GtkSizeGroup *title_size_group;
+ GtkSizeGroup *value_size_group;
GtkWidget *subject_box;
GtkWidget *attachment_icon;
GtkWidget *window_box;
parent_priv->menubar = NULL;
- size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
+ title_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
+ value_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
/* Note: This ModestPairList* must exist for as long as the picker
* that uses it, because the ModestSelectorPicker uses the ID opaquely,
* so it can't know how to manage its memory. */
priv->from_field = modest_selector_picker_new (MODEST_EDITABLE_SIZE,
- MODEST_EDITABLE_ARRANGEMENT,
+ HILDON_BUTTON_ARRANGEMENT_HORIZONTAL,
NULL, g_str_equal);
- hildon_button_set_alignment (HILDON_BUTTON (priv->from_field), 0.0, 0.5, 1.0, 0.0);
- hildon_button_set_title_alignment (HILDON_BUTTON (priv->from_field), 0.0, 0.5);
- hildon_button_set_value_alignment (HILDON_BUTTON (priv->from_field), 0.0, 0.5);
+ modest_maemo_utils_set_hbutton_layout (title_size_group, value_size_group,
+ _("mail_va_from"), priv->from_field);
priv->to_field = modest_recpt_editor_new ();
priv->cc_field = modest_recpt_editor_new ();
priv->header_box = gtk_vbox_new (FALSE, 0);
- hildon_button_add_title_size_group (HILDON_BUTTON (priv->from_field), size_group);
- to_caption = modest_maemo_utils_create_captioned (size_group, _("mail_va_to"), priv->to_field);
- priv->cc_caption = modest_maemo_utils_create_captioned (size_group, _("mail_va_cc"), priv->cc_field);
- priv->bcc_caption = modest_maemo_utils_create_captioned (size_group, _("mail_va_hotfix1"), priv->bcc_field);
- subject_caption = modest_maemo_utils_create_captioned (size_group, _("mail_va_subject"), subject_box);
- priv->attachments_caption = modest_maemo_utils_create_captioned (size_group, _("mail_va_attachment"), priv->attachments_view);
- g_object_unref (size_group);
-
- size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
- hildon_button_add_value_size_group (HILDON_BUTTON (priv->from_field), size_group);
- modest_recpt_editor_set_field_size_group (MODEST_RECPT_EDITOR (priv->to_field), size_group);
- modest_recpt_editor_set_field_size_group (MODEST_RECPT_EDITOR (priv->cc_field), size_group);
- modest_recpt_editor_set_field_size_group (MODEST_RECPT_EDITOR (priv->bcc_field), size_group);
- gtk_size_group_add_widget (size_group, priv->subject_field);
- gtk_size_group_add_widget (size_group, priv->attachments_view);
- g_object_unref (size_group);
+ to_caption = modest_maemo_utils_create_captioned (title_size_group, value_size_group,
+ _("mail_va_to"), priv->to_field);
+ priv->cc_caption = modest_maemo_utils_create_captioned (title_size_group, value_size_group,
+ _("mail_va_cc"), priv->cc_field);
+ priv->bcc_caption = modest_maemo_utils_create_captioned (title_size_group, value_size_group,
+ _("mail_va_hotfix1"), priv->bcc_field);
+ subject_caption = modest_maemo_utils_create_captioned (title_size_group, value_size_group,
+ _("mail_va_subject"), subject_box);
+ priv->attachments_caption = modest_maemo_utils_create_captioned (title_size_group, value_size_group,
+ _("mail_va_attachment"),
+ priv->attachments_view);
+ /* modest_recpt_editor_set_field_size_group (MODEST_RECPT_EDITOR (priv->to_field), value_size_group); */
+ /* modest_recpt_editor_set_field_size_group (MODEST_RECPT_EDITOR (priv->cc_field), value_size_group); */
+ /* modest_recpt_editor_set_field_size_group (MODEST_RECPT_EDITOR (priv->bcc_field), value_size_group); */
+ g_object_unref (title_size_group);
+ g_object_unref (value_size_group);
gtk_box_pack_start (GTK_BOX (priv->header_box), priv->from_field, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (priv->header_box), to_caption, FALSE, FALSE, 0);
readed = tny_stream_read (TNY_STREAM (stream), (char *) read_buffer, 128);
size += readed;
if (!gdk_pixbuf_loader_write (loader, read_buffer, readed, &error)) {
+ if (error)
+ g_error_free (error);
break;
}
}
text_buffer_refresh_attributes (WP_TEXT_BUFFER (priv->text_buffer), self);
+ g_free (buffer_format);
g_free (current_format);
/* Check dimming rules */
insert_mark = gtk_text_buffer_get_insert (GTK_TEXT_BUFFER (priv->text_buffer));
gtk_text_buffer_get_iter_at_mark (GTK_TEXT_BUFFER (priv->text_buffer), &position, insert_mark);
wp_text_buffer_insert_image (WP_TEXT_BUFFER (priv->text_buffer), &position, g_strdup (tny_mime_part_get_content_id (mime_part)), pixbuf);
+ g_object_unref (pixbuf);
}
tny_list_prepend (priv->images, (GObject *) mime_part);
priv->msg_uid = NULL;
}
priv->msg_uid = modest_tny_folder_get_header_unique_id (header);
- if (GTK_WIDGET_REALIZED (window))
- modest_window_mgr_register_window (mgr, MODEST_WINDOW (window), NULL);
+ if (GTK_WIDGET_REALIZED (window)) {
+ if (!modest_window_mgr_register_window (mgr, MODEST_WINDOW (window), NULL)) {
+ gtk_widget_destroy (GTK_WIDGET (window));
+ return;
+ }
+ }
}
priv->draft_msg = draft;
ModestMsgEditWindowPrivate *priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE (userdata);
gchar *tag_name;
- if (tag == NULL+13) return;
+ if (tag == NULL) return;
g_object_get (G_OBJECT (tag), "name", &tag_name, NULL);
if ((tag_name != NULL) && (g_str_has_prefix (tag_name, "image-tag-replace-"))) {
replace_with_images (window, priv->images);