more sync with sylpheed 0.5.0pre4
authorPaul Mangan <paul@claws-mail.org>
Wed, 4 Jul 2001 10:14:20 +0000 (10:14 +0000)
committerPaul Mangan <paul@claws-mail.org>
Wed, 4 Jul 2001 10:14:20 +0000 (10:14 +0000)
14 files changed:
ChangeLog
ChangeLog.claws
ChangeLog.jp
INSTALL
INSTALL.jp
configure.in
src/codeconv.c
src/imap.c
src/news.c
src/prefs_account.c
src/prefs_account.h
src/prefs_common.c
src/textview.c
src/textview.h

index b39350b..a674ce9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2001-07-04
+
+       * src/prefs_account.[ch]: the port numbers of IMAP4 and NNTP
+         became specifiable.
+       * src/imap.c: imap_session_get()
+         src/news.c: news_session_new_for_folder(), news_session_get():
+         use user-defined port number if specified.
+
+2001-07-03
+
+       * src/imap.c: imap_scan_tree_recursive(): get mailbox status when
+         scanning.
+         imap_scan_folder(): implemented. It updates the numbers of new,
+         unread and total messages.
+         imap_status(): new. It parses the response of STATUS command.
+         imap_status_uidnext(): removed.
+         imap_cmd_status(): removed.
+       * src/textview.c: textview_show_part(): fixed potential memory leaks.
+
 2001-07-03
 
        * src/alertpanel.c: alertpanel_create(): fixed truncated message.
@@ -7,6 +26,9 @@
          detection.
        * src/prefs_common.c: prefs_send_create(): made some more character
          sets specifiable when not using libjconv.
+       * configure.in: disabled --enable-threads option temporarily.
+       * INSTALL
+         INSTALL.jp: deleted the description about --enable-threads option.
 
 2001-07-02
 
index f6beb1c..58b468a 100644 (file)
@@ -1,3 +1,7 @@
+2001-07-04 [paul]
+
+       more sync with sylpheed 0.5.0pre4
+
 2001-07-03 [christoph]
 
        * src/addressbook.c
index 8555f72..63aa5fb 100644 (file)
@@ -1,3 +1,20 @@
+2001-07-04
+
+       * src/prefs_account.[ch]: IMAP4 ¤È NNTP ¤Î¥Ý¡¼¥ÈÈÖ¹æ¤ò»ØÄê²Äǽ¤Ë¤·¤¿¡£
+       * src/imap.c: imap_session_get()
+         src/news.c: news_session_new_for_folder(), news_session_get():
+         »ØÄꤵ¤ì¤Æ¤¤¤ì¤Ð¥æ¡¼¥¶ÄêµÁ¤Î¥Ý¡¼¥ÈÈÖ¹æ¤ò»ÈÍѤ¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+
+2001-07-03
+
+       * src/imap.c: imap_scan_tree_recursive(): ¥¹¥­¥ã¥óÃæ¤Ë¥á¡¼¥ë¥Ü¥Ã¥¯¥¹
+         ¤Î¥¹¥Æ¡¼¥¿¥¹¤ò¼èÆÀ¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+         imap_scan_folder(): ¼ÂÁõ¡£¿·Ã塢̤ÆÉ¡¢¹ç·×¤Î¥á¥Ã¥»¡¼¥¸¿ô¤ò¹¹¿·¤¹¤ë¡£
+         imap_status(): ¿·µ¬¡£ STATUS ¥³¥Þ¥ó¥É¤Î±þÅú¤ò²òÀϤ¹¤ë¡£
+         imap_status_uidnext(): ºï½ü¡£
+         imap_cmd_status(): ºï½ü¡£
+       * src/textview.c: textview_show_part(): ÀøºßŪ¤Ê¥á¥â¥ê¥ê¡¼¥¯¤ò½¤Àµ¡£
+
 2001-07-03
 
        * src/alertpanel.c: alertpanel_create(): ¥á¥Ã¥»¡¼¥¸¤¬ÅÓÀÚ¤ì¤ë¤Î¤ò½¤Àµ¡£
