[nautilus-actions] Define new on_add_clicked callback parameter



commit 0fb6b239834c40a74e576454e9938b34b2ddeb71
Author: Pierre Wieser <pwieser trychlos org>
Date:   Sun Jun 13 18:44:06 2010 +0200

    Define new on_add_clicked callback parameter

 ChangeLog                      |    9 +++++++++
 src/nact/nact-ibasenames-tab.c |    1 +
 src/nact/nact-ifolders-tab.c   |    1 +
 src/nact/nact-imimetypes-tab.c |    1 +
 src/nact/nact-ischemes-tab.c   |    1 +
 src/nact/nact-match-list.c     |   23 ++++++++++++++++-------
 src/nact/nact-match-list.h     |    4 +++-
 7 files changed, 32 insertions(+), 8 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 5867b1c..8ca8615 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2010-06-13 Pierre Wieser <pwieser trychlos org>
 
+	* src/nact/nact-match-list.c:
+	* src/nact/nact-match-list.h (nact_match_list_create_model):
+	Add on_add_clicked callback parameter.
+
+	* src/nact/nact-ibasenames-tab.c:
+	* src/nact/nact-ifolders-tab.c:
+	* src/nact/nact-imimetypes-tab.c:
+	* src/nact/nact-ischemes-tab.c: Updated accordingly.
+
 	* src/nact/nact-iaction-tab.c:
 	Use gtk_bin_get_child() function instead of GTK_BIN()->child.
 
diff --git a/src/nact/nact-ibasenames-tab.c b/src/nact/nact-ibasenames-tab.c
index 32ece40..24ba4f3 100644
--- a/src/nact/nact-ibasenames-tab.c
+++ b/src/nact/nact-ibasenames-tab.c
@@ -161,6 +161,7 @@ nact_ibasenames_tab_initial_load_toplevel( NactIBasenamesTab *instance )
 				list, add, remove,
 				( pget_filters ) get_basenames,
 				( pset_filters ) set_basenames,
+				NULL,
 				_( "Basename filter" ));
 	}
 }
diff --git a/src/nact/nact-ifolders-tab.c b/src/nact/nact-ifolders-tab.c
index fac0744..40ac1a2 100644
--- a/src/nact/nact-ifolders-tab.c
+++ b/src/nact/nact-ifolders-tab.c
@@ -166,6 +166,7 @@ nact_ifolders_tab_initial_load_toplevel( NactIFoldersTab *instance )
 				list, add, remove,
 				( pget_filters ) get_folders,
 				( pset_filters ) set_folders,
+				NULL,
 				_( "Folder filter" ));
 	}
 }
diff --git a/src/nact/nact-imimetypes-tab.c b/src/nact/nact-imimetypes-tab.c
index e8e8c58..92c14bb 100644
--- a/src/nact/nact-imimetypes-tab.c
+++ b/src/nact/nact-imimetypes-tab.c
@@ -159,6 +159,7 @@ nact_imimetypes_tab_initial_load_toplevel( NactIMimetypesTab *instance )
 				list, add, remove,
 				( pget_filters ) get_mimetypes,
 				( pset_filters ) set_mimetypes,
+				NULL,
 				_( "Mimetype filter" ));
 	}
 }
diff --git a/src/nact/nact-ischemes-tab.c b/src/nact/nact-ischemes-tab.c
index d2366b8..9cda0f9 100644
--- a/src/nact/nact-ischemes-tab.c
+++ b/src/nact/nact-ischemes-tab.c
@@ -156,6 +156,7 @@ nact_ischemes_tab_initial_load_toplevel( NactISchemesTab *instance )
 				list, add, remove,
 				( pget_filters ) get_schemes,
 				( pset_filters ) set_schemes,
+				NULL,
 				_( "Scheme filter" ));
 	}
 }
diff --git a/src/nact/nact-match-list.c b/src/nact/nact-match-list.c
index 9155768..ed45949 100644
--- a/src/nact/nact-match-list.c
+++ b/src/nact/nact-match-list.c
@@ -92,7 +92,7 @@ void
 nact_match_list_create_model( BaseWindow *window,
 		const gchar *tab_name, guint tab_id,
 		GtkWidget *listview, GtkWidget *addbutton, GtkWidget *removebutton,
-		pget_filters pget, pset_filters pset,
+		pget_filters pget, pset_filters pset, pon_add_cb pon_add,
 		const gchar *item_header )
 {
 	MatchListStr *data;
@@ -109,6 +109,7 @@ nact_match_list_create_model( BaseWindow *window,
 	data->removebutton = removebutton;
 	data->pget = pget;
 	data->pset = pset;
+	data->pon_add = pon_add;
 	data->item_header = g_strdup( item_header );
 	data->editable = FALSE;
 	data->sort_column = 0;
@@ -228,12 +229,20 @@ nact_match_list_init_view( BaseWindow *window, const gchar *tab_name )
 			G_CALLBACK( on_must_not_match_toggled ),
 			data );
 
-	base_window_signal_connect_with_data(
-			window,
-			G_OBJECT( data->addbutton ),
-			"clicked",
-			G_CALLBACK( on_add_filter_clicked ),
-			data );
+	if( data->pon_add ){
+		base_window_signal_connect(
+				window,
+				G_OBJECT( data->addbutton ),
+				"clicked",
+				G_CALLBACK( data->pon_add ));
+	} else {
+		base_window_signal_connect_with_data(
+				window,
+				G_OBJECT( data->addbutton ),
+				"clicked",
+				G_CALLBACK( on_add_filter_clicked ),
+				data );
+	}
 
 	base_window_signal_connect_with_data(
 			window,
diff --git a/src/nact/nact-match-list.h b/src/nact/nact-match-list.h
index 0361427..078605a 100644
--- a/src/nact/nact-match-list.h
+++ b/src/nact/nact-match-list.h
@@ -43,6 +43,7 @@ G_BEGIN_DECLS
 
 typedef GSList * ( *pget_filters )( void * );
 typedef void     ( *pset_filters )( void *, GSList * );
+typedef gchar *  ( *pon_add_cb )  ( void *, BaseWindow * );
 
 typedef struct {
 	BaseWindow      *window;
@@ -52,6 +53,7 @@ typedef struct {
 	GtkWidget       *removebutton;
 	pget_filters     pget;
 	pset_filters     pset;
+	pon_add_cb       pon_add;
 	gchar           *item_header;
 	gboolean         editable;
 	guint            sort_column;
@@ -62,7 +64,7 @@ typedef struct {
 void  nact_match_list_create_model        ( BaseWindow *window, const gchar *tab_name,
 		guint tab_id,
 		GtkWidget *listview, GtkWidget *addbutton, GtkWidget *removebutton,
-		pget_filters pget, pset_filters pset,
+		pget_filters pget, pset_filters pset, pon_add_cb pon_add,
 		const gchar *item_header );
 
 void  nact_match_list_init_view           ( BaseWindow *window, const gchar *tab_name );



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