2007-09-16 [colin] 3.0.0cvs17
authorColin Leroy <colin@colino.net>
Sun, 16 Sep 2007 10:07:11 +0000 (10:07 +0000)
committerColin Leroy <colin@colino.net>
Sun, 16 Sep 2007 10:07:11 +0000 (10:07 +0000)
* src/folderview.c
Fix bug 1311, 'Wrong arrow position
while moving message into folder when
column headers hidden'
* src/image_viewer.c
Show error in the GUI if image can't
be loaded
* src/matcher.c
Fix spurious output
* src/messageview.c
Allow setting domain in msgid
* src/common/plugin.c
Add timing information

ChangeLog
PATCHSETS
configure.ac
src/common/plugin.c
src/folderview.c
src/image_viewer.c
src/matcher.c
src/messageview.c

index 0efff932d9b0c2d83568bf2f6fec7748db5e5af7..a12dae240142e847c2ebec1a805c6ad72cd52f7b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2007-09-16 [colin]     3.0.0cvs17
+
+       * src/folderview.c
+               Fix bug 1311, 'Wrong arrow position 
+               while moving message into folder when 
+               column headers hidden'
+       * src/image_viewer.c
+               Show error in the GUI if image can't
+               be loaded
+       * src/matcher.c
+               Fix spurious output
+       * src/messageview.c
+               Allow setting domain in msgid
+       * src/common/plugin.c
+               Add timing information
+
 2007-09-16 [colin]     3.0.0cvs16
 
        * src/account.c
index 563ef424906ed7e07722411b284fc8094fcde255..94f86b4113e4401b902afbfbebbae893f6ed621a 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.207.2.181 -r 1.207.2.182 src/folderview.c;  cvs diff -u -r 1.115.2.166 -r 1.115.2.167 src/main.c;  cvs diff -u -r 1.274.2.210 -r 1.274.2.211 src/mainwindow.c;  ) > 3.0.0cvs14.patchset
 ( cvs diff -u -r 1.59.2.57 -r 1.59.2.58 src/prefs_filtering.c;  cvs diff -u -r 1.6.2.7 -r 1.6.2.8 src/prefs_filtering.h;  cvs diff -u -r 1.1.4.39 -r 1.1.4.40 src/prefs_filtering_action.c;  cvs diff -u -r 1.1.2.3 -r 1.1.2.4 src/common/tags.c;  ) > 3.0.0cvs15.patchset
 ( cvs diff -u -r 1.61.2.68 -r 1.61.2.69 src/account.c;  cvs diff -u -r 1.382.2.408 -r 1.382.2.409 src/compose.c;  cvs diff -u -r 1.105.2.109 -r 1.105.2.110 src/prefs_account.c;  cvs diff -u -r 1.49.2.33 -r 1.49.2.34 src/prefs_account.h;  cvs diff -u -r 1.12.2.47 -r 1.12.2.48 src/prefs_template.c;  cvs diff -u -r 1.36.2.110 -r 1.36.2.111 src/common/utils.c;  ) > 3.0.0cvs16.patchset
+( cvs diff -u -r 1.207.2.182 -r 1.207.2.183 src/folderview.c;  cvs diff -u -r 1.1.2.19 -r 1.1.2.20 src/image_viewer.c;  cvs diff -u -r 1.75.2.47 -r 1.75.2.48 src/matcher.c;  cvs diff -u -r 1.94.2.150 -r 1.94.2.151 src/messageview.c;  cvs diff -u -r 1.13.2.30 -r 1.13.2.31 src/common/plugin.c;  ) > 3.0.0cvs17.patchset
index bda8363a9c3fcc20f4ba1982c1d4cefe6c8ec220..39d2f57f4f9e6cc881ee7de448f5b54a1a410c73 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=0
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=16
+EXTRA_VERSION=17
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index ae72652433429d1ab839e14a6b1eada79dbc80c8..20f942e0c12871c2d81499849257e5758c3d7332 100644 (file)
@@ -33,6 +33,8 @@
 #include "plugin.h"
 #include "prefs.h"
 #include "claws.h"
