sync with 0.8.2cvs5
authorPaul Mangan <paul@claws-mail.org>
Thu, 29 Aug 2002 09:13:53 +0000 (09:13 +0000)
committerPaul Mangan <paul@claws-mail.org>
Thu, 29 Aug 2002 09:13:53 +0000 (09:13 +0000)
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.in
src/inc.c
src/inc.h
src/pop.c
src/prefs_common.c
src/prefs_common.h
src/progressdialog.c

index 09e4a35..5f4adfa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2002-08-29
+
+       * src/inc.[ch]
+         src/pop.c
+         src/progressdialog.c: show detailed information to the status
+         column.
+         Added cur_total_recv_bytes to Pop3State.
+       * src/prefs_common.[ch]: added an option to specify whether to
+         close receive dialog when finished.
+
 2002-08-28
 
        * src/folder.[ch]: folder_get_path(): new. It returns the root path
 2002-08-28
 
        * src/folder.[ch]: folder_get_path(): new. It returns the root path
index 0efcce0..4707eb3 100644 (file)
@@ -1,3 +1,8 @@
+2002-08-29 [paul]      0.8.2claws9
+
+       * sync with 0.8.2cvs5
+               see ChangeLog 2002-08-29
+
 2002-08-29 [colin]     0.8.2claws8
 
        * src/summaryview.c
 2002-08-29 [colin]     0.8.2claws8
 
        * src/summaryview.c
index 61d259f..0e5ea3f 100644 (file)
@@ -1,3 +1,12 @@
+2002-08-29
+
+       * src/inc.[ch]
+         src/pop.c
+         src/progressdialog.c: ¾õÂÖ¥«¥é¥à¤Ë¾ÜºÙ¤Ê¾ðÊó¤òɽ¼¨¡£
+         Pop3State ¤Ë cur_total_recv_bytes ¤òÄɲá£
+       * src/prefs_common.[ch]: ´°Î»»þ¤Ë¼õ¿®¥À¥¤¥¢¥í¥°¤òÊĤ¸¤ë¤«¤É¤¦¤«¤ò
+         »ØÄꤹ¤ë¥ª¥×¥·¥ç¥ó¤òÄɲá£
+
 2002-08-28
 
        * src/folder.[ch]: folder_get_path(): ¿·µ¬¡£ Folder ¤Î¥ë¡¼¥È¥Ñ¥¹¤ò
 2002-08-28
 
        * src/folder.[ch]: folder_get_path(): ¿·µ¬¡£ Folder ¤Î¥ë¡¼¥È¥Ñ¥¹¤ò
index 6c413f0..3ecd3ba 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=8
 MICRO_VERSION=2
 INTERFACE_AGE=0
 BINARY_AGE=0
 MICRO_VERSION=2
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws8
+EXTRA_VERSION=claws9
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index f376ec2..a3a2938 100644 (file)
--- a/src/inc.c
+++ b/src/inc.c
@@ -109,6 +109,9 @@ static void inc_put_error           (IncState        istate);
 
 static void inc_cancel_cb              (GtkWidget      *widget,
                                         gpointer        data);
 
 static void inc_cancel_cb              (GtkWidget      *widget,
                                         gpointer        data);
