[Commits] [SCM] claws branch, master, updated. 3.13.2-198-g72a45f9

mones at claws-mail.org mones at claws-mail.org
Sat Jul 23 03:03:57 CEST 2016


The branch, master has been updated
       via  72a45f97e63a1f8f19adef80dc197a917207f7e1 (commit)
       via  bc779dcb02bc8bc8653dfc5201dcfecc457bd971 (commit)
      from  00f51a67e4f0843f57773295dcbf897e087bcc6a (commit)

Summary of changes:
 src/inc.c             |    7 ++--
 src/prefs_common.c    |    7 ++--
 src/prefs_common.h    |    7 ++--
 src/prefs_migration.c |    9 ++++-
 src/prefs_receive.c   |   92 +++++++++++++++++++++++++++++++++++++++----------
 5 files changed, 90 insertions(+), 32 deletions(-)


- Log -----------------------------------------------------------------
commit 72a45f97e63a1f8f19adef80dc197a917207f7e1
Author: Ricardo Mones <ricardo at mones.org>
Date:   Sat Jul 23 03:00:00 2016 +0200

    Update copyright headers for previous commit

diff --git a/src/inc.c b/src/inc.c
index 89b50cd..4dafe97 100644
--- a/src/inc.c
+++ b/src/inc.c
@@ -1,6 +1,6 @@
 /*
- * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2013 Hiroyuki Yamamoto and the Claws Mail team
+ * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 1999-2016 Hiroyuki Yamamoto and the Claws Mail team
  *
  * 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
@@ -14,7 +14,6 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * 
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/src/prefs_common.c b/src/prefs_common.c
index 133c2e1..b1d937a 100644
--- a/src/prefs_common.c
+++ b/src/prefs_common.c
@@ -1,6 +1,6 @@
 /*
- * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2013 Hiroyuki Yamamoto and the Claws Mail team
+ * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 1999-2016 Hiroyuki Yamamoto and the Claws Mail team
  *
  * 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
@@ -14,7 +14,6 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * 
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/src/prefs_common.h b/src/prefs_common.h
index 13f966e..f2fee5d 100644
--- a/src/prefs_common.h
+++ b/src/prefs_common.h
@@ -1,6 +1,6 @@
 /*
- * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2013 Hiroyuki Yamamoto and the Claws Mail team
+ * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 1999-2016 Hiroyuki Yamamoto and the Claws Mail team
  *
  * 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
@@ -14,7 +14,6 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * 
  */
 
 #ifndef __PREFS_COMMON_H__
diff --git a/src/prefs_receive.c b/src/prefs_receive.c
index c87612b..2558fe6 100644
--- a/src/prefs_receive.c
+++ b/src/prefs_receive.c
@@ -1,6 +1,6 @@
 /*
- * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 2005-2013 Colin Leroy <colin at colino.net> & The Claws Mail Team
+ * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 2005-2016 Colin Leroy and The Claws Mail Team
  *
  * 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
@@ -14,7 +14,6 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * 
  */
 
 #ifdef HAVE_CONFIG_H

commit bc779dcb02bc8bc8653dfc5201dcfecc457bd971
Author: Ricardo Mones <ricardo at mones.org>
Date:   Sat Jul 23 02:59:21 2016 +0200

    Fix bug #2176: autochk_interval granularity is low
    
    This also fixes Debian bug “Please increase mail auto check period.”
    See: https://bugs.debian.org/712758
    
    Former bug wanted sub-minute granularity and latter the opposite: just
    check a few times a day, so this allows user to specify also hours and
    seconds in addition to existing minutes to address both requests.
    
    Checking range was from 1 minute to 1 hour 40 minutes and now is
    extended to a range from 10 seconds to 100 hours minus one second.
    
    Default for new configurations is preserved (10 minutes).
    
    Configuration version is raised to 2 for migrating existing values
    from minutes to seconds.

