aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-config.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-12-13 05:14:30 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-12-13 05:14:30 +0800
commit3622e520dda5f4b7c9cf6aee8aaadc1a50f21ba5 (patch)
tree3408a4ae0944753bf04bb93e5cea61f6486ad21c /mail/mail-config.c
parent39d4313c302735f75a215be0776d99c8ab398f60 (diff)
downloadgsoc2013-evolution-3622e520dda5f4b7c9cf6aee8aaadc1a50f21ba5.tar
gsoc2013-evolution-3622e520dda5f4b7c9cf6aee8aaadc1a50f21ba5.tar.gz
gsoc2013-evolution-3622e520dda5f4b7c9cf6aee8aaadc1a50f21ba5.tar.bz2
gsoc2013-evolution-3622e520dda5f4b7c9cf6aee8aaadc1a50f21ba5.tar.lz
gsoc2013-evolution-3622e520dda5f4b7c9cf6aee8aaadc1a50f21ba5.tar.xz
gsoc2013-evolution-3622e520dda5f4b7c9cf6aee8aaadc1a50f21ba5.tar.zst
gsoc2013-evolution-3622e520dda5f4b7c9cf6aee8aaadc1a50f21ba5.zip
set the new-mail-notify command.
2001-12-12 Jeffrey Stedfast <fejj@ximian.com> * mail-config.c (mail_config_set_new_mail_notification_command): set the new-mail-notify command. (mail_config_get_new_mail_notification_command): get the new-mail-notify command. (mail_config_set_new_mail_notification): set the new-mail-notification action. (mail_config_get_new_mail_notification): get the new-mail-notification action. (mail_config_write_on_exit): save the new-mail-notification settings. (config_read): Read in the new-mail-notification settings. * mail-ops.c (mail_execute_shell_command): New function to execute a shell command async. Will be used for playing sounds on new mail or whatever. svn path=/trunk/; revision=15005
Diffstat (limited to 'mail/mail-config.c')
-rw-r--r--mail/mail-config.c54
1 files changed, 48 insertions, 6 deletions
diff --git a/mail/mail-config.c b/mail/mail-config.c
index 91acb931ab..819b251284 100644
--- a/mail/mail-config.c
+++ b/mail/mail-config.c
@@ -106,6 +106,9 @@ typedef struct {
gboolean filter_log;
char *filter_log_path;
+
+ MailConfigNewMailNotification notify;
+ char *notify_command;
} MailConfig;
static MailConfig *config = NULL;
@@ -607,6 +610,14 @@ config_read (void)
config->filter_log_path = bonobo_config_get_string (
config->db, "/Mail/Filters/log_path", NULL);
+
+ /* New Mail Notification */
+ config->notify = bonobo_config_get_long_with_default (
+ config->db, "/Mail/Notify/new_mail_notification",
+ MAIL_CONFIG_NEW_MAIL_NOTIFICATION_NONE, NULL);
+
+ config->notify_command = bonobo_config_get_string (
+ config->db, "/Mail/Notify/new_mail_notification_command", NULL);
}
#define bonobo_config_set_string_wrapper(db, path, val, ev) bonobo_config_set_string (db, path, val ? val : "", ev)
@@ -886,7 +897,14 @@ mail_config_write_on_exit (void)
bonobo_config_set_string_wrapper (config->db, "/Mail/Filters/log_path",
config->filter_log_path, NULL);
-
+
+ /* New Mail Notification */
+ bonobo_config_set_long (config->db, "/Mail/Notify/new_mail_notification",
+ config->notify, NULL);
+
+ bonobo_config_set_string_wrapper (config->db, "/Mail/Notify/new_mail_notification_command",
+ config->notify_command, NULL);
+
if (config->threaded_hash)
g_hash_table_foreach_remove (config->threaded_hash, hash_save_state, "Threads");
@@ -898,7 +916,7 @@ mail_config_write_on_exit (void)
CORBA_exception_free (&ev);
/* Passwords */
-
+
/* then we make sure the ones we want to remember are in the
session cache */
accounts = mail_config_get_accounts ();
@@ -919,21 +937,21 @@ mail_config_write_on_exit (void)
g_free (passwd);
}
}
-
+
/* then we clear out our component passwords */
e_passwords_clear_component_passwords ();
-
+
/* then we remember them */
accounts = mail_config_get_accounts ();
for ( ; accounts; accounts = accounts->next) {
account = accounts->data;
if (account->source->save_passwd && account->source->url)
mail_session_remember_password (account->source->url);
-
+
if (account->transport->save_passwd && account->transport->url)
mail_session_remember_password (account->transport->url);
}
-
+
/* now do cleanup */
mail_config_clear ();
}
@@ -1610,6 +1628,30 @@ mail_config_set_default_charset (const char *charset)
config->default_charset = g_strdup (charset);
}
+MailConfigNewMailNotification
+mail_config_get_new_mail_notification (void)
+{
+ return config->notify;
+}
+
+void
+mail_config_set_new_mail_notification (MailConfigNewMailNotification type)
+{
+ config->notify = type;
+}
+
+const char *
+mail_config_get_new_mail_notification_command (void)
+{
+ return config->notify_command;
+}
+
+void
+mail_config_set_new_mail_notification_command (const char *command)
+{
+ g_free (config->notify_command);
+ config->notify_command = g_strdup (command);
+}
gboolean
mail_config_find_account (const MailConfigAccount *account)