sync with sylpheed 0.5.3cvs7
authorPaul Mangan <paul@claws-mail.org>
Fri, 24 Aug 2001 11:19:44 +0000 (11:19 +0000)
committerPaul Mangan <paul@claws-mail.org>
Fri, 24 Aug 2001 11:19:44 +0000 (11:19 +0000)
12 files changed:
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.in
src/compose.c
src/inc.c
src/main.c
src/mainwindow.c
src/recv.c
src/summaryview.c
src/utils.c
src/utils.h

index 4668c6b..e789dde 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,31 @@
-2001-08-22
+2001-08-24
+
+       * src/main.c: open new account dialog if no account is set.
+       * src/utils.[ch]: log_verbosity_set(): new. It increase/decrease
+         the verbosity count.
+         log_print(): put to statusbar only if log_verbosity_count > 0.
+         log_message(): put to statusbar.
+       * src/inc.c: inc_pop3_session_do(): set log verbosity.
+       * src/mainwindow.c: main_window_set_menu_sensitive(): added the
+         "Compose new message" item.
+         main_window_show_cur_account(): removed "Current account: " string.
+       * src/summaryview.c: summary_show(): ignore the current marks if
+         main window is locked.
+       * src/compose.c: compose_attach_property(): fixed a bug that caused
+         segmentation fault.
+
+2001-08-23
+
+       * src/mainwindow.c: main_window_get_current_state(): new. It returns
+         the current state for the sensitivity of UI.
+         main_window_set_toolbar_sensitive(): use table like
+         main_window_set_menu_sensitive().
+
+2001-08-23
 
        * src/mainwindow.[ch]: added progressbar and status label to the
          statusbar.
+         main_window_close_cb(): don't exit if locked.
        * src/inc.c: update the progressbar of main window, too.
 
 2001-08-22
index 339e192..ab31d55 100644 (file)
@@ -1,3 +1,10 @@
+2001-08-24 [paul]
+
+       * configure.in
+               change to 0.5.3claws4
+
+       * sync with sylpheed 0.5.3cvs7
+
 2001-08-24 [christoph]
 
        * src/compose.c
index ad508fd..19abb29 100644 (file)
@@ -1,7 +1,34 @@
-2001-08-22
+2001-08-24
+
+       * src/main.c: ¥¢¥«¥¦¥ó¥È¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¿·µ¬¥¢¥«¥¦¥ó¥È
+         ¥À¥¤¥¢¥í¥°¤ò³«¤¯¤è¤¦¤Ë¤·¤¿¡£
+       * src/utils.[ch]: log_verbosity_set(): ¿·µ¬¡£ verbosity count ¤ò
+         Áý²Ã/¸º¾¯¤µ¤»¤ë¡£
+         log_print(): log_verbosity_count > 0 ¤Î¾ì¹ç¤Î¤ß¥¹¥Æ¡¼¥¿¥¹¥Ð¡¼¤Ë
+         ½ÐÎÏ¡£
+         log_message(): ¥¹¥Æ¡¼¥¿¥¹¥Ð¡¼¤Ë½ÐÎÏ¡£
+       * src/inc.c: inc_pop3_session_do(): ¥í¥°¤Î verbosity ¤ò»ØÄê¡£
+       * src/mainwindow.c: main_window_set_menu_sensitive(): ¡Ö¿·µ¬
+         ¥á¥Ã¥»¡¼¥¸¤òºîÀ®¡×¹àÌܤòÄɲá£
+         main_window_show_cur_accoun(): ¡Ö¸½ºß¤Î¥¢¥«¥¦¥ó¥È: ¡×¤Îʸ»úÎó¤ò
+         ºï½ü¡£
+       * src/summaryview.c: summary_show(): ¥á¥¤¥ó¥¦¥£¥ó¥É¥¦¤¬¥í¥Ã¥¯¤µ¤ì
+         ¤Æ¤¤¤ì¤Ð¸½ºß¤Î¥Þ¡¼¥¯¤ò̵»ë¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+       * src/compose.c: compose_attach_property(): segmentation fault
+         ¤òµ¯¤³¤¹¥Ð¥°¤ò½¤Àµ¡£
+
+2001-08-23
+
+       * src/mainwindow.c: main_window_get_current_state(): ¿·µ¬¡£ UI ¤Î
+         sensitivity ¤Î¤¿¤á¤Î¡¢¸½ºß¤Î¾õÂÖ¤òÊÖ¤¹¡£
+         main_window_set_toolbar_sensitive():
+         main_window_set_menu_sensitive() ¤Î¤è¤¦¤Ë¥Æ¡¼¥Ö¥ë¤ò»ÈÍÑ¡£
+
+2001-08-23
 
        * src/mainwindow.[ch]: ¥¹¥Æ¡¼¥¿¥¹¥Ð¡¼¤Ë¥×¥í¥°¥ì¥¹¥Ð¡¼¤È¥¹¥Æ¡¼¥¿¥¹
          ¥é¥Ù¥ë¤òÄɲá£