diff --git a/src/inc.c b/src/inc.c
index 38f66ee..89b50cd 100644
--- a/src/inc.c
+++ b/src/inc.c
@@ -1464,7 +1464,7 @@ static void inc_autocheck_timer_set_interval(guint interval)
 
 void inc_autocheck_timer_set(void)
 {
-	inc_autocheck_timer_set_interval(prefs_common.autochk_itv * 60000);
+	inc_autocheck_timer_set_interval(prefs_common.autochk_itv * 1000);
 }
 
 void inc_autocheck_timer_remove(void)
diff --git a/src/prefs_common.c b/src/prefs_common.c
index 8518f80..133c2e1 100644
--- a/src/prefs_common.c
+++ b/src/prefs_common.c
@@ -152,7 +152,7 @@ static PrefParam param[] = {
 
 	{"autochk_newmail", "FALSE", &prefs_common.autochk_newmail, P_BOOL,
 	 NULL, NULL, NULL},
-	{"autochk_interval", "10", &prefs_common.autochk_itv, P_INT,
+	{"autochk_interval", "600", &prefs_common.autochk_itv, P_INT,
 	 NULL, NULL, NULL},
 	{"check_on_startup", "FALSE", &prefs_common.chk_on_startup, P_BOOL,
 	 NULL, NULL, NULL},
diff --git a/src/prefs_common.h b/src/prefs_common.h
index e38fda0..13f966e 100644
--- a/src/prefs_common.h
+++ b/src/prefs_common.h
@@ -36,7 +36,7 @@
 #include "prefs_msg_colors.h"
 #include "prefs_summary_open.h"
 
-#define CLAWS_CONFIG_VERSION 1
+#define CLAWS_CONFIG_VERSION 2
 
 typedef struct _PrefsCommon	PrefsCommon;
 
diff --git a/src/prefs_migration.c b/src/prefs_migration.c
index dbd039a..0ee859c 100644
--- a/src/prefs_migration.c
+++ b/src/prefs_migration.c
@@ -14,7 +14,6 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
  */
 
 #ifdef HAVE_CONFIG_H
@@ -58,6 +57,14 @@ static void _update_config(gint version)
 
 			break;
 
+		case 1:
+
+			/* The autochk_interval preference is now
+			 * interpreted as seconds instead of minutes */
+			prefs_common.autochk_itv *= 60;
+
+			break;
+
 		default:
 			break;
 	}
diff --git a/src/prefs_receive.c b/src/prefs_receive.c
index 1bda710..c87612b 100644
--- a/src/prefs_receive.c
+++ b/src/prefs_receive.c
@@ -52,7 +52,9 @@ typedef struct _ReceivePage
 	GtkWidget *checkbtn_incext;
 	GtkWidget *entry_incext;
 	GtkWidget *checkbtn_autochk;
-	GtkWidget *spinbtn_autochk;
+	GtkWidget *spinbtn_autochk_sec;
+	GtkWidget *spinbtn_autochk_min;
+	GtkWidget *spinbtn_autochk_hour;
 	GtkWidget *checkbtn_chkonstartup;
 	GtkWidget *checkbtn_openinbox;
 	GtkWidget *checkbtn_scan_after_inc;
@@ -78,6 +80,20 @@ static void prefs_common_recv_dialog_newmail_notify_toggle_cb(GtkWidget *w, gpoi
 	gtk_widget_set_sensitive(prefs_receive->hbox_newmail_notify, toggled);
 }
 
+static void prefs_receive_itv_spinbutton_value_changed_cb(GtkWidget *w, gpointer data)
+{
+	ReceivePage *page = (ReceivePage *)data;
+	gint seconds = gtk_spin_button_get_value_as_int (
+		GTK_SPIN_BUTTON (page->spinbtn_autochk_sec));
+	gint minutes = gtk_spin_button_get_value_as_int (
+		GTK_SPIN_BUTTON (page->spinbtn_autochk_min));
+	gint hours = gtk_spin_button_get_value_as_int (
+		GTK_SPIN_BUTTON(page->spinbtn_autochk_hour));
+	if (seconds < 10 && minutes == 0 && hours == 0) {
+		gtk_spin_button_set_value (
+			GTK_SPIN_BUTTON (page->spinbtn_autochk_sec), 10.0);
+	}
+}
 
 static void prefs_receive_create_widget(PrefsPage *_page, GtkWindow *window, 
 			       	  gpointer data)
@@ -94,7 +110,9 @@ static void prefs_receive_create_widget(PrefsPage *_page, GtkWindow *window,
 	GtkWidget *hbox_autochk;
 	GtkWidget *checkbtn_autochk;
 	GtkAdjustment *spinbtn_autochk_adj;
-	GtkWidget *spinbtn_autochk;
+	GtkWidget *spinbtn_autochk_sec;
+	GtkWidget *spinbtn_autochk_min;
+	GtkWidget *spinbtn_autochk_hour;
 	GtkWidget *label_autochk2;
 	GtkWidget *checkbtn_chkonstartup;
 	GtkWidget *checkbtn_openinbox;
@@ -148,19 +166,36 @@ static void prefs_receive_create_widget(PrefsPage *_page, GtkWindow *window,
 	PACK_CHECK_BUTTON (hbox_autochk, checkbtn_autochk,
 			   _("Check for new mail every"));
 
-	spinbtn_autochk_adj = GTK_ADJUSTMENT(gtk_adjustment_new (5, 1, 100, 1, 10, 0));
-	spinbtn_autochk = gtk_spin_button_new
+	spinbtn_autochk_adj = GTK_ADJUSTMENT(gtk_adjustment_new (5, 0, 99, 1, 10, 0));
+	spinbtn_autochk_hour = gtk_spin_button_new
 		(GTK_ADJUSTMENT (spinbtn_autochk_adj), 1, 0);
-	gtk_widget_show (spinbtn_autochk);
-	gtk_box_pack_start (GTK_BOX (hbox_autochk), spinbtn_autochk, FALSE, FALSE, 0);
-	gtk_widget_set_size_request (spinbtn_autochk, 64, -1);
-	gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_autochk), TRUE);
 
-	label_autochk2 = gtk_label_new (_("minute(s)"));
+	gtk_widget_show (spinbtn_autochk_hour);
+	gtk_box_pack_start (GTK_BOX (hbox_autochk), spinbtn_autochk_hour, FALSE, FALSE, 0);
+	spinbtn_autochk_adj = GTK_ADJUSTMENT(gtk_adjustment_new (5, 0, 59, 1, 10, 0));
+	spinbtn_autochk_min = gtk_spin_button_new
+		(GTK_ADJUSTMENT (spinbtn_autochk_adj), 1, 0);
+	gtk_widget_show (spinbtn_autochk_min);
+	gtk_box_pack_start (GTK_BOX (hbox_autochk), spinbtn_autochk_min, FALSE, FALSE, 0);
+	spinbtn_autochk_adj = GTK_ADJUSTMENT(gtk_adjustment_new (5, 0, 59, 1, 10, 0));
+	spinbtn_autochk_sec = gtk_spin_button_new
+		(GTK_ADJUSTMENT (spinbtn_autochk_adj), 1, 0);
+	gtk_widget_show (spinbtn_autochk_sec);
+	gtk_box_pack_start (GTK_BOX (hbox_autochk), spinbtn_autochk_sec, FALSE, FALSE, 0);
+	gtk_widget_set_size_request (spinbtn_autochk_sec, 48, -1);
+	gtk_widget_set_size_request (spinbtn_autochk_min, 48, -1);
+	gtk_widget_set_size_request (spinbtn_autochk_hour, 48, -1);
+	gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_autochk_sec), TRUE);
+	gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_autochk_min), TRUE);
+	gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_autochk_hour), TRUE);
+
+	label_autochk2 = gtk_label_new (_("hour(s)/min(s)/sec(s)"));
 	gtk_widget_show (label_autochk2);
 	gtk_box_pack_start (GTK_BOX (hbox_autochk), label_autochk2, FALSE, FALSE, 0);
 