@@ -7,6 +24,9 @@
          ½¤Àµ¡£
        * src/prefs_common.c: prefs_send_create(): libjconv Ì¤»ÈÍÑ»þ¤Ë
          ÄɲäǤ¤¤¯¤Ä¤«¤Îʸ»ú¥³¡¼¥É¥»¥Ã¥È¤ò»ØÄê¤Ç¤­¤ë¤è¤¦¤Ë¤·¤¿¡£
+       * configure.in: °ì»þŪ¤Ë --enable-threads ¤ò̵¸ú¤Ë¤·¤¿¡£
+       * INSTALL
+         INSTALL.jp: --enable-threads ¥ª¥×¥·¥ç¥ó¤Ë¤Ä¤¤¤Æ¤Îµ­½Ò¤òºï½ü¡£
 
 2001-07-01
 
diff --git a/INSTALL b/INSTALL
index 9360bea..8d18fd1 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -86,12 +86,6 @@ I recommend you to install gdk-pixbuf or gdk_imlib library before installing
 for built-in image view support, and libcompface for X-Face support.
 
 
-If you want to enable multithread support, append the option
---enable-threads after ./configure.
-
-WARNING: Multithread support is still in an experimental stage, and it
-         DOESN'T work correctly. DON'T use it unless you want to hack it.
-
 If you want to enable IPv6 support, append the option
 --enable-ipv6 after ./configure.
 
index 34040aa..a8104e7 100644 (file)
@@ -86,12 +86,6 @@ Password: [
 ¤³¤È¤ò¤ª´«¤á¤·¤Þ¤¹¡£
 
 
-¥Þ¥ë¥Á¥¹¥ì¥Ã¥ÉÂбþ¤òÍ­¸ú¤Ë¤·¤¿¤¤¾ì¹ç¤Ï¡¢ ./configure ¤Î¸å¤Ë
---enable-threads ¥ª¥×¥·¥ç¥ó¤òÄɲ䷤Ƥ¯¤À¤µ¤¤¡£
-
-·Ù¹ð: ¥Þ¥ë¥Á¥¹¥ì¥Ã¥ÉÂбþ¤Ï¤Þ¤À¼Â¸³Ãʳ¬¤Ç¤¢¤ê¡¢Àµ¤·¤¯Æ°ºî¤·¤Þ¤»¤ó¡£
-      hack ¤·¤¿¤¤¤Î¤Ç¤Ê¤±¤ì¤Ð¡¢»ÈÍѤ·¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£
-
 IPv6 Âбþ¤òÍ­¸ú¤Ë¤·¤¿¤¤¾ì¹ç¤Ï¡¢ ./configure ¤Î¸å¤Ë
 --enable-ipv6 ¥ª¥×¥·¥ç¥ó¤òÄɲ䷤Ƥ¯¤À¤µ¤¤¡£
 
index 08f152d..0ab89e9 100644 (file)
@@ -148,9 +148,9 @@ AC_CHECK_LIB(xpg4, setlocale)
 dnl AC_CHECK_LIB(kcc, KCC_filter)
 
 dnl for GThread support
-AC_ARG_ENABLE(threads,
-       [  --enable-threads        Enable multithread support [default=no]],
-       [use_threads=$enableval], [use_threads=no])
+dnl AC_ARG_ENABLE(threads,
+dnl    [  --enable-threads        Enable multithread support [default=no]],
+dnl    [use_threads=$enableval], [use_threads=no])
 
 AC_MSG_CHECKING([whether to use threads])
 if test x"$use_threads" = xyes ; then
@@ -215,7 +215,6 @@ AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \
                 sys/param.h sys/utsname.h \
                 wchar.h wctype.h)
 
-
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
 AC_TYPE_OFF_T
