empathy r585 - in trunk: libempathy-gtk megaphone/src python/pyempathygtk



Author: xclaesse
Date: Sun Jan 20 21:41:58 2008
New Revision: 585
URL: http://svn.gnome.org/viewvc/empathy?rev=585&view=rev

Log:
Add a features property on EmpathyContactListView to enable/disable each action.


Modified:
   trunk/libempathy-gtk/empathy-contact-list-store.c
   trunk/libempathy-gtk/empathy-contact-list-view.c
   trunk/libempathy-gtk/empathy-contact-list-view.h
   trunk/libempathy-gtk/empathy-group-chat.c
   trunk/libempathy-gtk/empathy-main-window.c
   trunk/megaphone/src/megaphone-applet.c
   trunk/python/pyempathygtk/pyempathygtk.defs

Modified: trunk/libempathy-gtk/empathy-contact-list-store.c
==============================================================================
--- trunk/libempathy-gtk/empathy-contact-list-store.c	(original)
+++ trunk/libempathy-gtk/empathy-contact-list-store.c	Sun Jan 20 21:41:58 2008
@@ -33,7 +33,6 @@
 #include <libempathy/empathy-debug.h>
 
 #include "empathy-contact-list-store.h"
-#include "empathy-contact-groups.h"
 #include "empathy-ui-utils.h"
 #include "empathy-gtk-enum-types.h"
 

Modified: trunk/libempathy-gtk/empathy-contact-list-view.c
==============================================================================
--- trunk/libempathy-gtk/empathy-contact-list-view.c	(original)
+++ trunk/libempathy-gtk/empathy-contact-list-view.c	Sun Jan 20 21:41:58 2008
@@ -56,6 +56,7 @@
 //#include "empathy-chat-invite.h"
 //#include "empathy-ft-window.h"
 #include "empathy-log-window.h"
+#include "empathy-gtk-enum-types.h"
 
 #define DEBUG_DOMAIN "ContactListView"
 
@@ -68,12 +69,12 @@
 
 #define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EMPATHY_TYPE_CONTACT_LIST_VIEW, EmpathyContactListViewPriv))
 
-struct _EmpathyContactListViewPriv {
-	EmpathyContactListStore *store;
-	GtkUIManager            *ui;
-	GtkTreeRowReference     *drag_row;
-	gboolean                 interactive;
-};
+typedef struct {
+	EmpathyContactListStore    *store;
+	GtkUIManager               *ui;
+	GtkTreeRowReference        *drag_row;
+	EmpathyContactListFeatures  features;
+} EmpathyContactListViewPriv;
 
 typedef struct {
 	EmpathyContactListView *view;
@@ -188,7 +189,7 @@
 
 enum {
 	PROP_0,
-	PROP_INTERACTIVE
+	PROP_FEATURES
 };
 
 static const GtkActionEntry entries[] = {
@@ -326,12 +327,13 @@
 			      3, EMPATHY_TYPE_CONTACT, G_TYPE_STRING, G_TYPE_STRING);
 
 	g_object_class_install_property (object_class,
-					 PROP_INTERACTIVE,
-					 g_param_spec_boolean ("interactive",
-							       "View is interactive",
-							       "Is the view interactive",
-							       FALSE,
-							       G_PARAM_READWRITE));
+					 PROP_FEATURES,
+					 g_param_spec_flags ("features",
+							     "Features of the view",
+							     "Falgs for all enabled features",
+							      EMPATHY_TYPE_CONTACT_LIST_FEATURES,
+							      0,
+							      G_PARAM_READWRITE));
 
 	g_type_class_add_private (object_class, sizeof (EmpathyContactListViewPriv));
 }
