[evolution] Provison to hide search label for Anjal's use.



commit 05c11c2cee07576e60963aa91ede71a6ecb6bea2
Author: Srinivasa Ragavan <sragavan gnome org>
Date:   Wed Dec 23 14:38:16 2009 +0530

    Provison to hide search label for Anjal's use.

 shell/e-shell-content.c   |    2 +-
 shell/e-shell-searchbar.c |   48 ++++++++++++++++++++++++++++++++++++++++++++-
 shell/e-shell-searchbar.h |    6 +++++
 3 files changed, 54 insertions(+), 2 deletions(-)
---
diff --git a/shell/e-shell-content.c b/shell/e-shell-content.c
index 61490fd..799df0d 100644
--- a/shell/e-shell-content.c
+++ b/shell/e-shell-content.c
@@ -260,7 +260,7 @@ shell_content_forall (GtkContainer *container,
 
 	priv = E_SHELL_CONTENT_GET_PRIVATE (container);
 
-	if (include_internals && priv->searchbar != NULL && container == priv->searchbar->parent)
+	if (include_internals && priv->searchbar != NULL && container == (GtkContainer *)priv->searchbar->parent)
 		callback (priv->searchbar, callback_data);
 
 	/* Chain up to parent's forall() method. */
diff --git a/shell/e-shell-searchbar.c b/shell/e-shell-searchbar.c
index f9b0b2e..c37a09a 100644
--- a/shell/e-shell-searchbar.c
+++ b/shell/e-shell-searchbar.c
@@ -55,6 +55,7 @@ struct _EShellSearchbarPrivate {
 	guint filter_visible : 1;
 	guint search_visible : 1;
 	guint scope_visible  : 1;
+	guint label_visible  : 1;
 };
 
 enum {
@@ -67,7 +68,8 @@ enum {
 	PROP_SEARCH_VISIBLE,
 	PROP_SCOPE_COMBO_BOX,
 	PROP_SCOPE_VISIBLE,
-	PROP_SHELL_VIEW
+	PROP_SHELL_VIEW,
+	PROP_LABEL_VISIBLE,
 };
 
 static gpointer parent_class;
@@ -321,6 +323,11 @@ shell_searchbar_set_property (GObject *object,
                               GParamSpec *pspec)
 {
 	switch (property_id) {
+		case PROP_LABEL_VISIBLE:
+			e_shell_searchbar_set_label_visible (
+				E_SHELL_SEARCHBAR (object),
+				g_value_get_boolean (value));
+			return;
 		case PROP_FILTER_VISIBLE:
 			e_shell_searchbar_set_filter_visible (
 				E_SHELL_SEARCHBAR (object),
@@ -380,6 +387,12 @@ shell_searchbar_get_property (GObject *object,
 				E_SHELL_SEARCHBAR (object)));
 			return;
 
+		case PROP_LABEL_VISIBLE:
+			g_value_set_boolean (
+				value, e_shell_searchbar_get_label_visible (
+				E_SHELL_SEARCHBAR (object)));
+			return;
+			
 		case PROP_FILTER_VISIBLE:
 			g_value_set_boolean (
 				value, e_shell_searchbar_get_filter_visible (
@@ -543,6 +556,17 @@ shell_searchbar_class_init (EShellSearchbarClass *class)
 
 	g_object_class_install_property (
 		object_class,
+		PROP_LABEL_VISIBLE,
+		g_param_spec_boolean (
+			"label-visible",
+			NULL,
+			NULL,
+			TRUE,
+			G_PARAM_READWRITE |
+			G_PARAM_CONSTRUCT));
+
+	g_object_class_install_property (
+		object_class,
 		PROP_FILTER_VISIBLE,
 		g_param_spec_boolean (
 			"filter-visible",
@@ -691,6 +715,9 @@ shell_searchbar_init (EShellSearchbar *searchbar)
 	gtk_widget_show (widget);
 
 	label = GTK_LABEL (widget);
+	e_binding_new (
+		searchbar, "label-visible",
+		widget, "visible");
 
 	widget = e_hinted_entry_new ();
 	gtk_label_set_mnemonic_widget (label, widget);
@@ -819,6 +846,25 @@ e_shell_searchbar_get_filter_combo_box (EShellSearchbar *searchbar)
 }
 
 gboolean
+e_shell_searchbar_get_label_visible (EShellSearchbar *searchbar)
+{
+	g_return_val_if_fail (E_IS_SHELL_SEARCHBAR (searchbar), FALSE);
+
+	return searchbar->priv->label_visible;
+}
+
+void
+e_shell_searchbar_set_label_visible (EShellSearchbar *searchbar,
+                                      gboolean label_visible)
+{
+	g_return_if_fail (E_IS_SHELL_SEARCHBAR (searchbar));
+
+	searchbar->priv->label_visible = label_visible;
+
+	g_object_notify (G_OBJECT (searchbar), "label-visible");
+}
+
+gboolean
 e_shell_searchbar_get_filter_visible (EShellSearchbar *searchbar)
 {
 	g_return_val_if_fail (E_IS_SHELL_SEARCHBAR (searchbar), FALSE);
diff --git a/shell/e-shell-searchbar.h b/shell/e-shell-searchbar.h
index b610449..6bb402b 100644
--- a/shell/e-shell-searchbar.h
+++ b/shell/e-shell-searchbar.h
@@ -103,6 +103,12 @@ gboolean	e_shell_searchbar_get_search_visible
 void		e_shell_searchbar_set_search_visible
 						(EShellSearchbar *searchbar,
 						 gboolean search_visible);
+gboolean	e_shell_searchbar_get_label_visible 
+						(EShellSearchbar *searchbar);
+void		e_shell_searchbar_set_label_visible 
+						(EShellSearchbar *searchbar,
+                                      		 gboolean label_visible);
+
 EActionComboBox *
 		e_shell_searchbar_get_scope_combo_box
 						(EShellSearchbar *searchbar);



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