|
Thank you, Not I think you are right, using destroy signal here is more clear and reasonable than response signal. Then please try this patch. Best Regards Charles Zhang Not Zed wrote: Ok, but as i said, please use destroy. It should be destroyed, thats all there is to it. It will be converted into a DESTROY dialog response anyway, and you need to handle that case anyway, so use destroy. On Tue, 2003-09-16 at 22:32 +0800, Charles Zhang wrote: |
Index: composer/e-msg-composer-attachment-bar.c
===================================================================
RCS file: /cvs/gnome/evolution/composer/e-msg-composer-attachment-bar.c,v
retrieving revision 1.67.4.4
diff -u -p -r1.67.4.4 e-msg-composer-attachment-bar.c
--- composer/e-msg-composer-attachment-bar.c 30 Jul 2003 12:59:06 -0000 1.67.4.4
+++ composer/e-msg-composer-attachment-bar.c 17 Sep 2003 14:13:09 -0000
@@ -192,9 +192,16 @@ static void
remove_attachment (EMsgComposerAttachmentBar *bar,
EMsgComposerAttachment *attachment)
{
+ g_return_if_fail (E_IS_MSG_COMPOSER_ATTACHMENT_BAR (bar));
+ g_return_if_fail (g_list_find (bar->priv->attachments, attachment) != NULL);
+
bar->priv->attachments = g_list_remove (bar->priv->attachments,
attachment);
bar->priv->num_attachments--;
+ if (attachment->editor_gui != NULL) {
+ GtkWidget *dialog = glade_xml_get_widget (attachment->editor_gui, "dialog");
+ gtk_widget_destroy (dialog);
+ }
g_object_unref(attachment);
@@ -356,8 +363,15 @@ remove_selected (EMsgComposerAttachmentB
p = gnome_icon_list_get_selection (icon_list);
for ( ; p != NULL; p = p->next) {
num = GPOINTER_TO_INT (p->data);
- attachment = E_MSG_COMPOSER_ATTACHMENT (g_list_nth (bar->priv->attachments, num)->data);
- attachment_list = g_list_prepend (attachment_list, attachment);
+ attachment = E_MSG_COMPOSER_ATTACHMENT (g_list_nth_data (bar->priv->attachments, num));
+
+ /* We need to check if there are duplicated index in the return value of
+ gnome_icon_list_get_selection() because of gnome bugzilla bug #122356.
+ FIXME in the future. */
+
+ if (g_list_find (attachment_list, attachment) == NULL) {
+ attachment_list = g_list_prepend (attachment_list, attachment);
+ }
}
for (p = attachment_list; p != NULL; p = p->next)
Index: composer/e-msg-composer-attachment.c
===================================================================
RCS file: /cvs/gnome/evolution/composer/e-msg-composer-attachment.c,v
retrieving revision 1.46.4.1
diff -u -p -r1.46.4.1 e-msg-composer-attachment.c
--- composer/e-msg-composer-attachment.c 29 Aug 2003 05:57:25 -0000 1.46.4.1
+++ composer/e-msg-composer-attachment.c 17 Sep 2003 14:13:18 -0000
@@ -448,6 +448,8 @@ e_msg_composer_attachment_edit (EMsgComp
disposition && !g_ascii_strcasecmp (disposition, "inline"));
connect_widget (editor_gui, "dialog", "response", (GCallback)response_cb, dialog_data);
+ connect_widget (editor_gui, "dialog", "destroy", (GCallback)close_cb, dialog_data);
+
#warning "signal connect while alive"
/* make sure that when the composer gets hidden/closed that our windows also close */
parent = gtk_widget_get_toplevel (parent);
Index: composer/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/composer/ChangeLog,v
retrieving revision 1.544.2.13
diff -u -p -r1.544.2.13 ChangeLog
--- composer/ChangeLog 29 Aug 2003 05:57:25 -0000 1.544.2.13
+++ composer/ChangeLog 17 Sep 2003 14:13:21 -0000
@@ -10,6 +10,15 @@
and composer icon name to get the path of composer icon.
[#47781]
+2003-09-13 Charles Zhang <charles zhang sun com>
+
+ * e-msg-composer-attachment.c (e_msg_composer_attachment_edit):
+ Connect destroy signal to attachment properties dialog.
+ * e-msg-composer-attachment-bar.c (remove_attachment): Add some
+ assertion. Destroy properties dialog while removeing an attachment.
+ * e-msg-composer-attachment-bar.c (remove_selected): Fix a re-
+ remove-attachment bug. [#48466]
+
2003-08-19 Jeffrey Stedfast <fejj ximian com>
* Original patch from David Woodhouse, but modified a bit by me.