+         main_window_close_cb(): ¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ì¤Ð½ªÎ»¤·¤Ê¤¤¤è¤¦¤Ë¤·¤¿¡£
        * src/inc.c: ¥á¥¤¥ó¥¦¥£¥ó¥É¥¦¤Î¥×¥í¥°¥ì¥¹¥Ð¡¼¤â¹¹¿·¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
 
 2001-08-22
index b691f0d..65767cb 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=5
 MICRO_VERSION=3
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws3
+EXTRA_VERSION=claws4
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl
index aef20d2..7cfbeca 100644 (file)
@@ -3603,8 +3603,8 @@ static void compose_attach_property(Compose *compose)
        GtkCList *clist = GTK_CLIST(compose->attach_clist);
        AttachInfo *ainfo;
        gint row;
-       gboolean cancelled;
        GtkOptionMenu *optmenu;
+       static gboolean cancelled;
 
        if (!clist->selection) return;
        row = GPOINTER_TO_INT(clist->selection->data);
@@ -3639,7 +3639,8 @@ static void compose_attach_property(Compose *compose)
                GtkWidget *menu;
                GtkWidget *menuitem;
 
-               gtk_main();
+               cancelled = FALSE;
+                gtk_main();
 
                if (cancelled == TRUE) {
                        gtk_widget_hide(attach_prop.window);
index 610e333..fc87c88 100644 (file)
--- a/src/inc.c
+++ b/src/inc.c
@@ -623,6 +623,7 @@ static IncState inc_pop3_session_do(IncSession *session)
        progress_dialog_set_label(inc_dialog->dialog, buf);
        g_free(buf);
        GTK_EVENTS_FLUSH();
+       statusbar_pop_all();
 
 #if USE_THREADS
        if ((sockinfo = sock_connect_with_thread(server, port)) == NULL) {
@@ -664,7 +665,7 @@ static IncState inc_pop3_session_do(IncSession *session)
        }
 #endif
 
-
+       log_verbosity_set(TRUE);
        recv_set_ui_func(inc_pop3_recv_func, session);
 
 #if USE_THREADS
@@ -678,6 +679,7 @@ static IncState inc_pop3_session_do(IncSession *session)
 
        gtk_main();
 
+       log_verbosity_set(FALSE);
        recv_set_ui_func(NULL, NULL);
 
 #if USE_THREADS
index 67e6903..ae08074 100644 (file)
@@ -267,6 +267,11 @@ int main(int argc, char *argv[])
                setup(mainwin);
                folder_write_list();
        }
+       if (!account_get_list()) {
+               account_edit_open();
+               account_add();
+       }
+
        account_set_missing_folder();
        folderview_set(folderview);
 
index 1e9a39f..45eae9d 100644 (file)
@@ -659,7 +659,7 @@ MainWindow *main_window_create(SeparateType type)
        gtk_box_pack_start(GTK_BOX(hbox_stat), statusbar, TRUE, TRUE, 0);
 
        progressbar = gtk_progress_bar_new();
-       gtk_widget_set_usize(progressbar, 120, -1);
+       gtk_widget_set_usize(progressbar, 120, 1);
        gtk_box_pack_start(GTK_BOX(hbox_stat), progressbar, FALSE, FALSE, 0);
 
        statuslabel = gtk_label_new("");
@@ -864,14 +864,13 @@ void main_window_cursor_normal(MainWindow *mainwin)
 /* lock / unlock the user-interface */
 void main_window_lock(MainWindow *mainwin)
 {
-       if (mainwin->lock_count == 0) {
-               gtk_widget_set_sensitive(mainwin->toolbar, FALSE);
+       if (mainwin->lock_count == 0)
                gtk_widget_set_sensitive(mainwin->ac_button, FALSE);
-       }
 
        mainwin->lock_count++;
 
        main_window_set_menu_sensitive(mainwin);
+       main_window_set_toolbar_sensitive(mainwin);
 }
 
 void main_window_unlock(MainWindow *mainwin)
