move 'Maximum number of articles to download' to account prefs
authorPaul Mangan <paul@claws-mail.org>
Wed, 19 Feb 2003 15:58:09 +0000 (15:58 +0000)
committerPaul Mangan <paul@claws-mail.org>
Wed, 19 Feb 2003 15:58:09 +0000 (15:58 +0000)
ChangeLog.claws
configure.ac
src/folder.c
src/news.c
src/prefs_account.c
src/prefs_account.h
src/prefs_common.c
src/prefs_common.h

index 2957b4825dc5587e65bbdb46edac3e4e4f371f7b..42c160f18846e3634383f1fa8aba87f3470dbd45 100644 (file)
@@ -1,3 +1,14 @@
+2003-02-19 [paul]      0.8.10claws28
+
+       * src/folder.c
+         src/news.c
+         src/prefs_account.[ch]
+         src/prefs_common.[ch]
+               move 'Maximum number of articles to download' to
+               account prefs.
+               clean up account prefs gui a little by hiding entries
+               rather then greying out entries
+
 2003-02-19 [hiro]      0.8.10claws27
 
        * src/common/utils.c
index 500cb322a853ffbcc69e00aec37f19093edc51d1..8741dbe1830701e572a2c2aac03db27ab2f34c5e 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=10
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws27
+EXTRA_VERSION=claws28
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index a005c1c1f8257cb83b1c0eb4f4fce0bfdd2410e0..817b1096d6df1ab12b8ba87ac6c954d2e0b82fbb 100644 (file)
@@ -1071,13 +1071,13 @@ gint folder_item_scan(FolderItem *item)
                                        if (folder_cur_num < cache_max_num)
                                                break;
                                        
