[anjal/inline-composer-quotes] Handle the reply modes. And change everything to buttons.



commit ee53019739057f597b8a0c4a14b78df19bf47179
Author: Bharath Acharya <abharath novell com>
Date:   Thu Mar 26 16:59:11 2009 +0530

    Handle the reply modes. And change everything to buttons.
---
 po/Makefile.in.in             |   13 +++++------
 src/e-composer-header-table.c |    8 +++---
 src/e-msg-composer.c          |   33 ++++++++++++++++++++++++------
 src/mail-message-view.c       |   43 +++++++++++++++++++++++++++++-----------
 4 files changed, 67 insertions(+), 30 deletions(-)

diff --git a/po/Makefile.in.in b/po/Makefile.in.in
index 6891e8f..57ef267 100644
--- a/po/Makefile.in.in
+++ b/po/Makefile.in.in
@@ -54,16 +54,16 @@ GENPOT   = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDA
 
 ALL_LINGUAS = @ALL_LINGUAS@
 
-PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; fi)
+PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; else echo "$(ALL_LINGUAS)"; fi)
 
-USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep ^$$lang$$ $(srcdir)/LINGUAS`" -o -n "`echo $$ALINGUAS|grep ' ?$$lang ?'`"; then printf "$$lang "; fi; done; fi)
+USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep ^$$lang$$ $(srcdir)/LINGUAS 2>/dev/null`" -o -n "`echo $$ALINGUAS|tr ' ' '\n'|grep ^$$lang$$`"; then printf "$$lang "; fi; done; fi)
 
-USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done)
+USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)" -o -n "$(LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done)
 