@@ -414,8 +416,8 @@
 	priv = GET_PRIV (object);
 
 	switch (param_id) {
-	case PROP_INTERACTIVE:
-		g_value_set_boolean (value, priv->interactive);
+	case PROP_FEATURES:
+		g_value_set_flags (value, priv->features);
 		break;
 	default:
 		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
@@ -435,8 +437,8 @@
 	priv = GET_PRIV (object);
 
 	switch (param_id) {
-	case PROP_INTERACTIVE:
-		empathy_contact_list_view_set_interactive (view, g_value_get_boolean (value));
+	case PROP_FEATURES:
+		empathy_contact_list_view_set_features (view, g_value_get_flags (value));
 		break;
 	default:
 		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
@@ -445,40 +447,69 @@
 }
 
 EmpathyContactListView *
-empathy_contact_list_view_new (EmpathyContactListStore *store)
+empathy_contact_list_view_new (EmpathyContactListStore    *store,
+			       EmpathyContactListFeatures  features)
 {
-	EmpathyContactListViewPriv *priv;
 	EmpathyContactListView     *view;
+	EmpathyContactListViewPriv *priv;
+
+	g_return_val_if_fail (EMPATHY_IS_CONTACT_LIST_STORE (store), NULL);
 	
-	view = g_object_new (EMPATHY_TYPE_CONTACT_LIST_VIEW, NULL);
-	priv = GET_PRIV (view);
+	view = g_object_new (EMPATHY_TYPE_CONTACT_LIST_VIEW,
+			    "features", features,
+			    NULL);
 
+	priv = GET_PRIV (view);
 	priv->store = g_object_ref (store);
-	contact_list_view_setup (view);
+	contact_list_view_setup (EMPATHY_CONTACT_LIST_VIEW (view));
 
 	return view;
 }
 
 void
-empathy_contact_list_view_set_interactive (EmpathyContactListView  *view,
-					   gboolean                 interactive)
+empathy_contact_list_view_set_features (EmpathyContactListView     *view,
+					EmpathyContactListFeatures  features)
 {
 	EmpathyContactListViewPriv *priv = GET_PRIV (view);
 
 	g_return_if_fail (EMPATHY_IS_CONTACT_LIST_VIEW (view));
 
-	priv->interactive = interactive;
-	g_object_notify (G_OBJECT (view), "interactive");
+	priv->features = features;
+
+	/* Update DnD source/dest */
+	if (features & EMPATHY_CONTACT_LIST_FEATURE_CONTACT_DRAG) {
+		gtk_drag_source_set (GTK_WIDGET (view),
+				     GDK_BUTTON1_MASK,
+				     drag_types_source,
+				     G_N_ELEMENTS (drag_types_source),
+				     GDK_ACTION_MOVE | GDK_ACTION_COPY);
+	} else {
+		gtk_drag_source_unset (GTK_WIDGET (view));
+
+	}
+
+	if (features & EMPATHY_CONTACT_LIST_FEATURE_CONTACT_DROP) {
+		gtk_drag_dest_set (GTK_WIDGET (view),
+				   GTK_DEST_DEFAULT_ALL,
+				   drag_types_dest,
+				   G_N_ELEMENTS (drag_types_dest),
+				   GDK_ACTION_MOVE | GDK_ACTION_COPY);
+	} else {
+		/* FIXME: URI could still be  droped depending on FT feature */
+		gtk_drag_dest_unset (GTK_WIDGET (view));
+	}
+
+	g_object_notify (G_OBJECT (view), "features");
 }
 
-gboolean
-empathy_contact_list_view_get_interactive (EmpathyContactListView  *view)
+EmpathyContactListFeatures
+empathy_contact_list_view_get_features (EmpathyContactListView  *view)
 {
 	EmpathyContactListViewPriv *priv = GET_PRIV (view);
 
 	g_return_val_if_fail (EMPATHY_IS_CONTACT_LIST_VIEW (view), FALSE);
 
-	return priv->interactive;
+	return priv->features;
 }
 
 EmpathyContact *
@@ -538,48 +569,6 @@
 	return name;
 }
 
