[evolution-patches] [PATCH 10/22] BUGFIX: Moblin Bugzilla #8362 - Allow cfg for Sent/Drafts specific for accounts. (cherry picked from commit df24b8c84b6a6cad7cfeb01cface6a550f912bd9)



From: Srinivasa Ragavan <sragavan gnome org>


Signed-off-by: Yan Li <yanli infradead org>
---
 src/mail-account-view.c |   40 +++++++++++++++++++++++-----------------
 src/mail-account-view.h |    5 +++--
 src/mail-folder-view.c  |    2 +-
 3 files changed, 27 insertions(+), 20 deletions(-)

diff --git a/src/mail-account-view.c b/src/mail-account-view.c
index 4e54dae..cc38789 100644
--- a/src/mail-account-view.c
+++ b/src/mail-account-view.c
@@ -361,7 +361,7 @@ create_review (MailAccountView *view)
 #define RECEIVE_OPT_DETAIL N_("You can specify more options to configure the account.")
 
 #define SEND_DETAIL N_("Now we need your settings for sending mail. We've tried to make some guesses but you should check them over to make sure.")
-
+#define DEFAULTS_DETAIL N_("You can specify your default settings for your account.")
 #define REVIEW_DETAIL N_("Time to check things over before we try and connect to the server and fetch your mail.")
 struct _page_text {
 	int id;
@@ -386,7 +386,9 @@ struct _page_text {
 	{ MAV_RECV_PAGE, N_("Receiving mail"), N_("Next - Sending mail"), N_("Back - Identity"), N_("Next - Receiving options"), N_("Back - Identity"), RECEIVE_DETAIL, "10.receive", NULL, NULL, NULL, NULL },
 	{ MAV_RECV_OPT_PAGE, N_("Receiving options"),  NULL, NULL, N_("Next - Sending mail"), N_("Back - Receiving mail"), RECEIVE_OPT_DETAIL, "10.receive", NULL, NULL, NULL, NULL },
 
-	{ MAV_SEND_PAGE, N_("Sending mail"), N_("Next - Review account"), N_("Back - Receiving mail"), N_("Next - Review account"), N_("Back - Receiving options"), SEND_DETAIL, "30.send", NULL, NULL, NULL, NULL},
+	{ MAV_SEND_PAGE, N_("Sending mail"), N_("Next - Review account"), N_("Back - Receiving mail"), N_("Next - Defaults"), N_("Back - Receiving options"), SEND_DETAIL, "30.send", NULL, NULL, NULL, NULL},
+	{ MAV_DEFAULTS_PAGE, N_("Defaults"), NULL, NULL, N_("Next - Review account"), N_("Back - Sending mail"), DEFAULTS_DETAIL, "40.defaults", NULL, NULL, NULL, NULL},
+
 	{ MAV_REVIEW_PAGE, N_("Review account"), N_("Finish"), N_("Back - Sending"), N_("Finish"), N_("Back - Sending"), REVIEW_DETAIL, NULL, create_review, NULL, NULL},
 };
 
@@ -407,20 +409,6 @@ mav_next_pressed (GtkButton *button, MailAccountView *mav)
 	if (mail_account_pages[mav->current_page].save_page) {
 		(*mail_account_pages[mav->current_page].save_page) (mav);
 	}
-	if (mav->current_page == MAV_LAST - 2) {
-		MAVPage *page = mav->pages[mav->current_page + 1];
-		GtkWidget *tmp;
-
-		if (page->main)
-			gtk_widget_destroy (page->main);
-
-		tmp = mail_account_pages[mav->current_page+1].create_page(mav);
-		page->main = gtk_hbox_new (FALSE, 0);
-		gtk_widget_show (page->main);
-		gtk_box_pack_start((GtkBox *)page->main, tmp, FALSE, FALSE, 0);
-		gtk_widget_show(tmp);
-		gtk_box_pack_start((GtkBox *)page->box, page->main, FALSE, FALSE, 3);
-	}
 
 	if (mav->current_page == MAV_LAST - 1) {
 		char *uri = (char *)e_account_get_string(mav->edit->account, E_ACCOUNT_SOURCE_URL);
@@ -449,6 +437,23 @@ mav_next_pressed (GtkButton *button, MailAccountView *mav)
 	mav->current_page++;
 	if (mav->current_page == MAV_RECV_OPT_PAGE && mav->original == NULL)
 		mav->current_page++; /* Skip recv options in new account creation. */
+	if (mav->current_page == MAV_DEFAULTS_PAGE && mav->original == NULL)
+		mav->current_page++; /* Skip defaults in new account creation. */
+
+	if (mav->current_page == MAV_LAST - 1) {
+		MAVPage *page = mav->pages[mav->current_page];
+		GtkWidget *tmp;
+
+		if (page->main)
+			gtk_widget_destroy (page->main);
+
+		tmp = mail_account_pages[mav->current_page].create_page(mav);
+		page->main = gtk_hbox_new (FALSE, 0);
+		gtk_widget_show (page->main);
+		gtk_box_pack_start((GtkBox *)page->main, tmp, FALSE, FALSE, 0);
+		gtk_widget_show(tmp);
+		gtk_box_pack_start((GtkBox *)page->box, page->main, FALSE, FALSE, 3);
+	}
 
 	gtk_widget_show (mav->pages[mav->current_page]->box);
 	if (!mav->pages[mav->current_page]->done) {
@@ -471,7 +476,8 @@ mav_prev_pressed (GtkButton *button, MailAccountView *mav)
 	mav->current_page--;
 	if (mav->current_page == MAV_RECV_OPT_PAGE && mav->original == NULL)
 		mav->current_page--; /* Skip recv options in new account creation. */
-
+	if (mav->current_page == MAV_DEFAULTS_PAGE && mav->original == NULL)
+		mav->current_page--; /* Skip defaults in new account creation. */
 	gtk_widget_show (mav->pages[mav->current_page]->box);
 
 }
diff --git a/src/mail-account-view.h b/src/mail-account-view.h
index a36fc53..0544802 100644
--- a/src/mail-account-view.h
+++ b/src/mail-account-view.h
@@ -45,6 +45,7 @@ typedef enum {
 	MAV_RECV_PAGE,
 	MAV_RECV_OPT_PAGE,
 	MAV_SEND_PAGE,
+	MAV_DEFAULTS_PAGE,
 	MAV_REVIEW_PAGE,
 	MAV_LAST,
 } MAVPageType;
@@ -72,9 +73,9 @@ typedef struct _MailAccountView {
 	GtkWidget *scroll;
 	GtkWidget *page_widget;
 
-	MAVPage *pages[5];
+	MAVPage *pages[6];
 	struct _EAccount *original;
-	GtkWidget *wpages[5];
+	GtkWidget *wpages[6];
 	int current_page;
 	struct _EMAccountEditor *edit;
 
diff --git a/src/mail-folder-view.c b/src/mail-folder-view.c
index 7e1865a..3dd91bc 100644
--- a/src/mail-folder-view.c
+++ b/src/mail-folder-view.c
@@ -1991,7 +1991,7 @@ mail_folder_view_search_done (MailFolderView *mfv, CamelFolder *folder, const ch
 void
 mail_folder_view_set_search (MailFolderView *mfv, const char *search, const char *search_str)
 {
-	if (search_str && mfv->search_str && strcmp (search_str, mfv->search_str) == 0 || 
+	if ((search_str && mfv->search_str && strcmp (search_str, mfv->search_str) == 0) || 
 		((mfv->search_str == NULL|| *(mfv->search_str) == '\0') && (search_str == NULL|| *search_str == '\0')))
 		return;
 
-- 
1.6.5.7



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