+static gint inc_dialog_delete_cb       (GtkWidget      *widget,
+                                        GdkEventAny    *event,
+                                        gpointer        data);
 
 static gint inc_spool                  (void);
 static gint get_spool                  (FolderItem     *dest,
 
 static gint inc_spool                  (void);
 static gint get_spool                  (FolderItem     *dest,
@@ -367,7 +370,7 @@ static IncProgressDialog *inc_progress_dialog_create(void)
        gtk_signal_connect(GTK_OBJECT(progress->cancel_btn), "clicked",
                           GTK_SIGNAL_FUNC(inc_cancel_cb), dialog);
        gtk_signal_connect(GTK_OBJECT(progress->window), "delete_event",
        gtk_signal_connect(GTK_OBJECT(progress->cancel_btn), "clicked",
                           GTK_SIGNAL_FUNC(inc_cancel_cb), dialog);
        gtk_signal_connect(GTK_OBJECT(progress->window), "delete_event",
-                          GTK_SIGNAL_FUNC(gtk_true), NULL);
+                          GTK_SIGNAL_FUNC(inc_dialog_delete_cb), dialog);
        /* manage_window_set_transient(GTK_WINDOW(progress->window)); */
 
        progress_dialog_set_value(progress, 0.0);
        /* manage_window_set_transient(GTK_WINDOW(progress->window)); */
 
        progress_dialog_set_value(progress, 0.0);
@@ -489,6 +492,7 @@ static gint inc_start(IncProgressDialog *inc_dialog)
        gint num = 0;
        gint error_num = 0;
        gint new_msgs = 0;
        gint num = 0;
        gint error_num = 0;
        gint new_msgs = 0;
+       gchar *fin_msg;
 
        while (inc_dialog->queue_list != NULL) {
                session = inc_dialog->queue_list->data;
 
        while (inc_dialog->queue_list != NULL) {
                session = inc_dialog->queue_list->data;
@@ -534,8 +538,18 @@ static gint inc_start(IncProgressDialog *inc_dialog)
                inc_state = inc_pop3_session_do(session);
 
                if (inc_state == INC_SUCCESS) {
                inc_state = inc_pop3_session_do(session);
 
                if (inc_state == INC_SUCCESS) {
+                       gchar *msg;
+
+                       if (pop3_state->cur_total_num > 0)
+                               msg = g_strdup_printf
+                                       (_("Done (%d message(s) (%s) received)"),
+                                        pop3_state->cur_total_num,
+                                        to_human_readable(pop3_state->cur_total_recv_bytes));
+                       else
+                               msg = g_strdup_printf(_("Done (no new messages)"));
                        gtk_clist_set_pixmap(clist, num, 0, okxpm, okxpmmask);
                        gtk_clist_set_pixmap(clist, num, 0, okxpm, okxpmmask);
-                       gtk_clist_set_text(clist, num, 2, _("Done"));
+                       gtk_clist_set_text(clist, num, 2, msg);
+                       g_free(msg);
                } else if (inc_state == INC_CANCEL) {
                        gtk_clist_set_pixmap(clist, num, 0, okxpm, okxpmmask);
                        gtk_clist_set_text(clist, num, 2, _("Cancelled"));
                } else if (inc_state == INC_CANCEL) {
                        gtk_clist_set_pixmap(clist, num, 0, okxpm, okxpmmask);
                        gtk_clist_set_text(clist, num, 2, _("Cancelled"));
@@ -633,11 +647,19 @@ static gint inc_start(IncProgressDialog *inc_dialog)
                num++;
        }
 
                num++;
        }
 
+       if (new_msgs > 0)
+               fin_msg = g_strdup_printf(_("Finished (%d new message(s))"),
+                                         new_msgs);
+       else
+               fin_msg = g_strdup_printf(_("Finished (no new messages)"));
+
+       progress_dialog_set_label(inc_dialog->dialog, fin_msg);
+
        if (error_num && !prefs_common.no_recv_err_panel) {
                if (inc_dialog->show_dialog)
                        manage_window_focus_in(inc_dialog->dialog->window,
                                               NULL, NULL);
        if (error_num && !prefs_common.no_recv_err_panel) {
                if (inc_dialog->show_dialog)
                        manage_window_focus_in(inc_dialog->dialog->window,
                                               NULL, NULL);
-               alertpanel_error(_("Some errors occured while getting mail."));
+               alertpanel_error(_("Some errors occurred while getting mail."));
                if (inc_dialog->show_dialog)
                        manage_window_focus_out(inc_dialog->dialog->window,
                                                NULL, NULL);
                if (inc_dialog->show_dialog)
                        manage_window_focus_out(inc_dialog->dialog->window,
                                                NULL, NULL);
@@ -650,7 +672,16 @@ static gint inc_start(IncProgressDialog *inc_dialog)
                        g_list_remove(inc_dialog->queue_list, session);
        }
 
                        g_list_remove(inc_dialog->queue_list, session);
        }
 
-       inc_progress_dialog_destroy(inc_dialog);
+       if (prefs_common.close_recv_dialog)
+               inc_progress_dialog_destroy(inc_dialog);
+       else {
+               gtk_window_set_title(GTK_WINDOW(inc_dialog->dialog->window),
+                                    fin_msg);
+               gtk_label_set_text(GTK_LABEL(GTK_BIN(inc_dialog->dialog->cancel_btn)->child),
+                                  _("Close"));
+       }
+
+       g_free(fin_msg);
 
        return new_msgs;
 }
 
        return new_msgs;
 }
@@ -1075,6 +1106,11 @@ static void inc_cancel(IncProgressDialog *dialog)
 
        g_return_if_fail(dialog != NULL);
 
 
        g_return_if_fail(dialog != NULL);
 
+       if (dialog->queue_list == NULL) {
+               inc_progress_dialog_destroy(dialog);
+               return;
+       }
+
        session = dialog->queue_list->data;
        sockinfo = session->pop3_state->sockinfo;
 
        session = dialog->queue_list->data;
        sockinfo = session->pop3_state->sockinfo;
 
@@ -1103,6 +1139,17 @@ static void inc_cancel_cb(GtkWidget *widget, gpointer data)
        inc_cancel((IncProgressDialog *)data);
 }
 
        inc_cancel((IncProgressDialog *)data);
 }
 
