aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog10
-rw-r--r--mail/mail-accounts.c30
-rw-r--r--mail/mail-signature-editor.c23
3 files changed, 57 insertions, 6 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 9db70b38b5..937fcc00e7 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,13 @@
+2002-03-08 Radek Doulik <rodo@ximian.com>
+
+ * mail-accounts.c (sig_event_client): handle name changed event
+ (sig_load_preview): don't run script before each reload
+ (sig_script_activate): run script only if script entry is
+ activated
+
+ * mail-signature-editor.c (mail_signature_editor): added signature
+ name entry
+
2002-03-07 Jeffrey Stedfast <fejj@ximian.com>
* mail-config-druid.c (management_changed): Re-focus the account
diff --git a/mail/mail-accounts.c b/mail/mail-accounts.c
index be24b7d64c..75eb77cfa7 100644
--- a/mail/mail-accounts.c
+++ b/mail/mail-accounts.c
@@ -845,7 +845,6 @@ sig_load_preview (MailAccountsDialog *dialog, MailConfigSignature *sig)
return;
}
- run_script (sig->script);
str = e_msg_composer_get_sig_file_content (sig->filename, sig->html);
if (!str)
str = g_strdup (" ");
@@ -883,6 +882,17 @@ sig_current_sig (MailAccountsDialog *dialog)
}
static void
+sig_script_activate (GtkWidget *w, MailAccountsDialog *dialog)
+{
+ MailConfigSignature *sig = sig_current_sig (dialog);
+
+ if (sig && sig->script && *sig->script) {
+ run_script (sig->script);
+ sig_write_and_update_preview (dialog, sig);
+ }
+}
+
+static void
sig_edit (GtkWidget *w, MailAccountsDialog *dialog)
{
MailConfigSignature *sig = sig_current_sig (dialog);
@@ -977,14 +987,16 @@ sig_row_select (GtkWidget *w, gint row, gint col, GdkEvent *event, MailAccountsD
sig = gtk_clist_get_row_data (GTK_CLIST (dialog->sig_clist), row);
if (sig) {
if (sig->name)
- gtk_entry_set_text (GTK_ENTRY (dialog->sig_name), sig->name);
+ e_utf8_gtk_entry_set_text (GTK_ENTRY (dialog->sig_name), sig->name);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->sig_random), sig->random);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->sig_html), sig->html);
if (sig->filename)
- gtk_entry_set_text (GTK_ENTRY (gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (dialog->sig_filename))),
+ gtk_entry_set_text (GTK_ENTRY (gnome_file_entry_gtk_entry
+ (GNOME_FILE_ENTRY (dialog->sig_filename))),
sig->filename);
if (sig->script)
- gtk_entry_set_text (GTK_ENTRY (gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (dialog->sig_script))),
+ gtk_entry_set_text (GTK_ENTRY (gnome_file_entry_gtk_entry
+ (GNOME_FILE_ENTRY (dialog->sig_script))),
sig->script);
}
dialog->sig_switch = FALSE;
@@ -1037,7 +1049,7 @@ sig_name_changed (GtkWidget *w, MailAccountsDialog *dialog)
if (dialog->sig_switch)
return;
- mail_config_signature_set_name (sig, gtk_entry_get_text (GTK_ENTRY (dialog->sig_name)));
+ mail_config_signature_set_name (sig, e_utf8_gtk_entry_get_text (GTK_ENTRY (dialog->sig_name)));
gtk_clist_set_text (GTK_CLIST (dialog->sig_clist), dialog->sig_row, 0, sig->name);
sig_write_and_update_preview (dialog, sig);
@@ -1128,6 +1140,12 @@ sig_event_client (MailConfigSigEvent event, MailConfigSignature *sig, MailAccoun
switch (event) {
case MAIL_CONFIG_SIG_EVENT_NAME_CHANGED:
printf ("accounts NAME CHANGED\n");
+ gtk_clist_set_text (GTK_CLIST (dialog->sig_clist), sig->id, 0, sig->name);
+ if (sig == sig_current_sig (dialog)) {
+ dialog->sig_switch = TRUE;
+ e_utf8_gtk_entry_set_text (GTK_ENTRY (dialog->sig_name), sig->name);
+ dialog->sig_switch = FALSE;
+ }
break;
case MAIL_CONFIG_SIG_EVENT_CONTENT_CHANGED:
printf ("accounts CONTENT CHANGED\n");
@@ -1184,6 +1202,8 @@ signatures_page_construct (MailAccountsDialog *dialog, GladeXML *gui)
dialog->sig_script = glade_xml_get_widget (gui, "file-sig-script");
gtk_signal_connect (GTK_OBJECT (gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (dialog->sig_script))),
"changed", GTK_SIGNAL_FUNC (sig_script_changed), dialog);
+ gtk_signal_connect (GTK_OBJECT (gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (dialog->sig_script))),
+ "activate", GTK_SIGNAL_FUNC (sig_script_activate), dialog);
dialog->sig_advanced_table = glade_xml_get_widget (gui, "table-sig-advanced");
dialog->sig_preview = glade_xml_get_widget (gui, "frame-sig-preview");
diff --git a/mail/mail-signature-editor.c b/mail/mail-signature-editor.c
index 45821a1028..58c18639c7 100644
--- a/mail/mail-signature-editor.c
+++ b/mail/mail-signature-editor.c
@@ -2,6 +2,7 @@
#include <bonobo/bonobo-stream-memory.h>
#include <gal/widgets/e-gui-utils.h>
+#include <gal/widgets/e-unicode.h>
#include "e-msg-composer.h"
#include "mail-signature-editor.h"
@@ -14,6 +15,7 @@
struct _ESignatureEditor {
GtkWidget *win;
GtkWidget *control;
+ GtkWidget *name_entry;
MailConfigSignature *sig;
@@ -225,6 +227,12 @@ load_signature (ESignatureEditor *editor)
}
}
+static void
+sig_name_changed (GtkWidget *w, ESignatureEditor *editor)
+{
+ mail_config_signature_set_name (editor->sig, e_utf8_gtk_entry_get_text (GTK_ENTRY (editor->name_entry)));
+}
+
void
mail_signature_editor (MailConfigSignature *sig)
{
@@ -232,6 +240,7 @@ mail_signature_editor (MailConfigSignature *sig)
ESignatureEditor *editor;
BonoboUIComponent *component;
BonoboUIContainer *container;
+ GtkWidget *vbox, *hbox, *label;
gchar *title;
if (!sig->filename || !*sig->filename)
@@ -274,7 +283,19 @@ mail_signature_editor (MailConfigSignature *sig)
gtk_signal_connect (GTK_OBJECT (editor->win), "delete_event",
GTK_SIGNAL_FUNC (delete_event_cb), editor);
- bonobo_window_set_contents (BONOBO_WINDOW (editor->win), editor->control);
+ vbox = gtk_vbox_new (FALSE, 0);
+ hbox = gtk_hbox_new (FALSE, 0);
+ label = gtk_label_new (_("Signature name:"));
+ gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 4);
+ editor->name_entry = gtk_entry_new ();
+ e_utf8_gtk_entry_set_text (GTK_ENTRY (editor->name_entry), sig->name);
+ gtk_signal_connect (GTK_OBJECT (editor->name_entry), "changed", GTK_SIGNAL_FUNC (sig_name_changed), editor);
+ gtk_box_pack_start_defaults (GTK_BOX (hbox), editor->name_entry);
+ gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 3);
+ gtk_widget_show_all (vbox);
+ gtk_box_pack_start_defaults (GTK_BOX (vbox), editor->control);
+
+ bonobo_window_set_contents (BONOBO_WINDOW (editor->win), vbox);
bonobo_widget_set_property (BONOBO_WIDGET (editor->control), "FormatHTML", sig->html, NULL);
gtk_widget_show (GTK_WIDGET (editor->win));
gtk_widget_show (GTK_WIDGET (editor->control));