[anjal] BUGFIX: #581418 - Disable sort by on settings view.



commit d764072c408c8789f747cb444d86b3a38394c1ef
Author: Srinivasa Ragavan <sragavan novell com>
Date:   Tue Jun 16 23:11:49 2009 +0530

    BUGFIX: #581418 - Disable sort by on settings view.

 src/mail-settings-view.c |    9 +++++++++
 src/mail-settings-view.h |    1 +
 src/mail-view.c          |   24 +++++++++++++++---------
 3 files changed, 25 insertions(+), 9 deletions(-)
---
diff --git a/src/mail-settings-view.c b/src/mail-settings-view.c
index c33f78b..ad218ca 100644
--- a/src/mail-settings-view.c
+++ b/src/mail-settings-view.c
@@ -195,3 +195,12 @@ mail_settings_view_get_tab_widget(MailSettingsView *mcv)
 	return tab_label;
 	
 }
+
+void
+mail_settings_view_activate (MailSettingsView *mcv, GtkWidget *tree, GtkWidget *folder_tree, GtkWidget *check_mail, GtkWidget *sort_by, gboolean act)
+{
+	 if (!folder_tree || !check_mail || !sort_by)
+		  return;
+	 gtk_widget_set_sensitive (check_mail, act);
+	 gtk_widget_set_sensitive (sort_by, act);
+}
diff --git a/src/mail-settings-view.h b/src/mail-settings-view.h
index 359d688..558be09 100644
--- a/src/mail-settings-view.h
+++ b/src/mail-settings-view.h
@@ -56,4 +56,5 @@ typedef struct _MailSettingsViewClass {
 
 MailSettingsView *mail_settings_view_new (void);
 GtkWidget * mail_settings_view_get_tab_widget(MailSettingsView *mcv);
+void mail_settings_view_activate (MailSettingsView *mcv, GtkWidget *tree, GtkWidget *folder_tree, GtkWidget *check_mail, GtkWidget *sort_by, gboolean act);
 #endif
diff --git a/src/mail-view.c b/src/mail-view.c
index a6dbc0b..c0e98a2 100644
--- a/src/mail-view.c
+++ b/src/mail-view.c
@@ -124,6 +124,9 @@ mv_switch (GtkNotebook     *notebook,GtkNotebookPage *page, guint page_num, gpoi
 
 		} else if (child->type == MAIL_VIEW_ACCOUNT)
 			mail_account_view_activate ((MailAccountView *)child, shell->tree, shell->folder_tree, shell->check_mail, shell->sort_by, FALSE);
+		else if (child->type == MAIL_VIEW_SETTINGS)
+			mail_settings_view_activate ((MailSettingsView *)child, shell->tree, shell->folder_tree, shell->check_mail, shell->sort_by, FALSE);
+
 		
 		
 #ifdef MV_NEW_TAB		
@@ -250,7 +253,8 @@ mv_close_mcv (MailViewChild *mfv, MailView *mv)
 		 mail_search_set_state (mv->priv->search, ((MailFolderView *)child)->search_str, ((MailFolderView *)child)->search_state);
 	} else if (child->type == MAIL_VIEW_ACCOUNT)
 		mail_account_view_activate ((MailAccountView *)child, mv->tree, mv->folder_tree, mv->check_mail, mv->sort_by, FALSE);
-
+	else if (child->type == MAIL_VIEW_SETTINGS)
+		mail_settings_view_activate ((MailSettingsView *)child, mv->tree, mv->folder_tree, mv->check_mail, mv->sort_by, FALSE);
 	
 }
 
@@ -315,8 +319,8 @@ mail_view_add_composer (MailView *mv, gpointer data, gboolean block)
 	position = gtk_notebook_append_page ((GtkNotebook *)mv, (GtkWidget *)mcv, mcv->tab_label); 
 	gtk_notebook_set_tab_reorderable (GTK_NOTEBOOK (mv), (GtkWidget *)mcv, FALSE);
         gtk_notebook_set_tab_detachable (GTK_NOTEBOOK (mv), (GtkWidget *)mcv, FALSE);
-		if (!block)	
-			 gtk_notebook_set_current_page ((GtkNotebook *)mv, position);
+	if (!block)	
+		 gtk_notebook_set_current_page ((GtkNotebook *)mv, position);
 	gtk_notebook_set_tab_label_packing ((GtkNotebook *)mv, (GtkWidget *)mcv, FALSE, FALSE, 0);
 	if (!block)
 		 mail_composer_view_activate (mcv, mv->folder_tree, mv->check_mail, mv->sort_by, FALSE);
@@ -340,8 +344,8 @@ mail_view_add_message (MailView *mv, gpointer data, gboolean block)
 	position = gtk_notebook_append_page ((GtkNotebook *)mv, (GtkWidget *)mcv, mail_conv_view_get_tab_widget(mcv)); 
 	gtk_notebook_set_tab_reorderable (GTK_NOTEBOOK (mv), (GtkWidget *)mcv, FALSE);
         gtk_notebook_set_tab_detachable (GTK_NOTEBOOK (mv), (GtkWidget *)mcv, FALSE);
-		if (!block)
-	gtk_notebook_set_current_page ((GtkNotebook *)mv, position);
+	if (!block)
+		gtk_notebook_set_current_page ((GtkNotebook *)mv, position);
 	gtk_notebook_set_tab_label_packing ((GtkNotebook *)mv, (GtkWidget *)mcv, FALSE, FALSE, 0);
 	if (!block)
 		 mail_conv_view_activate (mcv, mv->tree, mv->folder_tree, mv->check_mail, mv->sort_by, FALSE);
@@ -371,9 +375,11 @@ mail_view_add_settings (MailView *mv, gpointer data, gboolean block)
 	g_signal_connect (msv, "show-account", G_CALLBACK(mv_show_acc_mcv), mv);
 	gtk_notebook_set_tab_reorderable (GTK_NOTEBOOK (mv), (GtkWidget *)msv, FALSE);
         gtk_notebook_set_tab_detachable (GTK_NOTEBOOK (mv), (GtkWidget *)msv, FALSE);
-		if (!block)
-	gtk_notebook_set_current_page ((GtkNotebook *)mv, position);
+	if (!block)
+		gtk_notebook_set_current_page ((GtkNotebook *)mv, position);
 	gtk_notebook_set_tab_label_packing ((GtkNotebook *)mv, (GtkWidget *)msv, FALSE, FALSE, 0);
+	if(!block)
+		 mail_settings_view_activate (msv, mv->tree, mv->folder_tree, mv->check_mail, mv->sort_by, FALSE);
 
 	return (MailViewChild *)msv;
 }
@@ -391,8 +397,8 @@ mail_view_add_account (MailView *mv, gpointer data, gboolean block)
 	g_signal_connect_after (msv, "view-close", G_CALLBACK(mv_close_mcv), mv);
 	gtk_notebook_set_tab_reorderable (GTK_NOTEBOOK (mv), (GtkWidget *)msv, FALSE);
         gtk_notebook_set_tab_detachable (GTK_NOTEBOOK (mv), (GtkWidget *)msv, FALSE);
-		if(!block)
-			 gtk_notebook_set_current_page ((GtkNotebook *)mv, position);
+	if(!block)
+		gtk_notebook_set_current_page ((GtkNotebook *)mv, position);
 	gtk_notebook_set_tab_label_packing ((GtkNotebook *)mv, (GtkWidget *)msv, FALSE, FALSE, 0);
 	if(!block)
 		 mail_account_view_activate (msv, mv->tree, mv->folder_tree, mv->check_mail, mv->sort_by, FALSE);



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