+static gint inc_dialog_delete_cb(GtkWidget *widget, GdkEventAny *event,
+                                gpointer data)
+{
+       IncProgressDialog *dialog = (IncProgressDialog *)data;
+
+       if (dialog->queue_list == NULL)
+               inc_progress_dialog_destroy(dialog);
+
+       return TRUE;
+}
+
 static gint inc_spool(void)
 {
        gchar *mbox, *logname;
 static gint inc_spool(void)
 {
        gchar *mbox, *logname;
index eaead51..1ee99e0 100644 (file)
--- a/src/inc.h
+++ b/src/inc.h
@@ -86,6 +86,7 @@ struct _Pop3State
        gint cur_msg;
        gint cur_total_num;
        gint cur_total_bytes;
        gint cur_msg;
        gint cur_total_num;
        gint cur_total_bytes;
+       gint cur_total_recv_bytes;
 
        Pop3MsgInfo *msg;
 
 
        Pop3MsgInfo *msg;
 
index b648cfc..fce679e 100644 (file)
--- a/src/pop.c
+++ b/src/pop.c
@@ -408,6 +408,7 @@ gint pop3_getsize_list_recv(SockInfo *sock, gpointer data)
        if (pop3_ok(sock, NULL) != PS_SUCCESS) return POP3_LOGOUT_SEND;
 
        state->cur_total_bytes = 0;
        if (pop3_ok(sock, NULL) != PS_SUCCESS) return POP3_LOGOUT_SEND;
 
        state->cur_total_bytes = 0;
+       state->cur_total_recv_bytes = 0;
 
        while ((len = sock_gets(sock, buf, sizeof(buf))) > 0) {
                guint num, size;
 
        while ((len = sock_gets(sock, buf, sizeof(buf))) > 0) {
                guint num, size;
@@ -515,6 +516,7 @@ gint pop3_retr_recv(SockInfo *sock, gpointer data)
                        return next_state;
        
                state->cur_total_bytes += state->msg[state->cur_msg].size;
                        return next_state;
        
                state->cur_total_bytes += state->msg[state->cur_msg].size;
+               state->cur_total_recv_bytes += state->msg[state->cur_msg].size;
                state->cur_total_num++;
 
                state->msg[state->cur_msg].received = TRUE;
                state->cur_total_num++;
 
                state->msg[state->cur_msg].received = TRUE;
index 7915a3f..d39ddc9 100644 (file)
@@ -213,6 +213,7 @@ static struct Interface {
        GtkWidget *checkbtn_addaddrbyclick;
        GtkWidget *optmenu_recvdialog;
        GtkWidget *checkbtn_no_recv_err_panel;
        GtkWidget *checkbtn_addaddrbyclick;
        GtkWidget *optmenu_recvdialog;
        GtkWidget *checkbtn_no_recv_err_panel;
+       GtkWidget *checkbtn_close_recv_dialog;
        GtkWidget *optmenu_nextunreadmsgdialog;
        GtkWidget *entry_pixmap_theme;
        GtkWidget *combo_pixmap_theme;
        GtkWidget *optmenu_nextunreadmsgdialog;
        GtkWidget *entry_pixmap_theme;
        GtkWidget *combo_pixmap_theme;
@@ -732,6 +733,9 @@ static PrefParam param[] = {
        {"no_receive_error_panel", "FALSE", &prefs_common.no_recv_err_panel,
         P_BOOL, &interface.checkbtn_no_recv_err_panel,
         prefs_set_data_from_toggle, prefs_set_toggle},
        {"no_receive_error_panel", "FALSE", &prefs_common.no_recv_err_panel,
         P_BOOL, &interface.checkbtn_no_recv_err_panel,
         prefs_set_data_from_toggle, prefs_set_toggle},
+       {"close_receive_dialog", "TRUE", &prefs_common.close_recv_dialog,
+        P_BOOL, &interface.checkbtn_close_recv_dialog,
+        prefs_set_data_from_toggle, prefs_set_toggle},
        {"nextunreadmsg_dialog", NULL, &prefs_common.next_unread_msg_dialog, P_ENUM,
         &interface.optmenu_nextunreadmsgdialog,
         prefs_nextunreadmsgdialog_set_data_from_optmenu,
        {"nextunreadmsg_dialog", NULL, &prefs_common.next_unread_msg_dialog, P_ENUM,
         &interface.optmenu_nextunreadmsgdialog,
         prefs_nextunreadmsgdialog_set_data_from_optmenu,
@@ -2544,6 +2548,7 @@ static void prefs_interface_create(void)
        GtkWidget *menu;
        GtkWidget *menuitem;
        GtkWidget *checkbtn_no_recv_err_panel;
        GtkWidget *menu;
        GtkWidget *menuitem;
        GtkWidget *checkbtn_no_recv_err_panel;
+       GtkWidget *checkbtn_close_recv_dialog;
 
        GtkWidget *frame_addr;
        GtkWidget *vbox_addr;
 
        GtkWidget *frame_addr;
        GtkWidget *vbox_addr;
@@ -2610,9 +2615,6 @@ static void prefs_interface_create(void)
 
        PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW);
 
 
        PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW);
 
-       PACK_CHECK_BUTTON (vbox2, checkbtn_no_recv_err_panel,
-                          _("No popup error dialog on receive error"));
-
        hbox1 = gtk_hbox_new (FALSE, 8);
        gtk_widget_show (hbox1);
        gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, FALSE, 0);
        hbox1 = gtk_hbox_new (FALSE, 8);
        gtk_widget_show (hbox1);
        gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, FALSE, 0);
@@ -2634,6 +2636,12 @@ static void prefs_interface_create(void)
 
        gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_recvdialog), menu);
 
 
        gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_recvdialog), menu);
 
