diff options
author | Radek Doulik <rodo@ximian.com> | 2002-03-08 07:10:47 +0800 |
---|---|---|
committer | Radek Doulik <rodo@src.gnome.org> | 2002-03-08 07:10:47 +0800 |
commit | 5326b38eaaffc00e770def17b5fcc4d8be3e8472 (patch) | |
tree | a5caac91f604b3bfb374125f51bbe57db9d614b7 /mail/mail-accounts.c | |
parent | 3227c579dc08b9a78074930839b2aec86a8ed681 (diff) | |
download | gsoc2013-evolution-5326b38eaaffc00e770def17b5fcc4d8be3e8472.tar.gz gsoc2013-evolution-5326b38eaaffc00e770def17b5fcc4d8be3e8472.tar.zst gsoc2013-evolution-5326b38eaaffc00e770def17b5fcc4d8be3e8472.zip |
notify accounts dialog about signature content change
2002-03-07 Radek Doulik <rodo@ximian.com>
* mail-signature-editor.c: notify accounts dialog about signature
content change
* mail-accounts.c (run_script): run script only if file regular
file exists and has x flag
svn path=/trunk/; revision=15979
Diffstat (limited to 'mail/mail-accounts.c')
-rw-r--r-- | mail/mail-accounts.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/mail/mail-accounts.c b/mail/mail-accounts.c index d8573221f6..be24b7d64c 100644 --- a/mail/mail-accounts.c +++ b/mail/mail-accounts.c @@ -822,6 +822,20 @@ dialog_destroy (GtkWidget *dialog, gpointer user_data) /* Signatures */ static void +run_script (gchar *script) +{ + struct stat s; + + if (stat (script, &s)) + return; + + if (!S_ISREG (s.st_mode) || !(s.st_mode & (S_IXOTH | S_IXGRP | S_IXUSR))) + return; + + mail_config_signature_run_script (script); +} + +static void sig_load_preview (MailAccountsDialog *dialog, MailConfigSignature *sig) { gchar *str; @@ -831,7 +845,7 @@ sig_load_preview (MailAccountsDialog *dialog, MailConfigSignature *sig) return; } - mail_config_signature_run_script (sig->script); + run_script (sig->script); str = e_msg_composer_get_sig_file_content (sig->filename, sig->html); if (!str) str = g_strdup (" "); @@ -874,7 +888,7 @@ sig_edit (GtkWidget *w, MailAccountsDialog *dialog) MailConfigSignature *sig = sig_current_sig (dialog); if (sig->filename && *sig->filename) - mail_signature_editor (sig->filename, sig->html); + mail_signature_editor (sig); else e_notice (GTK_WINDOW (dialog), GNOME_MESSAGE_BOX_ERROR, _("Please specify signature filename\nin Andvanced section of signature settings.")); @@ -1115,6 +1129,11 @@ sig_event_client (MailConfigSigEvent event, MailConfigSignature *sig, MailAccoun case MAIL_CONFIG_SIG_EVENT_NAME_CHANGED: printf ("accounts NAME CHANGED\n"); break; + case MAIL_CONFIG_SIG_EVENT_CONTENT_CHANGED: + printf ("accounts CONTENT CHANGED\n"); + if (sig == sig_current_sig (dialog)) + sig_load_preview (dialog, sig); + break; default: ; } |