index 25dd5b7..45b5a09 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999,2000 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2001 Hiroyuki Yamamoto
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
index 4108bab..0518811 100644 (file)
@@ -97,12 +97,13 @@ static gint imap_select                     (IMAPSession    *session,
 static gint imap_get_uid               (IMAPSession    *session,
                                         gint            msgnum,
                                         guint32        *uid);
-#if 0
-static gint imap_status_uidnext                (IMAPSession    *session,
+static gint imap_status                        (IMAPSession    *session,
                                         IMAPFolder     *folder,
                                         const gchar    *path,
-                                        guint32        *uid_next);
-#endif
+                                        gint           *messages,
+                                        gint           *recent,
+                                        gint           *unseen,
+                                        guint32        *uid_validity);
 
 static void imap_parse_namespace               (IMAPSession    *session,
                                                 IMAPFolder     *folder);
@@ -148,12 +149,6 @@ static gint imap_cmd_select        (SockInfo       *sock,
                                 gint           *recent,
                                 gint           *unseen,
                                 guint32        *uid_validity);
-#if 0
-static gint imap_cmd_status    (SockInfo       *sock,
-                                const gchar    *folder,
-                                const gchar    *status,
-                                gint           *value);
-#endif
 static gint imap_cmd_create    (SockInfo       *sock,
                                 const gchar    *folder);
 static gint imap_cmd_delete    (SockInfo       *sock,
@@ -201,15 +196,18 @@ static void imap_path_separator_subst             (gchar          *str,
 static IMAPSession *imap_session_get(Folder *folder)
 {
        RemoteFolder *rfolder = REMOTE_FOLDER(folder);
+       gushort port;
 
        g_return_val_if_fail(folder != NULL, NULL);
        g_return_val_if_fail(folder->type == F_IMAP, NULL);
        g_return_val_if_fail(folder->account != NULL, NULL);
 
+       port = folder->account->set_imapport ? folder->account->imapport
+               : IMAP4_PORT;
+
        if (!rfolder->session) {
                rfolder->session =
-                       imap_session_new(folder->account->recv_server,
-                                        IMAP4_PORT,
+                       imap_session_new(folder->account->recv_server, port,
                                         folder->account->userid,
                                         folder->account->passwd);
                if (rfolder->session)
@@ -222,11 +220,11 @@ static IMAPSession *imap_session_get(Folder *folder)
        if (imap_cmd_noop(rfolder->session->sock) != IMAP_SUCCESS) {
                log_warning(_("IMAP4 connection to %s:%d has been"
                              " disconnected. Reconnecting...\n"),
-                           folder->account->recv_server, IMAP4_PORT);
+                           folder->account->recv_server, port);
                session_destroy(rfolder->session);
                rfolder->session =
-                       imap_session_new(folder->account->recv_server,
-                                        IMAP4_PORT, folder->account->userid,
+                       imap_session_new(folder->account->recv_server, port,
+                                        folder->account->userid,
                                         folder->account->passwd);
                if (rfolder->session)
                        imap_parse_namespace(IMAP_SESSION(rfolder->session),
@@ -679,6 +677,26 @@ gint imap_remove_all_msg(Folder *folder, FolderItem *item)
 
 void imap_scan_folder(Folder *folder, FolderItem *item)
 {
+       IMAPSession *session;
+       gint messages, recent, unseen;
+       guint32 uid_validity;
+       gint ok;
+
+       g_return_if_fail(folder != NULL);
+       g_return_if_fail(item != NULL);
+
+       session = imap_session_get(folder);
+       if (!session) return;
+
+       ok = imap_status(session, IMAP_FOLDER(folder), item->path,
+                        &messages, &recent, &unseen, &uid_validity);
+       statusbar_pop_all();
+       if (ok != IMAP_SUCCESS) return;
+
+       item->new = recent;
+       item->unread = unseen;
+       item->total = messages;
+       /* item->mtime = uid_validity; */
 }
 
 void imap_scan_tree(Folder *folder)
@@ -783,6 +801,8 @@ static void imap_scan_tree_recursive(IMAPSession *session,
                        }
                }
                folder_item_append(item, new_item);
+               if (new_item->no_select == FALSE)
+                       imap_scan_folder(new_item->folder, new_item);
                if (new_item->no_sub == FALSE)
                        imap_scan_tree_recursive(session, new_item, namespace);
        }
@@ -1493,7 +1513,6 @@ static MsgInfo *imap_parse_envelope(SockInfo *sock, GString *line_str)
        gchar *inreplyto = NULL;
        gchar *msgid = NULL;
        MsgFlags flags = 0;
-       gint n_element = 0;
 
        g_return_val_if_fail(line_str != NULL, NULL);
        g_return_val_if_fail(line_str->str[0] == '*' &&
@@ -1516,7 +1535,7 @@ static MsgInfo *imap_parse_envelope(SockInfo *sock, GString *line_str)
        g_return_val_if_fail(*cur_pos == '(', NULL);
        cur_pos++;
 
-       while (n_element < 4) {
+       while (*cur_pos != '\0' && *cur_pos != ')') {
                while (*cur_pos == ' ') cur_pos++;
 
                if (!strncmp(cur_pos, "UID ", 4)) {
@@ -1607,9 +1626,6 @@ static MsgInfo *imap_parse_envelope(SockInfo *sock, GString *line_str)
                        g_warning("invalid FETCH response: %s\n", cur_pos);
                        break;
                }
-
-               if (*cur_pos == '\0' || *cur_pos == ')') break;
-               n_element++;
        }
 
        msginfo = g_new0(MsgInfo, 1);
@@ -1707,26 +1723,69 @@ catch:
        return ok;
 }
 
-#undef THROW
-
-#if 0
-static gint imap_status_uidnext(IMAPSession *session, IMAPFolder *folder,
-                               const gchar *path, guint32 *uid_next)
+static gint imap_status(IMAPSession *session, IMAPFolder *folder,
+                       const gchar *path,
+                       gint *messages, gint *recent, gint *unseen,
+                       guint32 *uid_validity)
 {
        gchar *real_path;
        gint ok;
+       GPtrArray *argbuf;
+       gchar *str;
+
+       *messages = *recent = *unseen = *uid_validity = 0;
+
+       argbuf = g_ptr_array_new();
 
        real_path = imap_get_real_path(folder, path);
-       ok = imap_cmd_status(SESSION(session)->sock, real_path,
-                            "UIDNEXT", uid_next);
-       if (ok != IMAP_SUCCESS)
-               log_warning(_("can't get the next uid of folder: %s\n"),
-                           real_path);
+       if (strchr(real_path, ' ') != NULL)
+               imap_cmd_gen_send(SESSION(session)->sock, "STATUS \"%s\" "
+                                       "(MESSAGES RECENT UNSEEN UIDVALIDITY)",
+                                 real_path);
+       else
+               imap_cmd_gen_send(SESSION(session)->sock, "STATUS %s "
+                                       "(MESSAGES RECENT UNSEEN UIDVALIDITY)",
+                                 real_path);
+
+       ok = imap_cmd_ok(SESSION(session)->sock, argbuf);
+       if (ok != IMAP_SUCCESS) THROW(ok);
+
+       str = search_array_contain_str(argbuf, "STATUS");
+       if (!str) THROW(IMAP_ERROR);
+
+       str = strchr(str, '(');
+       if (!str) THROW(IMAP_ERROR);
+       str++;
+       while (*str != '\0' && *str != ')') {
+               while (*str == ' ') str++;
+
+               if (!strncmp(str, "MESSAGES ", 9)) {
+                       str += 9;
+                       *messages = strtol(str, &str, 10);
+               } else if (!strncmp(str, "RECENT ", 7)) {
+                       str += 7;
+                       *recent = strtol(str, &str, 10);
+               } else if (!strncmp(str, "UNSEEN ", 7)) {
+                       str += 7;
+                       *unseen = strtol(str, &str, 10);
+               } else if (!strncmp(str, "UIDVALIDITY ", 12)) {
+                       str += 12;
+                       *uid_validity = strtoul(str, &str, 10);
+               } else {
+                       g_warning("invalid STATUS response: %s\n", str);
+                       break;
+               }
+       }
+
+catch:
        g_free(real_path);
+       ptr_array_free_strings(argbuf);
+       g_ptr_array_free(argbuf, TRUE);
 
        return ok;
 }
-#endif
+
+#undef THROW
 
 
 /* low-level IMAP4rev1 commands */
@@ -1873,43 +1932,6 @@ catch:
        return ok;
 }
 
-#if 0
-static gint imap_cmd_status(SockInfo *sock, const gchar *folder,
-                           const gchar *status, gint *value)
-{
-       gint ok;
-       GPtrArray *argbuf;
-       gchar *str;
-
-       if (value) *value = 0;
-       argbuf = g_ptr_array_new();
-
-       if (strchr(folder, ' ') != NULL)
-               imap_cmd_gen_send(sock, "STATUS \"%s\" (%s)", folder, status);
-       else
-               imap_cmd_gen_send(sock, "STATUS %s (%s)", folder, status);
-
-       if ((ok = imap_cmd_ok(sock, argbuf)) != IMAP_SUCCESS) THROW;
-
-       str = search_array_contain_str(argbuf, "STATUS");
-       if (!str) THROW;
-       str = strchr(str, '(');
-       if (!str) THROW;
-       str++;
-       if (strncmp(str, status, strlen(status)) != 0) THROW;
-       str += strlen(status);
-       if (*str != ' ') THROW;
-       str++;
-       if (value) *value = atoi(str);
-
-catch:
-       ptr_array_free_strings(argbuf);
-       g_ptr_array_free(argbuf, TRUE);
-
-       return ok;
-}
-#endif
-
 #undef THROW
 
 static gint imap_cmd_create(SockInfo *sock, const gchar *folder)
index 31ee30a..e2a6905 100644 (file)
@@ -141,6 +141,9 @@ static Session *news_session_new_for_folder(Folder *folder)
        const gchar *userid = NULL;
        gchar *passwd = NULL;
 
+       g_return_val_if_fail(folder != NULL, NULL);
+       g_return_val_if_fail(folder->account != NULL, NULL);
+
        ac = folder->account;
        if (ac->use_nntp_auth && ac->userid && ac->userid[0]) {
                userid = ac->userid;
@@ -150,7 +153,9 @@ static Session *news_session_new_for_folder(Folder *folder)
                        passwd = news_query_password(ac->nntp_server, userid);
        }
 
-       session = news_session_new(ac->nntp_server, NNTP_PORT, userid, passwd);
+       session = news_session_new(ac->nntp_server,
+                                  ac->set_nntpport ? ac->nntpport : NNTP_PORT,
+                                  userid, passwd);
        g_free(passwd);
 
        return session;
@@ -175,7 +180,9 @@ NNTPSession *news_session_get(Folder *folder)
        if (nntp_mode(session->nntp_sock, FALSE) != NN_SUCCESS) {
                log_warning(_("NNTP connection to %s:%d has been"
                              " disconnected. Reconnecting...\n"),
-                           folder->account->nntp_server, NNTP_PORT);
+                           folder->account->nntp_server,
+                           folder->account->set_nntpport ?
+                           folder->account->nntpport : NNTP_PORT);
                session_destroy(REMOTE_FOLDER(folder)->session);
                REMOTE_FOLDER(folder)->session =
                        news_session_new_for_folder(folder);
index 4a15509..2b8e622 100644 (file)
@@ -127,8 +127,15 @@ static struct Privacy {
 static struct Advanced {
        GtkWidget *smtpport_chkbtn;
        GtkWidget *smtpport_entry;
+       GtkWidget *popport_hbox;
        GtkWidget *popport_chkbtn;
        GtkWidget *popport_entry;
+       GtkWidget *imapport_hbox;
+       GtkWidget *imapport_chkbtn;
+       GtkWidget *imapport_entry;
+       GtkWidget *nntpport_hbox;
+       GtkWidget *nntpport_chkbtn;
+       GtkWidget *nntpport_entry;
        GtkWidget *domain_chkbtn;
        GtkWidget *domain_entry;
 } advanced;
@@ -300,6 +307,22 @@ static PrefParam param[] = {
         &advanced.popport_entry,
         prefs_set_data_from_entry, prefs_set_entry},
 
+       {"set_imapport", "FALSE", &tmp_ac_prefs.set_imapport, P_BOOL,
+        &advanced.imapport_chkbtn,
+        prefs_set_data_from_toggle, prefs_set_toggle},
+
+       {"imap_port", "143", &tmp_ac_prefs.imapport, P_USHORT,
+        &advanced.imapport_entry,
+        prefs_set_data_from_entry, prefs_set_entry},
+
+       {"set_nntpport", "FALSE", &tmp_ac_prefs.set_nntpport, P_BOOL,
+        &advanced.nntpport_chkbtn,
+        prefs_set_data_from_toggle, prefs_set_toggle},
+
+       {"nntp_port", "119", &tmp_ac_prefs.nntpport, P_USHORT,
+        &advanced.nntpport_entry,
+        prefs_set_data_from_entry, prefs_set_entry},
+
        {"set_domain", "FALSE", &tmp_ac_prefs.set_domain, P_BOOL,
         &advanced.domain_chkbtn,
         prefs_set_data_from_toggle, prefs_set_toggle},
@@ -1179,13 +1202,33 @@ static void prefs_account_advanced_create(void)
        GtkWidget *hbox1;
        GtkWidget *checkbtn_smtpport;
        GtkWidget *entry_smtpport;
-       GtkWidget *hbox2;
+       GtkWidget *hbox_popport;
        GtkWidget *checkbtn_popport;
        GtkWidget *entry_popport;
-       GtkWidget *hbox3;
+       GtkWidget *hbox_imapport;
+       GtkWidget *checkbtn_imapport;
+       GtkWidget *entry_imapport;
+       GtkWidget *hbox_nntpport;
+       GtkWidget *checkbtn_nntpport;
+       GtkWidget *entry_nntpport;
        GtkWidget *checkbtn_domain;
        GtkWidget *entry_domain;
 
+#define PACK_HBOX(hbox) \
+{ \
+       hbox = gtk_hbox_new (FALSE, 8); \
+       gtk_widget_show (hbox); \
+       gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0); \
+}
+
+#define PACK_PORT_ENTRY(box, entry) \
+{ \
+       entry = gtk_entry_new_with_max_length (5); \
+       gtk_widget_show (entry); \
+       gtk_box_pack_start (GTK_BOX (box), entry, FALSE, FALSE, 0); \
+       gtk_widget_set_usize (entry, 64, -1); \
+}
+
        vbox1 = gtk_vbox_new (FALSE, VSPACING);
        gtk_widget_show (vbox1);
        gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
@@ -1195,45 +1238,51 @@ static void prefs_account_advanced_create(void)
        gtk_widget_show (vbox2);
        gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
 
-       hbox1 = gtk_hbox_new (FALSE, 8);
-       gtk_widget_show (hbox1);
-       gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, FALSE, 0);
-
+       PACK_HBOX (hbox1);
        PACK_CHECK_BUTTON (hbox1, checkbtn_smtpport, _("Specify SMTP port"));
-
-       entry_smtpport = gtk_entry_new_with_max_length (5);
-       gtk_widget_show (entry_smtpport);
-       gtk_box_pack_start (GTK_BOX (hbox1), entry_smtpport, FALSE, FALSE, 0);
-       gtk_widget_set_usize (entry_smtpport, 64, -1);
-       SET_TOGGLE_SENSITIVITY(checkbtn_smtpport, entry_smtpport);
-
-       hbox2 = gtk_hbox_new (FALSE, 8);
-       gtk_widget_show (hbox2);
-       gtk_box_pack_start (GTK_BOX (vbox2), hbox2, FALSE, FALSE, 0);
-
-       PACK_CHECK_BUTTON (hbox2, checkbtn_popport, _("Specify POP3 port"));
-
-       entry_popport = gtk_entry_new_with_max_length (5);
-       gtk_widget_show (entry_popport);
-       gtk_box_pack_start (GTK_BOX (hbox2), entry_popport, FALSE, FALSE, 0);
-       gtk_widget_set_usize (entry_popport, 64, -1);
-       SET_TOGGLE_SENSITIVITY(checkbtn_popport, entry_popport);
-
-       hbox3 = gtk_hbox_new (FALSE, 8);
-       gtk_widget_show (hbox3);
-       gtk_box_pack_start (GTK_BOX (vbox2), hbox3, FALSE, FALSE, 0);
-
-       PACK_CHECK_BUTTON (hbox3, checkbtn_domain, _("Specify domain name"));
+       PACK_PORT_ENTRY (hbox1, entry_smtpport);
+       SET_TOGGLE_SENSITIVITY (checkbtn_smtpport, entry_smtpport);
+
+       PACK_HBOX (hbox_popport);
+       PACK_CHECK_BUTTON (hbox_popport, checkbtn_popport,
+                          _("Specify POP3 port"));
+       PACK_PORT_ENTRY (hbox_popport, entry_popport);
+       SET_TOGGLE_SENSITIVITY (checkbtn_popport, entry_popport);
+
+       PACK_HBOX (hbox_imapport);
+       PACK_CHECK_BUTTON (hbox_imapport, checkbtn_imapport,
+                          _("Specify IMAP4 port"));
+       PACK_PORT_ENTRY (hbox_imapport, entry_imapport);
+       SET_TOGGLE_SENSITIVITY (checkbtn_imapport, entry_imapport);
+
+       PACK_HBOX (hbox_nntpport);
+       PACK_CHECK_BUTTON (hbox_nntpport, checkbtn_nntpport,
+                          _("Specify NNTP port"));
+       PACK_PORT_ENTRY (hbox_nntpport, entry_nntpport);
+       SET_TOGGLE_SENSITIVITY (checkbtn_nntpport, entry_nntpport);
+
+       PACK_HBOX (hbox1);
+       PACK_CHECK_BUTTON (hbox1, checkbtn_domain, _("Specify domain name"));
 
        entry_domain = gtk_entry_new ();
        gtk_widget_show (entry_domain);
-       gtk_box_pack_start (GTK_BOX (hbox3), entry_domain, TRUE, TRUE, 0);
-       SET_TOGGLE_SENSITIVITY(checkbtn_domain, entry_domain);
+       gtk_box_pack_start (GTK_BOX (hbox1), entry_domain, TRUE, TRUE, 0);
+       SET_TOGGLE_SENSITIVITY (checkbtn_domain, entry_domain);
+
+#undef PACK_HBOX
+#undef PACK_PORT_ENTRY
 
        advanced.smtpport_chkbtn        = checkbtn_smtpport;
        advanced.smtpport_entry         = entry_smtpport;
+       advanced.popport_hbox           = hbox_popport;
        advanced.popport_chkbtn         = checkbtn_popport;
        advanced.popport_entry          = entry_popport;
+       advanced.imapport_hbox          = hbox_imapport;
+       advanced.imapport_chkbtn        = checkbtn_imapport;
+       advanced.imapport_entry         = entry_imapport;
+       advanced.nntpport_hbox          = hbox_nntpport;
+       advanced.nntpport_chkbtn        = checkbtn_nntpport;
+       advanced.nntpport_entry         = entry_nntpport;
        advanced.domain_chkbtn          = checkbtn_domain;
        advanced.domain_entry           = entry_domain;
 }
@@ -1474,6 +1523,9 @@ static void prefs_account_protocol_activated(GtkMenuItem *menuitem)
                        (GTK_TOGGLE_BUTTON(basic.nntpauth_chkbtn), NULL);
                gtk_widget_set_sensitive(receive.pop3_frame, FALSE);
                gtk_widget_set_sensitive(receive.imap_frame, FALSE);
+               gtk_widget_hide(advanced.popport_hbox);
+               gtk_widget_hide(advanced.imapport_hbox);
+               gtk_widget_show(advanced.nntpport_hbox);
                break;
        case A_LOCAL:
                gtk_widget_set_sensitive(basic.inbox_label, TRUE);
@@ -1518,6 +1570,9 @@ static void prefs_account_protocol_activated(GtkMenuItem *menuitem)
                gtk_widget_set_sensitive(basic.pass_entry, TRUE);
                gtk_widget_set_sensitive(receive.pop3_frame, FALSE);
                gtk_widget_set_sensitive(receive.imap_frame, FALSE);
+               gtk_widget_hide(advanced.popport_hbox);
+               gtk_widget_hide(advanced.imapport_hbox);
+               gtk_widget_hide(advanced.nntpport_hbox);
                prefs_account_mailcmd_toggled
                        (GTK_TOGGLE_BUTTON(basic.mailcmd_chkbtn), NULL);
                break;
@@ -1568,6 +1623,9 @@ static void prefs_account_protocol_activated(GtkMenuItem *menuitem)
                gtk_widget_set_sensitive(receive.imap_frame, TRUE);
                gtk_widget_set_sensitive(basic.smtpserv_entry, TRUE);
                gtk_widget_set_sensitive(basic.smtpserv_label, TRUE);
+               gtk_widget_hide(advanced.popport_hbox);
+               gtk_widget_show(advanced.imapport_hbox);
+               gtk_widget_hide(advanced.nntpport_hbox);
                break;
        case A_POP3:
        default:
@@ -1617,6 +1675,9 @@ static void prefs_account_protocol_activated(GtkMenuItem *menuitem)
                gtk_widget_set_sensitive(receive.imap_frame, FALSE);
                gtk_widget_set_sensitive(basic.smtpserv_entry, TRUE);
                gtk_widget_set_sensitive(basic.smtpserv_label, TRUE);
+               gtk_widget_show(advanced.popport_hbox);
+               gtk_widget_hide(advanced.imapport_hbox);
+               gtk_widget_hide(advanced.nntpport_hbox);
                break;
        }
 
index c4627eb..edcfaad 100644 (file)
@@ -79,7 +79,7 @@ struct _PrefsAccount
        gboolean recv_at_getall;
        gboolean filter_on_recv;
 
-        gchar *imap_dir;
+       gchar *imap_dir;
 
        /* Send */
        gboolean  add_date;
@@ -110,6 +110,8 @@ struct _PrefsAccount
        gushort   smtpport;
        gboolean  set_popport;
        gushort   popport;
+       gboolean  set_imapport;
+       gushort   imapport;
        gboolean  set_nntpport;
        gushort   nntpport;
        gboolean  set_domain;
index 7f71e47..86c496e 100644 (file)
@@ -357,7 +357,7 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"show_mime", "TRUE", &prefs_common.show_mime, P_BOOL,
         NULL, NULL, NULL},
-       {"show_number", "TRUE", &prefs_common.show_number, P_BOOL,
+       {"show_number", "FALSE", &prefs_common.show_number, P_BOOL,
         NULL, NULL, NULL},
        {"show_score", "TRUE", &prefs_common.show_score, P_BOOL,
         NULL, NULL, NULL},
index 276ea5c..ef3c18a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999,2000 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2001 Hiroyuki Yamamoto
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
index fd3d101..71334a2 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999,2000 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2001 Hiroyuki Yamamoto
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by