diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-12-13 05:14:30 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-12-13 05:14:30 +0800 |
commit | 3622e520dda5f4b7c9cf6aee8aaadc1a50f21ba5 (patch) | |
tree | 3408a4ae0944753bf04bb93e5cea61f6486ad21c /mail/mail-ops.c | |
parent | 39d4313c302735f75a215be0776d99c8ab398f60 (diff) | |
download | gsoc2013-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-ops.c')
-rw-r--r-- | mail/mail-ops.c | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/mail/mail-ops.c b/mail/mail-ops.c index 8626a5acbb..6bb3f5b5f0 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -30,6 +30,7 @@ /* #include <ctype.h> */ #include <errno.h> +#include <gnome.h> #include <gal/util/e-util.h> #include <gal/widgets/e-unicode.h> #include <gal/util/e-unicode-i18n.h> @@ -2170,3 +2171,57 @@ mail_store_set_offline (CamelStore *store, gboolean offline, e_thread_put(mail_thread_queued, (EMsg *)m); } + + +/* ** Execute Shell Command ***************************************************** */ + +struct _execute_shell_command_msg { + struct _mail_msg msg; + + char *command; +}; + +static char *execute_shell_command_desc (struct _mail_msg *mm, int done) +{ + struct _execute_shell_command_msg *m = (struct _execute_shell_command_msg *) mm; + char *msg; + + msg = g_strdup_printf (_("Executing shell command: %s"), m->command); + + return msg; +} + +static void execute_shell_command_do (struct _mail_msg *mm) +{ + struct _execute_shell_command_msg *m = (struct _execute_shell_command_msg *) mm; + + gnome_execute_shell (NULL, m->command); +} + +static void execute_shell_command_free (struct _mail_msg *mm) +{ + struct _execute_shell_command_msg *m = (struct _execute_shell_command_msg *) mm; + + g_free (m->command); +} + +static struct _mail_msg_op execute_shell_command_op = { + execute_shell_command_desc, + execute_shell_command_do, + NULL, + execute_shell_command_free, +}; + +void +mail_execute_shell_command (const char *command) +{ + struct _execute_shell_command_msg *m; + + if (command == NULL) + return; + + m = mail_msg_new (&execute_shell_command_op, NULL, sizeof (*m)); + m->command = g_strdup (command); + + e_thread_put (mail_thread_queued, (EMsg *) m); +} |