+#include "timing.h"
+
 #ifdef HAVE_VALGRIND
 #include "valgrind.h"
 #endif
@@ -294,9 +296,8 @@ Plugin *plugin_load(const gchar *filename, gchar **error)
        const gchar *(*plugin_type)(void);
        const gchar *(*plugin_licence)(void);
        struct PluginFeature *(*plugin_provides)(void);
-
        gint ok;
-
+       START_TIMING((filename?filename:"NULL plugin"));
        g_return_val_if_fail(filename != NULL, NULL);
        g_return_val_if_fail(error != NULL, NULL);
 
@@ -393,7 +394,7 @@ init_plugin:
        plugin->unloaded_hidden = FALSE;
 
        debug_print("Plugin %s (from file %s) loaded\n", plugin->name(), filename);
-
+       END_TIMING();
        return plugin;
 }
 
index 2294789a179c514a1493c908ff5b612f57b98946..1b6fe080ab117341a98379ed7e380d1b1eda1982 100644 (file)
@@ -2853,9 +2853,10 @@ static gboolean folderview_drag_motion_cb(GtkWidget      *widget,
        int height = (int)pos->page_size;
        int total_height = (int)pos->upper;
        int vpos = (int) pos->value;
-
+       int offset = prefs_common.show_col_headers ? 24:0;
+       
        if (gtk_clist_get_selection_info
-               (GTK_CLIST(widget), x - 24, y - 24, &row, &column)) {
+               (GTK_CLIST(widget), x - offset, y - offset, &row, &column)) {
                GtkWidget *srcwidget;
 
                if (y > height - 24 && height + vpos < total_height) {
@@ -2994,13 +2995,14 @@ static void folderview_drag_received_cb(GtkWidget        *widget,
        gint row, column;
        FolderItem *item = NULL, *src_item;
        GtkCTreeNode *node;
+       int offset = prefs_common.show_col_headers ? 24:0;
 
        if (info == TARGET_DUMMY) {
                drag_state_stop(folderview);
                if ((void *)strstr(data->data, "FROM_OTHER_FOLDER") != (void *)data->data) {
                        /* comes from summaryview */
                        if (gtk_clist_get_selection_info
-                               (GTK_CLIST(widget), x - 24, y - 24, &row, &column) == 0)
+                               (GTK_CLIST(widget), x - offset, y - offset, &row, &column) == 0)
                                return;
 
                        node = gtk_ctree_node_nth(GTK_CTREE(widget), row);
@@ -3042,7 +3044,7 @@ static void folderview_drag_received_cb(GtkWidget        *widget,
 
                        source = data->data + 17;
                        if (gtk_clist_get_selection_info
-                           (GTK_CLIST(widget), x - 24, y - 24, &row, &column) == 0
+                           (GTK_CLIST(widget), x - offset, y - offset, &row, &column) == 0
                            || *source == 0) {
                                gtk_drag_finish(drag_context, FALSE, FALSE, time);                      
                                return;
@@ -3069,7 +3071,7 @@ static void folderview_drag_received_cb(GtkWidget        *widget,
                folderview->nodes_to_recollapse = NULL;
        } else if (info == TARGET_MAIL_URI_LIST) {
                if (gtk_clist_get_selection_info
-                       (GTK_CLIST(widget), x - 24, y - 24, &row, &column) == 0)
+                       (GTK_CLIST(widget), x - offset, y - offset, &row, &column) == 0)
                        return;
 
                node = gtk_ctree_node_nth(GTK_CTREE(widget), row);
index 85e021d878537175cd065e21601b137b6db3ed7e..2035ce1719b5bcea47d98d6020b7a46a49917378 100644 (file)
@@ -53,6 +53,8 @@ struct _ImageViewer
        GtkWidget *notebook;
        GtkWidget *filename;
        GtkWidget *filesize;
+       GtkWidget *error_lbl;
+       GtkWidget *error_msg;
        GtkWidget *content_type;
 };
 
@@ -92,7 +94,9 @@ static void image_viewer_load_file(ImageViewer *imageviewer, const gchar *imgfil
        }
 
        if (error) {
-               g_warning(error->message);
+               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);
                g_error_free(error);
        }
        if (!pixbuf) {
@@ -158,14 +162,15 @@ static void image_viewer_show_mimepart(MimeViewer *_mimeviewer, const gchar *fil
        imageviewer->file = g_strdup(file);
        imageviewer->mimeinfo = mimeinfo;
 
+       gtk_label_set_text(GTK_LABEL(imageviewer->filename),
+                          procmime_mimeinfo_get_parameter(mimeinfo, "name"));
+       gtk_label_set_text(GTK_LABEL(imageviewer->filesize), to_human_readable(mimeinfo->length));
+       gtk_label_set_text(GTK_LABEL(imageviewer->content_type), mimeinfo->subtype);
+       gtk_label_set_text(GTK_LABEL(imageviewer->error_lbl), "");
+       gtk_label_set_text(GTK_LABEL(imageviewer->error_msg), "");
+
        if (prefs_common.display_img)
                image_viewer_load_image(imageviewer);
-       else {
-               gtk_label_set_text(GTK_LABEL(imageviewer->filename),
-                                  procmime_mimeinfo_get_parameter(mimeinfo, "name"));
-               gtk_label_set_text(GTK_LABEL(imageviewer->filesize), to_human_readable(mimeinfo->length));
-               gtk_label_set_text(GTK_LABEL(imageviewer->content_type), mimeinfo->subtype);
-       }
 }
 
 static void image_viewer_clear_viewer(MimeViewer *_mimeviewer)
@@ -277,6 +282,8 @@ static MimeViewer *image_viewer_create(void)
        GtkWidget *label5;
        GtkWidget *content_type;
        GtkWidget *scrolledwin;
+       GtkWidget *error_lbl;
+       GtkWidget *error_msg;
 
        notebook = gtk_notebook_new();
        gtk_widget_show(notebook);
@@ -284,7 +291,7 @@ static MimeViewer *image_viewer_create(void)
        gtk_notebook_set_show_tabs(GTK_NOTEBOOK(notebook), FALSE);
        gtk_notebook_set_show_border(GTK_NOTEBOOK(notebook), FALSE);
 
-       table1 = gtk_table_new(4, 3, FALSE);
+       table1 = gtk_table_new(5, 3, FALSE);
        gtk_widget_show(table1);
        gtk_container_add(GTK_CONTAINER(notebook), table1);
        gtk_container_set_border_width(GTK_CONTAINER(table1), 8);
@@ -319,12 +326,6 @@ static MimeViewer *image_viewer_create(void)
                         (GtkAttachOptions) (0), 0, 0);
        gtk_misc_set_alignment(GTK_MISC(filesize), 0, 0.5);
 
-       load_button = gtk_button_new_with_label(_("Load Image"));
-       gtk_widget_show(load_button);
-       gtk_table_attach(GTK_TABLE(table1), load_button, 1, 2, 3, 4,
-                        (GtkAttachOptions) (GTK_FILL),
-                        (GtkAttachOptions) (0), 0, 0);
-
        label5 = gtk_label_new(_("Content-Type:"));
        gtk_widget_show(label5);
        gtk_table_attach(GTK_TABLE(table1), label5, 0, 1, 2, 3,
@@ -339,6 +340,26 @@ static MimeViewer *image_viewer_create(void)
                         (GtkAttachOptions) (0), 0, 0);
        gtk_misc_set_alignment(GTK_MISC(content_type), 0, 0.5);
 
+       error_lbl = gtk_label_new("");
+       gtk_widget_show(error_lbl);
+       gtk_table_attach(GTK_TABLE(table1), error_lbl, 0, 1, 3, 4,
+                        (GtkAttachOptions) (GTK_FILL),
+                        (GtkAttachOptions) (0), 0, 0);
+       gtk_misc_set_alignment(GTK_MISC(error_lbl), 0, 0.5);
+
+       error_msg = gtk_label_new("");
+       gtk_widget_show(error_msg);
+       gtk_table_attach(GTK_TABLE(table1), error_msg, 1, 3, 3, 4,
+                        (GtkAttachOptions) (GTK_FILL),
+                        (GtkAttachOptions) (0), 0, 0);
+       gtk_misc_set_alignment(GTK_MISC(error_msg), 0, 0.5);
+
+       load_button = gtk_button_new_with_label(_("Load Image"));
+       gtk_widget_show(load_button);
+       gtk_table_attach(GTK_TABLE(table1), load_button, 0, 1, 4, 5,
+                        (GtkAttachOptions) (GTK_FILL),
+                        (GtkAttachOptions) (0), 0, 0);
+
        scrolledwin = gtk_scrolled_window_new(NULL, NULL);
        gtk_widget_show(scrolledwin);
        gtk_container_add(GTK_CONTAINER(notebook), scrolledwin);
@@ -367,6 +388,8 @@ static MimeViewer *image_viewer_create(void)
        imageviewer->filename     = filename;
        imageviewer->filesize     = filesize;
        imageviewer->content_type = content_type;
+       imageviewer->error_msg    = error_msg;
+       imageviewer->error_lbl    = error_lbl;
 
        gtk_widget_ref(notebook);
 
index 2732e8d1b3d157341ee61e2b6c104042c42b93e6..b2bbfcb30ebba01bc96c60714a856445b2cae970 100644 (file)
@@ -623,8 +623,7 @@ static void *matcher_test_thread(void *data)
        pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
        pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
 
-       result = system(td->cmd);
-       if (result) perror("system");
+       result = execute_command_line(td->cmd, FALSE);
        td->done = TRUE; /* let the caller thread join() */
        return GINT_TO_POINTER(result);
 }
@@ -673,9 +672,9 @@ static gboolean matcherprop_match_test(const MatcherProp *prop,
        td->done = FALSE;
        if (pthread_create(&pt, PTHREAD_CREATE_JOINABLE, 
                        matcher_test_thread, td) != 0)
-               retval = system(cmd);
+               retval = execute_command_line(cmd, FALSE);
        else {
-               g_print("waiting for test thread\n");
+               debug_print("waiting for test thread\n");
                while(!td->done) {
                        /* don't let the interface freeze while waiting */
                        claws_do_idle();
@@ -687,7 +686,7 @@ static gboolean matcherprop_match_test(const MatcherProp *prop,
                }
                pthread_join(pt, &res);
                retval = GPOINTER_TO_INT(res);
-               g_print(" test thread returned %d\n", retval);
+               debug_print(" test thread returned %d\n", retval);
        }
        g_free(td);
 #else
@@ -699,7 +698,7 @@ static gboolean matcherprop_match_test(const MatcherProp *prop,
                                cmd);
        }
 
-       retval = system(cmd);
+       retval = execute_command_line(cmd, FALSE);
 #endif
        debug_print("Command exit code: %d\n", retval);
 
index 632bed8704013c1414a9c5b649169dda42d0d303..028f0d07e6b51b6900bff7d937000ef41be47abf 100644 (file)
@@ -709,6 +709,16 @@ static gint disposition_notification_send(MsgInfo *msginfo)
        fprintf(fp, "Subject: Disposition notification: %s\n", buf);
 
        /* Message ID */
+       if (account->set_domain && account->domain) {
+               g_snprintf(buf, sizeof(buf), "%s", account->domain); 
+       } else if (!strncmp(get_domain_name(), "localhost", strlen("localhost"))) {
+               g_snprintf(buf, sizeof(buf), "%s", 
+                       strchr(account->address, '@') ?
+                               strchr(account->address, '@')+1 :
+                               account->address);
+       } else {
+               g_snprintf(buf, sizeof(buf), "%s", "");
+       }
        generate_msgid(buf, sizeof(buf));
        fprintf(fp, "Message-ID: <%s>\n", buf);