commit 688c2751dfe57da18dd612a2014522cf17976b73 from: Oliver Lowe date: Tue Sep 2 01:32:25 2025 UTC Only receive mail when clicking receive mail button commit - 510cb0e589614f608ab294b4b8c41c624717aaa1 commit + 688c2751dfe57da18dd612a2014522cf17976b73 blob - de1d42a7703208dec0ca139de6f979ebd0006edd blob + a4862ab20daae6619cd5b0d1bfa2f5f4222fb07d --- src/inc.c +++ src/inc.c @@ -76,9 +76,6 @@ static GdkPixbuf *okpix; #define MESSAGEBUFSIZE 8192 -static void inc_finished (MainWindow *mainwin, - gboolean new_messages, - gboolean autocheck); static gint inc_account_mail_real (MainWindow *mainwin, PrefsAccount *account); @@ -138,39 +135,8 @@ static gint inc_spool_account(PrefsAccount *account); static void inc_autocheck_timer_set_interval (guint interval); static gint inc_autocheck_func (gpointer data); -static void inc_notify_cmd (gint new_msgs, - gboolean notify); +static void inc_notify_cmd(gint new_msgs, gboolean notify); -/** - * inc_finished: - * @mainwin: Main window. - * @new_messages: TRUE if some messages have been received. - * - * Update the folder view and the summary view after receiving - * messages. If @new_messages is FALSE, this function avoids unneeded - * updating. - **/ -static void inc_finished(MainWindow *mainwin, gboolean new_messages, gboolean autocheck) -{ - if (prefs_common.scan_all_after_inc) - folderview_check_new(NULL); - - if (!autocheck && new_messages && prefs_common.open_inbox_on_inc) { - FolderItem *item = NULL; - - if (cur_account && cur_account->inbox) - item = folder_find_item_from_identifier(cur_account->inbox); - if (item == NULL && cur_account && cur_account->folder) - item = cur_account->folder->inbox; - if (item == NULL) - item = folder_get_default_inbox(); - - folderview_unselect(mainwin->folderview); - folderview_select(mainwin->folderview, item); - } - statusbar_progress_all(0,0,0); -} - void inc_mail(MainWindow *mainwin, gboolean notify) { gint new_msgs = 0; @@ -202,7 +168,7 @@ void inc_mail(MainWindow *mainwin, gboolean notify) new_msgs += account_new_msgs; } - inc_finished(mainwin, new_msgs > 0, FALSE); + statusbar_progress_all(0,0,0); main_window_unlock(mainwin); inc_notify_cmd(new_msgs, notify); inc_autocheck_timer_set(); @@ -295,7 +261,7 @@ gint inc_account_mail(MainWindow *mainwin, PrefsAccoun new_msgs = inc_account_mail_real(mainwin, account); - inc_finished(mainwin, new_msgs > 0, FALSE); + statusbar_progress_all(0,0,0); main_window_unlock(mainwin); inc_autocheck_timer_set(); @@ -320,7 +286,7 @@ void inc_account_list_mail(MainWindow *mainwin, GList main_window_lock(mainwin); if (!account_list) { - inc_finished(mainwin, new_msgs > 0, autocheck); + statusbar_progress_all(0,0,0); main_window_unlock(mainwin); inc_notify_cmd(new_msgs, notify); return; @@ -393,7 +359,7 @@ void inc_account_list_mail(MainWindow *mainwin, GList new_msgs += inc_start(inc_dialog); } - inc_finished(mainwin, new_msgs > 0, autocheck); + statusbar_progress_all(0,0,0); main_window_unlock(mainwin); inc_notify_cmd(new_msgs, notify); } blob - dede93ff027877e2d83ffbed3031ac87762cced8 blob + 41fccfd82a8b2770201e8ddd705320ad8a60b79f --- src/prefs_common.c +++ src/prefs_common.c @@ -93,10 +93,6 @@ static PrefParam param[] = { NULL, NULL, NULL}, {"check_on_startup", "FALSE", &prefs_common.chk_on_startup, P_BOOL, NULL, NULL, NULL}, - {"open_inbox_on_inc", "FALSE", &prefs_common.open_inbox_on_inc, - P_BOOL, NULL, NULL, NULL}, - {"scan_all_after_inc", "FALSE", &prefs_common.scan_all_after_inc, - P_BOOL, NULL, NULL, NULL}, {"newmail_notify_manu", "FALSE", &prefs_common.newmail_notify_manu, P_BOOL, NULL, NULL, NULL}, {"newmail_notify_auto", "FALSE", &prefs_common.newmail_notify_auto, blob - 0d6281d5c2fcb60deb3d4676bc66521e39f7c8f0 blob + 8ed30733488204f7312fb545a7fab1e795ea6731 --- src/prefs_common.h +++ src/prefs_common.h @@ -149,11 +149,9 @@ struct _PrefsCommon /* Receive */ gboolean use_extinc; gchar *extinc_cmd; - gboolean scan_all_after_inc; gboolean autochk_newmail; gint autochk_itv; gboolean chk_on_startup; - gboolean open_inbox_on_inc; gboolean newmail_notify_auto; gboolean newmail_notify_manu; gchar *newmail_notify_cmd; blob - 86f78e28bc2be896acc2f9685b511f1883095f64 blob + f4181fc51b4de5e3e18219595f1fcb5d7bd45ece --- src/prefs_receive.c +++ src/prefs_receive.c @@ -56,8 +56,6 @@ typedef struct _ReceivePage GtkWidget *spinbtn_autochk_min; GtkWidget *spinbtn_autochk_hour; GtkWidget *checkbtn_chkonstartup; - GtkWidget *checkbtn_openinbox; - GtkWidget *checkbtn_scan_after_inc; GtkWidget *checkbtn_newmail_auto; GtkWidget *checkbtn_newmail_manu; GtkWidget *entry_newmail_notify_cmd; @@ -118,8 +116,6 @@ static void prefs_receive_create_widget(PrefsPage *_pa GtkWidget *label_autochk1; GtkWidget *label_autochk0; GtkWidget *checkbtn_chkonstartup; - GtkWidget *checkbtn_openinbox; - GtkWidget *checkbtn_scan_after_inc; GtkWidget *frame; GtkWidget *vbox3; @@ -243,15 +239,8 @@ static void prefs_receive_create_widget(PrefsPage *_pa PACK_CHECK_BUTTON (vbox2, checkbtn_show_recv_err_dialog, _("Show error dialog on receive error")); - vbox2 = gtkut_get_options_frame(vbox1, &frame, - _("After receiving new mail")); + vbox3 = gtkut_get_options_frame(vbox1, &frame, _("Run command after receiving new mail")); - PACK_CHECK_BUTTON (vbox2, checkbtn_openinbox, _("Go to Inbox")); - PACK_CHECK_BUTTON (vbox2, checkbtn_scan_after_inc, - _("Update all local folders")); - - vbox3 = gtkut_get_options_frame(vbox2, &frame, _("Run command")); - hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 8); gtk_widget_show (hbox); PACK_CHECK_BUTTON (hbox, checkbtn_newmail_auto, @@ -303,10 +292,6 @@ static void prefs_receive_create_widget(PrefsPage *_pa prefs_common.close_recv_dialog); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_chkonstartup), prefs_common.chk_on_startup); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_openinbox), - prefs_common.open_inbox_on_inc); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_scan_after_inc), - prefs_common.scan_all_after_inc); gtk_entry_set_text(GTK_ENTRY(entry_incext), prefs_common.extinc_cmd); @@ -327,8 +312,6 @@ static void prefs_receive_create_widget(PrefsPage *_pa prefs_receive->spinbtn_autochk_min = spinbtn_autochk_min; prefs_receive->spinbtn_autochk_hour = spinbtn_autochk_hour; prefs_receive->checkbtn_chkonstartup = checkbtn_chkonstartup; - prefs_receive->checkbtn_openinbox = checkbtn_openinbox; - prefs_receive->checkbtn_scan_after_inc = checkbtn_scan_after_inc; prefs_receive->checkbtn_newmail_auto = checkbtn_newmail_auto; prefs_receive->checkbtn_newmail_manu = checkbtn_newmail_manu; prefs_receive->entry_newmail_notify_cmd = entry_newmail_notify_cmd; @@ -369,10 +352,6 @@ static void prefs_receive_save(PrefsPage *_page) GTK_TOGGLE_BUTTON(page->checkbtn_close_recv_dialog)); prefs_common.chk_on_startup = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(page->checkbtn_chkonstartup)); - prefs_common.open_inbox_on_inc = gtk_toggle_button_get_active( - GTK_TOGGLE_BUTTON(page->checkbtn_openinbox)); - prefs_common.scan_all_after_inc = gtk_toggle_button_get_active( - GTK_TOGGLE_BUTTON(page->checkbtn_scan_after_inc)); prefs_common.newmail_notify_auto = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(page->checkbtn_newmail_auto));