@@ -880,11 +879,10 @@ void main_window_unlock(MainWindow *mainwin)
                mainwin->lock_count--;
 
        main_window_set_menu_sensitive(mainwin);
+       main_window_set_toolbar_sensitive(mainwin);
 
-       if (mainwin->lock_count == 0) {
-               gtk_widget_set_sensitive(mainwin->toolbar, TRUE);
+       if (mainwin->lock_count == 0)
                gtk_widget_set_sensitive(mainwin->ac_button, TRUE);
-       }
 }
 
 void main_window_reflect_prefs_all(void)
@@ -896,13 +894,8 @@ void main_window_reflect_prefs_all(void)
                mainwin = (MainWindow *)cur->data;
 
                main_window_show_cur_account(mainwin);
-               if (cur_account) {
-                       gtk_widget_set_sensitive(mainwin->get_btn,    TRUE);
-                       gtk_widget_set_sensitive(mainwin->getall_btn, TRUE);
-               } else {
-                       gtk_widget_set_sensitive(mainwin->get_btn,    FALSE);
-                       gtk_widget_set_sensitive(mainwin->getall_btn, FALSE);
-               }
+               main_window_set_menu_sensitive(mainwin);
+               main_window_set_toolbar_sensitive(mainwin);
 
                if (prefs_common.immediate_exec)
                        gtk_widget_hide(mainwin->exec_btn);
@@ -967,10 +960,11 @@ static void main_window_show_cur_account(MainWindow *mainwin)
        gtk_window_set_title(GTK_WINDOW(mainwin->window), buf);
        g_free(buf);
 
-       buf = g_strdup_printf(_("Current account: %s"), ac_name);
-       gtk_label_set_text(GTK_LABEL(mainwin->ac_label), buf);
+       /* buf = g_strdup_printf(_("Current account: %s"), ac_name);
+       gtk_label_set_text(GTK_LABEL(mainwin->ac_label), buf);   */
+       gtk_label_set_text(GTK_LABEL(mainwin->ac_label), ac_name);
        gtk_widget_queue_resize(mainwin->ac_button);
-       g_free(buf);
+       /* g_free(buf); */
 
        g_free(ac_name);
 }
@@ -1175,52 +1169,93 @@ void main_window_add_mbox(MainWindow *mainwin)
        folderview_set(mainwin->folderview);
 }
 
-void main_window_set_toolbar_sensitive(MainWindow *mainwin)
+typedef enum
 {
-       gboolean sensitive;
+       M_UNLOCKED            = 1 << 0,
+       M_MSG_EXIST           = 1 << 1,
+       M_TARGET_EXIST        = 1 << 2,
+       M_SINGLE_TARGET_EXIST = 1 << 3,
+       M_EXEC                = 1 << 4,
+       M_ALLOW_REEDIT        = 1 << 5,
+       M_HAVE_ACCOUNT        = 1 << 6
+} SensitiveCond;
 
-       if (GTK_CLIST(mainwin->summaryview->ctree)->row_list)
-               sensitive = TRUE;
-       else
-               sensitive = FALSE;
-
-       gtk_widget_set_sensitive(mainwin->reply_btn,       sensitive);
-       gtk_widget_set_sensitive(mainwin->replyall_btn,    sensitive);
-       gtk_widget_set_sensitive(mainwin->replysender_btn, sensitive);
-       gtk_widget_set_sensitive(mainwin->fwd_btn,         sensitive);
-       gtk_widget_set_sensitive(mainwin->exec_btn,        sensitive);
-       gtk_widget_set_sensitive(mainwin->next_btn,        sensitive);
-
-       if (!mainwin->summaryview->folder_item ||
-           mainwin->summaryview->folder_item->folder->type == F_NEWS)
-               gtk_widget_set_sensitive(mainwin->delete_btn, FALSE);
-       else
-               gtk_widget_set_sensitive(mainwin->delete_btn, sensitive);
+static SensitiveCond main_window_get_current_state(MainWindow *mainwin)
+{
+       SensitiveCond state = 0;
+       SummarySelection selection;
+
+       selection = summary_get_selection_type(mainwin->summaryview);
+
+       if (mainwin->lock_count == 0)
+               state |= M_UNLOCKED;
+       if (selection != SUMMARY_NONE)
+               state |= M_MSG_EXIST;
+       if (selection == SUMMARY_SELECTED_SINGLE ||
+           selection == SUMMARY_SELECTED_MULTIPLE)
+               state |= M_TARGET_EXIST;
+       if (selection == SUMMARY_SELECTED_SINGLE)
+               state |= M_SINGLE_TARGET_EXIST;
+       if (mainwin->summaryview->folder_item &&
+           mainwin->summaryview->folder_item->folder->type != F_NEWS)
+               state |= M_EXEC;
+       if (selection == SUMMARY_SELECTED_SINGLE &&
+           (mainwin->summaryview->folder_item &&
+            mainwin->summaryview->folder_item->stype == F_DRAFT))
+               state |= M_ALLOW_REEDIT;
+       if (cur_account)
+               state |= M_HAVE_ACCOUNT;
+
+       return state;
 }
 
