aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-04-02 06:55:40 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-04-02 06:55:40 +0800
commit4ce6a59f74ccc3dbf9e2065e4049bf5749cd08f1 (patch)
tree56f21aa423ea8d1cf6121b383886b6eccaff934c /mail
parent7f497424b67fd42dd8068b3d7e72d023ff54bd9a (diff)
downloadgsoc2013-evolution-4ce6a59f74ccc3dbf9e2065e4049bf5749cd08f1.tar.gz
gsoc2013-evolution-4ce6a59f74ccc3dbf9e2065e4049bf5749cd08f1.tar.zst
gsoc2013-evolution-4ce6a59f74ccc3dbf9e2065e4049bf5749cd08f1.zip
Re-Implemented the signature editor stuff (mostly just copy/paste from
2002-04-01 Jeffrey Stedfast <fejj@ximian.com> * mail-composer-prefs.c (mail_composer_prefs_construct): Re-Implemented the signature editor stuff (mostly just copy/paste from Radeks original code). * mail-signature-editor.c (mail_signature_editor): Use the right oafiid for the html editor control. svn path=/trunk/; revision=16316
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog9
-rw-r--r--mail/mail-account-gui.c8
-rw-r--r--mail/mail-composer-prefs.c390
-rw-r--r--mail/mail-composer-prefs.h18
-rw-r--r--mail/mail-config.glade68
-rw-r--r--mail/mail-signature-editor.c31
-rw-r--r--mail/mail-signature-editor.h1
7 files changed, 479 insertions, 46 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index ebd8134c6b..73621e452a 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,12 @@
+2002-04-01 Jeffrey Stedfast <fejj@ximian.com>
+
+ * mail-composer-prefs.c (mail_composer_prefs_construct):
+ Re-Implemented the signature editor stuff (mostly just copy/paste
+ from Radeks original code).
+
+ * mail-signature-editor.c (mail_signature_editor): Use the right
+ oafiid for the html editor control.
+
2002-04-01 Dan Winship <danw@ximian.com>
* importers/Makefile.am (liboutlook_la_LDFLAGS,
diff --git a/mail/mail-account-gui.c b/mail/mail-account-gui.c
index 8eb305ca9e..39be507cca 100644
--- a/mail/mail-account-gui.c
+++ b/mail/mail-account-gui.c
@@ -1149,14 +1149,14 @@ sig_new_text (GtkWidget *w, MailAccountGui *gui)
#if 0
if (!gui->dialog)
return;
-
+
sig_switch_to_list (w, gui);
-
- gui->text_signature = mail_accounts_dialog_new_signature (gui->dialog, FALSE);
+
+ gui->text_signature = mail_composer_prefs_new_signature (gui->dialog, FALSE);
gui->text_random = FALSE;
gtk_option_menu_set_history (GTK_OPTION_MENU (gui->sig_option_text), sig_get_index (gui->text_signature));
-
+
sig_set_and_write (gui);
gtk_widget_set_sensitive (gui->sig_edit_text, TRUE);
#endif
diff --git a/mail/mail-composer-prefs.c b/mail/mail-composer-prefs.c
index 97ebced5e8..1ba15082fc 100644
--- a/mail/mail-composer-prefs.c
+++ b/mail/mail-composer-prefs.c
@@ -26,6 +26,7 @@
#endif
#include "mail-composer-prefs.h"
+#include "composer/e-msg-composer.h"
#include <bonobo/bonobo-generic-factory.h>
@@ -35,8 +36,11 @@
static void mail_composer_prefs_class_init (MailComposerPrefsClass *class);
static void mail_composer_prefs_init (MailComposerPrefs *dialog);
+static void mail_composer_prefs_destroy (GtkObject *obj);
static void mail_composer_prefs_finalise (GtkObject *obj);
+static void sig_event_client (MailConfigSigEvent event, MailConfigSignature *sig, MailComposerPrefs *prefs);
+
static GtkVBoxClass *parent_class = NULL;
@@ -70,6 +74,7 @@ mail_composer_prefs_class_init (MailComposerPrefsClass *klass)
object_class = (GtkObjectClass *) klass;
parent_class = gtk_type_class (gtk_vbox_get_type ());
+ object_class->destroy = mail_composer_prefs_destroy;
object_class->finalize = mail_composer_prefs_finalise;
/* override methods */
@@ -84,13 +89,20 @@ mail_composer_prefs_init (MailComposerPrefs *composer_prefs)
static void
mail_composer_prefs_finalise (GtkObject *obj)
{
- MailComposerPrefs *composer_prefs = (MailComposerPrefs *) obj;
+ MailComposerPrefs *prefs = (MailComposerPrefs *) obj;
- gtk_object_unref (GTK_OBJECT (composer_prefs->gui));
+ gtk_object_unref (GTK_OBJECT (prefs->gui));
((GtkObjectClass *)(parent_class))->finalize (obj);
}
+static void
+mail_composer_prefs_destroy (GtkObject *obj)
+{
+ MailComposerPrefs *prefs = (MailComposerPrefs *) obj;
+
+ mail_config_signature_unregister_client ((MailConfigSignatureClient) sig_event_client, prefs);
+}
static void
colorpicker_set_color (GnomeColorPicker *color, guint32 rgb)
@@ -161,9 +173,331 @@ option_menu_connect (GtkOptionMenu *omenu, gpointer user_data)
}
static void
+run_script (char *script)
+{
+ struct stat st;
+
+ if (stat (script, &st))
+ return;
+
+ if (!S_ISREG (st.st_mode) || !(st.st_mode & (S_IXOTH | S_IXGRP | S_IXUSR)))
+ return;
+
+ mail_config_signature_run_script (script);
+}
+
+static void
+sig_load_preview (MailComposerPrefs *prefs, MailConfigSignature *sig)
+{
+ char *str;
+
+ if (!sig) {
+ gtk_html_load_from_string (GTK_HTML (prefs->sig_preview), " ", 1);
+ return;
+ }
+
+ str = e_msg_composer_get_sig_file_content (sig->filename, sig->html);
+ if (!str)
+ str = g_strdup (" ");
+
+ /* printf ("HTML: %s\n", str); */
+ if (sig->html)
+ gtk_html_load_from_string (GTK_HTML (prefs->sig_preview), str, strlen (str));
+ else {
+ GtkHTMLStream *stream;
+ int len;
+
+ len = strlen (str);
+ stream = gtk_html_begin (GTK_HTML (prefs->sig_preview));
+ gtk_html_write (GTK_HTML (prefs->sig_preview), stream, "<PRE>", 5);
+ if (len)
+ gtk_html_write (GTK_HTML (prefs->sig_preview), stream, str, len);
+ gtk_html_write (GTK_HTML (prefs->sig_preview), stream, "</PRE>", 6);
+ gtk_html_end (GTK_HTML (prefs->sig_preview), stream, GTK_HTML_STREAM_OK);
+ }
+
+ g_free (str);
+}
+
+static void
+sig_write_and_update_preview (MailComposerPrefs *prefs, MailConfigSignature *sig)
+{
+ sig_load_preview (prefs, sig);
+ mail_config_signature_write (sig);
+}
+
+static MailConfigSignature *
+sig_current_sig (MailComposerPrefs *prefs)
+{
+ return gtk_clist_get_row_data (GTK_CLIST (prefs->sig_clist), prefs->sig_row);
+}
+
+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);
+
+ if (sig->filename && *sig->filename)
+ mail_signature_editor (sig);
+ else
+ e_notice (GTK_WINDOW (prefs), GNOME_MESSAGE_BOX_ERROR,
+ _("Please specify signature filename\nin Andvanced section of signature settings."));
+}
+
+MailConfigSignature *
+mail_composer_prefs_new_signature (MailComposerPrefs *prefs, gboolean html)
+{
+ MailConfigSignature *sig;
+ char *name[2];
+ int row;
+
+ sig = mail_config_signature_add (html);
+
+ name[0] = sig->name;
+ name[1] = sig->random ? _("yes") : _("no");
+ 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);
+ /*gtk_widget_grab_focus (prefs->sig_name);*/
+
+ sig_edit (NULL, prefs);
+
+ return sig;
+}
+
+static void sig_row_unselect (GtkCList *clist, int row, int col, GdkEvent *event, MailComposerPrefs *prefs);
+
+static void
+sig_delete (GtkWidget *widget, MailComposerPrefs *prefs)
+{
+ MailConfigSignature *sig = sig_current_sig (prefs);
+
+ gtk_clist_remove (prefs->sig_clist, prefs->sig_row);
+ mail_config_signature_delete (sig);
+ if (prefs->sig_row < prefs->sig_clist->rows)
+ gtk_clist_select_row (prefs->sig_clist, prefs->sig_row, 0);
+ else if (prefs->sig_row)
+ gtk_clist_select_row (prefs->sig_clist, prefs->sig_row - 1, 0);
+ else
+ sig_row_unselect (prefs->sig_clist, prefs->sig_row, 0, NULL, prefs);
+}
+
+static void
+sig_add (GtkWidget *widget, MailComposerPrefs *prefs)
+{
+ mail_composer_prefs_new_signature (prefs, FALSE);
+}
+
+static void
+sig_row_select (GtkCList *clist, int row, int col, GdkEvent *event, MailComposerPrefs *prefs)
+{
+ MailConfigSignature *sig;
+
+ 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);
+}
+
+static void
+sig_row_unselect (GtkCList *clist, int row, int col, GdkEvent *event, MailComposerPrefs *prefs)
+{
+ 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];
+ 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);
+}
+
+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);
+}
+
+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_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)
+{
+ GtkHTMLStreamStatus status;
+ int fd;
+
+ if (!strncmp (url, "file:", 5))
+ url += 5;
+
+ fd = open (url, O_RDONLY);
+ status = GTK_HTML_STREAM_OK;
+ if (fd != -1) {
+ ssize_t size;
+ void *buf = alloca (1 << 7);
+ while ((size = read (fd, buf, 1 << 7))) {
+ if (size == -1) {
+ status = GTK_HTML_STREAM_ERROR;
+ break;
+ } else
+ gtk_html_write (html, handle, (const gchar *) buf, size);
+ }
+ } else
+ status = GTK_HTML_STREAM_ERROR;
+
+ gtk_html_end (html, handle, status);
+}
+
+static void
+sig_event_client (MailConfigSigEvent event, MailConfigSignature *sig, MailComposerPrefs *prefs)
+{
+ switch (event) {
+ case MAIL_CONFIG_SIG_EVENT_NAME_CHANGED:
+ printf ("accounts NAME CHANGED\n");
+ gtk_clist_set_text (GTK_CLIST (prefs->sig_clist), sig->id, 0, sig->name);
+ if (sig == sig_current_sig (prefs)) {
+ prefs->sig_switch = TRUE;
+ /*e_utf8_gtk_entry_set_text (GTK_ENTRY (prefs->sig_name), sig->name);*/
+ prefs->sig_switch = FALSE;
+ }
+ break;
+ case MAIL_CONFIG_SIG_EVENT_CONTENT_CHANGED:
+ printf ("accounts CONTENT CHANGED\n");
+ 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:
+ ;
+ }
+}
+
+static void
mail_composer_prefs_construct (MailComposerPrefs *prefs)
{
- GtkWidget *toplevel, *menu;
+ GtkWidget *toplevel, *widget, *menu;
GladeXML *gui;
int style;
@@ -223,7 +557,55 @@ mail_composer_prefs_construct (MailComposerPrefs *prefs)
attach_style_info, &style);
option_menu_connect (prefs->reply_style, prefs);
- /* FIXME: do the other tabs... */
+ /* Signatures */
+ prefs->sig_add = GTK_BUTTON (glade_xml_get_widget (gui, "cmdSignatureAdd"));
+ gtk_signal_connect (GTK_OBJECT (prefs->sig_add), "clicked",
+ GTK_SIGNAL_FUNC (sig_add), prefs);
+
+ prefs->sig_edit = GTK_BUTTON (glade_xml_get_widget (gui, "cmdSignatureEdit"));
+ gtk_signal_connect (GTK_OBJECT (prefs->sig_edit), "clicked",
+ GTK_SIGNAL_FUNC (sig_edit), prefs);
+
+ prefs->sig_delete = GTK_BUTTON (glade_xml_get_widget (gui, "cmdSignatureDelete"));
+ 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);
+
+ 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_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);
+
+ 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 ();
+ gtk_signal_connect (GTK_OBJECT (prefs->sig_preview), "url_requested", GTK_SIGNAL_FUNC (url_requested), NULL);
+ gtk_widget_show (GTK_WIDGET (prefs->sig_preview));
+ gtk_container_add (GTK_CONTAINER (widget), GTK_WIDGET (prefs->sig_preview));
+
+ if (GTK_CLIST (prefs->sig_clist)->rows)
+ gtk_clist_select_row (GTK_CLIST (prefs->sig_clist), 0, 0);
+
+ mail_config_signature_register_client ((MailConfigSignatureClient) sig_event_client, prefs);
}
diff --git a/mail/mail-composer-prefs.h b/mail/mail-composer-prefs.h
index 567540143a..f4e29760f2 100644
--- a/mail/mail-composer-prefs.h
+++ b/mail/mail-composer-prefs.h
@@ -34,6 +34,9 @@ extern "C" {
#include <libgnomeui/gnome-color-picker.h>
#include <libgnomeui/gnome-dialog.h>
#include <libgnomeui/gnome-file-entry.h>
+#include <gtkhtml/gtkhtml.h>
+
+#include "mail-signature-editor.h"
#include "evolution-config-control.h"
@@ -77,7 +80,17 @@ struct _MailComposerPrefs {
GtkCList *keybindings;
/* Signatures */
-
+ GtkCList *sig_clist;
+ GtkButton *sig_add;
+ GtkButton *sig_edit;
+ GtkButton *sig_delete;
+ GtkToggleButton *sig_random;
+ GtkToggleButton *sig_html;
+ GnomeFileEntry *sig_filename;
+ GnomeFileEntry *sig_script;
+ GtkHTML *sig_preview;
+ gboolean sig_switch;
+ int sig_row;
};
struct _MailComposerPrefsClass {
@@ -94,6 +107,9 @@ GtkWidget *mail_composer_prefs_new (void);
void mail_composer_prefs_apply (MailComposerPrefs *prefs);
+
+MailConfigSignature *mail_composer_prefs_new_signature (MailComposerPrefs *prefs, gboolean html);
+
/* needed by global config */
#define MAIL_COMPOSER_PREFS_CONTROL_ID "OAFIID:GNOME_Evolution_Mail_ComposerPrefs_ConfigControl"
diff --git a/mail/mail-config.glade b/mail/mail-config.glade
index c93f43605e..714d830c8e 100644
--- a/mail/mail-config.glade
+++ b/mail/mail-config.glade
@@ -6091,7 +6091,7 @@ Microsoft
<widget>
<class>GtkCList</class>
- <name>clist-sig</name>
+ <name>clistSignatures</name>
<can_focus>True</can_focus>
<columns>2</columns>
<column_widths>189,80</column_widths>
@@ -6102,7 +6102,7 @@ Microsoft
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
- <name>label443</name>
+ <name>lblSignature</name>
<label>Signature</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
@@ -6115,7 +6115,7 @@ Microsoft
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
- <name>label444</name>
+ <name>lblRandomized</name>
<label>Randomized</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
@@ -6129,7 +6129,7 @@ Microsoft
<widget>
<class>GtkVBox</class>
- <name>vbox157</name>
+ <name>vboxSignatureButtons</name>
<border_width>3</border_width>
<homogeneous>False</homogeneous>
<spacing>3</spacing>
@@ -6141,7 +6141,7 @@ Microsoft
<widget>
<class>GtkLabel</class>
- <name>label445</name>
+ <name>lblSpacer</name>
<label></label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
@@ -6173,7 +6173,7 @@ Microsoft
<widget>
<class>GtkButton</class>
- <name>button-sig-add</name>
+ <name>cmdSignatureAdd</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<label>_Add</label>
@@ -6182,7 +6182,7 @@ Microsoft
<widget>
<class>GtkButton</class>
- <name>button-sig-edit</name>
+ <name>cmdSignatureEdit</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<label>_Edit</label>
@@ -6191,7 +6191,7 @@ Microsoft
<widget>
<class>GtkButton</class>
- <name>button-sig-delete</name>
+ <name>cmdSignatureDelete</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<label>_Delete</label>
@@ -6200,28 +6200,17 @@ Microsoft
</widget>
<widget>
- <class>GtkVButtonBox</class>
- <name>vbuttonbox26</name>
- <layout_style>GTK_BUTTONBOX_DEFAULT_STYLE</layout_style>
- <spacing>10</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>
+ <class>GtkToggleButton</class>
+ <name>chkRandomSignature</name>
+ <can_focus>True</can_focus>
+ <label>_Random</label>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ <active>False</active>
<child>
<padding>0</padding>
- <expand>True</expand>
- <fill>True</fill>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
-
- <widget>
- <class>GtkButton</class>
- <name>button-sig-randomize</name>
- <can_default>True</can_default>
- <can_focus>True</can_focus>
- <label>_Randomize</label>
- <relief>GTK_RELIEF_NORMAL</relief>
- </widget>
</widget>
</widget>
</widget>
@@ -6240,7 +6229,7 @@ Microsoft
<widget>
<class>GtkFrame</class>
- <name>frame-sig-preview</name>
+ <name>frameSignaturePreview</name>
<label_xalign>0</label_xalign>
<shadow_type>GTK_SHADOW_IN</shadow_type>
<child>
@@ -6250,14 +6239,23 @@ Microsoft
</child>
<widget>
- <class>Placeholder</class>
+ <class>GtkScrolledWindow</class>
+ <name>scrolled-sig</name>
+ <hscrollbar_policy>GTK_POLICY_AUTOMATIC</hscrollbar_policy>
+ <vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
+ <hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
+ <vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
+
+ <widget>
+ <class>Placeholder</class>
+ </widget>
</widget>
</widget>
</widget>
<widget>
<class>GtkCheckButton</class>
- <name>check-sig-advanced</name>
+ <name>chkAdvancedSignature</name>
<can_focus>True</can_focus>
<label>Enable advanced options</label>
<active>False</active>
@@ -6320,12 +6318,12 @@ Microsoft
<widget>
<class>GnomeFileEntry</class>
- <name>file-sig-filename</name>
+ <name>fileSignatureFilename</name>
<history_id>sig-filename</history_id>
<max_saved>10</max_saved>
<title>Select a signature file</title>
<directory>False</directory>
- <modal>False</modal>
+ <modal>True</modal>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
@@ -6355,12 +6353,12 @@ Microsoft
<widget>
<class>GnomeFileEntry</class>
- <name>file-sig-script</name>
+ <name>fileSignatureScript</name>
<history_id>sig-script</history_id>
<max_saved>10</max_saved>
<title>Select a signature script</title>
<directory>False</directory>
- <modal>False</modal>
+ <modal>True</modal>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
@@ -6417,7 +6415,7 @@ Microsoft
<widget>
<class>GtkCheckButton</class>
- <name>check-sig-html</name>
+ <name>chkHtmlSignature</name>
<can_focus>True</can_focus>
<label>Use _HTML for this signature</label>
<active>False</active>
diff --git a/mail/mail-signature-editor.c b/mail/mail-signature-editor.c
index 04f5da7ef4..3c2651b095 100644
--- a/mail/mail-signature-editor.c
+++ b/mail/mail-signature-editor.c
@@ -1,3 +1,30 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Authors: Radek Doulik <rodo@ximian.com>
+ *
+ * Copyright 2002 Ximian, Inc. (www.ximian.com)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <bonobo.h>
#include <bonobo/bonobo-stream-memory.h>
@@ -287,11 +314,11 @@ mail_signature_editor (MailConfigSignature *sig)
bonobo_ui_component_add_verb_list_with_data (component, verbs, editor);
bonobo_ui_util_set_ui (component, EVOLUTION_DATADIR, "evolution-signature-editor.xml", "evolution-signature-editor");
- editor->control = bonobo_widget_new_control ("OAFIID:GNOME_GtkHTML_Editor",
+ editor->control = bonobo_widget_new_control ("OAFIID:GNOME_GtkHTML_Editor:1.1",
bonobo_ui_component_get_container (component));
if (editor->control == NULL) {
- g_warning ("Cannot get 'OAFIID:GNOME_GtkHTML_Editor'.");
+ g_warning ("Cannot get 'OAFIID:GNOME_GtkHTML_Editor:1.1'.");
destroy_editor (editor);
return;
diff --git a/mail/mail-signature-editor.h b/mail/mail-signature-editor.h
index bcce6412d9..60a5e6ae04 100644
--- a/mail/mail-signature-editor.h
+++ b/mail/mail-signature-editor.h
@@ -30,6 +30,7 @@ extern "C" {
#endif /* __cplusplus */
#include <glib.h>
+#include <mail-config.h>
void mail_signature_editor (MailConfigSignature *sig);