pidgin.next.major: 455864fc: Add API:

andrew.victor at mxit.com andrew.victor at mxit.com
Tue May 3 17:01:30 EDT 2011


----------------------------------------------------------------------
Revision: 455864fc2a2d3f9a352f3cfa5f21ca6fffac6001
Parent:   69fe560e6120c230ef6713ece648c4a132daac16
Author:   andrew.victor at mxit.com
Date:     05/03/11 16:55:39
Branch:   im.pidgin.pidgin.next.major
URL: http://d.pidgin.im/viewmtn/revision/info/455864fc2a2d3f9a352f3cfa5f21ca6fffac6001

Changelog: 

Add API:
 * purple_notify_searchresult_column_set_visible
 * purple_notify_searchresult_column_is_visible

This allows columns to be defined in the search-results, but that are not
visible to the user.  These columns can, for example, be used to store values
associated with the selected-row that are required in the search-result
callback.


Changes against parent 69fe560e6120c230ef6713ece648c4a132daac16

  patched  ChangeLog.API
  patched  finch/gntnotify.c
  patched  libpurple/notify.c
  patched  libpurple/notify.h
  patched  pidgin/gtknotify.c

-------------- next part --------------
============================================================
--- pidgin/gtknotify.c	06c15f794dd070d35181720e0cf03dd3fd49bf25
+++ pidgin/gtknotify.c	35a2e52a99011cc21a0cbb06f3b9bab30a727765
@@ -1035,6 +1035,10 @@ pidgin_notify_searchresults(PurpleConnec
 
 		gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(treeview), -1,
 				column->title, renderer, "text", i, NULL);
+
+		if (!purple_notify_searchresult_column_is_visible(column))
+			gtk_tree_view_column_set_visible(gtk_tree_view_get_column(GTK_TREE_VIEW(treeview), i), FALSE);
+
 		i++;
 	}
 
============================================================
--- libpurple/notify.c	7110d5940b0743e117730aebc9f3e18a2e8c959c
+++ libpurple/notify.c	f82c218ffc860dd5a6e862b98a5e776d793afe4e
@@ -363,10 +363,26 @@ purple_notify_searchresults_column_new(c
 
 	sc = g_new0(PurpleNotifySearchColumn, 1);
 	sc->title = g_strdup(title);
+	sc->visible = TRUE;
 
 	return sc;
 }
 
+void purple_notify_searchresult_column_set_visible(PurpleNotifySearchColumn *column, gboolean visible)
+{
+	g_return_if_fail(column != NULL);
+
+	column->visible = visible;
+}
+
+gboolean
+purple_notify_searchresult_column_is_visible(const PurpleNotifySearchColumn *column)
+{
+	g_return_val_if_fail(column != NULL, FALSE);
+
+	return column->visible;
+}
+
 guint
 purple_notify_searchresults_get_columns_count(PurpleNotifySearchResults *results)
 {
============================================================
--- libpurple/notify.h	37a8aa775ee077a7770b0917d10576d62256f8cd
+++ libpurple/notify.h	c2af7b6a96b897070b614b81e7e8950d9d0109db
@@ -111,7 +111,8 @@ typedef struct
  */
 typedef struct
 {
-	char *title; /**< Title of the column. */
+	char *title;           /**< Title of the column. */
+	gboolean visible;
 
 } PurpleNotifySearchColumn;
 
@@ -275,6 +276,23 @@ PurpleNotifySearchColumn *purple_notify_
 PurpleNotifySearchColumn *purple_notify_searchresults_column_new(const char *title);
 
 /**
+ * Sets whether or not a search result column is visible.
+ *
+ * @param field   The search column object.
+ * @param visible TRUE if visible, or FALSE if not.
+ */
+void purple_notify_searchresult_column_set_visible(PurpleNotifySearchColumn *column, gboolean visible);
+
+/**
+ * Returns whether or not a search result column is visible.
+ *
+ * @param field The search column object.
+ *
+ * @return TRUE if the search result column is visible. FALSE otherwise.
+ */
+gboolean purple_notify_searchresult_column_is_visible(const PurpleNotifySearchColumn *column);
+
+/**
  * Adds a new column to the search result object.
  *
  * @param results The result object to which the column will be added.
============================================================
--- ChangeLog.API	6eb5aa01f0b0749178abd90dd49c3c6f48bfb0d3
+++ ChangeLog.API	a9bc474642a87557b86761c858054ce203dc049f
@@ -2,6 +2,10 @@ version 3.0.0 (??/??/????):
 
 version 3.0.0 (??/??/????):
 	libpurple:
+		Added:
+		* purple_notify_searchresult_column_set_visible
+		* purple_notify_searchresult_column_is_visible
+
 		Removed:
 		* purple_core_migrate
 
============================================================
--- finch/gntnotify.c	0aa0b8de803020f52b66b32047a50d406d87840e
+++ finch/gntnotify.c	cffbae7cf0afa70881634069ddf55aaa1320905e
@@ -426,6 +426,9 @@ finch_notify_searchresults(PurpleConnect
 	{
 		PurpleNotifySearchColumn *column = iter->data;
 		gnt_tree_set_column_title(GNT_TREE(tree), i, column->title);
+
+		if (!purple_notify_searchresult_column_is_visible(column))
+			gnt_tree_set_column_visible(GNT_TREE(tree), i, FALSE);
 		i++;
 	}
 


More information about the Commits mailing list