aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorRadek Doulik <rodo@src.gnome.org>2002-06-05 23:43:50 +0800
committerRadek Doulik <rodo@src.gnome.org>2002-06-05 23:43:50 +0800
commitee96e3762905713b1785d24f6de278608060d6c3 (patch)
tree3a789f264c3bf3d039d2f6733e1693b2bf2a137b /mail
parent4ea52e5e61cbd750f37b07f4aad0c92ede66556c (diff)
downloadgsoc2013-evolution-ee96e3762905713b1785d24f6de278608060d6c3.tar
gsoc2013-evolution-ee96e3762905713b1785d24f6de278608060d6c3.tar.gz
gsoc2013-evolution-ee96e3762905713b1785d24f6de278608060d6c3.tar.bz2
gsoc2013-evolution-ee96e3762905713b1785d24f6de278608060d6c3.tar.lz
gsoc2013-evolution-ee96e3762905713b1785d24f6de278608060d6c3.tar.xz
gsoc2013-evolution-ee96e3762905713b1785d24f6de278608060d6c3.tar.zst
gsoc2013-evolution-ee96e3762905713b1785d24f6de278608060d6c3.zip
signature editor reworked, WIP
svn path=/trunk/; revision=17117
Diffstat (limited to 'mail')
-rw-r--r--mail/mail-account-gui.c295
-rw-r--r--mail/mail-account-gui.h14
-rw-r--r--mail/mail-composer-prefs.c168
-rw-r--r--mail/mail-composer-prefs.h5
-rw-r--r--mail/mail-config.c97
-rw-r--r--mail/mail-config.glade398
-rw-r--r--mail/mail-config.h11
7 files changed, 403 insertions, 585 deletions
diff --git a/mail/mail-account-gui.c b/mail/mail-account-gui.c
index 71f72e4269..80b27b0ff0 100644
--- a/mail/mail-account-gui.c
+++ b/mail/mail-account-gui.c
@@ -1179,78 +1179,51 @@ clear_menu (GtkWidget *menu)
static inline int
sig_get_index (MailConfigSignature *sig)
{
- return sig->id + (mail_config_get_signatures_random () ? 2 : 1);
+ return sig ? sig->id + 2 : 0;
}
-static gint
-sig_get_gui_index (MailAccountGui *gui, gboolean text)
+static inline int
+sig_gui_get_index (MailAccountGui *gui)
{
- MailConfigSignature *sig = text ? gui->text_signature : gui->html_signature;
- gboolean random = text ? gui->text_random : gui->html_random;
-
- if (random)
+ if (gui->auto_signature)
return 1;
- else if (!sig)
- return 0;
- else
- return sig_get_index (sig);
+ return sig_get_index (gui->def_signature);
}
static void
sig_fill_options (MailAccountGui *gui)
{
- GtkWidget *menu_text, *menu_html;
+ GtkWidget *menu;
GtkWidget *mi;
GList *l;
MailConfigSignature *sig;
- menu_text = gtk_option_menu_get_menu (GTK_OPTION_MENU (gui->sig_option_text));
- menu_html = gtk_option_menu_get_menu (GTK_OPTION_MENU (gui->sig_option_html));
-
- if (menu_text)
- clear_menu (menu_text);
- else
- menu_text = gtk_menu_new ();
+ menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (gui->sig_option_menu));
- if (menu_html)
- clear_menu (menu_html);
+ if (menu)
+ clear_menu (menu);
else
- menu_html = gtk_menu_new ();
-
- gtk_menu_append (GTK_MENU (menu_text), gtk_menu_item_new_with_label (_("None")));
- gtk_menu_append (GTK_MENU (menu_html), gtk_menu_item_new_with_label (_("None")));
-
- if (mail_config_get_signatures_random ()) {
- gtk_menu_append (GTK_MENU (menu_text), gtk_menu_item_new_with_label (_("Random")));
- gtk_menu_append (GTK_MENU (menu_html), gtk_menu_item_new_with_label (_("Random")));
- }
+ menu = gtk_menu_new ();
+
+ gtk_menu_append (GTK_MENU (menu), gtk_menu_item_new_with_label (_("None")));
+ gtk_menu_append (GTK_MENU (menu), gtk_menu_item_new_with_label (_("Autogenerated")));
+ /* gtk_menu_append (GTK_MENU (menu), gtk_menu_item_new_with_label (_("Random"))); */
for (l = mail_config_get_signature_list (); l; l = l->next) {
+ gchar *utf8;
+
sig = l->data;
- mi = gtk_menu_item_new_with_label (sig->name);
- gtk_object_set_data (GTK_OBJECT (mi), "sig", sig);
- gtk_menu_append (GTK_MENU (menu_text), mi);
-
- mi = gtk_menu_item_new_with_label (sig->name);
+ utf8 = e_utf8_to_gtk_string (menu, sig->name);
+ mi = gtk_menu_item_new_with_label (utf8);
+ g_free (utf8);
gtk_object_set_data (GTK_OBJECT (mi), "sig", sig);
- gtk_menu_append (GTK_MENU (menu_html), mi);
+ gtk_widget_show (mi);
+ gtk_menu_append (GTK_MENU (menu), mi);
}
}
static void
-sig_select_text_sig (MailAccountGui *gui)
-{
- gtk_option_menu_set_history (GTK_OPTION_MENU (gui->sig_option_text), sig_get_gui_index (gui, TRUE));
-}
-
-static void
-sig_select_html_sig (MailAccountGui *gui)
-{
- gtk_option_menu_set_history (GTK_OPTION_MENU (gui->sig_option_html), sig_get_gui_index (gui, FALSE));
-}
-
-static void
-sig_changed_text (GtkWidget *w, MailAccountGui *gui)
+sig_changed (GtkWidget *w, MailAccountGui *gui)
{
GtkWidget *active;
int index;
@@ -1258,55 +1231,8 @@ sig_changed_text (GtkWidget *w, MailAccountGui *gui)
active = gtk_menu_get_active (GTK_MENU (w));
index = g_list_index (GTK_MENU_SHELL (w)->children, active);
- gui->text_signature = (MailConfigSignature *) gtk_object_get_data (GTK_OBJECT (active), "sig");
- gui->text_random = index == 1;
-
- gtk_widget_set_sensitive (GTK_WIDGET (gui->sig_edit_text), gui->text_signature != NULL);
-}
-
-static void
-sig_changed_html (GtkWidget *w, MailAccountGui *gui)
-{
- GtkWidget *active;
- int index;
-
- active = gtk_menu_get_active (GTK_MENU (w));
- index = g_list_index (GTK_MENU_SHELL (w)->children, active);
-
- gui->html_signature = (MailConfigSignature *) gtk_object_get_data (GTK_OBJECT (active), "sig");
- gui->html_random = index == 1;
-
- gtk_widget_set_sensitive (GTK_WIDGET (gui->sig_edit_html), gui->html_signature != NULL);
-}
-
-static void
-sig_edit_text (GtkWidget *w, MailAccountGui *gui)
-{
- MailConfigSignature *sig = gui->text_signature;
-
- if (!sig)
- return;
-
- if (sig->filename && *sig->filename)
- mail_signature_editor (sig);
- else
- e_notice (NULL, GNOME_MESSAGE_BOX_ERROR,
- _("Please specify signature filename\nin Andvanced section of signature settings."));
-}
-
-static void
-sig_edit_html (GtkWidget *w, MailAccountGui *gui)
-{
- MailConfigSignature *sig = gui->html_signature;
-
- if (!sig)
- return;
-
- if (sig->filename && *sig->filename)
- mail_signature_editor (sig);
- else
- e_notice (NULL, GNOME_MESSAGE_BOX_ERROR,
- _("Please specify signature filename\nin Andvanced section of signature settings."));
+ gui->def_signature = (MailConfigSignature *) gtk_object_get_data (GTK_OBJECT (active), "sig");
+ gui->auto_signature = index == 1 ? TRUE : FALSE;
}
static void
@@ -1318,50 +1244,25 @@ sig_switch_to_list (GtkWidget *w, MailAccountGui *gui)
}
static void
-sig_new_text (GtkWidget *w, MailAccountGui *gui)
+sig_add_new_signature (GtkWidget *w, MailAccountGui *gui)
{
if (!gui->dialog)
return;
sig_switch_to_list (w, gui);
- gui->text_signature = mail_composer_prefs_new_signature (NULL, FALSE);
- gui->text_random = FALSE;
-
- gtk_option_menu_set_history (GTK_OPTION_MENU (gui->sig_option_text), sig_get_index (gui->text_signature));
+ gui->def_signature = mail_composer_prefs_new_signature (NULL, FALSE);
+ gui->auto_signature = FALSE;
- gtk_widget_set_sensitive (gui->sig_edit_text, TRUE);
-}
-
-static void
-sig_new_html (GtkWidget *w, MailAccountGui *gui)
-{
- if (!gui->dialog)
- return;
-
- sig_switch_to_list (w, gui);
-
- gui->html_signature = mail_composer_prefs_new_signature (NULL, TRUE);
- gui->html_random = FALSE;
-
- gtk_option_menu_set_history (GTK_OPTION_MENU (gui->sig_option_html), sig_get_index (gui->html_signature));
-
- gtk_widget_set_sensitive (gui->sig_edit_html, TRUE);
+ gtk_option_menu_set_history (GTK_OPTION_MENU (gui->sig_option_menu), sig_gui_get_index (gui));
}
static void
setup_signatures (MailAccountGui *gui)
{
- gui->text_signature = gui->account->id->text_signature;
- gui->text_random = gui->account->id->text_random;
- gui->html_signature = gui->account->id->html_signature;
- gui->html_random = gui->account->id->html_random;
-
- sig_select_text_sig (gui);
- sig_select_html_sig (gui);
-
- gtk_widget_set_sensitive (GTK_WIDGET (gui->sig_edit_text), gui->text_signature != NULL);
- gtk_widget_set_sensitive (GTK_WIDGET (gui->sig_edit_html), gui->html_signature != NULL);
+ gui->def_signature = gui->account->id->def_signature;
+ gui->auto_signature = gui->account->id->auto_signature;
+ gtk_option_menu_set_history (GTK_OPTION_MENU (gui->sig_option_menu), sig_gui_get_index (gui));
}
static void
@@ -1376,15 +1277,9 @@ sig_event_client (MailConfigSigEvent event, MailConfigSignature *sig, MailAccoun
mi = gtk_menu_item_new_with_label (sig->name);
gtk_object_set_data (GTK_OBJECT (mi), "sig", sig);
gtk_widget_show (mi);
- menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (gui->sig_option_text));
+ menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (gui->sig_option_menu));
gtk_menu_append (GTK_MENU (menu), mi);
-
- mi = gtk_menu_item_new_with_label (sig->name);
- gtk_object_set_data (GTK_OBJECT (mi), "sig", sig);
- gtk_widget_show (mi);
- menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (gui->sig_option_html));
- gtk_menu_append (GTK_MENU (GTK_MENU (menu)), mi);
-
+
break;
}
case MAIL_CONFIG_SIG_EVENT_NAME_CHANGED: {
@@ -1392,24 +1287,15 @@ sig_event_client (MailConfigSigEvent event, MailConfigSignature *sig, MailAccoun
GtkWidget *mi;
d(printf ("gui NAME CHANGED\n"));
- menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (gui->sig_option_text));
- gtk_widget_ref (menu);
- gtk_option_menu_remove_menu (GTK_OPTION_MENU (gui->sig_option_text));
- mi = g_list_nth_data (GTK_MENU_SHELL (menu)->children, sig_get_index (sig));
- gtk_label_set_text (GTK_LABEL (GTK_BIN (mi)->child), sig->name);
- gtk_option_menu_set_menu (GTK_OPTION_MENU (gui->sig_option_text), menu);
- gtk_widget_unref (menu);
- gtk_option_menu_set_history (GTK_OPTION_MENU (gui->sig_option_text), sig_get_gui_index (gui, TRUE));
-
- menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (gui->sig_option_html));
+ menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (gui->sig_option_menu));
gtk_widget_ref (menu);
- gtk_option_menu_remove_menu (GTK_OPTION_MENU (gui->sig_option_html));
+ gtk_option_menu_remove_menu (GTK_OPTION_MENU (gui->sig_option_menu));
mi = g_list_nth_data (GTK_MENU_SHELL (menu)->children, sig_get_index (sig));
gtk_label_set_text (GTK_LABEL (GTK_BIN (mi)->child), sig->name);
- gtk_option_menu_set_menu (GTK_OPTION_MENU (gui->sig_option_html), menu);
+ gtk_option_menu_set_menu (GTK_OPTION_MENU (gui->sig_option_menu), menu);
gtk_widget_unref (menu);
- gtk_option_menu_set_history (GTK_OPTION_MENU (gui->sig_option_html), sig_get_gui_index (gui, FALSE));
-
+ gtk_option_menu_set_history (GTK_OPTION_MENU (gui->sig_option_menu), sig_gui_get_index (gui));
+
break;
}
case MAIL_CONFIG_SIG_EVENT_DELETED: {
@@ -1418,74 +1304,18 @@ sig_event_client (MailConfigSigEvent event, MailConfigSignature *sig, MailAccoun
d(printf ("gui DELETED\n"));
- if (sig == gui->text_signature) {
- gui->text_signature = NULL;
- gtk_option_menu_set_history (GTK_OPTION_MENU (gui->sig_option_text),
- sig_get_gui_index (gui, TRUE));
+ if (sig == gui->def_signature) {
+ gui->def_signature = NULL;
+ gui->auto_signature = TRUE;
+ gtk_option_menu_set_history (GTK_OPTION_MENU (gui->sig_option_menu), sig_gui_get_index (gui));
}
-
- if (sig == gui->html_signature) {
- gui->html_signature = NULL;
- gtk_option_menu_set_history (GTK_OPTION_MENU (gui->sig_option_html),
- sig_get_gui_index (gui, FALSE));
- }
-
- menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (gui->sig_option_text));
- mi = g_list_nth_data (GTK_MENU_SHELL (menu)->children, sig_get_index (sig));
- gtk_container_remove (GTK_CONTAINER (menu), mi);
-
- menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (gui->sig_option_html));
+
+ menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (gui->sig_option_menu));
mi = g_list_nth_data (GTK_MENU_SHELL (menu)->children, sig_get_index (sig));
gtk_container_remove (GTK_CONTAINER (menu), mi);
break;
}
- case MAIL_CONFIG_SIG_EVENT_RANDOM_ON: {
- GtkWidget *menu;
- GtkWidget *mi;
-
- d(printf ("gui RANDOM ON\n"));
-
- mi = gtk_menu_item_new_with_label (_("Random"));
- menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (gui->sig_option_text));
- gtk_menu_insert (GTK_MENU (menu), mi, 1);
- gtk_widget_show (mi);
-
- mi = gtk_menu_item_new_with_label (_("Random"));
- menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (gui->sig_option_html));
- gtk_menu_insert (GTK_MENU (menu), mi, 1);
- gtk_widget_show (mi);
-
- break;
- }
- case MAIL_CONFIG_SIG_EVENT_RANDOM_OFF: {
- GtkWidget *menu;
- GtkWidget *mi;
-
- d(printf ("gui RANDOM OFF\n"));
-
- if (gui->text_random) {
- gui->text_random = FALSE;
- gtk_option_menu_set_history (GTK_OPTION_MENU (gui->sig_option_text),
- sig_get_gui_index (gui, TRUE));
- }
-
- if (gui->html_random) {
- gui->html_random = FALSE;
- gtk_option_menu_set_history (GTK_OPTION_MENU (gui->sig_option_html),
- sig_get_gui_index (gui, FALSE));
- }
-
- menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (gui->sig_option_text));
- mi = g_list_nth_data (GTK_MENU_SHELL (menu)->children, 1);
- gtk_container_remove (GTK_CONTAINER (menu), mi);
-
- menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (gui->sig_option_html));
- mi = g_list_nth_data (GTK_MENU_SHELL (menu)->children, 1);
- gtk_container_remove (GTK_CONTAINER (menu), mi);
-
- break;
- }
default:
;
}
@@ -1494,34 +1324,17 @@ sig_event_client (MailConfigSigEvent event, MailConfigSignature *sig, MailAccoun
static void
prepare_signatures (MailAccountGui *gui)
{
- gui->sig_option_text = glade_xml_get_widget (gui->xml, "option-sig-text");
- gui->sig_option_html = glade_xml_get_widget (gui->xml, "option-sig-html");
-
+ gui->sig_option_menu = glade_xml_get_widget (gui->xml, "sigOption");
sig_fill_options (gui);
+ gtk_signal_connect (GTK_OBJECT (gtk_option_menu_get_menu (GTK_OPTION_MENU (gui->sig_option_menu))),
+ "selection-done", sig_changed, gui);
- gtk_signal_connect (GTK_OBJECT (gtk_option_menu_get_menu (GTK_OPTION_MENU (gui->sig_option_text))),
- "selection-done", sig_changed_text, gui);
- gtk_signal_connect (GTK_OBJECT (gtk_option_menu_get_menu (GTK_OPTION_MENU (gui->sig_option_html))),
- "selection-done", sig_changed_html, gui);
-
- gui->sig_new_text = glade_xml_get_widget (gui->xml, "button-sig-new-text");
- gtk_signal_connect (GTK_OBJECT (gui->sig_new_text), "clicked", GTK_SIGNAL_FUNC (sig_new_text), gui);
- gui->sig_new_html = glade_xml_get_widget (gui->xml, "button-sig-new-html");
- gtk_signal_connect (GTK_OBJECT (gui->sig_new_html), "clicked", GTK_SIGNAL_FUNC (sig_new_html), gui);
- gui->sig_edit_text = glade_xml_get_widget (gui->xml, "button-sig-edit-text");
- gtk_signal_connect (GTK_OBJECT (gui->sig_edit_text), "clicked", GTK_SIGNAL_FUNC (sig_edit_text), gui);
- gui->sig_edit_html = glade_xml_get_widget (gui->xml, "button-sig-edit-html");
- gtk_signal_connect (GTK_OBJECT (gui->sig_edit_html), "clicked", GTK_SIGNAL_FUNC (sig_edit_html), gui);
+ glade_xml_signal_connect_data (gui->xml, "sigAddNewClicked", GTK_SIGNAL_FUNC (sig_add_new_signature), gui);
if (!gui->dialog) {
- gtk_widget_hide (glade_xml_get_widget (gui->xml, "label-sig-text"));
- gtk_widget_hide (glade_xml_get_widget (gui->xml, "label-sig-html"));
- gtk_widget_hide (gui->sig_option_text);
- gtk_widget_hide (gui->sig_option_html);
- gtk_widget_hide (gui->sig_new_text);
- gtk_widget_hide (gui->sig_new_html);
- gtk_widget_hide (gui->sig_edit_text);
- gtk_widget_hide (gui->sig_edit_html);
+ gtk_widget_hide (glade_xml_get_widget (gui->xml, "sigLabel"));
+ gtk_widget_hide (glade_xml_get_widget (gui->xml, "sigOption"));
+ gtk_widget_hide (glade_xml_get_widget (gui->xml, "sigAddNew"));
} else {
mail_config_signature_register_client ((MailConfigSignatureClient) sig_event_client, gui);
}
@@ -1993,10 +1806,8 @@ mail_account_gui_save (MailAccountGui *gui)
account->id->organization = e_utf8_gtk_entry_get_text (gui->organization);
/* signatures */
- account->id->text_signature = gui->text_signature;
- account->id->text_random = gui->text_random;
- account->id->html_signature = gui->html_signature;
- account->id->html_random = gui->html_random;
+ account->id->def_signature = gui->def_signature;
+ account->id->auto_signature = gui->auto_signature;
old_enabled = account->source && account->source->enabled;
service_destroy (account->source);
diff --git a/mail/mail-account-gui.h b/mail/mail-account-gui.h
index d5d873f3e0..b9469f54b1 100644
--- a/mail/mail-account-gui.h
+++ b/mail/mail-account-gui.h
@@ -70,16 +70,10 @@ typedef struct {
GtkEntry *organization;
/* signatures */
- GtkWidget *sig_option_text;
- GtkWidget *sig_option_html;
- GtkWidget *sig_new_text;
- GtkWidget *sig_new_html;
- GtkWidget *sig_edit_text;
- GtkWidget *sig_edit_html;
- MailConfigSignature *text_signature;
- gboolean text_random;
- MailConfigSignature *html_signature;
- gboolean html_random;
+ GtkWidget *sig_option_menu;
+
+ MailConfigSignature *def_signature;
+ gboolean auto_signature;
/* incoming mail */
MailAccountGuiService source;
diff --git a/mail/mail-composer-prefs.c b/mail/mail-composer-prefs.c
index c90d7ca229..95bb5bf8a8 100644
--- a/mail/mail-composer-prefs.c
+++ b/mail/mail-composer-prefs.c
@@ -226,17 +226,6 @@ sig_current_sig (MailComposerPrefs *prefs)
}
static void
-sig_script_activate (GtkWidget *widget, MailComposerPrefs *prefs)
-{
- MailConfigSignature *sig = sig_current_sig (prefs);
-
- if (sig && sig->script && *sig->script) {
- run_script (sig->script);
- sig_write_and_update_preview (prefs, sig);
- }
-}
-
-static void
sig_edit (GtkWidget *widget, MailComposerPrefs *prefs)
{
MailConfigSignature *sig = sig_current_sig (prefs);
@@ -252,17 +241,17 @@ MailConfigSignature *
mail_composer_prefs_new_signature (MailComposerPrefs *prefs, gboolean html)
{
MailConfigSignature *sig;
- char *name[2];
+ char *name [1];
int row;
sig = mail_config_signature_add (html);
if (prefs) {
- name[0] = sig->name;
- name[1] = sig->random ? _("yes") : _("no");
+ name [0] = e_utf8_to_gtk_string (prefs->sig_clist, sig->name);
row = gtk_clist_append (GTK_CLIST (prefs->sig_clist), name);
gtk_clist_set_row_data (GTK_CLIST (prefs->sig_clist), row, sig);
gtk_clist_select_row (GTK_CLIST (prefs->sig_clist), row, 0);
+ g_free (name [0]);
/*gtk_widget_grab_focus (prefs->sig_name);*/
}
@@ -303,28 +292,8 @@ sig_row_select (GtkCList *clist, int row, int col, GdkEvent *event, MailComposer
printf ("sig_row_select\n");
gtk_widget_set_sensitive ((GtkWidget *) prefs->sig_delete, TRUE);
gtk_widget_set_sensitive ((GtkWidget *) prefs->sig_edit, TRUE);
- /*gtk_widget_set_sensitive ((GtkWidget *) prefs->sig_name, TRUE);*/
- gtk_widget_set_sensitive ((GtkWidget *) prefs->sig_random, TRUE);
- gtk_widget_set_sensitive ((GtkWidget *) prefs->sig_html, TRUE);
- gtk_widget_set_sensitive ((GtkWidget *) prefs->sig_filename, TRUE);
- gtk_widget_set_sensitive ((GtkWidget *) prefs->sig_script, TRUE);
- gtk_widget_set_sensitive ((GtkWidget *) prefs->sig_html, TRUE);
- prefs->sig_switch = TRUE;
sig = gtk_clist_get_row_data (prefs->sig_clist, row);
- if (sig) {
- /*if (sig->name)
- e_utf8_gtk_entry_set_text (GTK_ENTRY (prefs->sig_name), sig->name);*/
- gtk_toggle_button_set_active (prefs->sig_random, sig->random);
- gtk_toggle_button_set_active (prefs->sig_html, sig->html);
- if (sig->filename)
- gtk_entry_set_text (GTK_ENTRY (gnome_file_entry_gtk_entry (prefs->sig_filename)),
- sig->filename);
- if (sig->script)
- gtk_entry_set_text (GTK_ENTRY (gnome_file_entry_gtk_entry (prefs->sig_script)),
- sig->script);
- }
- prefs->sig_switch = FALSE;
prefs->sig_row = row;
sig_load_preview (prefs, sig);
@@ -336,116 +305,24 @@ sig_row_unselect (GtkCList *clist, int row, int col, GdkEvent *event, MailCompos
printf ("sig_row_unselect\n");
gtk_widget_set_sensitive ((GtkWidget *) prefs->sig_delete, FALSE);
gtk_widget_set_sensitive ((GtkWidget *) prefs->sig_edit, FALSE);
- /*gtk_widget_set_sensitive ((GtkWidget *) prefs->sig_name, FALSE);*/
- gtk_widget_set_sensitive ((GtkWidget *) prefs->sig_random, FALSE);
- gtk_widget_set_sensitive ((GtkWidget *) prefs->sig_html, FALSE);
- gtk_widget_set_sensitive ((GtkWidget *) prefs->sig_filename, FALSE);
- gtk_widget_set_sensitive ((GtkWidget *) prefs->sig_script, FALSE);
-
- prefs->sig_switch = TRUE;
- /*gtk_entry_set_text (GTK_ENTRY (prefs->sig_name), "");*/
- gtk_toggle_button_set_active (prefs->sig_random, FALSE);
- gtk_entry_set_text (GTK_ENTRY (gnome_file_entry_gtk_entry (prefs->sig_filename)), "");
- gtk_entry_set_text (GTK_ENTRY (gnome_file_entry_gtk_entry (prefs->sig_script)), "");
- prefs->sig_switch = FALSE;
}
static void
sig_fill_clist (GtkCList *clist)
{
GList *l;
- char *name[2];
+ char *name[1];
int row;
gtk_clist_freeze (clist);
for (l = mail_config_get_signature_list (); l; l = l->next) {
name[0] = ((MailConfigSignature *) l->data)->name;
- name[1] = ((MailConfigSignature *) l->data)->random ? _("yes") : _("no");
row = gtk_clist_append (clist, name);
gtk_clist_set_row_data (clist, row, l->data);
}
gtk_clist_thaw (clist);
}
-#if 0
-static void
-sig_name_changed (GtkWidget *widget, MailComposerPrefs *prefs)
-{
- MailConfigSignature *sig = sig_current_sig (prefs);
-
- if (prefs->sig_switch)
- return;
-
- /*mail_config_signature_set_name (sig, e_utf8_gtk_entry_get_text (GTK_ENTRY (prefs->sig_name)));*/
- gtk_clist_set_text (GTK_CLIST (prefs->sig_clist), prefs->sig_row, 0, sig->name);
-
- sig_write_and_update_preview (prefs, sig);
-}
-#endif
-
-static void
-sig_random_toggled (GtkWidget *widget, MailComposerPrefs *prefs)
-{
- MailConfigSignature *sig = sig_current_sig (prefs);
-
- if (prefs->sig_switch)
- return;
-
- mail_config_signature_set_random (sig, gtk_toggle_button_get_active (prefs->sig_random));
-
- gtk_clist_set_text (prefs->sig_clist, prefs->sig_row, 1, sig->random ? _("yes") : _("no"));
-
- sig_write_and_update_preview (prefs, sig);
-}
-
-static void
-sig_advanced_toggled (GtkWidget *widget, MailComposerPrefs *prefs)
-{
- GtkWidget *advanced_frame;
-
- advanced_frame = glade_xml_get_widget (prefs->gui, "frameAdvancedOptions");
- gtk_widget_set_sensitive (advanced_frame, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)));
-}
-
-static void
-sig_html_toggled (GtkWidget *widget, MailComposerPrefs *prefs)
-{
- MailConfigSignature *sig = sig_current_sig (prefs);
-
- if (prefs->sig_switch)
- return;
-
- sig->html = gtk_toggle_button_get_active (prefs->sig_html);
-
- sig_write_and_update_preview (prefs, sig);
-}
-
-static void
-sig_filename_changed (GtkWidget *widget, MailComposerPrefs *prefs)
-{
- MailConfigSignature *sig = sig_current_sig (prefs);
-
- if (prefs->sig_switch)
- return;
-
- mail_config_signature_set_filename (sig, gnome_file_entry_get_full_path (prefs->sig_filename, FALSE));
- sig_write_and_update_preview (prefs, sig);
-}
-
-static void
-sig_script_changed (GtkWidget *widget, MailComposerPrefs *prefs)
-{
- MailConfigSignature *sig = sig_current_sig (prefs);
-
- if (prefs->sig_switch)
- return;
-
- g_free (sig->script);
- sig->script = g_strdup (gnome_file_entry_get_full_path (prefs->sig_script, FALSE));
-
- sig_write_and_update_preview (prefs, sig);
-}
-
static void
url_requested (GtkHTML *html, const char *url, GtkHTMLStream *handle)
{
@@ -491,11 +368,6 @@ sig_event_client (MailConfigSigEvent event, MailConfigSignature *sig, MailCompos
if (sig == sig_current_sig (prefs))
sig_load_preview (prefs, sig);
break;
- case MAIL_CONFIG_SIG_EVENT_HTML_CHANGED:
- printf ("accounts HTML CHANGED\n");
- if (sig == sig_current_sig (prefs))
- gtk_toggle_button_set_active (prefs->sig_html, sig->html);
- break;
default:
;
}
@@ -940,43 +812,13 @@ mail_composer_prefs_construct (MailComposerPrefs *prefs)
gtk_signal_connect (GTK_OBJECT (prefs->sig_delete), "clicked",
GTK_SIGNAL_FUNC (sig_delete), prefs);
- prefs->sig_random = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkRandomSignature"));
- gtk_signal_connect (GTK_OBJECT (prefs->sig_random), "toggled",
- GTK_SIGNAL_FUNC (sig_random_toggled), prefs);
- gtk_signal_connect (GTK_OBJECT (prefs->sig_random), "toggled",
- toggle_button_toggled, prefs);
-
prefs->sig_clist = GTK_CLIST (glade_xml_get_widget (gui, "clistSignatures"));
sig_fill_clist (prefs->sig_clist);
gtk_signal_connect (GTK_OBJECT (prefs->sig_clist), "select_row",
GTK_SIGNAL_FUNC (sig_row_select), prefs);
gtk_signal_connect (GTK_OBJECT (prefs->sig_clist), "unselect_row",
GTK_SIGNAL_FUNC (sig_row_unselect), prefs);
-
- prefs->sig_advanced = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkAdvancedSignature"));
- gtk_toggle_button_set_active (prefs->sig_advanced, FALSE);
- gtk_signal_connect (GTK_OBJECT (prefs->sig_advanced), "toggled",
- GTK_SIGNAL_FUNC (sig_advanced_toggled), prefs);
-
- widget = glade_xml_get_widget (gui, "frameAdvancedOptions");
- gtk_widget_set_sensitive (widget, FALSE);
-
- prefs->sig_html = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkHtmlSignature"));
- gtk_signal_connect (GTK_OBJECT (prefs->sig_html), "toggled",
- GTK_SIGNAL_FUNC (sig_html_toggled), prefs);
- gtk_signal_connect (GTK_OBJECT (prefs->sig_html), "toggled",
- toggle_button_toggled, prefs);
-
- prefs->sig_filename = GNOME_FILE_ENTRY (glade_xml_get_widget (gui, "fileSignatureFilename"));
- gtk_signal_connect (GTK_OBJECT (gnome_file_entry_gtk_entry (prefs->sig_filename)),
- "changed", GTK_SIGNAL_FUNC (sig_filename_changed), prefs);
-
- prefs->sig_script = GNOME_FILE_ENTRY (glade_xml_get_widget (gui, "fileSignatureScript"));
- gtk_signal_connect (GTK_OBJECT (gnome_file_entry_gtk_entry (prefs->sig_script)),
- "changed", GTK_SIGNAL_FUNC (sig_script_changed), prefs);
- gtk_signal_connect (GTK_OBJECT (gnome_file_entry_gtk_entry (prefs->sig_script)),
- "activate", GTK_SIGNAL_FUNC (sig_script_activate), prefs);
-
+
/* preview GtkHTML widget */
widget = glade_xml_get_widget (gui, "scrolled-sig");
prefs->sig_preview = (GtkHTML *) gtk_html_new ();
diff --git a/mail/mail-composer-prefs.h b/mail/mail-composer-prefs.h
index a23cfbfbcc..885baa6f9c 100644
--- a/mail/mail-composer-prefs.h
+++ b/mail/mail-composer-prefs.h
@@ -102,11 +102,6 @@ struct _MailComposerPrefs {
GtkButton *sig_add;
GtkButton *sig_edit;
GtkButton *sig_delete;
- GtkToggleButton *sig_random;
- GtkToggleButton *sig_advanced;
- GtkToggleButton *sig_html;
- GnomeFileEntry *sig_filename;
- GnomeFileEntry *sig_script;
GtkHTML *sig_preview;
gboolean sig_switch;
int sig_row;
diff --git a/mail/mail-config.c b/mail/mail-config.c
index 316f945d59..673c8f2bbd 100644
--- a/mail/mail-config.c
+++ b/mail/mail-config.c
@@ -128,7 +128,6 @@ typedef struct {
GList *signature_list;
int signatures;
- int signatures_random;
MailConfigLabel labels[5];
} MailConfig;
@@ -155,7 +154,6 @@ signature_copy (const MailConfigSignature *sig)
ns->name = g_strdup (sig->name);
ns->filename = g_strdup (sig->filename);
ns->script = g_strdup (sig->script);
- ns->random = sig->random;
ns->html = sig->html;
return ns;
@@ -183,10 +181,8 @@ identity_copy (const MailConfigIdentity *id)
new->address = g_strdup (id->address);
new->reply_to = g_strdup (id->reply_to);
new->organization = g_strdup (id->organization);
- new->text_signature = id->text_signature;
- new->text_random = id->text_random;
- new->html_signature = id->html_signature;
- new->html_random = id->html_random;
+ new->def_signature = id->def_signature;
+ new->auto_signature = id->auto_signature;
return new;
}
@@ -413,11 +409,7 @@ config_read_signature (gint i)
sig->script = val;
else
g_free (val);
-
- path = g_strdup_printf ("/Mail/Signatures/random_%d", i);
- sig->random = bonobo_config_get_boolean_with_default (config->db, path, FALSE, NULL);
- g_free (path);
-
+
path = g_strdup_printf ("/Mail/Signatures/html_%d", i);
sig->html = bonobo_config_get_boolean_with_default (config->db, path, FALSE, NULL);
g_free (path);
@@ -432,14 +424,11 @@ config_read_signatures ()
gint i;
config->signature_list = NULL;
- config->signatures_random = 0;
config->signatures = bonobo_config_get_long_with_default (config->db, "/Mail/Signatures/num", 0, NULL);
for (i = 0; i < config->signatures; i ++) {
sig = config_read_signature (i);
config->signature_list = g_list_append (config->signature_list, sig);
- if (sig->random)
- config->signatures_random ++;
}
}
@@ -462,10 +451,6 @@ config_write_signature (MailConfigSignature *sig, gint i)
bonobo_config_set_string (config->db, path, sig->script ? sig->script : "", NULL);
g_free (path);
- path = g_strdup_printf ("/Mail/Signatures/random_%d", i);
- bonobo_config_set_boolean (config->db, path, sig->random, NULL);
- g_free (path);
-
path = g_strdup_printf ("/Mail/Signatures/html_%d", i);
bonobo_config_set_boolean (config->db, path, sig->html, NULL);
g_free (path);
@@ -736,22 +721,15 @@ config_read (void)
g_free (path);
/* id signatures */
- path = g_strdup_printf ("/Mail/Accounts/identity_signature_text_%d", i);
- id->text_signature = lookup_signature (bonobo_config_get_long_with_default (config->db, path, -1, NULL));
- g_free (path);
-
- path = g_strdup_printf ("/Mail/Accounts/identity_signature_html_%d", i);
- id->html_signature = lookup_signature (bonobo_config_get_long_with_default (config->db, path, -1, NULL));
+ path = g_strdup_printf ("/Mail/Accounts/identity_def_signature_%d", i);
+ id->def_signature = lookup_signature (bonobo_config_get_long_with_default (config->db, path, -1, NULL));
g_free (path);
-
- path = g_strdup_printf ("/Mail/Accounts/identity_signature_text_random_%d", i);
- id->text_random = bonobo_config_get_boolean_with_default (config->db, path, FALSE, NULL);
- g_free (path);
-
- path = g_strdup_printf ("/Mail/Accounts/identity_signature_html_random_%d", i);
- id->html_random = bonobo_config_get_boolean_with_default (config->db, path, FALSE, NULL);
+
+ /* autogenerated signature */
+ path = g_strdup_printf ("/Mail/Accounts/identity_autogenerated_signature_%d", i);
+ id->auto_signature = bonobo_config_get_boolean_with_default (config->db, path, TRUE, NULL);
g_free (path);
-
+
/* get the source */
source = g_new0 (MailConfigService, 1);
@@ -1011,22 +989,9 @@ mail_config_write_account_sig (MailConfigAccount *account, gint i)
}
/* id signatures */
- path = g_strdup_printf ("/Mail/Accounts/identity_signature_text_%d", i);
- bonobo_config_set_long (config->db, path, account->id->text_signature
- ? account->id->text_signature->id : -1, NULL);
- g_free (path);
-
- path = g_strdup_printf ("/Mail/Accounts/identity_signature_html_%d", i);
- bonobo_config_set_long (config->db, path, account->id->html_signature
- ? account->id->html_signature->id : -1, NULL);
- g_free (path);
-
- path = g_strdup_printf ("/Mail/Accounts/identity_signature_text_random_%d", i);
- bonobo_config_set_boolean (config->db, path, account->id->text_random, NULL);
- g_free (path);
-
- path = g_strdup_printf ("/Mail/Accounts/identity_signature_html_random_%d", i);
- bonobo_config_set_boolean (config->db, path, account->id->html_random, NULL);
+ path = g_strdup_printf ("/Mail/Accounts/identity_def_signature_%d", i);
+ bonobo_config_set_long (config->db, path, account->id->def_signature
+ ? account->id->def_signature->id : -1, NULL);
g_free (path);
}
@@ -1142,6 +1107,10 @@ mail_config_write (void)
g_free (path);
mail_config_write_account_sig (account, i);
+
+ path = g_strdup_printf ("/Mail/Accounts/identity_autogenerated_signature_%d", i);
+ bonobo_config_set_boolean (config->db, path, account->id->auto_signature, NULL);
+ g_free (path);
/* source info */
path = g_strdup_printf ("/Mail/Accounts/source_url_%d", i);
@@ -2890,10 +2859,8 @@ mail_config_signature_delete (MailConfigSignature *sig)
account = (MailConfigAccount *) al->data;
- if (account->id->text_signature == sig)
- account->id->text_signature = NULL;
- if (account->id->html_signature == sig)
- account->id->html_signature = NULL;
+ if (account->id->def_signature == sig)
+ account->id->def_signature = NULL;
}
for (l = config->signature_list; l; l = next) {
@@ -2904,8 +2871,6 @@ mail_config_signature_delete (MailConfigSignature *sig)
config->signature_list = g_list_remove_link (config->signature_list, l);
after = TRUE;
config->signatures --;
- if (sig->random)
- config->signatures_random --;
}
}
@@ -2944,30 +2909,6 @@ mail_config_signature_set_name (MailConfigSignature *sig, const gchar *name)
mail_config_signature_emit_event (MAIL_CONFIG_SIG_EVENT_NAME_CHANGED, sig);
}
-void
-mail_config_signature_set_random (MailConfigSignature *sig, gboolean random)
-{
- if (random != sig->random) {
- if (random && !sig->random) {
- config->signatures_random ++;
- if (config->signatures_random == 1)
- mail_config_signature_emit_event (MAIL_CONFIG_SIG_EVENT_RANDOM_ON, sig);
- } else if (!random && sig->random) {
- config->signatures_random --;
- if (config->signatures_random == 0)
- mail_config_signature_emit_event (MAIL_CONFIG_SIG_EVENT_RANDOM_OFF, sig);
- }
- sig->random = random;
- mail_config_signature_write (sig);
- }
-}
-
-gint
-mail_config_get_signatures_random (void)
-{
- return config->signatures_random;
-}
-
static GList *clients = NULL;
void
diff --git a/mail/mail-config.glade b/mail/mail-config.glade
index e4dd881ee7..cab9d8f94c 100644
--- a/mail/mail-config.glade
+++ b/mail/mail-config.glade
@@ -511,7 +511,7 @@ For example: &quot;Work&quot; or &quot;Personal&quot;</label>
<widget>
<class>GtkLabel</class>
- <name>label-sig-text</name>
+ <name>sigLabel</name>
<label>_Default signature:</label>
<justify>GTK_JUSTIFY_LEFT</justify>
<wrap>False</wrap>
@@ -611,12 +611,10 @@ For example: &quot;Work&quot; or &quot;Personal&quot;</label>
</widget>
<widget>
- <class>GtkAlignment</class>
- <name>alignment27</name>
- <xalign>0</xalign>
- <yalign>0.5</yalign>
- <xscale>0</xscale>
- <yscale>1</yscale>
+ <class>GtkHBox</class>
+ <name>hbox169</name>
+ <homogeneous>False</homogeneous>
+ <spacing>5</spacing>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
@@ -624,24 +622,49 @@ For example: &quot;Work&quot; or &quot;Personal&quot;</label>
<bottom_attach>3</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
- <xexpand>True</xexpand>
+ <xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
- <yfill>False</yfill>
+ <yfill>True</yfill>
</child>
<widget>
<class>GtkOptionMenu</class>
- <name>optionmenu2</name>
+ <name>sigOption</name>
<can_focus>True</can_focus>
<items>Default
Signature #1
Signature #2
+xxxxxxxxxxxxxxxxxxxx
</items>
<initial_choice>0</initial_choice>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>sigAddNew</name>
+ <can_focus>True</can_focus>
+ <signal>
+ <name>clicked</name>
+ <handler>sigAddNewClicked</handler>
+ <last_modification_time>Tue, 04 Jun 2002 19:50:56 GMT</last_modification_time>
+ </signal>
+ <label>Add new signature...</label>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ <pack>GTK_PACK_END</pack>
+ </child>
</widget>
</widget>
</widget>
@@ -4080,7 +4103,6 @@ Baltic (ISO-8859-4)
<widget>
<class>GtkHBox</class>
<name>hbox161</name>
- <border_width>3</border_width>
<homogeneous>False</homogeneous>
<spacing>3</spacing>
<child>
@@ -4116,7 +4138,7 @@ Baltic (ISO-8859-4)
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>label448</name>
- <label>Description</label>
+ <label>Name</label>
<justify>GTK_JUSTIFY_LEFT</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
@@ -4140,6 +4162,23 @@ Baltic (ISO-8859-4)
</child>
<widget>
+ <class>GtkLabel</class>
+ <name>label455</name>
+ <label></label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
<class>GtkVButtonBox</class>
<name>vbuttonbox25</name>
<layout_style>GTK_BUTTONBOX_START</layout_style>
@@ -4159,43 +4198,34 @@ Baltic (ISO-8859-4)
<name>cmdSignatureAdd</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
- <label>_Create Signature</label>
+ <label>_Add...</label>
<relief>GTK_RELIEF_NORMAL</relief>
</widget>
<widget>
<class>GtkButton</class>
- <name>cmdSignatureEdit</name>
+ <name>cmdSignatureAddScript</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
- <label>_Edit</label>
+ <label>Add Sc_ript...</label>
<relief>GTK_RELIEF_NORMAL</relief>
</widget>
<widget>
<class>GtkButton</class>
- <name>cmdSignatureDelete</name>
- <can_default>True</can_default>
- <can_focus>True</can_focus>
- <label>_Duplicate</label>
- <relief>GTK_RELIEF_NORMAL</relief>
- </widget>
-
- <widget>
- <class>GtkButton</class>
- <name>button1</name>
+ <name>cmdSignatureEdit</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
- <label>_Remove</label>
+ <label>_Edit...</label>
<relief>GTK_RELIEF_NORMAL</relief>
</widget>
<widget>
<class>GtkButton</class>
- <name>button2</name>
+ <name>cmdSignatureDelete</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
- <label>_Add Script...</label>
+ <label>_Delete</label>
<relief>GTK_RELIEF_NORMAL</relief>
</widget>
</widget>
@@ -4204,61 +4234,13 @@ Baltic (ISO-8859-4)
<widget>
<class>GtkHBox</class>
- <name>hbox165</name>
- <homogeneous>False</homogeneous>
- <spacing>0</spacing>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>False</fill>
- </child>
-
- <widget>
- <class>GtkLabel</class>
- <name>label449</name>
- <label>De_fault signature:</label>
- <justify>GTK_JUSTIFY_CENTER</justify>
- <wrap>False</wrap>
- <xalign>0.5</xalign>
- <yalign>0.5</yalign>
- <xpad>3</xpad>
- <ypad>0</ypad>
- <default_focus_target>optionmenu1</default_focus_target>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>False</fill>
- </child>
- </widget>
-
- <widget>
- <class>GtkOptionMenu</class>
- <name>optionmenu1</name>
- <can_focus>True</can_focus>
- <items>Random
-
-Signature #1
-Signature #2
-</items>
- <initial_choice>0</initial_choice>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>False</fill>
- </child>
- </widget>
- </widget>
-
- <widget>
- <class>GtkHBox</class>
<name>hbox162</name>
- <border_width>3</border_width>
<homogeneous>False</homogeneous>
<spacing>3</spacing>
<child>
<padding>0</padding>
- <expand>True</expand>
- <fill>True</fill>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
<widget>
@@ -4892,4 +4874,264 @@ Signature #2
</widget>
</widget>
+<widget>
+ <class>GnomeDialog</class>
+ <name>add_script_signature</name>
+ <visible>False</visible>
+ <type>GTK_WINDOW_TOPLEVEL</type>
+ <position>GTK_WIN_POS_NONE</position>
+ <modal>False</modal>
+ <allow_shrink>False</allow_shrink>
+ <allow_grow>False</allow_grow>
+ <auto_shrink>False</auto_shrink>
+ <auto_close>False</auto_close>
+ <hide_on_close>False</hide_on_close>
+
+ <widget>
+ <class>GtkVBox</class>
+ <child_name>GnomeDialog:vbox</child_name>
+ <name>dialog-vbox1</name>
+ <homogeneous>False</homogeneous>
+ <spacing>8</spacing>
+ <child>
+ <padding>4</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkHButtonBox</class>
+ <child_name>GnomeDialog:action_area</child_name>
+ <name>dialog-action_area1</name>
+ <layout_style>GTK_BUTTONBOX_END</layout_style>
+ <spacing>8</spacing>
+ <child_min_width>85</child_min_width>
+ <child_min_height>27</child_min_height>
+ <child_ipad_x>7</child_ipad_x>
+ <child_ipad_y>0</child_ipad_y>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ <pack>GTK_PACK_END</pack>
+ </child>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>button4</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <label>Add signature</label>
+ </widget>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>button5</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>vbox160</name>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkFrame</class>
+ <name>frame5</name>
+ <border_width>3</border_width>
+ <label>Signature information</label>
+ <label_xalign>0</label_xalign>
+ <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>vbox161</name>
+ <border_width>3</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>3</spacing>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox171</name>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+
+ <widget>
+ <class>GnomePixmap</class>
+ <name>pixmap1</name>
+ <filename>info.png</filename>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label456</name>
+ <label>Type the name to which you would like to refer to this signature into Name entry.
+Enter the filename of the script which you want to use to generate your signature into Script entry. Standard output of this script will be used.</label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>True</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkTable</class>
+ <name>table9</name>
+ <rows>2</rows>
+ <columns>2</columns>
+ <homogeneous>False</homogeneous>
+ <row_spacing>3</row_spacing>
+ <column_spacing>3</column_spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label459</name>
+ <label>Name:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label460</name>
+ <label>Script:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkEntry</class>
+ <name>entry1</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GnomeFileEntry</class>
+ <name>fileentry1</name>
+ <max_saved>10</max_saved>
+ <directory>False</directory>
+ <modal>False</modal>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+
+ <widget>
+ <class>GtkEntry</class>
+ <child_name>GnomeEntry:entry</child_name>
+ <name>combo-entry2</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
+ </widget>
+ </widget>
+ </widget>
+ </widget>
+ </widget>
+ </widget>
+ </widget>
+</widget>
+
</GTK-Interface>
diff --git a/mail/mail-config.h b/mail/mail-config.h
index bfcd442344..92f2073a32 100644
--- a/mail/mail-config.h
+++ b/mail/mail-config.h
@@ -36,7 +36,6 @@ typedef struct {
char *name;
char *filename;
char *script;
- gboolean random;
gboolean html;
} MailConfigSignature;
@@ -46,10 +45,8 @@ typedef struct {
char *reply_to;
char *organization;
- MailConfigSignature *text_signature;
- gboolean text_random;
- MailConfigSignature *html_signature;
- gboolean html_random;
+ MailConfigSignature *def_signature;
+ gboolean auto_signature;
} MailConfigIdentity;
typedef struct {
@@ -287,21 +284,17 @@ gboolean mail_config_check_service (const char *url, CamelProviderType type, GLi
gboolean evolution_mail_config_factory_init (void);
GList * mail_config_get_signature_list (void);
-gint mail_config_get_signatures_random (void);
MailConfigSignature *mail_config_signature_add (gboolean html);
void mail_config_signature_delete (MailConfigSignature *sig);
void mail_config_signature_write (MailConfigSignature *sig);
void mail_config_signature_set_name (MailConfigSignature *sig, const gchar *name);
void mail_config_signature_set_html (MailConfigSignature *sig, gboolean html);
void mail_config_signature_set_filename (MailConfigSignature *sig, const gchar *filename);
-void mail_config_signature_set_random (MailConfigSignature *sig, gboolean random);
typedef enum {
MAIL_CONFIG_SIG_EVENT_NAME_CHANGED,
MAIL_CONFIG_SIG_EVENT_CONTENT_CHANGED,
MAIL_CONFIG_SIG_EVENT_HTML_CHANGED,
- MAIL_CONFIG_SIG_EVENT_RANDOM_ON,
- MAIL_CONFIG_SIG_EVENT_RANDOM_OFF,
MAIL_CONFIG_SIG_EVENT_ADDED,
MAIL_CONFIG_SIG_EVENT_DELETED
} MailConfigSigEvent;