aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer/ChangeLog6
-rw-r--r--composer/e-msg-composer.c51
-rw-r--r--mail/ChangeLog8
-rw-r--r--mail/em-composer-prefs.c4
-rw-r--r--mail/em-composer-prefs.h1
-rw-r--r--mail/mail-config.glade115
6 files changed, 159 insertions, 26 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog
index f4294aa9d7..1a99398cb8 100644
--- a/composer/ChangeLog
+++ b/composer/ChangeLog
@@ -1,3 +1,9 @@
+2007-07-16 Sankar P <psankar@novell.com>
+
+ * e-msg-composer.c: (set_editor_text):
+ Provide option to keep signature on top,
+ while replying. Outlook users need it.
+
2007-07-09 Srinivasa Ragavan <sragavan@novell.com>
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index fcfd767f39..adec84e35f 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -1259,17 +1259,60 @@ set_editor_text(EMsgComposer *composer, const char *text, ssize_t len, int set_s
BonoboStream *stream;
CORBA_Environment ev;
Bonobo_Unknown object;
+ gboolean reply_signature_on_top;
+ char *body = NULL, *html = NULL;
+ GConfClient *gconf;
g_return_if_fail (p->persist_stream_interface != CORBA_OBJECT_NIL);
persist = p->persist_stream_interface;
CORBA_exception_init (&ev);
+
+ gconf = gconf_client_get_default ();
+
+ /*
+
+ Keeping Signatures in the beginning of composer
+ ------------------------------------------------
+
+ Purists are gonna blast me for this.
+ But there are so many people (read Outlook users) who want this.
+ And Evo is an exchange-client, Outlook-replacement etc.
+ So Here it goes :(
+
+ -- Sankar
+
+ */
+
+ reply_signature_on_top = gconf_client_get_bool (gconf, "/apps/evolution/mail/composer/top_signature", NULL);
- if (len == -1)
- len = strlen (text);
+ g_object_unref (gconf);
+
+ if (set_signature && reply_signature_on_top) {
+ char *tmp = NULL;
+ tmp = get_signature_html (composer);
+ if (tmp) {
+ /* Minimizing the damage. Make it just a part of the body instead of a signature */
+ html = strstr (tmp, "-- \n");
+ if (html) {
+ /* That two consecutive - symbols followed by a space */
+ *(html+1) = ' ';
+ body = g_strdup_printf ("</br>%s</br>%s", tmp, text);
+ } else {
+ /* HTML Signature. Make it as part of body */
+ body = g_strdup_printf ("</br>%s</br>%s", tmp, text);
+ }
+ }
+ } else {
+ body = g_strdup(text);
+ }
+
+ if (body) {
+ len = strlen (body);
+ }
- stream = bonobo_stream_mem_create (text, len, TRUE, FALSE);
+ stream = bonobo_stream_mem_create (body, len, TRUE, FALSE);
object = bonobo_object_corba_objref (BONOBO_OBJECT (stream));
Bonobo_PersistStream_load (persist, (Bonobo_Stream) object, "text/html", &ev);
if (ev._major != CORBA_NO_EXCEPTION) {
@@ -1283,7 +1326,7 @@ set_editor_text(EMsgComposer *composer, const char *text, ssize_t len, int set_s
bonobo_object_unref (BONOBO_OBJECT (stream));
- if (set_signature)
+ if (set_signature && !reply_signature_on_top)
e_msg_composer_show_sig_file (composer);
}
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 5fa138fa4f..df105d97a1 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,11 @@
+2007-07-16 Sankar P <psankar@novell.com>
+
+ * em-composer-prefs.c: (em_composer_prefs_construct):
+ * em-composer-prefs.h:
+ * mail-config.glade:
+ Provide support for keeping your signature on top
+ while replying.
+
2007-07-11 Srinivasa Ragavan <sragavan@novell.com>
* em-format-html-display.c: (efhd_attachment_button): Take warning
diff --git a/mail/em-composer-prefs.c b/mail/em-composer-prefs.c
index b37a3ff628..deed25bd3b 100644
--- a/mail/em-composer-prefs.c
+++ b/mail/em-composer-prefs.c
@@ -924,6 +924,10 @@ em_composer_prefs_construct (EMComposerPrefs *prefs)
toggle_button_init (prefs, prefs->auto_smileys, FALSE,
"/apps/evolution/mail/composer/magic_smileys");
+ prefs->top_signature = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkTopSignature"));
+ toggle_button_init (prefs, prefs->top_signature, FALSE,
+ "/apps/evolution/mail/composer/top_signature");
+
prefs->spell_check = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkEnableSpellChecking"));
toggle_button_init (prefs, prefs->spell_check, FALSE,
"/apps/evolution/mail/composer/inline_spelling");
diff --git a/mail/em-composer-prefs.h b/mail/em-composer-prefs.h
index ecdbb22f3f..2a2e80cbd1 100644
--- a/mail/em-composer-prefs.h
+++ b/mail/em-composer-prefs.h
@@ -80,6 +80,7 @@ struct _EMComposerPrefs {
/* Forwards and Replies */
struct _GtkOptionMenu *forward_style;
struct _GtkOptionMenu *reply_style;
+ struct _GtkToggleButton *top_signature;
/* Keyboard Shortcuts */
struct _GtkOptionMenu *shortcuts_type;
diff --git a/mail/mail-config.glade b/mail/mail-config.glade
index 36defd6626..2266bb5e50 100644
--- a/mail/mail-config.glade
+++ b/mail/mail-config.glade
@@ -2787,9 +2787,9 @@ For example: &quot;Work&quot; or &quot;Personal&quot;</property>
<widget class="Custom" id="sent_button">
<property name="visible">True</property>
<property name="creation_function">em_account_editor_folder_selector_button_new</property>
+ <property name="string1">Select Sent Folder</property>
<property name="int1">0</property>
<property name="int2">0</property>
- <property name="string1" translatable="yes">Select Sent Folder</property>
<property name="last_modification_time">Tue, 14 Dec 2004 17:07:09 GMT</property>
</widget>
<packing>
@@ -2806,9 +2806,9 @@ For example: &quot;Work&quot; or &quot;Personal&quot;</property>
<widget class="Custom" id="drafts_button">
<property name="visible">True</property>
<property name="creation_function">em_account_editor_folder_selector_button_new</property>
+ <property name="string1">Select Drafts Folder</property>
<property name="int1">0</property>
<property name="int2">0</property>
- <property name="string1" translatable="yes">Select Drafts Folder</property>
<property name="last_modification_time">Tue, 14 Dec 2004 17:07:02 GMT</property>
</widget>
<packing>
@@ -4458,17 +4458,12 @@ For example: &quot;Work&quot; or &quot;Personal&quot;</property>
</widget>
</child>
</widget>
- </child>
+ </child>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
</child>
<child>
- <widget class="GtkButton" id="cmdAccountDelete">
+ <widget class="GtkButton" id="cmdAccountDelete">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_default">True</property>
@@ -4477,12 +4472,12 @@ For example: &quot;Work&quot; or &quot;Personal&quot;</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
- </widget>
+ </widget>
</child>
<child>
- <widget class="GtkButton" id="cmdAccountDefault">
- <property name="width_request">89</property>
+ <widget class="GtkButton" id="cmdAccountDefault">
+ <property name="width_request">89</property>
<property name="height_request">36</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
@@ -4492,11 +4487,11 @@ For example: &quot;Work&quot; or &quot;Personal&quot;</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
- </widget>
+ </widget>
</child>
<child>
- <widget class="GtkButton" id="cmdAccountAble">
+ <widget class="GtkButton" id="cmdAccountAble">
<property name="width_request">89</property>
<property name="height_request">36</property>
<property name="visible">True</property>
@@ -4507,20 +4502,22 @@ For example: &quot;Work&quot; or &quot;Personal&quot;</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
- </widget>
+ </widget>
</child>
-
</widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
</child>
-
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
- </packing>
+ </packing>
</child>
-
</widget>
</child>
</widget>
@@ -7083,7 +7080,7 @@ For example: &quot;Work&quot; or &quot;Personal&quot;</property>
<widget class="GtkVBox" id="vboxBehavior">
<property name="visible">True</property>
<property name="homogeneous">False</property>
- <property name="spacing">6</property>
+ <property name="spacing">8</property>
<child>
<widget class="GtkCheckButton" id="chkSendHTML">
@@ -7212,14 +7209,14 @@ For example: &quot;Work&quot; or &quot;Personal&quot;</property>
<property name="use_underline">True</property>
</widget>
</child>
- <child>
+
+ <child>
<widget class="GtkMenuItem" id="convertwidget50">
<property name="visible">True</property>
<property name="label" translatable="yes">Inline original message (Outlook style)</property>
<property name="use_underline">True</property>
</widget>
</child>
-
</widget>
</child>
</widget>
@@ -7403,6 +7400,80 @@ For example: &quot;Work&quot; or &quot;Personal&quot;</property>
<property name="fill">True</property>
</packing>
</child>
+
+ <child>
+ <widget class="GtkHBox" id="hbox241">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">2</property>
+
+ <child>
+ <widget class="GtkVBox" id="vbox207">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">8</property>
+
+ <child>
+ <widget class="GtkLabel" id="label588">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">&lt;b&gt;Top Posting Option&lt;/b&gt; (Not Recommended)</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.479999989271</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkCheckButton" id="chkTopSignature">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">_Keep Signature above the original message on replying</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="left_attach">0</property>