aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2003-04-08 03:10:23 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2003-04-08 03:10:23 +0800
commitcd84f6183343d2bb0d9c33f580fad11ee894b0b6 (patch)
treeb7c50aaa6d9531c7f0c0702578a94bffeab3b05a /mail
parentf47b935f60651d08c5ce667a5d9e75998d1fde9f (diff)
downloadgsoc2013-evolution-cd84f6183343d2bb0d9c33f580fad11ee894b0b6.tar.gz
gsoc2013-evolution-cd84f6183343d2bb0d9c33f580fad11ee894b0b6.tar.zst
gsoc2013-evolution-cd84f6183343d2bb0d9c33f580fad11ee894b0b6.zip
Set the "script" data on the GtkEntry to NULL. (sig_add_script_response):
2003-04-07 Jeffrey Stedfast <fejj@ximian.com> * mail-composer-prefs.c (sig_add_script_cb): Set the "script" data on the GtkEntry to NULL. (sig_add_script_response): If the "script" data on the GtkEntry object is non-NULL, then we are editing an existing signature, so just change the values in place and don't add it to the signature db. (sig_edit_cb): If sig->script is non-NULL, then we are editing a script signature, so pop up the script dialog instead. Fixes bug #38929. svn path=/trunk/; revision=20723
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog12
-rw-r--r--mail/mail-composer-prefs.c46
2 files changed, 47 insertions, 11 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index f0db6e735e..7ef81f7b34 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,15 @@
+2003-04-07 Jeffrey Stedfast <fejj@ximian.com>
+
+ * mail-composer-prefs.c (sig_add_script_cb): Set the "script" data
+ on the GtkEntry to NULL.
+ (sig_add_script_response): If the "script" data on the GtkEntry
+ object is non-NULL, then we are editing an existing signature, so
+ just change the values in place and don't add it to the signature
+ db.
+ (sig_edit_cb): If sig->script is non-NULL, then we are editing a
+ script signature, so pop up the script dialog instead. Fixes bug
+ #38929.
+
2003-04-07 Radek Doulik <rodo@ximian.com>
* mail-composer-prefs.c (spell_load_values): use e_iconv_locale_language
diff --git a/mail/mail-composer-prefs.c b/mail/mail-composer-prefs.c
index c5daa41bb1..0a01135964 100644
--- a/mail/mail-composer-prefs.c
+++ b/mail/mail-composer-prefs.c
@@ -220,15 +220,32 @@ sig_edit_cb (GtkWidget *widget, MailComposerPrefs *prefs)
gtk_tree_model_get (model, &iter, 1, &sig, -1);
- if (!sig->filename || *sig->filename == '\0') {
- g_free (sig->filename);
- sig->filename = g_strdup (_("Unnamed"));
+ if (sig->script == NULL) {
+ /* normal signature */
+ if (!sig->filename || *sig->filename == '\0') {
+ g_free (sig->filename);
+ sig->filename = g_strdup (_("Unnamed"));
+ }
+
+ parent = gtk_widget_get_toplevel ((GtkWidget *) prefs);
+ parent = GTK_WIDGET_TOPLEVEL (parent) ? parent : NULL;
+
+ mail_signature_editor (sig, (GtkWindow *) parent, FALSE);
+ } else {
+ /* signature script */
+ GtkWidget *entry;
+
+ entry = glade_xml_get_widget (prefs->sig_script_gui, "fileentry_add_script_script");
+ gtk_entry_set_text (GTK_ENTRY (entry), sig->name);
+
+ entry = glade_xml_get_widget (prefs->sig_script_gui, "entry_add_script_name");
+ gtk_entry_set_text (GTK_ENTRY (entry), sig->name);
+
+ g_object_set_data ((GObject *) entry, "script", sig);
+
+ gtk_widget_show (prefs->sig_script_dialog);
+ gdk_window_raise (prefs->sig_script_dialog->window);
}
-
- parent = gtk_widget_get_toplevel ((GtkWidget *) prefs);
- parent = GTK_WIDGET_TOPLEVEL (parent) ? parent : NULL;
-
- mail_signature_editor (sig, (GtkWindow *) parent, FALSE);
}
MailConfigSignature *
@@ -297,9 +314,14 @@ sig_add_script_response (GtkWidget *widget, int button, MailComposerPrefs *prefs
parent = gtk_widget_get_toplevel ((GtkWidget *) prefs);
parent = GTK_WIDGET_TOPLEVEL (parent) ? parent : NULL;
- sig = mail_composer_prefs_new_signature ((GtkWindow *) parent, TRUE, script);
- mail_config_signature_set_name (sig, name);
- mail_config_signature_add (sig);
+ if ((sig = g_object_get_data ((GObject *) entry, "script"))) {
+ /* we're just editing an existing signature script */
+ mail_config_signature_set_name (sig, name);
+ } else {
+ sig = mail_composer_prefs_new_signature ((GtkWindow *) parent, TRUE, script);
+ mail_config_signature_set_name (sig, name);
+ mail_config_signature_add (sig);
+ }
gtk_widget_hide (prefs->sig_script_dialog);
@@ -327,6 +349,8 @@ sig_add_script_cb (GtkWidget *widget, MailComposerPrefs *prefs)
entry = glade_xml_get_widget (prefs->sig_script_gui, "entry_add_script_name");
gtk_entry_set_text (GTK_ENTRY (entry), _("Unnamed"));
+ g_object_set_data ((GObject *) entry, "script", NULL);
+
gtk_widget_show (prefs->sig_script_dialog);
gdk_window_raise (prefs->sig_script_dialog->window);
}