commit 688c2751dfe57da18dd612a2014522cf17976b73
parent 510cb0e589614f608ab294b4b8c41c624717aaa1
Author: Oliver Lowe <o@olowe.co>
Date: Tue, 2 Sep 2025 10:54:59 +1000
Only receive mail when clicking receive mail button
Diffstat:
4 files changed, 6 insertions(+), 67 deletions(-)
diff --git a/src/inc.c b/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,38 +135,7 @@ 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);
-
-/**
- * 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);
-}
+static void inc_notify_cmd(gint new_msgs, gboolean notify);
void inc_mail(MainWindow *mainwin, gboolean notify)
{
@@ -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, PrefsAccount *account)
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 *account_list, gboolean au
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 *account_list, gboolean au
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);
}
diff --git a/src/prefs_common.c b/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,
diff --git a/src/prefs_common.h b/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;
diff --git a/src/prefs_receive.c b/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 *_page, GtkWindow *window,
GtkWidget *label_autochk1;
GtkWidget *label_autochk0;
GtkWidget *checkbtn_chkonstartup;
- GtkWidget *checkbtn_openinbox;
- GtkWidget *checkbtn_scan_after_inc;
GtkWidget *frame;
GtkWidget *vbox3;
@@ -243,14 +239,7 @@ static void prefs_receive_create_widget(PrefsPage *_page, GtkWindow *window,
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"));
-
- 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"));
+ vbox3 = gtkut_get_options_frame(vbox1, &frame, _("Run command after receiving new mail"));
hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 8);
gtk_widget_show (hbox);
@@ -303,10 +292,6 @@ static void prefs_receive_create_widget(PrefsPage *_page, GtkWindow *window,
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 *_page, GtkWindow *window,
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));