+       PACK_CHECK_BUTTON (vbox2, checkbtn_no_recv_err_panel,
+                          _("Don't popup error dialog on receive error"));
+
+       PACK_CHECK_BUTTON (vbox2, checkbtn_close_recv_dialog,
+                          _("Close receive dialog when finished"));
+
        PACK_FRAME (vbox1, frame_addr, _("Address book"));
 
        vbox_addr = gtk_vbox_new (FALSE, 0);
        PACK_FRAME (vbox1, frame_addr, _("Address book"));
 
        vbox_addr = gtk_vbox_new (FALSE, 0);
@@ -2727,6 +2735,7 @@ static void prefs_interface_create(void)
        interface.checkbtn_immedexec          = checkbtn_immedexec;
        interface.optmenu_recvdialog          = optmenu_recvdialog;
        interface.checkbtn_no_recv_err_panel  = checkbtn_no_recv_err_panel;
        interface.checkbtn_immedexec          = checkbtn_immedexec;
        interface.optmenu_recvdialog          = optmenu_recvdialog;
        interface.checkbtn_no_recv_err_panel  = checkbtn_no_recv_err_panel;
+       interface.checkbtn_close_recv_dialog  = checkbtn_close_recv_dialog;
        interface.checkbtn_addaddrbyclick     = checkbtn_addaddrbyclick;
        interface.optmenu_nextunreadmsgdialog = optmenu_nextunreadmsgdialog;
        interface.combo_pixmap_theme          = combo_pixmap_theme;
        interface.checkbtn_addaddrbyclick     = checkbtn_addaddrbyclick;
        interface.optmenu_nextunreadmsgdialog = optmenu_nextunreadmsgdialog;
        interface.combo_pixmap_theme          = combo_pixmap_theme;