-GtkWidget *
-empathy_contact_list_view_get_group_menu (EmpathyContactListView *view)
-{
-	EmpathyContactListViewPriv *priv;
-	GtkWidget                 *widget;
-
-	g_return_val_if_fail (EMPATHY_IS_CONTACT_LIST_VIEW (view), NULL);
-
-	priv = GET_PRIV (view);
-
-	widget = gtk_ui_manager_get_widget (priv->ui, "/Group");
-
-	return widget;
-}
-
-GtkWidget *
-empathy_contact_list_view_get_contact_menu (EmpathyContactListView *view,
-					    EmpathyContact         *contact)
-{
-	EmpathyLogManager *log_manager;
-	gboolean           can_show_log;
-	gboolean           can_send_file;
-	gboolean           can_voip;
-
-	g_return_val_if_fail (EMPATHY_IS_CONTACT_LIST_VIEW (view), NULL);
-	g_return_val_if_fail (EMPATHY_IS_CONTACT (contact), NULL);
-
-	log_manager = empathy_log_manager_new ();
-	can_show_log = empathy_log_manager_exists (log_manager,
-						   empathy_contact_get_account (contact),
-						   empathy_contact_get_id (contact),
-						   FALSE);
-	g_object_unref (log_manager);
-	can_send_file = FALSE;
-	can_voip = empathy_contact_can_voip (contact);
-
-	return contact_list_view_get_contact_menu (view,
-						   can_send_file,
-						   can_show_log,
-						   can_voip);
-}
-
 static void
 contact_list_view_setup (EmpathyContactListView *view)
 {
@@ -693,21 +682,6 @@
 		drag_atoms_source[i] = gdk_atom_intern (drag_types_source[i].target,
 							FALSE);
 	}
-
-	/* Note: We support the COPY action too, but need to make the
-	 * MOVE action the default.
-	 */
-	gtk_drag_source_set (GTK_WIDGET (view),
-			     GDK_BUTTON1_MASK,
-			     drag_types_source,
-			     G_N_ELEMENTS (drag_types_source),
-			     GDK_ACTION_MOVE | GDK_ACTION_COPY);
-
-	gtk_drag_dest_set (GTK_WIDGET (view),
-			   GTK_DEST_DEFAULT_ALL,
-			   drag_types_dest,
-			   G_N_ELEMENTS (drag_types_dest),
-			   GDK_ACTION_MOVE | GDK_ACTION_COPY);
 }
 
 static void
@@ -716,6 +690,7 @@
 					    GtkTreeIter           *iter,
 					    EmpathyContactListView *view)
 {
+	EmpathyContactListViewPriv *priv = GET_PRIV (view);
 	gboolean  is_group = FALSE;
 	gchar    *name = NULL;
 
@@ -729,7 +704,8 @@
 		return;
 	}
 
