2004-12-02 [colin] 0.9.12cvs179
authorColin Leroy <colin@colino.net>
Thu, 2 Dec 2004 07:57:26 +0000 (07:57 +0000)
committerColin Leroy <colin@colino.net>
Thu, 2 Dec 2004 07:57:26 +0000 (07:57 +0000)
* src/compose.c
Prevent duplicate edition of queued
and drafted mails

ChangeLog.claws
PATCHSETS
configure.ac
src/compose.c

index 0dbd38d50ec5e0c09132dcde237fd682c0250020..058085b5b26e769807bc43d97975cb043dedbcff 100644 (file)
@@ -1,3 +1,9 @@
+2004-12-02 [colin]     0.9.12cvs179
+
+       * src/compose.c
+               Prevent duplicate edition of queued
+               and drafted mails
+
 2004-12-02 [colin]     0.9.12cvs178
 
        * src/compose.c
 2004-12-02 [colin]     0.9.12cvs178
 
        * src/compose.c
index 7cff1f893948696a38b9afa51e4566be8934c208..eb620bdc368a042c5f1f3ccc5ec3eee42e2e0e0f 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.252 -r 1.253 src/folderview.c; ) > 0.9.12cvs176.patchset
 ( cvs diff -u -r 1.16 -r 1.17 src/gtk/prefswindow.c; cvs diff -u -r 1.8 -r 1.9 src/gtk/pluginwindow.c; ) > 0.9.12cvs177.patchset
 ( cvs diff -u -r 1.458 -r 1.459 src/compose.c; ) > 0.9.12cvs178.patchset
 ( cvs diff -u -r 1.252 -r 1.253 src/folderview.c; ) > 0.9.12cvs176.patchset
 ( cvs diff -u -r 1.16 -r 1.17 src/gtk/prefswindow.c; cvs diff -u -r 1.8 -r 1.9 src/gtk/pluginwindow.c; ) > 0.9.12cvs177.patchset
 ( cvs diff -u -r 1.458 -r 1.459 src/compose.c; ) > 0.9.12cvs178.patchset
+( cvs diff -u -r 1.459 -r 1.460 src/compose.c; ) > 0.9.12cvs179.patchset
index efbb8bdaf0265fff882b9bfa4d7e3a661ee06bf3..5dc1ee19e5d86ff445c76f29c7f62400f432a715 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=12
 INTERFACE_AGE=0
 BINARY_AGE=0
 MICRO_VERSION=12
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=178
+EXTRA_VERSION=179
 EXTRA_RELEASE=
 
 if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
 EXTRA_RELEASE=
 
 if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
index c0e926f4280abd2023912ac943c9766712f9c0ee..13f4e7917526825183fc1df1ced8779a386f3235 100644 (file)
@@ -675,6 +675,29 @@ static GtkTargetEntry compose_mime_types[] =
        {"text/uri-list", 0, 0}
 };
 
        {"text/uri-list", 0, 0}
 };
 
+static gboolean compose_put_existing_to_front(MsgInfo *info)
+{
+       GList *compose_list = compose_get_compose_list();
+       GList *elem = NULL;
+       
+       if (compose_list) {
+               for (elem = compose_list; elem != NULL && elem->data != NULL; 
+                    elem = elem->next) {
+                       Compose *c = (Compose*)elem->data;
+
+                       if (!c->targetinfo || !c->targetinfo->msgid ||
+                           !info->msgid)
+                               continue;
+
+                       if (!strcmp(c->targetinfo->msgid, info->msgid)) {
+                               gtkut_window_popup(c->window);
+                               return TRUE;
+                       }
+               }
+       }
+       return FALSE;
+}
+
 Compose *compose_new(PrefsAccount *account, const gchar *mailto,
                     GPtrArray *attach_files)
 {
 Compose *compose_new(PrefsAccount *account, const gchar *mailto,
                     GPtrArray *attach_files)
 {
@@ -1206,6 +1229,9 @@ void compose_reedit(MsgInfo *msginfo)
        g_return_if_fail(msginfo != NULL);
        g_return_if_fail(msginfo->folder != NULL);
 
        g_return_if_fail(msginfo != NULL);
        g_return_if_fail(msginfo->folder != NULL);
 
+       if (compose_put_existing_to_front(msginfo)) 
+               return;
+
         if (msginfo->folder->stype == F_QUEUE || msginfo->folder->stype == F_DRAFT) {
                gchar queueheader_buf[BUFFSIZE];
                gint id, param;
         if (msginfo->folder->stype == F_QUEUE || msginfo->folder->stype == F_DRAFT) {
                gchar queueheader_buf[BUFFSIZE];
                gint id, param;