index 82bef0d..fed5e03 100644 (file)
@@ -220,6 +220,7 @@ struct _PrefsCommon
        gboolean open_inbox_on_inc;
        gboolean immediate_exec;
        RecvDialogMode recv_dialog_mode;
        gboolean open_inbox_on_inc;
        gboolean immediate_exec;
        RecvDialogMode recv_dialog_mode;
+       gboolean close_recv_dialog;
        gboolean no_recv_err_panel;
        NextUnreadMsgDialogShow next_unread_msg_dialog;
        gboolean add_address_by_click;
        gboolean no_recv_err_panel;
        NextUnreadMsgDialogShow next_unread_msg_dialog;
        gboolean add_address_by_click;
index 875b372..2ff64bc 100644 (file)
@@ -56,7 +56,7 @@ ProgressDialog *progress_dialog_create(void)
        progress = g_new0(ProgressDialog, 1);
 
        window = gtk_window_new(GTK_WINDOW_DIALOG);
        progress = g_new0(ProgressDialog, 1);
 
        window = gtk_window_new(GTK_WINDOW_DIALOG);
-       gtk_widget_set_usize(window, 450, -1);
+       gtk_widget_set_usize(window, 460, -1);
        gtk_container_set_border_width(GTK_CONTAINER(window), 8);
        gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
        gtk_window_set_policy(GTK_WINDOW(window), FALSE, TRUE, TRUE);
        gtk_container_set_border_width(GTK_CONTAINER(window), 8);
        gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
        gtk_window_set_policy(GTK_WINDOW(window), FALSE, TRUE, TRUE);
@@ -98,7 +98,7 @@ ProgressDialog *progress_dialog_create(void)
        gtk_clist_set_column_justification(GTK_CLIST(clist), 0,
                                           GTK_JUSTIFY_CENTER);
        gtk_clist_set_column_width(GTK_CLIST(clist), 0, 16);
        gtk_clist_set_column_justification(GTK_CLIST(clist), 0,
                                           GTK_JUSTIFY_CENTER);
        gtk_clist_set_column_width(GTK_CLIST(clist), 0, 16);
-       gtk_clist_set_column_width(GTK_CLIST(clist), 1, 180);
+       gtk_clist_set_column_width(GTK_CLIST(clist), 1, 160);
 
        progress->window      = window;
        progress->label       = label;
 
        progress->window      = window;
        progress->label       = label;