-	SET_TOGGLE_SENSITIVITY(checkbtn_autochk, spinbtn_autochk);
+	SET_TOGGLE_SENSITIVITY(checkbtn_autochk, spinbtn_autochk_sec);
+	SET_TOGGLE_SENSITIVITY(checkbtn_autochk, spinbtn_autochk_min);
+	SET_TOGGLE_SENSITIVITY(checkbtn_autochk, spinbtn_autochk_hour);
 	SET_TOGGLE_SENSITIVITY(checkbtn_autochk, label_autochk2);
 
 	PACK_CHECK_BUTTON (vbox2, checkbtn_chkonstartup,
@@ -258,8 +293,12 @@ static void prefs_receive_create_widget(PrefsPage *_page, GtkWindow *window,
 
 	gtk_entry_set_text(GTK_ENTRY(entry_incext), 
 		prefs_common.extinc_cmd);
-	gtk_spin_button_set_value(GTK_SPIN_BUTTON(spinbtn_autochk), 
-		prefs_common.autochk_itv);
+	gtk_spin_button_set_value(GTK_SPIN_BUTTON(spinbtn_autochk_hour),
+		prefs_common.autochk_itv / 3600);
+	gtk_spin_button_set_value(GTK_SPIN_BUTTON(spinbtn_autochk_min),
+		(prefs_common.autochk_itv % 3600) / 60);
+	gtk_spin_button_set_value(GTK_SPIN_BUTTON(spinbtn_autochk_sec),
+		(prefs_common.autochk_itv % 3600) % 60);
 	combobox_select_by_data(GTK_COMBO_BOX(optmenu_recvdialog),
 		prefs_common.recv_dialog_mode);
 
@@ -267,7 +306,9 @@ static void prefs_receive_create_widget(PrefsPage *_page, GtkWindow *window,
 	prefs_receive->checkbtn_incext = checkbtn_incext;
 	prefs_receive->entry_incext = entry_incext;
 	prefs_receive->checkbtn_autochk = checkbtn_autochk;
-	prefs_receive->spinbtn_autochk = spinbtn_autochk;
+	prefs_receive->spinbtn_autochk_sec = spinbtn_autochk_sec;
+	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;
@@ -287,6 +328,15 @@ static void prefs_receive_create_widget(PrefsPage *_page, GtkWindow *window,
 	g_signal_connect(G_OBJECT(checkbtn_newmail_manu), "toggled",
 			 G_CALLBACK(prefs_common_recv_dialog_newmail_notify_toggle_cb),
 			 NULL);
+	g_signal_connect(G_OBJECT(spinbtn_autochk_hour), "value-changed",
+		G_CALLBACK(prefs_receive_itv_spinbutton_value_changed_cb),
+		(gpointer) prefs_receive);
+	g_signal_connect(G_OBJECT(spinbtn_autochk_min), "value-changed",
+		G_CALLBACK(prefs_receive_itv_spinbutton_value_changed_cb),
+		(gpointer) prefs_receive);
+	g_signal_connect(G_OBJECT(spinbtn_autochk_sec), "value-changed",
+		G_CALLBACK(prefs_receive_itv_spinbutton_value_changed_cb),
+		(gpointer) prefs_receive);
 }
 
 static void prefs_receive_save(PrefsPage *_page)
@@ -313,9 +363,14 @@ static void prefs_receive_save(PrefsPage *_page)
 		GTK_TOGGLE_BUTTON(page->checkbtn_newmail_manu));
 	prefs_common.autochk_newmail = gtk_toggle_button_get_active(
 		GTK_TOGGLE_BUTTON(page->checkbtn_autochk));
-	prefs_common.autochk_itv = gtk_spin_button_get_value_as_int(
-		GTK_SPIN_BUTTON(page->spinbtn_autochk));
-	
+	prefs_common.autochk_itv =
+		(3600 * gtk_spin_button_get_value_as_int(
+			GTK_SPIN_BUTTON(page->spinbtn_autochk_hour)))
+		+ (60 * gtk_spin_button_get_value_as_int(
+			GTK_SPIN_BUTTON(page->spinbtn_autochk_min)))
+		+ gtk_spin_button_get_value_as_int(
+			GTK_SPIN_BUTTON(page->spinbtn_autochk_sec));
+
 	tmp = gtk_editable_get_chars(GTK_EDITABLE(page->entry_incext), 0, -1);
 	g_free(prefs_common.extinc_cmd);
 	prefs_common.extinc_cmd = tmp;

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list