-	if (empathy_contact_group_get_expanded (name)) {
+	if (!(priv->features & EMPATHY_CONTACT_LIST_FEATURE_GROUPS_SAVE) ||
+	    empathy_contact_group_get_expanded (name)) {
 		g_signal_handlers_block_by_func (view,
 						 contact_list_view_row_expand_or_collapse_cb,
 						 GINT_TO_POINTER (TRUE));
@@ -953,7 +929,6 @@
 	const gchar                *contact_id;
 	const gchar                *account_id;
 	gchar                      *str;
-	
 
 	priv = GET_PRIV (widget);
 
@@ -1204,27 +1179,100 @@
 				    gboolean               can_show_log,
 				    gboolean               can_voip)
 {
-	EmpathyContactListViewPriv *priv;
-	GtkAction                 *action;
-	GtkWidget                 *widget;
+	EmpathyContactListViewPriv *priv = GET_PRIV (view);
+	GtkAction                  *action;
 
-	priv = GET_PRIV (view);
+	if (!(priv->features & (EMPATHY_CONTACT_LIST_FEATURE_CONTACT_CHAT |
+				EMPATHY_CONTACT_LIST_FEATURE_CONTACT_CALL |
+				EMPATHY_CONTACT_LIST_FEATURE_CONTACT_LOG |
+				EMPATHY_CONTACT_LIST_FEATURE_CONTACT_FT |
+				EMPATHY_CONTACT_LIST_FEATURE_CONTACT_INVITE |
+				EMPATHY_CONTACT_LIST_FEATURE_CONTACT_EDIT |
+				EMPATHY_CONTACT_LIST_FEATURE_CONTACT_INFO |
+				EMPATHY_CONTACT_LIST_FEATURE_CONTACT_REMOVE))) {
+		return NULL;
+	}
 
-	/* Sort out sensitive items */
-	action = gtk_ui_manager_get_action (priv->ui, "/Contact/Log");
-	gtk_action_set_sensitive (action, can_show_log);
+	/* Sort out sensitive/visible items */
+	action = gtk_ui_manager_get_action (priv->ui, "/Contact/Chat");
+	gtk_action_set_visible (action, priv->features & EMPATHY_CONTACT_LIST_FEATURE_CONTACT_CHAT);
 
 #ifdef HAVE_VOIP
 	action = gtk_ui_manager_get_action (priv->ui, "/Contact/Call");
 	gtk_action_set_sensitive (action, can_voip);
+	gtk_action_set_visible (action, priv->features & EMPATHY_CONTACT_LIST_FEATURE_CONTACT_CALL);
 #endif
 
+	action = gtk_ui_manager_get_action (priv->ui, "/Contact/Log");
+	gtk_action_set_sensitive (action, can_show_log);
+	gtk_action_set_visible (action, priv->features & EMPATHY_CONTACT_LIST_FEATURE_CONTACT_LOG);
+
+
 	action = gtk_ui_manager_get_action (priv->ui, "/Contact/SendFile");
-	gtk_action_set_visible (action, can_send_file);
+	gtk_action_set_visible (action, can_send_file && (priv->features & EMPATHY_CONTACT_LIST_FEATURE_CONTACT_FT));
+
+	action = gtk_ui_manager_get_action (priv->ui, "/Contact/Invite");
+	gtk_action_set_visible (action, priv->features & EMPATHY_CONTACT_LIST_FEATURE_CONTACT_INVITE);
+
+	action = gtk_ui_manager_get_action (priv->ui, "/Contact/Edit");
+	gtk_action_set_visible (action, priv->features & EMPATHY_CONTACT_LIST_FEATURE_CONTACT_EDIT);
+
+	action = gtk_ui_manager_get_action (priv->ui, "/Contact/Information");
+	gtk_action_set_visible (action, priv->features & EMPATHY_CONTACT_LIST_FEATURE_CONTACT_INFO);
+
+	action = gtk_ui_manager_get_action (priv->ui, "/Contact/Remove");
+	gtk_action_set_visible (action, priv->features & EMPATHY_CONTACT_LIST_FEATURE_CONTACT_REMOVE);
+
+	return gtk_ui_manager_get_widget (priv->ui, "/Contact");
+}
+
+GtkWidget *
+empathy_contact_list_view_get_group_menu (EmpathyContactListView *view)
+{
+	EmpathyContactListViewPriv *priv = GET_PRIV (view);
+	GtkAction                  *action;
+
+	g_return_val_if_fail (EMPATHY_IS_CONTACT_LIST_VIEW (view), NULL);
+
+	if (!(priv->features & (EMPATHY_CONTACT_LIST_FEATURE_GROUPS_RENAME |
+				EMPATHY_CONTACT_LIST_FEATURE_GROUPS_REMOVE))) {
+		return NULL;
+	}
+
+	action = gtk_ui_manager_get_action (priv->ui, "/Group/Rename");
+	gtk_action_set_visible (action, priv->features & EMPATHY_CONTACT_LIST_FEATURE_GROUPS_RENAME);
+
+	action = gtk_ui_manager_get_action (priv->ui, "/Group/Remove");
+	gtk_action_set_visible (action, priv->features & EMPATHY_CONTACT_LIST_FEATURE_GROUPS_REMOVE);
+
+	return gtk_ui_manager_get_widget (priv->ui, "/Group");
+}
+
+GtkWidget *
+empathy_contact_list_view_get_contact_menu (EmpathyContactListView *view,
+					    EmpathyContact         *contact)
+{
+	EmpathyLogManager *log_manager;
+	gboolean           can_show_log;
+	gboolean           can_send_file;
+	gboolean           can_voip;
 
-	widget = gtk_ui_manager_get_widget (priv->ui, "/Contact");
+	g_return_val_if_fail (EMPATHY_IS_CONTACT_LIST_VIEW (view), NULL);
+	g_return_val_if_fail (EMPATHY_IS_CONTACT (contact), NULL);
+
+	log_manager = empathy_log_manager_new ();
+	can_show_log = empathy_log_manager_exists (log_manager,
+						   empathy_contact_get_account (contact),
+						   empathy_contact_get_id (contact),
+						   FALSE);
+	g_object_unref (log_manager);
+	can_send_file = FALSE;
+	can_voip = empathy_contact_can_voip (contact);
 
-	return widget;
+	return contact_list_view_get_contact_menu (view,
+						   can_send_file,
+						   can_show_log,
+						   can_voip);
 }
 
 static gboolean
@@ -1243,7 +1291,7 @@
 
 	priv = GET_PRIV (view);
 
-	if (!priv->interactive || event->button != 3) {
+	if (event->button != 3) {
 		return FALSE;
 	}
 
@@ -1301,7 +1349,7 @@
 	GtkTreeModel               *model;
 	GtkTreeIter                 iter;
 
-	if (!priv->interactive) {
+	if (!(priv->features & EMPATHY_CONTACT_LIST_FEATURE_CONTACT_CHAT)) {
 		return;
 	}
 
@@ -1329,10 +1377,6 @@
 	GtkTreeIter                 iter;
 	EmpathyContact             *contact;
 
-	if (!priv->interactive) {
-		return;
-	}
-
 	model = gtk_tree_view_get_model (GTK_TREE_VIEW (view));
 	if (!gtk_tree_model_get_iter_from_string (model, &iter, path_string)) {
 		return;
@@ -1356,9 +1400,14 @@
 					     GtkTreePath           *path,
 					     gpointer               user_data)
 {
-	GtkTreeModel *model;
-	gchar        *name;
-	gboolean      expanded;
+	EmpathyContactListViewPriv *priv = GET_PRIV (view);
+	GtkTreeModel               *model;
+	gchar                      *name;
+	gboolean                    expanded;
+
+	if (!(priv->features & EMPATHY_CONTACT_LIST_FEATURE_GROUPS_SAVE)) {
+		return;
+	}
 
 	model = gtk_tree_view_get_model (GTK_TREE_VIEW (view));
 

Modified: trunk/libempathy-gtk/empathy-contact-list-view.h
==============================================================================
--- trunk/libempathy-gtk/empathy-contact-list-view.h	(original)
+++ trunk/libempathy-gtk/empathy-contact-list-view.h	Sun Jan 20 21:41:58 2008
@@ -43,7 +43,24 @@
 
 typedef struct _EmpathyContactListView      EmpathyContactListView;
 typedef struct _EmpathyContactListViewClass EmpathyContactListViewClass;
-typedef struct _EmpathyContactListViewPriv  EmpathyContactListViewPriv;
+
+typedef enum {
+	EMPATHY_CONTACT_LIST_FEATURE_NONE = 0,
+	EMPATHY_CONTACT_LIST_FEATURE_GROUPS_SAVE = 1 << 0,
+	EMPATHY_CONTACT_LIST_FEATURE_GROUPS_RENAME = 1 << 1,
+	EMPATHY_CONTACT_LIST_FEATURE_GROUPS_REMOVE = 1 << 2,
+	EMPATHY_CONTACT_LIST_FEATURE_CONTACT_CHAT = 1 << 3,
+	EMPATHY_CONTACT_LIST_FEATURE_CONTACT_CALL = 1 << 4,
+	EMPATHY_CONTACT_LIST_FEATURE_CONTACT_LOG = 1 << 5,
+	EMPATHY_CONTACT_LIST_FEATURE_CONTACT_FT = 1 << 6,
+	EMPATHY_CONTACT_LIST_FEATURE_CONTACT_INVITE = 1 << 7,
+	EMPATHY_CONTACT_LIST_FEATURE_CONTACT_EDIT = 1 << 8,
+	EMPATHY_CONTACT_LIST_FEATURE_CONTACT_INFO = 1 << 9,
+	EMPATHY_CONTACT_LIST_FEATURE_CONTACT_REMOVE = 1 << 10,
+	EMPATHY_CONTACT_LIST_FEATURE_CONTACT_DROP = 1 << 11,
+	EMPATHY_CONTACT_LIST_FEATURE_CONTACT_DRAG = 1 << 12,
+	EMPATHY_CONTACT_LIST_FEATURE_ALL = (1 << 13) - 1,
+} EmpathyContactListFeatures;
 
 struct _EmpathyContactListView {
 	GtkTreeView            parent;
@@ -53,16 +70,17 @@
 	GtkTreeViewClass       parent_class;
 };
 
-GType                   empathy_contact_list_view_get_type           (void) G_GNUC_CONST;
-EmpathyContactListView *empathy_contact_list_view_new                (EmpathyContactListStore *store);
-void                    empathy_contact_list_view_set_interactive    (EmpathyContactListView  *view,
-								      gboolean                 interactive);
-gboolean                empathy_contact_list_view_get_interactive    (EmpathyContactListView  *view);
-EmpathyContact *        empathy_contact_list_view_get_selected       (EmpathyContactListView  *view);
-gchar *                 empathy_contact_list_view_get_selected_group (EmpathyContactListView  *view);
-GtkWidget *             empathy_contact_list_view_get_contact_menu   (EmpathyContactListView  *view,
-								      EmpathyContact          *contact);
-GtkWidget *             empathy_contact_list_view_get_group_menu     (EmpathyContactListView  *view);
+GType                      empathy_contact_list_view_get_type           (void) G_GNUC_CONST;
+EmpathyContactListView *   empathy_contact_list_view_new                (EmpathyContactListStore    *store,
+								         EmpathyContactListFeatures  features);
+void                       empathy_contact_list_view_set_features       (EmpathyContactListView     *view,
+								         EmpathyContactListFeatures  features);
+EmpathyContactListFeatures empathy_contact_list_view_get_features       (EmpathyContactListView     *view);
+EmpathyContact *           empathy_contact_list_view_get_selected       (EmpathyContactListView     *view);
+gchar *                    empathy_contact_list_view_get_selected_group (EmpathyContactListView     *view);
+GtkWidget *                empathy_contact_list_view_get_contact_menu   (EmpathyContactListView     *view,
+								         EmpathyContact             *contact);
+GtkWidget *                empathy_contact_list_view_get_group_menu     (EmpathyContactListView     *view);
 
 G_END_DECLS
 

Modified: trunk/libempathy-gtk/empathy-group-chat.c
==============================================================================
--- trunk/libempathy-gtk/empathy-group-chat.c	(original)
+++ trunk/libempathy-gtk/empathy-group-chat.c	Sun Jan 20 21:41:58 2008
@@ -527,8 +527,14 @@
 
 	/* Create contact list */
 	priv->store = empathy_contact_list_store_new (EMPATHY_CONTACT_LIST (priv->tp_chat));
-	priv->view = empathy_contact_list_view_new (priv->store);
-	empathy_contact_list_view_set_interactive (priv->view, TRUE);
+	priv->view = empathy_contact_list_view_new (priv->store,
+						    EMPATHY_CONTACT_LIST_FEATURE_CONTACT_CHAT |
+						    EMPATHY_CONTACT_LIST_FEATURE_CONTACT_CALL |
+						    EMPATHY_CONTACT_LIST_FEATURE_CONTACT_LOG |
+						    EMPATHY_CONTACT_LIST_FEATURE_CONTACT_FT |
+						    EMPATHY_CONTACT_LIST_FEATURE_CONTACT_INVITE |
+						    EMPATHY_CONTACT_LIST_FEATURE_CONTACT_INFO);
+
 	gtk_container_add (GTK_CONTAINER (priv->scrolled_window_contacts),
 			   GTK_WIDGET (priv->view));
 	gtk_widget_show (GTK_WIDGET (priv->view));

Modified: trunk/libempathy-gtk/empathy-main-window.c
==============================================================================
--- trunk/libempathy-gtk/empathy-main-window.c	(original)
+++ trunk/libempathy-gtk/empathy-main-window.c	Sun Jan 20 21:41:58 2008
@@ -285,8 +285,8 @@
 
 	list_iface = EMPATHY_CONTACT_LIST (empathy_contact_manager_new ());
 	window->list_store = empathy_contact_list_store_new (list_iface);
-	window->list_view = empathy_contact_list_view_new (window->list_store);
-	empathy_contact_list_view_set_interactive (window->list_view, TRUE);
+	window->list_view = empathy_contact_list_view_new (window->list_store,
+							   EMPATHY_CONTACT_LIST_FEATURE_ALL);
 	g_object_unref (list_iface);
 
 	gtk_widget_show (GTK_WIDGET (window->list_view));

Modified: trunk/megaphone/src/megaphone-applet.c
==============================================================================
--- trunk/megaphone/src/megaphone-applet.c	(original)
+++ trunk/megaphone/src/megaphone-applet.c	Sun Jan 20 21:41:58 2008
@@ -365,8 +365,8 @@
 		      "show-offline", TRUE,
 		      "sort-criterium", EMPATHY_CONTACT_LIST_STORE_SORT_NAME,
 		      NULL);
-	contact_list = empathy_contact_list_view_new (contact_store);
-	gtk_tree_view_expand_all (GTK_TREE_VIEW (contact_list));
+	contact_list = empathy_contact_list_view_new (contact_store,
+						      EMPATHY_CONTACT_LIST_FEATURE_NONE);
 	g_object_unref (contact_manager);
 	g_object_unref (contact_store);
 	gtk_widget_show (GTK_WIDGET (contact_list));

Modified: trunk/python/pyempathygtk/pyempathygtk.defs
==============================================================================
--- trunk/python/pyempathygtk/pyempathygtk.defs	(original)
+++ trunk/python/pyempathygtk/pyempathygtk.defs	Sun Jan 20 21:41:58 2008
@@ -194,6 +194,24 @@
   )
 )
 
+(define-flags ContactListFeatures
+  (in-module "Empathy")
+  (c-name "EmpathyContactListFeatures")
+  (gtype-id "EMPATHY_TYPE_CONTACT_LIST_FEATURES")
+  (values
+    '("groups-show" "EMPATHY_CONTACT_LIST_FEATURE_GROUPS_SHOW")
+    '("groups-modify" "EMPATHY_CONTACT_LIST_FEATURE_GROUPS_MODIFY")
+    '("contact-chat" "EMPATHY_CONTACT_LIST_FEATURE_CONTACT_CHAT")
+    '("contact-call" "EMPATHY_CONTACT_LIST_FEATURE_CONTACT_CALL")
+    '("contact-log" "EMPATHY_CONTACT_LIST_FEATURE_CONTACT_LOG")
+    '("contact-ft" "EMPATHY_CONTACT_LIST_FEATURE_CONTACT_FT")
+    '("contact-invite" "EMPATHY_CONTACT_LIST_FEATURE_CONTACT_INVITE")
+    '("contact-edit" "EMPATHY_CONTACT_LIST_FEATURE_CONTACT_EDIT")
+    '("contact-info" "EMPATHY_CONTACT_LIST_FEATURE_CONTACT_INFO")
+    '("contact-remove" "EMPATHY_CONTACT_LIST_FEATURE_CONTACT_REMOVE")
+  )
+)
+
 (define-flags ContactWidgetFlags
   (in-module "Empathy")
   (c-name "EmpathyContactWidgetFlags")
@@ -1144,22 +1162,23 @@
   (return-type "EmpathyContactListView*")
   (parameters
     '("EmpathyContactListStore*" "store")
+    '("EmpathyContactListFeatures" "features")
   )
 )
 
-(define-method set_interactive
+(define-method set_features
   (of-object "EmpathyContactListView")
-  (c-name "empathy_contact_list_view_set_interactive")
+  (c-name "empathy_contact_list_view_set_features")
   (return-type "none")
   (parameters
-    '("gboolean" "interactive")
+    '("EmpathyContactListFeatures" "features")
   )
 )
 
-(define-method get_interactive
+(define-method get_features
   (of-object "EmpathyContactListView")
-  (c-name "empathy_contact_list_view_get_interactive")
-  (return-type "gboolean")
+  (c-name "empathy_contact_list_view_get_features")
+  (return-type "EmpathyContactListFeatures")
 )
 
 (define-method get_selected
@@ -1306,6 +1325,11 @@
   (return-type "GType")
 )
 
+(define-function empathy_contact_list_features_get_type
+  (c-name "empathy_contact_list_features_get_type")
+  (return-type "GType")
+)
+
 (define-function empathy_chat_view_block_get_type
   (c-name "empathy_chat_view_block_get_type")
   (return-type "GType")
@@ -1321,7 +1345,7 @@
 
 (define-function empathy_log_window_show
   (c-name "empathy_log_window_show")
-  (return-type "none")
+  (return-type "GtkWidget*")
   (parameters
     '("McAccount*" "account")
     '("const-gchar*" "chat_id")



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