-POFILES=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done)
+POFILES=$(shell LINGUAS="$(PO_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done)
 
-DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(POFILES)
-EXTRA_DISTFILES = POTFILES.skip Makevars LINGUAS
+DISTFILES = Makefile.in.in POTFILES.in $(POFILES)
+EXTRA_DISTFILES = ChangeLog POTFILES.skip Makevars LINGUAS
 
 POTFILES = \
 # This comment gets stripped out
@@ -101,7 +101,6 @@ install: install-data
 install-data: install-data- USE_NLS@
 install-data-no: all
 install-data-yes: all
-	$(mkdir_p) $(DESTDIR)$(itlocaledir)
 	linguas="$(USE_LINGUAS)"; \
 	for lang in $$linguas; do \
 	  dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \
diff --git a/src/e-composer-header-table.c b/src/e-composer-header-table.c
index b3769dc..1f02318 100644
--- a/src/e-composer-header-table.c
+++ b/src/e-composer-header-table.c
@@ -236,7 +236,7 @@ composer_header_table_constructor (GType type,
 
 	/*Add the actions container.*/
 
-	for (ii = 0; ii < rows; ii++) {
+	for (ii = rows -1; ii > 0; ii--) {
 		if (priv->headers [ii] != NULL) {
 			gtk_table_attach (GTK_TABLE (object), priv->headers[ii]->title_widget,
 					  0, 1, ii, ii + 1, GTK_FILL, GTK_FILL, 0, 3);
@@ -244,7 +244,7 @@ composer_header_table_constructor (GType type,
 					  1, 4, ii, ii + 1, GTK_FILL | GTK_EXPAND, 0, 0, 3);
 
 			if (priv->headers [ii]->action_widget) {
-				gtk_box_pack_start (priv->actions_container, priv->headers[ii]->action_widget,
+				gtk_box_pack_end (priv->actions_container, priv->headers[ii]->action_widget,
 						    FALSE, FALSE, 6);
 			}
 		}
@@ -540,12 +540,12 @@ composer_header_table_init (EComposerHeaderTable *table)
 	composer_header_table_bind_header ("destinations-to", "changed", header);
 	table->priv->headers[E_COMPOSER_HEADER_TO] = header;
 
-	header = e_composer_name_header_new_with_action (_("_Cc:"), _("Add CC"), name_selector);
+	header = e_composer_name_header_new_with_action (_("_Cc:"), _("Show CC"), name_selector);
 	e_composer_header_set_input_tooltip (header, HEADER_TOOLTIP_CC);
 	composer_header_table_bind_header ("destinations-cc", "changed", header);
 	table->priv->headers[E_COMPOSER_HEADER_CC] = header;
 
-	header = e_composer_name_header_new_with_action (_("_Bcc:"), _("Add BCC"), name_selector);
+	header = e_composer_name_header_new_with_action (_("_Bcc:"), _("Show BCC"), name_selector);
 	e_composer_header_set_input_tooltip (header, HEADER_TOOLTIP_BCC);
 	composer_header_table_bind_header ("destinations-bcc", "changed", header);
 	table->priv->headers[E_COMPOSER_HEADER_BCC] = header;
diff --git a/src/e-msg-composer.c b/src/e-msg-composer.c
index 16cf979..b09c26b 100644
--- a/src/e-msg-composer.c
+++ b/src/e-msg-composer.c
@@ -1174,11 +1174,13 @@ gpointer
 reply_to_message (struct _CamelFolder *f, const char *uid, struct _CamelMimeMessage *message, int mode, struct _EMFormat *source)
 {
 	EMsgComposer *composer;
-	EComposerHeaderTable *table;	
+	EComposerHeaderTable *table;
+	EComposerHeader *header;
 	MailEditor *editor;
 	char *text;
 	CamelInternetAddress *to, *cc;
 	EDestination **tov, **ccv;
+	char *subject;
 	
 	composer = e_msg_composer_new ();
 	editor = e_msg_composer_get_mail_editor(composer);
@@ -1189,15 +1191,32 @@ reply_to_message (struct _CamelFolder *f, const char *uid, struct _CamelMimeMess
 	text = em_utils_construct_composer_text (message, source);
 	mail_editor_set_text_html (editor, text, strlen (text));
 
-	em_utils_get_reply_sender (message, to, NULL);
+	table = e_msg_composer_get_header_table (composer);
 
+	switch (mode) {
+	case REPLY_MODE_SENDER:
+		em_utils_get_reply_sender (message, to, NULL);
+		break;
+	case REPLY_MODE_ALL:
+		em_utils_get_reply_all (message, to, cc, NULL);
+		ccv = em_utils_camel_address_to_destination (cc);
+		e_composer_header_table_set_destinations_cc (table, ccv);
+		break;
+	}
 	tov = em_utils_camel_address_to_destination (to);
-//	g_print ("\n %s is the address********\n", e_destination_get_address(tov[0]));
-	ccv = em_utils_camel_address_to_destination (cc);
-
-	table = e_msg_composer_get_header_table (composer);
 	e_composer_header_table_set_destinations_to (table, tov);
-	e_composer_header_table_set_destinations_cc (table, ccv);
+	
+	if ((subject = (char *) camel_mime_message_get_subject (message))) {
+		if (g_ascii_strncasecmp (subject, "Re: ", 4) != 0)
+			subject = g_strdup_printf ("Re: %s", subject);
+		else
+			subject = g_strdup (subject);
+	} else {
+		subject = g_strdup ("");
+	}
+	e_composer_header_table_set_subject (table, subject);
+	g_free (subject);
+	header = e_composer_header_table_get_header (table, E_COMPOSER_HEADER_CC);
 	
 	g_free (text);
 	return composer;
diff --git a/src/mail-message-view.c b/src/mail-message-view.c
index 8d20dbe..1e6d34f 100644
--- a/src/mail-message-view.c
+++ b/src/mail-message-view.c
@@ -49,6 +49,7 @@ struct  _MailMessageViewPrivate {
 	CamelMessageInfoBase *info;
 	GtkWidget *header_row;
 	const char *active_color;
+	int mode;
 	GtkWidget *spinner;
 	GtkWidget *unread_image;
 };
@@ -254,13 +255,13 @@ discard_composer_cb (GtkWidget *w, MailMessageView *mmv)
 }
 
 static void
-invoke_composer_cb (GtkWidget *w, MailMessageView *mmv)
+construct_reply_composer (MailMessageView *mmv, int mode)
 {
 	MailEditor *editor;
 	EComposerHeaderTable *table;
 
 	if (!E_IS_MSG_COMPOSER (mmv->comp_view)) {
-		mmv->comp_view = (EMsgComposer *)reply_to_message (NULL, NULL, mmv->priv->msg, 0, NULL);	
+		mmv->comp_view = (EMsgComposer *)reply_to_message (NULL, NULL, mmv->priv->msg, mode, NULL);
 		gtk_widget_set_size_request (mmv->comp_view, -1, 480);	
 		
 		/* Trying to focus on the editor */
@@ -284,6 +285,24 @@ invoke_composer_cb (GtkWidget *w, MailMessageView *mmv)
 }
 
 static void
+invoke_reply_name_composer_cb (GtkWidget *w, MailMessageView *mmv)
+{
+	construct_reply_composer (mmv, REPLY_MODE_SENDER);
+}
+
+static void
+invoke_reply_all_composer_cb (GtkWidget *w, MailMessageView *mmv)
+{
+	construct_reply_composer (mmv, REPLY_MODE_ALL);
+}
+
+static void
+invoke_forward_composer_cb (GtkWidget *w, MailMessageView *mmv)
+{
+
+}
+
+static void
 more_details_cb (GtkWidget *w, GdkEventButton *event, MailMessageView *mmv)
 {
 	if (!GTK_WIDGET_VISIBLE(mmv->main_header)) {
@@ -572,7 +591,6 @@ mail_message_view_set_message (MailMessageView *mmview, CamelFolder *folder, con
 	gtk_label_set_max_width_chars (tmp, 50);
 	mmview->sub_details = tmp;
 	g_free(str);
-	g_strfreev(strv);
 	gtk_widget_show(tmp);
 	gtk_box_pack_start (header_row, tmp, FALSE, FALSE, 2);
 
@@ -633,9 +651,7 @@ mail_message_view_set_message (MailMessageView *mmview, CamelFolder *folder, con
 	gtk_label_set_use_markup (GTK_LABEL (widget), TRUE);
 	gtk_table_attach (table, widget , 0, 1, row,  row + 1, GTK_FILL, 0, 0, 0);
 	str = camel_message_info_from(info);
-	strv = g_strsplit (str, "<", 2);
 	widget = gtk_label_new (*strv);
-	g_strfreev(strv);
 	gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5);
 	gtk_table_attach (table, widget , 1, 2, row,  row + 1, GTK_FILL|GTK_EXPAND, 0, 0, 0);
 	row++;
@@ -729,22 +745,25 @@ mail_message_view_set_message (MailMessageView *mmview, CamelFolder *folder, con
 	mmview->footer = gtk_hbox_new (FALSE, 0);
 	gtk_box_pack_start (mmview, mmview->footer, FALSE, FALSE, 0);
 	
-	reply = gtk_link_button_new_with_label ("Reply to name", "Reply to name");
-	g_signal_connect (reply, "clicked", G_CALLBACK (invoke_composer_cb), mmview);
+	str = g_strdup_printf ("Reply to %s", *strv);
+	reply = gtk_button_new_with_label (str);
+	g_free (str);
+	g_strfreev(strv);
+	g_signal_connect (reply, "clicked", G_CALLBACK (invoke_reply_name_composer_cb), mmview);
 //	EXPOSE(reply, bgcolor);
 	gtk_box_pack_start (mmview->footer, reply, FALSE, FALSE, 12);
 
-	reply_all = gtk_link_button_new_with_label ("Reply All", "Reply All");
-	g_signal_connect (reply_all, "clicked", G_CALLBACK (invoke_composer_cb), mmview);
+	reply_all = gtk_button_new_with_label ("Reply All");
+	g_signal_connect (reply_all, "clicked", G_CALLBACK (invoke_reply_all_composer_cb), mmview);
 //	EXPOSE(reply_all, bgcolor);
 	gtk_box_pack_start (mmview->footer, reply_all, FALSE, FALSE, 12);
 
-	forward = gtk_link_button_new_with_label ("Forward", "Forward");
-	g_signal_connect (forward, "clicked", G_CALLBACK (invoke_composer_cb), mmview);	
+	forward = gtk_button_new_with_label ("Forward");
+	g_signal_connect (forward, "clicked", G_CALLBACK (invoke_forward_composer_cb), mmview);	
 //	EXPOSE(forward, bgcolor);
 	gtk_box_pack_start (mmview->footer, forward, FALSE, FALSE, 12);
 
-	mmview->discard = gtk_link_button_new_with_label ("Discard", "Discard");
+	mmview->discard = gtk_button_new_with_label ("Discard");
 	g_signal_connect (mmview->discard, "clicked", G_CALLBACK (discard_composer_cb), mmview);
 //	EXPOSE(discard, bgcolor);
 	/* Hide this one be default */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]