-typedef enum
+void main_window_set_toolbar_sensitive(MainWindow *mainwin)
 {
-       M_UNLOCKED             = 1 << 0,
-       M_MSG_EXIST            = 1 << 1,
-       M_TARGET_EXIST         = 1 << 2,
-       M_SINGLE_TARGET_EXIST  = 1 << 3,
-       M_EXEC                 = 1 << 4,
-       M_ALLOW_REEDIT         = 1 << 5
-} MenuItemSensitiveCond;
+       SensitiveCond state;
+        gboolean sensitive;
+       gint i;
+
+       const struct {
+               GtkWidget *widget;
+               SensitiveCond cond;
+       } entry[] = {
+               {mainwin->get_btn         , M_HAVE_ACCOUNT|M_UNLOCKED},
+               {mainwin->getall_btn      , M_HAVE_ACCOUNT|M_UNLOCKED},
+               {mainwin->compose_mail_btn, M_HAVE_ACCOUNT},
+               {mainwin->compose_news_btn, M_HAVE_ACCOUNT},
+               {mainwin->reply_btn       , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST},
+               {mainwin->replyall_btn    , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST},
+               {mainwin->replysender_btn , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST},
+               {mainwin->fwd_btn         , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST},
+               /* {mainwin->prefs_btn      , M_UNLOCKED},
+               {mainwin->account_btn    , M_UNLOCKED}, */
+               {mainwin->next_btn        , M_MSG_EXIST},
+               {mainwin->delete_btn      , M_TARGET_EXIST|M_EXEC|M_UNLOCKED},
+               {mainwin->exec_btn        , M_MSG_EXIST|M_EXEC|M_UNLOCKED},
+               {NULL, 0}
+       };
+
+       state = main_window_get_current_state(mainwin);
+
+       for (i = 0; entry[i].widget != NULL; i++) {
+               sensitive = ((entry[i].cond & state) == entry[i].cond);
+               gtk_widget_set_sensitive(entry[i].widget, sensitive);
+       }
+}
 
 void main_window_set_menu_sensitive(MainWindow *mainwin)
 {
        GtkItemFactory *ifactory;
-       SummarySelection selection;
-       MenuItemSensitiveCond state = 0;
+       SensitiveCond state;
        gboolean sensitive;
        gint i;
 
        static const struct {
                gchar *const entry;
-               MenuItemSensitiveCond cond;
+               SensitiveCond cond;
        } entry[] = {
                {"/File/Add mailbox..."        , M_UNLOCKED},
+                {"/File/Add mbox mailbox..."   , M_UNLOCKED},
                {"/File/Update folder tree"    , M_UNLOCKED},
                {"/File/Folder"                , M_UNLOCKED},
                {"/File/Import mbox file..."   , M_UNLOCKED},
@@ -1235,6 +1270,7 @@ void main_window_set_menu_sensitive(MainWindow *mainwin)
                {"/Message/Get from all accounts", M_UNLOCKED},
                {"/Message/Reply"                , M_SINGLE_TARGET_EXIST},
                {"/Message/Reply to sender"      , M_SINGLE_TARGET_EXIST},
+                {"/Message/Folllow-up and reply to", M_SINGLE_TARGET_EXIST},
                {"/Message/Reply to all"         , M_SINGLE_TARGET_EXIST},
                {"/Message/Forward"              , M_SINGLE_TARGET_EXIST},
                {"/Message/Forward as attachment", M_SINGLE_TARGET_EXIST},
@@ -1248,10 +1284,12 @@ void main_window_set_menu_sensitive(MainWindow *mainwin)
                {"/Message/Re-edit", M_ALLOW_REEDIT},
 
                {"/Summary/Delete duplicated messages", M_MSG_EXIST|M_EXEC|M_UNLOCKED},
-               {"/Summary/Filter messages", M_MSG_EXIST|M_EXEC|M_UNLOCKED},
+               {"/Summary/Filter messages"    , M_MSG_EXIST|M_EXEC|M_UNLOCKED},
                {"/Summary/Execute"            , M_MSG_EXIST|M_UNLOCKED},
                {"/Summary/Prev message"       , M_MSG_EXIST},
                {"/Summary/Next message"       , M_MSG_EXIST},
+               {"/Summary/Prev marked message", M_MSG_EXIST},
+               {"/Summary/Next marked message", M_MSG_EXIST},
                {"/Summary/Next unread message", M_MSG_EXIST},
                {"/Summary/Sort"               , M_MSG_EXIST},
 
@@ -1261,24 +1299,7 @@ void main_window_set_menu_sensitive(MainWindow *mainwin)
        };
 
        ifactory = gtk_item_factory_from_widget(mainwin->menubar);
-       selection = summary_get_selection_type(mainwin->summaryview);
-
-       if (mainwin->lock_count == 0)
-               state |= M_UNLOCKED;
-       if (selection != SUMMARY_NONE)
-               state |= M_MSG_EXIST;
-       if (selection == SUMMARY_SELECTED_SINGLE ||
-           selection == SUMMARY_SELECTED_MULTIPLE)
-               state |= M_TARGET_EXIST;
-       if (selection == SUMMARY_SELECTED_SINGLE)
-               state |= M_SINGLE_TARGET_EXIST;
-       if (mainwin->summaryview->folder_item &&
-           mainwin->summaryview->folder_item->folder->type != F_NEWS)
-               state |= M_EXEC;
-       if (selection == SUMMARY_SELECTED_SINGLE &&
-           (mainwin->summaryview->folder_item &&
-            mainwin->summaryview->folder_item->stype == F_DRAFT))
-               state |= M_ALLOW_REEDIT;
+        state = main_window_get_current_state(mainwin);
 
        for (i = 0; entry[i].entry != NULL; i++) {
                sensitive = ((entry[i].cond & state) == entry[i].cond);
index 8be500a..e462758 100644 (file)
@@ -126,7 +126,7 @@ gint recv_write(SockInfo *sock, FILE *fp)
                if (recv_ui_func) {
                        gettimeofday(&tv_cur, NULL);
                        /* if elapsed time from previous update is greater
-                          than 10msec, update UI */
+                          than 50msec, update UI */
                        if (tv_cur.tv_sec - tv_prev.tv_sec > 0 ||
                            tv_cur.tv_usec - tv_prev.tv_usec > UI_REFRESH_INTERVAL) {
                                recv_ui_func(sock, count, bytes,
index 5e85875..c3c22cb 100644 (file)
@@ -933,7 +933,8 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item,
        }
 
        /* process the marks if any */
-       if (summaryview->moved > 0 || summaryview->copied > 0) {
+       if (summaryview->mainwin->lock_count == 0 &&
+           (summaryview->moved > 0 || summaryview->copied > 0)) {
                AlertValue val;
 
                val = alertpanel(_("Process mark"),
index e12d18a..0ee97f4 100644 (file)
@@ -1999,6 +1999,16 @@ void close_log_file(void)
        }
 }
 
+static guint log_verbosity_count = 0;
+
+void log_verbosity_set(gboolean verbose)
+{
+       if (verbose)
+               log_verbosity_count++;
+       else if (log_verbosity_count > 0)
+               log_verbosity_count--;
+}
+
 void debug_print(const gchar *format, ...)
 {
        va_list args;
@@ -2035,8 +2045,8 @@ void log_print(const gchar *format, ...)
                fputs(logbuf, log_fp);
                fflush(log_fp);
        }
-       statusbar_puts_all(buf);
-       
+       if (log_verbosity_count)
+               statusbar_puts_all(buf);
        g_free(logbuf);
 }
 
@@ -2056,6 +2066,7 @@ void log_message(const gchar *format, ...)
                fputs(buf, log_fp);
                fflush(log_fp);
        }
+       statusbar_puts_all(buf);
 }
 
 void log_warning(const gchar *format, ...)
index 9501547..63e19f1 100644 (file)
@@ -295,6 +295,7 @@ void get_rfc822_date                (gchar          *buf,
 /* logging */
 void set_log_file      (const gchar *filename);
 void close_log_file    (void);
+void log_verbosity_set (gboolean verbose);
 void debug_print       (const gchar *format, ...) G_GNUC_PRINTF(1, 2);
 void log_print         (const gchar *format, ...) G_GNUC_PRINTF(1, 2);
 void log_message       (const gchar *format, ...) G_GNUC_PRINTF(1, 2);