diff options
author | Jason Leach <jleach@ximian.com> | 2001-07-11 05:08:02 +0800 |
---|---|---|
committer | Jacob Leach <jleach@src.gnome.org> | 2001-07-11 05:08:02 +0800 |
commit | 2864edc6325ba994179b35b6a40d9d053e8805d8 (patch) | |
tree | 0186cc996d68660c1f8e0e0e28c78939c886f9ff | |
parent | b2716b04c952a71d385a07c32c36269024a57ea4 (diff) | |
download | gsoc2013-evolution-2864edc6325ba994179b35b6a40d9d053e8805d8.tar gsoc2013-evolution-2864edc6325ba994179b35b6a40d9d053e8805d8.tar.gz gsoc2013-evolution-2864edc6325ba994179b35b6a40d9d053e8805d8.tar.bz2 gsoc2013-evolution-2864edc6325ba994179b35b6a40d9d053e8805d8.tar.lz gsoc2013-evolution-2864edc6325ba994179b35b6a40d9d053e8805d8.tar.xz gsoc2013-evolution-2864edc6325ba994179b35b6a40d9d053e8805d8.tar.zst gsoc2013-evolution-2864edc6325ba994179b35b6a40d9d053e8805d8.zip |
[Bug #4305: Make the automatic mark-as-read timer optional]
2001-07-10 Jason Leach <jleach@ximian.com>
[Bug #4305: Make the automatic mark-as-read timer optional]
* mail-config.glade: Necessary changes to make the Mark as "Read"
label a toggle button instead.
* mail-accounts.c (construct): Connect to the "toggled" on our new
toggle.
(timeout_toggled): New callback, called from above.
* mail-config.c (mail_config_get_do_seen_timeout): New.
(mail_config_set_do_seen_timeout): New.
(mail_config_write_on_exit): Save the preference here.
(config_read): Load it here.
svn path=/trunk/; revision=10973
-rw-r--r-- | mail/ChangeLog | 16 | ||||
-rw-r--r-- | mail/folder-browser.c | 2 | ||||
-rw-r--r-- | mail/mail-accounts.c | 14 | ||||
-rw-r--r-- | mail/mail-accounts.h | 1 | ||||
-rw-r--r-- | mail/mail-config.c | 26 | ||||
-rw-r--r-- | mail/mail-config.glade | 15 | ||||
-rw-r--r-- | mail/mail-config.h | 3 |
7 files changed, 63 insertions, 14 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 9e44ca9ed2..e88fc24b30 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,19 @@ +2001-07-10 Jason Leach <jleach@ximian.com> + + [Bug #4305: Make the automatic mark-as-read timer optional] + + * mail-config.glade: Necessary changes to make the Mark as "Read" + label a toggle button instead. + + * mail-accounts.c (construct): Connect to the "toggled" on our new + toggle. + (timeout_toggled): New callback, called from above. + + * mail-config.c (mail_config_get_do_seen_timeout): New. + (mail_config_set_do_seen_timeout): New. + (mail_config_write_on_exit): Save the preference here. + (config_read): Load it here. + 2001-07-10 JP Rosevear <jpr@ximian.com> * folder-browser.c: Cosmetic patch - replace our defines with the diff --git a/mail/folder-browser.c b/mail/folder-browser.c index 2afbe445f5..c682b850d6 100644 --- a/mail/folder-browser.c +++ b/mail/folder-browser.c @@ -1693,7 +1693,7 @@ done_message_selected (CamelFolder *folder, char *uid, CamelMimeMessage *msg, vo if (fb->seen_id) gtk_timeout_remove(fb->seen_id); - if (msg) { + if (mail_config_get_do_seen_timeout() && msg) { if (timeout > 0) fb->seen_id = gtk_timeout_add(timeout, do_mark_seen, fb); else diff --git a/mail/mail-accounts.c b/mail/mail-accounts.c index e4e02fe61d..31718f2948 100644 --- a/mail/mail-accounts.c +++ b/mail/mail-accounts.c @@ -574,6 +574,12 @@ citation_highlight_toggled (GtkToggleButton *button, gpointer data) } static void +timeout_toggled (GtkToggleButton *button, gpointer data) +{ + mail_config_set_do_seen_timeout (gtk_toggle_button_get_active (button)); +} + +static void citation_color_set (GnomeColorPicker *cp, guint r, guint g, guint b, guint a) { guint32 rgb; @@ -587,6 +593,7 @@ citation_color_set (GnomeColorPicker *cp, guint r, guint g, guint b, guint a) mail_config_set_citation_color (rgb); } +/* FIXME: */ static void timeout_changed (GtkEntry *entry, gpointer data) @@ -763,7 +770,12 @@ construct (MailAccountsDialog *dialog) set_color (dialog->citation_color); gtk_signal_connect (GTK_OBJECT (dialog->citation_color), "color_set", GTK_SIGNAL_FUNC (citation_color_set), dialog); - + + dialog->timeout_toggle = GTK_SPIN_BUTTON (glade_xml_get_widget (gui, "checkMarkTimeout")); + gtk_toggle_button_set_active (dialog->timeout_toggle, mail_config_get_do_seen_timeout ()); + gtk_signal_connect (GTK_OBJECT (dialog->timeout_toggle), "toggled", + GTK_SIGNAL_FUNC (timeout_toggled), dialog); + dialog->timeout = GTK_SPIN_BUTTON (glade_xml_get_widget (gui, "spinMarkTimeout")); gtk_spin_button_set_value (dialog->timeout, (1.0 * mail_config_get_mark_as_seen_timeout ()) / 1000.0); gtk_signal_connect (GTK_OBJECT (dialog->timeout), "changed", diff --git a/mail/mail-accounts.h b/mail/mail-accounts.h index 765ab399ec..7cc853c0b6 100644 --- a/mail/mail-accounts.h +++ b/mail/mail-accounts.h @@ -75,6 +75,7 @@ struct _MailAccountsDialog { /* Display page */ GtkToggleButton *citation_highlight; GnomeColorPicker *citation_color; + GtkToggleButton *timeout_toggle; GtkSpinButton *timeout; GtkToggleButton *images_always, *images_sometimes, *images_never; diff --git a/mail/mail-config.c b/mail/mail-config.c index 0f0b8ab762..59679a532c 100644 --- a/mail/mail-config.c +++ b/mail/mail-config.c @@ -65,6 +65,7 @@ typedef struct { guint32 citation_color; gboolean prompt_empty_subject; gboolean prompt_only_bcc; + gboolean do_seen_timeout; gint seen_timeout; gboolean empty_trash_on_exit; @@ -481,6 +482,10 @@ config_read (void) config->citation_color = bonobo_config_get_long_with_default ( config->db, "/Mail/Display/citation_color", 0x737373, NULL); + /* Mark as seen toggle */ + config->do_seen_timeout = bonobo_config_get_long_with_default (config->db, + "/Mail/Display/do_seen_timeout", TRUE, NULL); + /* Mark as seen timeout */ config->seen_timeout = bonobo_config_get_long_with_default (config->db, "/Mail/Display/seen_timeout", 1500, NULL); @@ -742,13 +747,16 @@ mail_config_write_on_exit (void) config->show_preview, NULL); /* Hide deleted automatically */ - bonobo_config_set_boolean (config->db, "Mail/Display/hide_deleted", + bonobo_config_set_boolean (config->db, "/Mail/Display/hide_deleted", config->hide_deleted, NULL); /* Size of vpaned in mail view */ - bonobo_config_set_long (config->db, "Mail/Display/paned_size", + bonobo_config_set_long (config->db, "/Mail/Display/paned_size", config->paned_size, NULL); - + + /* Mark as seen toggle */ + bonobo_config_set_boolean (config->db, "/Mail/Display/do_seen_timeout", + config->do_seen_timeout, NULL); /* Mark as seen timeout */ bonobo_config_set_long (config->db, "/Mail/Display/seen_timeout", config->seen_timeout, NULL); @@ -1041,6 +1049,18 @@ mail_config_set_citation_color (guint32 citation_color) config->citation_color = citation_color; } +gboolean +mail_config_get_do_seen_timeout (void) +{ + return config->do_seen_timeout; +} + +void +mail_config_set_do_seen_timeout (gboolean do_seen_timeout) +{ + config->do_seen_timeout = do_seen_timeout; +} + gint mail_config_get_mark_as_seen_timeout (void) { diff --git a/mail/mail-config.glade b/mail/mail-config.glade index f0590975ef..c6af4f05f0 100644 --- a/mail/mail-config.glade +++ b/mail/mail-config.glade @@ -2434,15 +2434,12 @@ Kerberos </child> <widget> - <class>GtkLabel</class> - <name>lblMarkAsRead</name> - <label>Mark messages as "Read" after:</label> - <justify>GTK_JUSTIFY_CENTER</justify> - <wrap>False</wrap> - <xalign>0.5</xalign> - <yalign>0.5</yalign> - <xpad>4</xpad> - <ypad>0</ypad> + <class>GtkCheckButton</class> + <name>checkMarkTimeout</name> + <can_focus>True</can_focus> + <label>Mark messages as "Read" after</label> + <active>False</active> + <draw_indicator>True</draw_indicator> <child> <padding>0</padding> <expand>False</expand> diff --git a/mail/mail-config.h b/mail/mail-config.h index 0d012ec046..365d97a7af 100644 --- a/mail/mail-config.h +++ b/mail/mail-config.h @@ -130,6 +130,9 @@ void mail_config_set_citation_highlight (gboolean); guint32 mail_config_get_citation_color (void); void mail_config_set_citation_color (guint32); +gint mail_config_get_do_seen_timeout (void); +void mail_config_set_do_seen_timeout (gboolean do_seen_timeout); + gint mail_config_get_mark_as_seen_timeout (void); void mail_config_set_mark_as_seen_timeout (gint timeout); |