[anjal] Added NICE UI resonse for user, while search is done/cleared.



commit 84d6a9005c3cc6814c0ff50b1c4705d32125089b
Author: Srinivasa Ragavan <sragavan novell com>
Date:   Tue Aug 25 18:46:39 2009 +0530

    Added NICE UI resonse for user, while search is done/cleared.

 src/mail-folder-view.c  |   14 ++++++++++++--
 src/mail-folder-view.h  |    2 +-
 src/mail-message-view.c |    2 +-
 src/mail-view.c         |    2 +-
 4 files changed, 15 insertions(+), 5 deletions(-)
---
diff --git a/src/mail-folder-view.c b/src/mail-folder-view.c
index e90c7e8..0175186 100644
--- a/src/mail-folder-view.c
+++ b/src/mail-folder-view.c
@@ -1944,10 +1944,14 @@ static void
 mail_folder_view_search_done (MailFolderView *mfv, CamelFolder *folder, const char *uri)
 {
 		gtk_tree_view_set_model (GTK_TREE_VIEW (mfv->tree), mfv->model);	
+		gtk_widget_hide (mfv->priv->info_spinner);
+		gtk_widget_hide ((GtkWidget *)mfv->mail);
+		gtk_widget_hide ((GtkWidget *)mfv->priv->info_bar);
+		gtk_widget_show (mfv->priv->view_scroller);
 }
 
 void
-mail_folder_view_set_search (MailFolderView *mfv, const char *search)
+mail_folder_view_set_search (MailFolderView *mfv, const char *search, const char *search_str)
 {
 	if (mfv->search) {
 		g_free (mfv->search);
@@ -1956,10 +1960,16 @@ mail_folder_view_set_search (MailFolderView *mfv, const char *search)
 
 	if (search|| 1) {
 		struct _db_read_msg *m;
-
+		gboolean search_on = (search_str && *search_str) ? TRUE : FALSE;
+		char *str = g_strdup_printf ("%s %c%s%c", search_on ? _("Searching for ") : _("Clearing search"), search_on ? '\'' : ' ', search_on ? search_str : "", search_on ? '\'' : ' ');
 		mfv->search = search ? g_strdup(search) : NULL;
 
 		gtk_tree_view_set_model (GTK_TREE_VIEW (mfv->tree), NULL);
+		gtk_widget_show (mfv->priv->info_spinner);
+		gtk_widget_hide ((GtkWidget *)mfv->mail);
+		gtk_widget_show ((GtkWidget *)mfv->priv->info_bar);
+		gtk_widget_hide (mfv->priv->view_scroller);
+		gtk_label_set_text (g_object_get_data((GObject *)mfv->priv->info_bar, "label"), str);
 		m = mail_msg_new (&db_read_info);
 		m->mfv = mfv;
 		m->load = FALSE;
diff --git a/src/mail-folder-view.h b/src/mail-folder-view.h
index 45d6bc1..ecef064 100644
--- a/src/mail-folder-view.h
+++ b/src/mail-folder-view.h
@@ -82,6 +82,6 @@ void mail_folder_view_show_list (MailFolderView *mfv);
 void mail_folder_view_activate (MailFolderView *mfv, GtkWidget *tree, GtkWidget *folder_tree, GtkWidget *check_mail, GtkWidget *sort_by, GtkWidget *slider, gboolean act);
 void mail_folder_view_check_mail (MailFolderView *mfv);
 void mail_folder_view_save (MailFolderView *mfv);
-void mail_folder_view_set_search (MailFolderView *mfv, const char *search);
+void mail_folder_view_set_search (MailFolderView *mfv, const char *search, const char *str);
 void mail_folder_view_set_folder_pane (MailFolderView *mfv, GtkWidget *pane);
 #endif
diff --git a/src/mail-message-view.c b/src/mail-message-view.c
index f4b619f..26422c6 100644
--- a/src/mail-message-view.c
+++ b/src/mail-message-view.c
@@ -496,7 +496,7 @@ construct_reply_composer (MailMessageView *mmv, int mode)
 		gtk_widget_show(box);
 		
 		if (mode != -1)
-			mmv->composer = (GtkWidget *)em_utils_reply_to_message (mmv->priv->folder, mmv->priv->uid, mmv->priv->msg, mode, NULL);
+			mmv->composer = (GtkWidget *)em_utils_reply_to_message (mmv->priv->folder, mmv->priv->uid, mmv->priv->msg, mode, mmv->efwd);
 		else 
 			mmv->composer = (GtkWidget *)em_utils_forward_message (mmv->priv->msg, mmv->priv->folder_uri);
 		mmv->comp_view = g_object_get_data((GObject *)mmv->composer,"vbox");
diff --git a/src/mail-view.c b/src/mail-view.c
index ee8fe88..65d54e6 100644
--- a/src/mail-view.c
+++ b/src/mail-view.c
@@ -780,7 +780,7 @@ mail_view_set_search (MailView *mv, const char *search, char *state, char *searc
 			g_free (mfv->search_str);
 		mfv->search_state = state;
 		mfv->search_str = search_str;
-		mail_folder_view_set_search (mfv, search);
+		mail_folder_view_set_search (mfv, search, search_str);
 	}
 }
 



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