-                                       if (prefs_common.max_articles == 0) {
+                                       if (folder->account->max_articles == 0) {
                                                add = TRUE;
                                        }
 
-                                       if (folder_max_num <= prefs_common.max_articles) {
+                                       if (folder_max_num <= folder->account->max_articles) {
                                                add = TRUE;
-                                       } else if (folder_cur_num > (folder_max_num - prefs_common.max_articles)) {
+                                       } else if (folder_cur_num > (folder_max_num - folder->account->max_articles)) {
                                                add = TRUE;
                                        }
                                        break;
index 327fdcc2a1e3f10a97ecf467864ce65a97b5f7b2..409220da3ce1e843b8a0de97561ad0f894f2bdad 100644 (file)
@@ -745,9 +745,9 @@ static GSList *news_get_uncached_articles(NNTPSession *session,
                begin = cache_last + 1;
        end = last;
 
-       if (prefs_common.max_articles > 0 &&
-           end - begin + 1 > prefs_common.max_articles)
-               begin = end - prefs_common.max_articles + 1;
+       if (item->account->max_articles > 0 &&
+           end - begin + 1 > item->account->max_articles)
+               begin = end - item->account->max_articles + 1;
 
        log_message(_("getting xover %d - %d in %s...\n"),
                    begin, end, item->path);
index 31ddbfec1aa16e6ef5e880ebdcc7dd935cec9189..69d2e823caa211c882ddd8e72d46511e9d7ec3d6 100644 (file)
@@ -99,6 +99,11 @@ static struct Receive {
        GtkWidget *inbox_btn;
 
        GtkWidget *recvatgetall_chkbtn;
+
+       GtkWidget *frame_maxarticle;
+       GtkWidget *label_maxarticle;
+       GtkWidget *spinbtn_maxarticle;
+       GtkObject *spinbtn_maxarticle_adj;
 } receive;
 
 static struct Send {
@@ -312,6 +317,10 @@ static PrefParam param[] = {
         &receive.recvatgetall_chkbtn,
         prefs_set_data_from_toggle, prefs_set_toggle},
 
+       {"max_news_articles", "300", &tmp_ac_prefs.max_articles, P_INT,
+        &receive.spinbtn_maxarticle,
+        prefs_set_data_from_spinbtn, prefs_set_spinbtn},
+
        /* Send */
        {"add_date", "TRUE", &tmp_ac_prefs.add_date, P_BOOL,
         &p_send.date_chkbtn,
@@ -1105,6 +1114,12 @@ static void prefs_account_receive_create(void)
        GtkWidget *inbox_btn;
        GtkWidget *recvatgetall_chkbtn;
 
+       GtkWidget *hbox2;
+       GtkWidget *frame2;
+       GtkWidget *label_maxarticle;
+       GtkWidget *spinbtn_maxarticle;
+       GtkObject *spinbtn_maxarticle_adj;
+
        vbox1 = gtk_vbox_new (FALSE, VSPACING);
        gtk_widget_show (vbox1);
        gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
@@ -1222,6 +1237,31 @@ static void prefs_account_receive_create(void)
        gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
        gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
 
+       PACK_FRAME(vbox1, frame2, _("Maximum number of articles to download"));
+
+       hbox2 = gtk_hbox_new (FALSE, 8);
+       gtk_widget_show (hbox2);
+       gtk_container_add (GTK_CONTAINER (frame2), hbox2);
+       gtk_container_set_border_width (GTK_CONTAINER (hbox2), 8);
+
+       spinbtn_maxarticle_adj =
+               gtk_adjustment_new (300, 0, 10000, 10, 100, 100);
+       spinbtn_maxarticle = gtk_spin_button_new
+               (GTK_ADJUSTMENT (spinbtn_maxarticle_adj), 10, 0);
+       gtk_widget_show (spinbtn_maxarticle);
+       gtk_box_pack_start (GTK_BOX (hbox2), spinbtn_maxarticle,
+                           FALSE, FALSE, 0);
+       gtk_widget_set_usize (spinbtn_maxarticle, 64, -1);
+       gtk_spin_button_set_numeric
+               (GTK_SPIN_BUTTON (spinbtn_maxarticle), TRUE);
+
+       label_maxarticle = gtk_label_new
+               (_("unlimited if 0 is specified"));
+       gtk_widget_show (label_maxarticle);
+       gtk_box_pack_start (GTK_BOX (hbox2), label_maxarticle, FALSE, FALSE, 0);
+       gtk_label_set_justify (GTK_LABEL (label_maxarticle), GTK_JUSTIFY_LEFT);
+
+
        PACK_CHECK_BUTTON
                (vbox1, recvatgetall_chkbtn,
                 _("`Get all' checks for new messages on this account"));
@@ -1240,6 +1280,10 @@ static void prefs_account_receive_create(void)
        receive.inbox_btn                = inbox_btn;
 
        receive.recvatgetall_chkbtn      = recvatgetall_chkbtn;
+
+       receive.frame_maxarticle        = frame2;
+       receive.spinbtn_maxarticle      = spinbtn_maxarticle;
+       receive.spinbtn_maxarticle_adj  = spinbtn_maxarticle_adj;
 }
 
 static void prefs_account_send_create(void)
@@ -2394,9 +2438,9 @@ static void prefs_account_protocol_activated(GtkMenuItem *menuitem)
 
                prefs_account_nntpauth_toggled
                        (GTK_TOGGLE_BUTTON(basic.nntpauth_chkbtn), NULL);
-               gtk_widget_set_sensitive(receive.pop3_frame, FALSE);
+               gtk_widget_hide(receive.pop3_frame);
+               gtk_widget_show(receive.frame_maxarticle);
                gtk_widget_set_sensitive(receive.recvatgetall_chkbtn, TRUE);
-
                /* update pop_before_smtp sensitivity */
                gtk_toggle_button_set_active
                        (GTK_TOGGLE_BUTTON(p_send.pop_bfr_smtp_chkbtn), FALSE);
@@ -2464,8 +2508,9 @@ static void prefs_account_protocol_activated(GtkMenuItem *menuitem)
                gtk_widget_set_sensitive(basic.pass_label, TRUE);
                gtk_widget_set_sensitive(basic.uid_entry,  TRUE);
                gtk_widget_set_sensitive(basic.pass_entry, TRUE);
-               gtk_widget_set_sensitive(receive.pop3_frame, FALSE);
-               gtk_widget_set_sensitive(receive.recvatgetall_chkbtn, FALSE);
+               gtk_widget_hide(receive.pop3_frame);
+               gtk_widget_hide(receive.frame_maxarticle);
+               gtk_widget_set_sensitive(receive.recvatgetall_chkbtn, TRUE);
                prefs_account_mailcmd_toggled
                        (GTK_TOGGLE_BUTTON(basic.mailcmd_chkbtn), NULL);
 
@@ -2539,7 +2584,8 @@ static void prefs_account_protocol_activated(GtkMenuItem *menuitem)
                gtk_widget_set_sensitive(basic.pass_label, TRUE);
                gtk_widget_set_sensitive(basic.uid_entry,  TRUE);
                gtk_widget_set_sensitive(basic.pass_entry, TRUE);
-               gtk_widget_set_sensitive(receive.pop3_frame, FALSE);
+               gtk_widget_hide(receive.pop3_frame);
+               gtk_widget_hide(receive.frame_maxarticle);
                gtk_widget_set_sensitive(receive.recvatgetall_chkbtn, TRUE);
                gtk_widget_set_sensitive(basic.smtpserv_entry, TRUE);
                gtk_widget_set_sensitive(basic.smtpserv_label, TRUE);
@@ -2616,7 +2662,10 @@ static void prefs_account_protocol_activated(GtkMenuItem *menuitem)
                gtk_widget_set_sensitive(basic.uid_entry,  TRUE);
                gtk_widget_set_sensitive(basic.pass_entry, TRUE);
                gtk_widget_set_sensitive(receive.pop3_frame, TRUE);
+               gtk_widget_show(receive.pop3_frame);
+               gtk_widget_hide(receive.frame_maxarticle);
                gtk_widget_set_sensitive(receive.recvatgetall_chkbtn, TRUE);
+
                gtk_widget_set_sensitive(basic.smtpserv_entry, TRUE);
                gtk_widget_set_sensitive(basic.smtpserv_label, TRUE);
 
index 99b719d5047a29480784be399f19a6b4fc6aba7f..40d75a161b70950ac7bf2c4cfb6e7f91ad2664a9 100644 (file)
@@ -116,6 +116,7 @@ struct _PrefsAccount
        gint size_limit;
        gboolean filter_on_recv;
        gchar *inbox;
+       gint max_articles;
 
        /* selective Download */
        gint   session;
index 6b649136a84367fdb1de92261dcac3e9955e67f7..4a1579c04978ca86375080ea5158166be65a15a8 100644 (file)
@@ -85,9 +85,6 @@ static struct Receive {
        GtkWidget *checkbtn_newmail_manu;
        GtkWidget *entry_newmail_notify_cmd;
        GtkWidget *hbox_newmail_notify;
-
-       GtkWidget *spinbtn_maxarticle;
-       GtkObject *spinbtn_maxarticle_adj;
 } receive;
 
 static struct Send {
@@ -333,10 +330,6 @@ static PrefParam param[] = {
         &receive.entry_newmail_notify_cmd,
         prefs_set_data_from_entry, prefs_set_entry},
  
-       {"max_news_articles", "300", &prefs_common.max_articles, P_INT,
-        &receive.spinbtn_maxarticle,
-        prefs_set_data_from_spinbtn, prefs_set_spinbtn},
-
        /* Send */
        {"use_ext_sendmail", "FALSE", &prefs_common.use_extsend, P_BOOL,
         &p_send.checkbtn_extsend,
@@ -1089,11 +1082,6 @@ static void prefs_receive_create(void)
        GtkWidget *entry_newmail_notify_cmd;
        GtkWidget *label_newmail_notify_cmd;
 
-       GtkWidget *frame_news;
-       GtkWidget *label_maxarticle;
-       GtkWidget *spinbtn_maxarticle;
-       GtkObject *spinbtn_maxarticle_adj;
-
        vbox1 = gtk_vbox_new (FALSE, VSPACING);
        gtk_widget_show (vbox1);
        gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
@@ -1240,31 +1228,6 @@ static void prefs_receive_create(void)
                                 prefs_common.newmail_notify_auto || 
                                 prefs_common.newmail_notify_manu);
 
-       PACK_FRAME(vbox1, frame_news, _("News"));
-
-       hbox = gtk_hbox_new (FALSE, 8);
-       gtk_widget_show (hbox);
-       gtk_container_add (GTK_CONTAINER (frame_news), hbox);
-       gtk_container_set_border_width (GTK_CONTAINER (hbox), 8);
-
-       label_maxarticle = gtk_label_new
-               (_("Maximum number of articles to download\n"
-                  "(unlimited if 0 is specified)"));
-       gtk_widget_show (label_maxarticle);
-       gtk_box_pack_start (GTK_BOX (hbox), label_maxarticle, FALSE, FALSE, 0);
-       gtk_label_set_justify (GTK_LABEL (label_maxarticle), GTK_JUSTIFY_LEFT);
-
-       spinbtn_maxarticle_adj =
-               gtk_adjustment_new (300, 0, 10000, 10, 100, 100);
-       spinbtn_maxarticle = gtk_spin_button_new
-               (GTK_ADJUSTMENT (spinbtn_maxarticle_adj), 10, 0);
-       gtk_widget_show (spinbtn_maxarticle);
-       gtk_box_pack_start (GTK_BOX (hbox), spinbtn_maxarticle,
-                           FALSE, FALSE, 0);
-       gtk_widget_set_usize (spinbtn_maxarticle, 64, -1);
-       gtk_spin_button_set_numeric
-               (GTK_SPIN_BUTTON (spinbtn_maxarticle), TRUE);
-
        receive.checkbtn_incext = checkbtn_incext;
        receive.entry_incext    = entry_incext;
        /* receive.button_incext   = button_incext; */
@@ -1285,9 +1248,6 @@ static void prefs_receive_create(void)
        receive.checkbtn_newmail_manu  = checkbtn_newmail_manu;
        receive.hbox_newmail_notify    = hbox_newmail_notify;
        receive.entry_newmail_notify_cmd = entry_newmail_notify_cmd;
-
-       receive.spinbtn_maxarticle     = spinbtn_maxarticle;
-       receive.spinbtn_maxarticle_adj = spinbtn_maxarticle_adj;
 }
 
 static void prefs_send_create(void)
index cec5d29e9e5add7a7c35a705a25f129eb4355522..0eadffe162a1ddbcf1181d4e84f112656b689edb 100644 (file)
@@ -74,7 +74,6 @@ struct _PrefsCommon
        gboolean newmail_notify_auto;
        gboolean newmail_notify_manu;
        gchar   *newmail_notify_cmd;
-       gint max_articles;
 
        /* Send */
        gboolean use_extsend;