[nautilus-actions] Implement first tab of conditions



commit d4be18cce703c84e2f092f6356357f95b14e4bae
Author: Pierre Wieser <pwieser trychlos org>
Date:   Tue Jun 30 12:58:32 2009 +0200

    Implement first tab of conditions

 ChangeLog                                |   25 ++
 src/common/na-utils.c                    |   29 ++
 src/common/na-utils.h                    |    5 +
 src/nact/Makefile.am                     |    2 -
 src/nact/nact-action-conditions-editor.c |    3 +
 src/nact/nact-imenu-item.c               |  222 ++++++------
 src/nact/nact-imenu-item.h               |    1 +
 src/nact/nact-import-export.c            |   95 +++---
 src/nact/nact-iprofile-conditions.c      |  579 ++++++++++++++++++++++--------
 src/nact/nact-iprofile-conditions.h      |    2 +
 src/nact/nact-utils.c                    |  346 ------------------
 src/nact/nact-utils.h                    |   66 ----
 src/nact/nautilus-actions-config.ui      |  202 +++++++++++-
 13 files changed, 860 insertions(+), 717 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 292db11..c8c2098 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,28 @@
+2009-06-30 Pierre Wieser <pwieser trychlos org>
+
+	* src/common/na-utils.c:
+	* src/common/na-utils.h (na_utils_gstring_joinv): New function.
+
+	* src/nact/nact-action-conditions-editor.c:
+	Call _dispose functions when closing the window.
+
+	* src/nact/nact-imenu-item.c:
+	* src/nact/nact-imenu-item.h (nact_imenu_item_dispose):
+	New function.
+
+	* src/nact/nact-iprofile-conditions.c:
+	* src/nact/nact-iprofile-conditions.h
+	(nact_iprofile_conditions_dispose): New function.
+
+	* src/nact/nact-iprofile-conditions.c:
+	All first tab is now implemented.
+
+	* src/nact/nact-utils.c:
+	* src/nact/nact-utils.h: Removed files.
+
+	* src/nact/nautilus-actions-config.ui:
+	Add LegendDialog window.
+
 2009-06-29 Pierre Wieser <pwieser trychlos org>
 
 	* src/common/na-action.c:
diff --git a/src/common/na-utils.c b/src/common/na-utils.c
index 99d0d32..ad2fb1c 100644
--- a/src/common/na-utils.c
+++ b/src/common/na-utils.c
@@ -120,3 +120,32 @@ na_utils_free_string_list( GSList *list )
 	}
 	g_slist_free( list );
 }
+
+/**
+ * Concatenates a gchar **list of strings to a GString.
+ */
+gchar *
+na_utils_gstring_joinv( const gchar *start, const gchar *separator, gchar **list )
+{
+	GString *tmp_string = g_string_new( "" );
+	int i;
+
+	g_return_val_if_fail( list != NULL, NULL );
+
+	if( start != NULL ){
+		tmp_string = g_string_append( tmp_string, start );
+	}
+
+	if( list[0] != NULL ){
+		tmp_string = g_string_append( tmp_string, list[0] );
+	}
+
+	for( i = 1 ; list[i] != NULL ; i++ ){
+		if( separator ){
+			tmp_string = g_string_append( tmp_string, separator );
+		}
+		tmp_string = g_string_append( tmp_string, list[i] );
+	}
+
+	return( g_string_free( tmp_string, FALSE ));
+}
diff --git a/src/common/na-utils.h b/src/common/na-utils.h
index d14792a..3d36b90 100644
--- a/src/common/na-utils.h
+++ b/src/common/na-utils.h
@@ -46,6 +46,11 @@ GSList  *na_utils_duplicate_string_list( GSList *list );
 
 void     na_utils_free_string_list( GSList *list );
 
+/*
+ * Some functions for GString manipulations.
+ */
+gchar *  na_utils_gstring_joinv( const gchar *start, const gchar *separator, gchar **list );
+
 G_END_DECLS
 
 #endif /* __NA_UTILS_H__ */
diff --git a/src/nact/Makefile.am b/src/nact/Makefile.am
index 5b3ba58..08e4470 100644
--- a/src/nact/Makefile.am
+++ b/src/nact/Makefile.am
@@ -61,8 +61,6 @@ nautilus_actions_config_SOURCES = \
 	nact-main-window.h									\
 	nact-profile-conditions-editor.c					\
 	nact-profile-conditions-editor.h					\
-	nact-utils.c										\
-	nact-utils.h										\
 	nact-prefs.c										\
 	nact-prefs.h										\
 	nact-import-export.c								\
diff --git a/src/nact/nact-action-conditions-editor.c b/src/nact/nact-action-conditions-editor.c
index 11c7268..c4ecd29 100644
--- a/src/nact/nact-action-conditions-editor.c
+++ b/src/nact/nact-action-conditions-editor.c
@@ -207,6 +207,9 @@ instance_dispose( GObject *dialog )
 
 		self->private->dispose_has_run = TRUE;
 
+		nact_imenu_item_dispose( NACT_WINDOW( dialog ));
+		nact_iprofile_conditions_dispose( NACT_WINDOW( dialog ));
+
 		g_object_unref( self->private->original );
 		g_object_unref( self->private->edited );
 
diff --git a/src/nact/nact-imenu-item.c b/src/nact/nact-imenu-item.c
index 1325117..ee080dc 100644
--- a/src/nact/nact-imenu-item.c
+++ b/src/nact/nact-imenu-item.c
@@ -60,15 +60,14 @@ static void          interface_base_finalize( NactIMenuItemInterface *klass );
 static GObject      *v_get_edited_action( NactWindow *window );
 static void          v_field_modified( NactWindow *window );
 
-static void          icon_combo_list_fill( GtkComboBoxEntry* combo );
-static GtkTreeModel *create_stock_icon_model( void );
-static gint          sort_stock_ids( gconstpointer a, gconstpointer b );
-static gchar        *strip_underscore( const gchar *text );
-
 static void          on_label_changed( GtkEntry *entry, gpointer user_data );
 static void          on_tooltip_changed( GtkEntry *entry, gpointer user_data );
 static void          on_icon_changed( GtkEntry *entry, gpointer user_data );
 static void          on_icon_browse( GtkButton *button, gpointer user_data );
+static void          icon_combo_list_fill( GtkComboBoxEntry* combo );
+static GtkTreeModel *create_stock_icon_model( void );
+static gint          sort_stock_ids( gconstpointer a, gconstpointer b );
+static gchar        *strip_underscore( const gchar *text );
 
 GType
 nact_imenu_item_get_type( void )
@@ -204,6 +203,11 @@ nact_imenu_item_has_label( NactWindow *window )
 	return( g_utf8_strlen( label, -1 ) > 0 );
 }
 
+void
+nact_imenu_item_dispose( NactWindow *dialog )
+{
+}
+
 static GObject *
 v_get_edited_action( NactWindow *window )
 {
@@ -227,6 +231,110 @@ v_field_modified( NactWindow *window )
 }
 
 static void
+on_label_changed( GtkEntry *entry, gpointer user_data )
+{
+	g_assert( NACT_IS_WINDOW( user_data ));
+	NactWindow *dialog = NACT_WINDOW( user_data );
+
+	NAAction *edited = NA_ACTION( v_get_edited_action( dialog ));
+	na_action_set_label( edited, gtk_entry_get_text( entry ));
+
+	v_field_modified( dialog );
+}
+
+static void
+on_tooltip_changed( GtkEntry *entry, gpointer user_data )
+{
+	g_assert( NACT_IS_WINDOW( user_data ));
+	NactWindow *dialog = NACT_WINDOW( user_data );
+
+	NAAction *edited = NA_ACTION( v_get_edited_action( dialog ));
+	na_action_set_tooltip( edited, gtk_entry_get_text( entry ));
+
+	v_field_modified( dialog );
+}
+
+static void
+on_icon_changed( GtkEntry *icon_entry, gpointer user_data )
+{
+	static const gchar *thisfn = "nact_imenu_item_on_icon_changed";
+
+	g_assert( NACT_IS_WINDOW( user_data ));
+	NactWindow *dialog = NACT_WINDOW( user_data );
+
+	GtkWidget *image = base_window_get_widget( BASE_WINDOW( dialog ), "IconImage" );
+	g_assert( GTK_IS_WIDGET( image ));
+	const gchar *icon_name = gtk_entry_get_text( icon_entry );
+	g_debug( "%s: icon_name=%s", thisfn, icon_name );
+
+	GtkStockItem stock_item;
+	GdkPixbuf *icon = NULL;
+
+	if( icon_name && strlen( icon_name ) > 0 ){
+
+		/* TODO: code should be mutualized with those IActionsList */
+		if( gtk_stock_lookup( icon_name, &stock_item )){
+			g_debug( "%s: gtk_stock_lookup", thisfn );
+			gtk_image_set_from_stock( GTK_IMAGE( image ), icon_name, GTK_ICON_SIZE_MENU );
+			gtk_widget_show( image );
+
+		} else if( g_file_test( icon_name, G_FILE_TEST_EXISTS ) &&
+					g_file_test( icon_name, G_FILE_TEST_IS_REGULAR )){
+			g_debug( "%s: g_file_test", thisfn );
+			gint width;
+			gint height;
+			GError *error = NULL;
+
+			gtk_icon_size_lookup( GTK_ICON_SIZE_MENU, &width, &height );
+			icon = gdk_pixbuf_new_from_file_at_size( icon_name, width, height, &error );
+			if( error ){
+				g_warning( "%s: gdk_pixbuf_new_from_file_at_size:%s", thisfn, error->message );
+				icon = NULL;
+				g_error_free( error );
+			}
+			gtk_image_set_from_pixbuf( GTK_IMAGE( image ), icon );
+			gtk_widget_show( image );
+
+		} else {
+			g_debug( "%s: not stock, nor file", thisfn );
+			gtk_widget_hide( image );
+		}
+	} else {
+		gtk_widget_hide( image );
+	}
+
+	NAAction *edited = NA_ACTION( v_get_edited_action( dialog ));
+	na_action_set_icon( edited, icon_name );
+
+	v_field_modified( dialog );
+}
+
+/* TODO: replace with a fds-compliant icon chooser */
+static void
+on_icon_browse( GtkButton *button, gpointer user_data )
+{
+	g_assert( NACT_IS_IMENU_ITEM( user_data ));
+
+	GtkWidget *dialog = gtk_file_chooser_dialog_new(
+			_( "Choosing an icon" ),
+			NULL,
+			GTK_FILE_CHOOSER_ACTION_OPEN,
+			GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+			GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
+			NULL
+			);
+
+	if( gtk_dialog_run( GTK_DIALOG( dialog )) == GTK_RESPONSE_ACCEPT ){
+		gchar *filename = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER( dialog ));
+		GtkWidget *icon_widget = base_window_get_widget( BASE_WINDOW( user_data ), "MenuIconComboBoxEntry" );
+		gtk_entry_set_text( GTK_ENTRY( GTK_BIN( icon_widget )->child ), filename );
+	    g_free (filename);
+	  }
+
+	gtk_widget_destroy( dialog );
+}
+
+static void
 icon_combo_list_fill( GtkComboBoxEntry* combo )
 {
 	GtkCellRenderer *cell_renderer_pix;
@@ -337,107 +445,3 @@ strip_underscore( const gchar *text )
 
 	return( result );
 }
-
-static void
-on_label_changed( GtkEntry *entry, gpointer user_data )
-{
-	g_assert( NACT_IS_WINDOW( user_data ));
-	NactWindow *dialog = NACT_WINDOW( user_data );
-
-	NAAction *edited = NA_ACTION( v_get_edited_action( dialog ));
-	na_action_set_label( edited, gtk_entry_get_text( entry ));
-
-	v_field_modified( dialog );
-}
-
-static void
-on_tooltip_changed( GtkEntry *entry, gpointer user_data )
-{
-	g_assert( NACT_IS_WINDOW( user_data ));
-	NactWindow *dialog = NACT_WINDOW( user_data );
-
-	NAAction *edited = NA_ACTION( v_get_edited_action( dialog ));
-	na_action_set_tooltip( edited, gtk_entry_get_text( entry ));
-
-	v_field_modified( dialog );
-}
-
-static void
-on_icon_changed( GtkEntry *icon_entry, gpointer user_data )
-{
-	static const gchar *thisfn = "nact_imenu_item_on_icon_changed";
-
-	g_assert( NACT_IS_WINDOW( user_data ));
-	NactWindow *dialog = NACT_WINDOW( user_data );
-
-	GtkWidget *image = base_window_get_widget( BASE_WINDOW( dialog ), "IconImage" );
-	g_assert( GTK_IS_WIDGET( image ));
-	const gchar *icon_name = gtk_entry_get_text( icon_entry );
-	g_debug( "%s: icon_name=%s", thisfn, icon_name );
-
-	GtkStockItem stock_item;
-	GdkPixbuf *icon = NULL;
-
-	if( icon_name && strlen( icon_name ) > 0 ){
-
-		/* TODO: code should be mutualized with those IActionsList */
-		if( gtk_stock_lookup( icon_name, &stock_item )){
-			g_debug( "%s: gtk_stock_lookup", thisfn );
-			gtk_image_set_from_stock( GTK_IMAGE( image ), icon_name, GTK_ICON_SIZE_MENU );
-			gtk_widget_show( image );
-
-		} else if( g_file_test( icon_name, G_FILE_TEST_EXISTS ) &&
-					g_file_test( icon_name, G_FILE_TEST_IS_REGULAR )){
-			g_debug( "%s: g_file_test", thisfn );
-			gint width;
-			gint height;
-			GError *error = NULL;
-
-			gtk_icon_size_lookup( GTK_ICON_SIZE_MENU, &width, &height );
-			icon = gdk_pixbuf_new_from_file_at_size( icon_name, width, height, &error );
-			if( error ){
-				g_warning( "%s: gdk_pixbuf_new_from_file_at_size:%s", thisfn, error->message );
-				icon = NULL;
-				g_error_free( error );
-			}
-			gtk_image_set_from_pixbuf( GTK_IMAGE( image ), icon );
-			gtk_widget_show( image );
-
-		} else {
-			g_debug( "%s: not stock, nor file", thisfn );
-			gtk_widget_hide( image );
-		}
-	} else {
-		gtk_widget_hide( image );
-	}
-
-	NAAction *edited = NA_ACTION( v_get_edited_action( dialog ));
-	na_action_set_icon( edited, icon_name );
-
-	v_field_modified( dialog );
-}
-
-/* TODO: replace with a fds-compliant icon chooser */
-static void
-on_icon_browse( GtkButton *button, gpointer user_data )
-{
-	g_assert( NACT_IS_IMENU_ITEM( user_data ));
-
-	GtkWidget *dialog = gtk_file_chooser_dialog_new(
-			_( "Choosing an icon" ),
-			NULL,
-			GTK_FILE_CHOOSER_ACTION_OPEN,
-			GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
-			GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
-			NULL
-			);
-
-	if( gtk_dialog_run( GTK_DIALOG( dialog )) == GTK_RESPONSE_ACCEPT ){
-		gchar *filename = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER( dialog ));
-		GtkWidget *icon_widget = base_window_get_widget( BASE_WINDOW( user_data ), "MenuIconComboBoxEntry" );
-		gtk_entry_set_text( GTK_ENTRY( GTK_BIN( icon_widget )->child ), filename );
-	    g_free (filename);
-	  }
-
-	gtk_widget_destroy( dialog );
-}
diff --git a/src/nact/nact-imenu-item.h b/src/nact/nact-imenu-item.h
index 7f8f136..72be58d 100644
--- a/src/nact/nact-imenu-item.h
+++ b/src/nact/nact-imenu-item.h
@@ -67,6 +67,7 @@ GType    nact_imenu_item_get_type( void );
 void     nact_imenu_item_initial_load( NactWindow *dialog, NAAction *action );
 void     nact_imenu_item_runtime_init( NactWindow *dialog, NAAction *action );
 void     nact_imenu_item_all_widgets_showed( NactWindow *dialog );
+void     nact_imenu_item_dispose( NactWindow *dialog );
 
 gboolean nact_imenu_item_has_label( NactWindow *window );
 
diff --git a/src/nact/nact-import-export.c b/src/nact/nact-import-export.c
index 2ff5deb..b0fa6ee 100644
--- a/src/nact/nact-import-export.c
+++ b/src/nact/nact-import-export.c
@@ -38,20 +38,20 @@
 #include <common/nautilus-actions-config-schema-reader.h>
 #include <common/nautilus-actions-config-schema-writer.h>
 #include <common/nautilus-actions-config-gconf-writer.h>
-#include "nact-utils.h"
+/*#include "nact-utils.h"*/
 #include "nact-import-export.h"
 #include "nact-prefs.h"
 #include "old-nact.h"
 
 /* gui callback functions */
-void import_browse_button_clicked_cb (GtkWidget* widget, gpointer data);
+/*void import_browse_button_clicked_cb (GtkWidget* widget, gpointer data);
 void export_browse_button_clicked_cb (GtkWidget* widget, gpointer data);
 void mode_toggled_cb (GtkWidget* widget, gpointer user_data);
 
 static gboolean nact_import_actions (void);
-static gboolean nact_export_actions (void);
+static gboolean nact_export_actions (void);*/
 
-void
+/*void
 mode_toggled_cb (GtkWidget* widget, gpointer user_data)
 {
 	GtkWidget* import_radio = nact_get_glade_widget_from ("ImportRadioButton", GLADE_IM_EX_PORT_DIALOG_WIDGET);
@@ -66,9 +66,9 @@ mode_toggled_cb (GtkWidget* widget, gpointer user_data)
 		gtk_widget_set_sensitive (nact_get_glade_widget_from ("ExportVBox", GLADE_IM_EX_PORT_DIALOG_WIDGET), TRUE);
 		gtk_widget_set_sensitive (nact_get_glade_widget_from ("ImportVBox", GLADE_IM_EX_PORT_DIALOG_WIDGET), FALSE);
 	}
-}
+}*/
 
-void
+/*void
 import_browse_button_clicked_cb (GtkWidget* widget, gpointer data)
 {
 	gchar* last_dir;
@@ -104,9 +104,9 @@ import_browse_button_clicked_cb (GtkWidget* widget, gpointer data)
 		case GTK_RESPONSE_DELETE_EVENT:
 			gtk_widget_hide (filechooser);
 	}
-}
+}*/
 
-void
+/*void
 export_browse_button_clicked_cb (GtkWidget* widget, gpointer data)
 {
 	gchar* last_dir;
@@ -142,12 +142,11 @@ export_browse_button_clicked_cb (GtkWidget* widget, gpointer data)
 		case GTK_RESPONSE_DELETE_EVENT:
 			gtk_widget_hide (folderchooser);
 	}
-}
+}*/
 
-static void
+/*static void
 list_selection_changed_cb (GtkTreeSelection *selection, gpointer user_data)
 {
-/*
 	GtkWidget *nact_edit_button;
 	GtkWidget *nact_delete_button;
 
@@ -161,22 +160,21 @@ list_selection_changed_cb (GtkTreeSelection *selection, gpointer user_data)
 		gtk_widget_set_sensitive (nact_edit_button, FALSE);
 		gtk_widget_set_sensitive (nact_delete_button, FALSE);
 	}
-*/
-}
+}*/
 
-static void nact_setup_actions_list (GtkWidget *list)
+/*static void nact_setup_actions_list (GtkWidget *list)
 {
 	GtkTreeViewColumn *column;
 	GtkTreeSelection* selection;
 	GtkTreeModel* nact_action_list_model;
 
-	/* Get the model from the main list */
-	nact_action_list_model = gtk_tree_view_get_model (GTK_TREE_VIEW (nact_get_glade_widget ("ActionsList")));
+	*//* Get the model from the main list */
+	/*nact_action_list_model = gtk_tree_view_get_model (GTK_TREE_VIEW (nact_get_glade_widget ("ActionsList")));
 
 	gtk_tree_view_set_model (GTK_TREE_VIEW (list), nact_action_list_model);
-
+*/
 	/* create columns on the tree view */
-	column = gtk_tree_view_column_new_with_attributes (_("Icon"),
+	/*column = gtk_tree_view_column_new_with_attributes (_("Icon"),
 							   gtk_cell_renderer_pixbuf_new (),
 							   "pixbuf", MENU_ICON_COLUMN, NULL);
 	gtk_tree_view_append_column (GTK_TREE_VIEW (list), column);
@@ -188,14 +186,13 @@ static void nact_setup_actions_list (GtkWidget *list)
 
 	selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (list));
 	gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE);
-
+*/
 	/* set up selection */
-	g_signal_connect (G_OBJECT (gtk_tree_view_get_selection (GTK_TREE_VIEW (list))), "changed",
+	/*g_signal_connect (G_OBJECT (gtk_tree_view_get_selection (GTK_TREE_VIEW (list))), "changed",
 			  G_CALLBACK (list_selection_changed_cb), NULL);
+}*/
 
-}
-
-static gboolean
+/*static gboolean
 nact_import_actions (void)
 {
 	gboolean retv = FALSE;
@@ -239,9 +236,9 @@ nact_import_actions (void)
 				retv = TRUE;
 			}
 			else
-			{
+			{*/
 				/* i18n notes: %s is the label of the action (eg, 'Mount ISO') */
-				error_message = g_strdup_printf (_("Action '%s' importation failed!"), action->label);
+				/*error_message = g_strdup_printf (_("Action '%s' importation failed!"), action->label);
 				nautilus_actions_display_error (error_message, error->message);
 				g_error_free (error);
 				g_free (error_message);
@@ -249,9 +246,9 @@ nact_import_actions (void)
 		}
 	}
 	return retv;
-}
+}*/
 
-static gboolean
+/*static gboolean
 nact_export_actions (void)
 {
 	gboolean retv = FALSE;
@@ -285,11 +282,11 @@ nact_export_actions (void)
 			gtk_tree_model_get (model, &iter, UUID_COLUMN, &uuid, -1);
 
 			action = nautilus_actions_config_get_action (NAUTILUS_ACTIONS_CONFIG (config), uuid);
-			/* TODO: Better error handling: deal with the GError param */
-			if (nautilus_actions_config_add_action (NAUTILUS_ACTIONS_CONFIG (schema_writer), action, NULL))
-			{
+			*//* TODO: Better error handling: deal with the GError param */
+			/*if (nautilus_actions_config_add_action (NAUTILUS_ACTIONS_CONFIG (schema_writer), action, NULL))
+			{*/
 				/*nautilus_actions_config_schema_writer_get_saved_filename (schema_writer, action->uuid);*/
-			}
+			/*}
 
 			g_free (uuid);
 		}
@@ -306,13 +303,12 @@ nact_export_actions (void)
 	}
 
 	return retv;
-}
+}*/
 
 gboolean nact_import_export_actions (void)
 {
-	static gboolean init = FALSE;
 	gboolean retv = FALSE;
-	GtkWidget* nact_action_list_tree;
+	/*GtkWidget* nact_action_list_tree;
 	GtkWidget* import_export_dialog;
 	GtkWidget* import_radio;
 	GtkTreeSelection *selection;
@@ -322,11 +318,12 @@ gboolean nact_import_export_actions (void)
 	GtkSizeGroup* button_size_group;
 	gint width, height, x, y;
 	gchar* last_dir;
+	static gboolean init = FALSE;
 
 	if (!init)
-	{
+	{*/
 		/* load the GUI */
-		GladeXML* gui = nact_get_glade_xml_object (GLADE_IM_EX_PORT_DIALOG_WIDGET);
+		/*GladeXML* gui = nact_get_glade_xml_object (GLADE_IM_EX_PORT_DIALOG_WIDGET);
 		if (!gui) {
 			g_error (_("Could not load interface for Nautilus Actions Config Tool"));
 			return FALSE;
@@ -350,8 +347,8 @@ gboolean nact_import_export_actions (void)
 		gtk_size_group_add_widget (button_size_group,
 											nact_get_glade_widget_from ("ExportBrowseButton",
 																		GLADE_IM_EX_PORT_DIALOG_WIDGET));
-		/* free memory */
-		g_object_unref (gui);
+		*//* free memory */
+		/*g_object_unref (gui);
 		init = TRUE;
 	}
 	nact_action_list_tree = nact_get_glade_widget_from ("ExportTreeView", GLADE_IM_EX_PORT_DIALOG_WIDGET);
@@ -361,12 +358,12 @@ gboolean nact_import_export_actions (void)
 	import_export_dialog = nact_get_glade_widget_from (GLADE_IM_EX_PORT_DIALOG_WIDGET, GLADE_IM_EX_PORT_DIALOG_WIDGET);
 
 	import_radio = nact_get_glade_widget_from ("ImportRadioButton", GLADE_IM_EX_PORT_DIALOG_WIDGET);
-
+*/
 	/* Get the default dialog size */
-	gtk_window_get_default_size (GTK_WINDOW (import_export_dialog), &width, &height);
-
+	/*gtk_window_get_default_size (GTK_WINDOW (import_export_dialog), &width, &height);
+*/
 	/* Override with preferred one, if any */
-	nact_prefs_get_im_ex_dialog_size (&width, &height);
+	/*nact_prefs_get_im_ex_dialog_size (&width, &height);
 
 	gtk_window_resize (GTK_WINDOW (import_export_dialog), width, height);
 
@@ -378,20 +375,20 @@ gboolean nact_import_export_actions (void)
 	last_dir = nact_prefs_get_export_last_browsed_dir ();
 	gtk_entry_set_text (GTK_ENTRY (nact_get_glade_widget_from ("ExportEntry", GLADE_IM_EX_PORT_DIALOG_WIDGET)), last_dir);
 	gtk_editable_select_region (GTK_EDITABLE (nact_get_glade_widget_from ("ExportEntry", GLADE_IM_EX_PORT_DIALOG_WIDGET)), 0, -1);
-
+*/
 	/* run the dialog */
-	switch (gtk_dialog_run (GTK_DIALOG (import_export_dialog)))
+	/*switch (gtk_dialog_run (GTK_DIALOG (import_export_dialog)))
 	{
 		case GTK_RESPONSE_OK :
 			if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (import_radio)))
-			{
+			{*/
 				/* Import mode */
-				retv = nact_import_actions ();
+				/*retv = nact_import_actions ();
 			}
 			else
-			{
+			{*/
 				/* Export Mode */
-				retv = nact_export_actions ();
+				/*retv = nact_export_actions ();
 			}
 			break;
 		case GTK_RESPONSE_DELETE_EVENT:
@@ -404,6 +401,6 @@ gboolean nact_import_export_actions (void)
 	nact_prefs_set_im_ex_dialog_position (GTK_WINDOW (import_export_dialog));
 
 	gtk_widget_hide (import_export_dialog);
-
+*/
 	return retv;
 }
diff --git a/src/nact/nact-iprofile-conditions.c b/src/nact/nact-iprofile-conditions.c
index 118761a..d01c19f 100644
--- a/src/nact/nact-iprofile-conditions.c
+++ b/src/nact/nact-iprofile-conditions.c
@@ -62,22 +62,33 @@ static void          interface_base_finalize( NactIProfileConditionsInterface *k
 static GObject      *v_get_edited_profile( NactWindow *window );
 static void          v_field_modified( NactWindow *window );
 
-static gchar        *basenames_to_text( GSList *basenames );
-static GSList       *text_to_basenames( const gchar *text );
-static GtkTreeView  *get_schemes_tree_view( NactWindow *window );
-static GtkTreeModel *get_schemes_tree_model( NactWindow *window );
-static void          create_schemes_selection_list( NactWindow *window );
-static GSList       *get_schemes_default_list( NactWindow *window );
-
 static void          on_path_changed( GtkEntry *entry, gpointer user_data );
 static void          on_path_browse( GtkButton *button, gpointer user_data );
+static GtkWidget    *get_path_widget( NactWindow *window );
 static void          on_parameters_changed( GtkEntry *entry, gpointer user_data );
+static GtkWidget    *get_parameters_widget( NactWindow *window );
+static void          update_example_label( NactWindow *window );
+static gchar        *parse_parameters( NactWindow *window );
+static void          on_legend_clicked( GtkButton *button, gpointer user_data );
+static void          show_legend_dialog( NactWindow *window );
+static void          hide_legend_dialog( NactWindow *window );
+static GtkWidget    *get_legend_button( NactWindow *window );
+static GtkWidget    *get_legend_dialog( NactWindow *window );
+
 static void          on_basenames_changed( GtkEntry *entry, gpointer user_data );
 static void          on_scheme_selection_toggled( GtkCellRendererToggle *renderer, gchar *path, gpointer user_data );
 static void          on_scheme_keyword_edited( GtkCellRendererText *renderer, const gchar *path, const gchar *text, gpointer user_data );
 static void          on_scheme_desc_edited( GtkCellRendererText *renderer, const gchar *path, const gchar *text, gpointer user_data );
 static void          on_scheme_list_selection_changed( GtkTreeSelection *selection, gpointer user_data );
 
+static gchar        *basenames_to_text( GSList *basenames );
+static GSList       *text_to_basenames( const gchar *text );
+static GtkTreeView  *get_schemes_tree_view( NactWindow *window );
+static GtkTreeModel *get_schemes_tree_model( NactWindow *window );
+static void          create_schemes_selection_list( NactWindow *window );
+static gboolean      get_action_schemes_list( GtkTreeModel* scheme_model, GtkTreePath *path, GtkTreeIter* iter, gpointer data );
+static GSList       *get_schemes_default_list( NactWindow *window );
+
 GType
 nact_iprofile_conditions_get_type( void )
 {
@@ -160,25 +171,23 @@ nact_iprofile_conditions_runtime_init( NactWindow *dialog, NAActionProfile *prof
 	static const gchar *thisfn = "nact_iprofile_conditions_runtime_init";
 	g_debug( "%s: dialog=%p, profile=%p", thisfn, dialog, profile );
 
-	GtkWidget *path_widget = base_window_get_widget( BASE_WINDOW( dialog ), "CommandPathEntry" );
+	GtkWidget *path_widget = get_path_widget( dialog );
 	nact_window_signal_connect( dialog, G_OBJECT( path_widget ), "changed", G_CALLBACK( on_path_changed ));
 	gchar *path = na_action_profile_get_path( profile );
-	g_debug( "%s: path=%s", thisfn, path );
 	gtk_entry_set_text( GTK_ENTRY( path_widget ), path );
 	g_free( path );
 
 	GtkWidget *button = base_window_get_widget( BASE_WINDOW( dialog ), "PathBrowseButton" );
 	nact_window_signal_connect( dialog, G_OBJECT( button ), "clicked", G_CALLBACK( on_path_browse ));
 
-	GtkWidget *parameters_widget = base_window_get_widget( BASE_WINDOW( dialog ), "CommandParamsEntry" );
+	GtkWidget *parameters_widget = get_parameters_widget( dialog );
 	nact_window_signal_connect( dialog, G_OBJECT( parameters_widget ), "changed", G_CALLBACK( on_parameters_changed ));
 	gchar *parameters = na_action_profile_get_parameters( profile );
 	gtk_entry_set_text( GTK_ENTRY( parameters_widget ), parameters );
 	g_free( parameters );
 
-	button = base_window_get_widget( BASE_WINDOW( dialog ), "LegendButton" );
-	/* TODO: implement legend button */
-	gtk_widget_set_sensitive( button, FALSE );
+	button = get_legend_button( dialog );
+	nact_window_signal_connect( dialog, G_OBJECT( button ), "clicked", G_CALLBACK( on_legend_clicked ));
 
 	GtkWidget *basenames_widget = base_window_get_widget( BASE_WINDOW( dialog ), "PatternEntry" );
 	nact_window_signal_connect( dialog, G_OBJECT( basenames_widget ), "changed", G_CALLBACK( on_basenames_changed ));
@@ -214,6 +223,17 @@ nact_iprofile_conditions_runtime_init( NactWindow *dialog, NAActionProfile *prof
 	/* TODO: remove scheme */
 }
 
+void
+nact_iprofile_conditions_all_widgets_showed( NactWindow *dialog )
+{
+}
+
+void
+nact_iprofile_conditions_dispose( NactWindow *dialog )
+{
+	hide_legend_dialog( dialog );
+}
+
 static GObject *
 v_get_edited_profile( NactWindow *window )
 {
@@ -236,6 +256,384 @@ v_field_modified( NactWindow *window )
 	}
 }
 
+static void
+on_path_changed( GtkEntry *entry, gpointer user_data )
+{
+	g_assert( NACT_IS_WINDOW( user_data ));
+	NactWindow *dialog = NACT_WINDOW( user_data );
+
+	NAActionProfile *edited = NA_ACTION_PROFILE( v_get_edited_profile( dialog ));
+	na_action_profile_set_path( edited, gtk_entry_get_text( entry ));
+
+	update_example_label( dialog );
+	v_field_modified( dialog );
+}
+
+/* TODO: keep trace of last browsed dir */
+static void
+on_path_browse( GtkButton *button, gpointer user_data )
+{
+	g_assert( NACT_IS_IPROFILE_CONDITIONS( user_data ));
+	gboolean set_current_location = FALSE;
+
+	GtkWidget *dialog = gtk_file_chooser_dialog_new(
+			_( "Choosing a command" ),
+			NULL,
+			GTK_FILE_CHOOSER_ACTION_OPEN,
+			GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+			GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
+			NULL
+			);
+
+	GtkWidget *path_widget = get_path_widget( NACT_WINDOW( user_data ));
+	const gchar *path = gtk_entry_get_text( GTK_ENTRY( path_widget ));
+	if( path && strlen( path )){
+		set_current_location = gtk_file_chooser_set_filename( GTK_FILE_CHOOSER( dialog ), path );
+	}
+
+	if( gtk_dialog_run( GTK_DIALOG( dialog )) == GTK_RESPONSE_ACCEPT ){
+		gchar *filename = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER( dialog ));
+		gtk_entry_set_text( GTK_ENTRY( path_widget ), filename );
+	    g_free (filename);
+	  }
+
+	gtk_widget_destroy( dialog );
+}
+
+static GtkWidget *
+get_path_widget( NactWindow *window )
+{
+	return( base_window_get_widget( BASE_WINDOW( window ), "CommandPathEntry" ));
+}
+
+static void
+on_parameters_changed( GtkEntry *entry, gpointer user_data )
+{
+	g_assert( NACT_IS_WINDOW( user_data ));
+	NactWindow *dialog = NACT_WINDOW( user_data );
+
+	NAActionProfile *edited = NA_ACTION_PROFILE( v_get_edited_profile( dialog ));
+	na_action_profile_set_parameters( edited, gtk_entry_get_text( entry ));
+
+	update_example_label( dialog );
+	v_field_modified( dialog );
+}
+
+static GtkWidget *
+get_parameters_widget( NactWindow *window )
+{
+	return( base_window_get_widget( BASE_WINDOW( window ), "CommandParamsEntry" ));
+}
+
+static void
+update_example_label( NactWindow *window )
+{
+	/*static const char *thisfn = "nact_iprofile_conditions_update_example_label";*/
+
+	static const gchar *original_label = N_( "<i><b><span size=\"small\">e.g., %s</span></b></i>" );
+
+	GtkWidget *example_widget = base_window_get_widget( BASE_WINDOW( window ), "LabelExample" );
+
+	gchar *parameters = parse_parameters( window );
+	/*g_debug( "%s: parameters=%s", thisfn, parameters );*/
+
+	/* convert special xml chars (&, <, >,...) to avoid warnings
+	 * generated by Pango parser
+	 */
+	gchar *new_label = g_markup_printf_escaped( original_label, parameters );
+
+	gtk_label_set_label( GTK_LABEL( example_widget ), new_label );
+	g_free( new_label );
+	g_free( parameters );
+}
+
+/*
+ * Valid parameters :
+ *
+ * %d : base dir of the selected file(s)/folder(s)
+ * %f : the name of the selected file/folder or the 1st one if many are selected
+ * %h : hostname of the GVfs URI
+ * %m : list of the basename of the selected files/directories separated by space.
+ * %M : list of the selected files/directories with their complete path separated by space.
+ * %s : scheme of the GVfs URI
+ * %u : GVfs URI
+ * %U : username of the GVfs URI
+ * %% : a percent sign
+ */
+static gchar *
+parse_parameters( NactWindow *window )
+{
+	GString* tmp_string = g_string_new( "" );
+
+	/* i18n notes: example strings for the command preview */
+	gchar* ex_path = _( "/path/to" );
+	gchar* ex_files[] = { N_( "file1.txt" ), N_( "file2.txt" ), NULL };
+	gchar* ex_dirs[] = { N_(" folder1" ), N_( "folder2" ), NULL };
+	gchar* ex_mixed[] = { N_(" file1.txt" ), N_( "folder1" ), NULL };
+	gchar* ex_scheme_default = "file";
+	gchar* ex_host_default = _( "test.example.net" );
+	gchar* ex_one_file = _( "file.txt" );
+	gchar* ex_one_dir = _( "folder" );
+	gchar* ex_one = NULL;
+	gchar* ex_list = NULL;
+	gchar* ex_path_list = NULL;
+	gchar* ex_scheme;
+	gchar* ex_host;
+
+	const gchar* command = gtk_entry_get_text( GTK_ENTRY( get_path_widget( window )));
+	const gchar* param_template = gtk_entry_get_text( GTK_ENTRY( get_parameters_widget( window )));
+
+	gchar* iter = g_strdup( param_template );
+	gchar* old_iter = iter;
+	gchar* tmp;
+	gchar* separator;
+	gchar* start;
+	GSList* scheme_list = NULL;
+
+	g_string_append_printf( tmp_string, "%s ", command );
+
+	gboolean is_file = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( base_window_get_widget( BASE_WINDOW( window ), "OnlyFilesButton" )));
+	gboolean is_dir = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( base_window_get_widget( BASE_WINDOW( window ), "OnlyFoldersButton" )));
+	if (gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( base_window_get_widget( BASE_WINDOW( window ), "BothButton" )))){
+		is_file = TRUE;
+		is_dir = TRUE;
+	}
+	gboolean accept_multiple = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( base_window_get_widget( BASE_WINDOW( window ), "AcceptMultipleButton" )));
+
+	GtkTreeModel* scheme_model = get_schemes_tree_model( window );
+	gtk_tree_model_foreach( scheme_model, ( GtkTreeModelForeachFunc ) get_action_schemes_list, &scheme_list );
+
+	separator = g_strdup_printf( " %s/", ex_path );
+	start = g_strdup_printf( "%s/", ex_path );
+
+	if( accept_multiple ){
+		if( is_file && is_dir ){
+			ex_one = ex_files[0];
+			ex_list = na_utils_gstring_joinv( NULL, " ", ex_mixed );
+			ex_path_list = na_utils_gstring_joinv( start, separator, ex_mixed );
+
+		} else if( is_dir ){
+			ex_one = ex_dirs[0];
+			ex_list = na_utils_gstring_joinv( NULL, " ", ex_dirs );
+			ex_path_list = na_utils_gstring_joinv( start, separator, ex_dirs );
+
+		} else if( is_file ){
+			ex_one = ex_files[0];
+			ex_list = na_utils_gstring_joinv( NULL, " ", ex_files );
+			ex_path_list = na_utils_gstring_joinv( start, separator, ex_files );
+		}
+	} else {
+		if( is_dir && !is_file ){
+			ex_one = ex_one_dir;
+
+		} else {
+			ex_one = ex_one_file;
+		}
+		ex_list = g_strdup( ex_one );
+		ex_path_list = g_strjoin( "/", ex_path, ex_one, NULL );
+	}
+
+	g_free (start);
+	g_free (separator);
+
+	if( scheme_list != NULL ){
+		ex_scheme = ( gchar * ) scheme_list->data;
+		if( g_ascii_strcasecmp( ex_scheme, "file" ) == 0 ){
+			if( g_slist_length( scheme_list ) > 1 ){
+				ex_scheme = ( gchar * ) scheme_list->next->data;
+				ex_host = ex_host_default;
+			} else {
+				ex_host = "";
+			}
+		} else {
+			ex_host = ex_host_default;
+		}
+	} else {
+		ex_scheme = ex_scheme_default;
+		ex_host = "";
+	}
+
+	while(( iter = g_strstr_len( iter, strlen( iter ), "%" ))){
+		tmp_string = g_string_append_len( tmp_string, old_iter, strlen( old_iter ) - strlen( iter ));
+		switch( iter[1] ){
+
+			case 'd': /* base dir of the selected file(s)/folder(s) */
+				tmp_string = g_string_append( tmp_string, ex_path );
+				break;
+
+			case 'f': /* the basename of the selected file/folder or the 1st one if many are selected */
+				tmp_string = g_string_append( tmp_string, ex_one );
+				break;
+
+			case 'h': /* hostname of the GVfs URI */
+				tmp_string = g_string_append( tmp_string, ex_host );
+				break;
+
+			case 'm': /* list of the basename of the selected files/directories separated by space */
+				tmp_string = g_string_append( tmp_string, ex_list );
+				break;
+
+			case 'M': /* list of the selected files/directories with their complete path separated by space. */
+				tmp_string = g_string_append( tmp_string, ex_path_list );
+				break;
+
+			case 's': /* scheme of the GVfs URI */
+				tmp_string = g_string_append( tmp_string, ex_scheme );
+				break;
+
+			case 'u': /* GVfs URI */
+				tmp = g_strjoin( NULL, ex_scheme, "://", ex_path, "/", ex_one, NULL );
+				tmp_string = g_string_append( tmp_string, tmp );
+				g_free( tmp );
+				break;
+
+			case 'U': /* username of the GVfs URI */
+				tmp_string = g_string_append( tmp_string, "root" );
+				break;
+
+			case '%': /* a percent sign */
+				tmp_string = g_string_append_c( tmp_string, '%' );
+				break;
+		}
+		iter+=2; /* skip the % sign and the character after. */
+		old_iter = iter; /* store the new start of the string */
+	}
+	tmp_string = g_string_append_len( tmp_string, old_iter, strlen( old_iter ));
+
+	g_free( ex_list );
+	g_free( ex_path_list );
+	g_free( iter );
+
+	return( g_string_free( tmp_string, FALSE ));
+}
+
+static void
+on_legend_clicked( GtkButton *button, gpointer user_data )
+{
+	g_assert( NACT_IS_IPROFILE_CONDITIONS( user_data ));
+
+	if( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( button ))){
+		show_legend_dialog( NACT_WINDOW( user_data ));
+
+	} else {
+		hide_legend_dialog( NACT_WINDOW( user_data ));
+	}
+}
+
+/* TODO: get back the last position saved */
+static void
+show_legend_dialog( NactWindow *window )
+{
+	GtkWidget *legend_dialog = get_legend_dialog( window );
+	gtk_window_set_deletable( GTK_WINDOW( legend_dialog ), FALSE );
+
+	GtkWindow *toplevel = base_window_get_toplevel_widget( BASE_WINDOW( window ));
+	gtk_window_set_transient_for( GTK_WINDOW( legend_dialog ), toplevel );
+
+	gtk_widget_show( legend_dialog );
+}
+
+/* TODO: save the current position */
+static void
+hide_legend_dialog( NactWindow *window )
+{
+	GtkWidget *legend_dialog = get_legend_dialog( window );
+	gtk_widget_hide( legend_dialog );
+
+	/* set the legend button state consistent for when the dialog is
+	 * hidden by another mean (eg. close the edit profile dialog)
+	 */
+	GtkWidget *legend_button = get_legend_button( window );
+	gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( legend_button ), FALSE );
+}
+
+static GtkWidget *
+get_legend_button( NactWindow *window )
+{
+	return( base_window_get_widget( BASE_WINDOW( window ), "LegendButton" ));
+}
+
+static GtkWidget *
+get_legend_dialog( NactWindow *window )
+{
+	return( base_window_get_widget( BASE_WINDOW( window ), "LegendDialog" ));
+}
+
+static void
+on_basenames_changed( GtkEntry *entry, gpointer user_data )
+{
+	g_assert( NACT_IS_WINDOW( user_data ));
+	NactWindow *dialog = NACT_WINDOW( user_data );
+
+	NAActionProfile *edited = NA_ACTION_PROFILE( v_get_edited_profile( dialog ));
+	const gchar *text = gtk_entry_get_text( entry );
+	GSList *basenames = text_to_basenames( text );
+	na_action_profile_set_basenames( edited, basenames );
+	na_utils_free_string_list( basenames );
+
+	v_field_modified( dialog );
+}
+
+static void
+on_scheme_selection_toggled( GtkCellRendererToggle *renderer, gchar *path, gpointer user_data )
+{
+	/*static const gchar *thisfn = "nact_iprofile_conditions_on_scheme_selection_changed";
+	g_debug( "%s: renderer=%p, path=%s, user_data=%p", thisfn, renderer, path, user_data );*/
+	g_assert( NACT_IS_WINDOW( user_data ));
+	NactWindow *dialog = NACT_WINDOW( user_data );
+
+	GtkTreeModel *model = get_schemes_tree_model( dialog );
+	GtkTreePath *tree_path = gtk_tree_path_new_from_string( path );
+	GtkTreeIter iter;
+	gboolean state;
+	gtk_tree_model_get_iter( model, &iter, tree_path );
+	gtk_tree_model_get( model, &iter, SCHEMES_CHECKBOX_COLUMN, &state, -1 );
+	gtk_list_store_set( GTK_LIST_STORE( model ), &iter, SCHEMES_CHECKBOX_COLUMN, !state, -1 );
+	gtk_tree_path_free( tree_path );
+
+	/* TODO set profile scheme selection */
+	/*NAActionProfile *edited = NA_ACTION_PROFILE( v_get_edited_profile( dialog ));*/
+	/*na_action_set_label( edited, gtk_entry_get_text( entry ));*/
+
+	v_field_modified( dialog );
+}
+
+static void
+on_scheme_keyword_edited( GtkCellRendererText *renderer, const gchar *path, const gchar *text, gpointer user_data )
+{
+	static const gchar *thisfn = "nact_iprofile_conditions_on_scheme_keyword_edited";
+	g_debug( "%s: renderer=%p, path=%s, text=%s, user_data=%p", thisfn, renderer, path, text, user_data );
+
+	g_assert( NACT_IS_WINDOW( user_data ));
+	NactWindow *dialog = NACT_WINDOW( user_data );
+
+	v_field_modified( dialog );
+}
+
+static void
+on_scheme_desc_edited( GtkCellRendererText *renderer, const gchar *path, const gchar *text, gpointer user_data )
+{
+	static const gchar *thisfn = "nact_iprofile_conditions_on_scheme_desc_edited";
+	g_debug( "%s: renderer=%p, path=%s, text=%s, user_data=%p", thisfn, renderer, path, text, user_data );
+
+	g_assert( NACT_IS_WINDOW( user_data ));
+	NactWindow *dialog = NACT_WINDOW( user_data );
+
+	v_field_modified( dialog );
+}
+
+static void
+on_scheme_list_selection_changed( GtkTreeSelection *selection, gpointer user_data )
+{
+	static const gchar *thisfn = "nact_iprofile_conditions_on_scheme_list_selection_changed";
+	g_debug( "%s: selection=%p, user_data=%p", thisfn, selection, user_data );
+
+	g_assert( NACT_IS_WINDOW( user_data ));
+	NactWindow *dialog = NACT_WINDOW( user_data );
+
+	v_field_modified( dialog );
+}
+
 static gchar *
 basenames_to_text( GSList *basenames )
 {
@@ -357,6 +755,30 @@ create_schemes_selection_list( NactWindow *window )
 	gtk_tree_view_append_column( GTK_TREE_VIEW( listview ), column );
 }
 
+static gboolean
+get_action_schemes_list( GtkTreeModel* scheme_model, GtkTreePath *path, GtkTreeIter* iter, gpointer data )
+{
+	static const char *thisfn = "nact_iprofile_conditions_get_action_schemes_list";
+
+	GSList** list = data;
+	gboolean toggle_state;
+	gchar* scheme;
+
+	gtk_tree_model_get (scheme_model, iter, SCHEMES_CHECKBOX_COLUMN, &toggle_state, SCHEMES_KEYWORD_COLUMN, &scheme, -1);
+
+	if (toggle_state)
+	{
+		g_debug( "%s: adding '%s' scheme", thisfn, scheme );
+		(*list) = g_slist_append ((*list), scheme);
+	}
+	else
+	{
+		g_free (scheme);
+	}
+
+	return FALSE; /* Don't stop looping */
+}
+
 static GSList *
 get_schemes_default_list( NactWindow *window )
 {
@@ -375,134 +797,3 @@ get_schemes_default_list( NactWindow *window )
 
 	return( list );
 }
-
-/* TODO: update label example when path or parameters changed */
-static void
-on_path_changed( GtkEntry *entry, gpointer user_data )
-{
-	g_assert( NACT_IS_WINDOW( user_data ));
-	NactWindow *dialog = NACT_WINDOW( user_data );
-
-	NAActionProfile *edited = NA_ACTION_PROFILE( v_get_edited_profile( dialog ));
-	na_action_profile_set_path( edited, gtk_entry_get_text( entry ));
-
-	v_field_modified( dialog );
-}
-
-/* TODO: keep trace of last browsed dir */
-static void
-on_path_browse( GtkButton *button, gpointer user_data )
-{
-	g_assert( NACT_IS_IPROFILE_CONDITIONS( user_data ));
-	gboolean set_current_location = FALSE;
-
-	GtkWidget *dialog = gtk_file_chooser_dialog_new(
-			_( "Choosing a command" ),
-			NULL,
-			GTK_FILE_CHOOSER_ACTION_OPEN,
-			GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
-			GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
-			NULL
-			);
-
-	GtkWidget *path_widget = base_window_get_widget( BASE_WINDOW( user_data ), "CommandPathEntry" );
-	const gchar *path = gtk_entry_get_text( GTK_ENTRY( path_widget ));
-	if( path && strlen( path )){
-		set_current_location = gtk_file_chooser_set_filename( GTK_FILE_CHOOSER( dialog ), path );
-	}
-
-	if( gtk_dialog_run( GTK_DIALOG( dialog )) == GTK_RESPONSE_ACCEPT ){
-		gchar *filename = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER( dialog ));
-		gtk_entry_set_text( GTK_ENTRY( path_widget ), filename );
-	    g_free (filename);
-	  }
-
-	gtk_widget_destroy( dialog );
-}
-
-static void
-on_parameters_changed( GtkEntry *entry, gpointer user_data )
-{
-	g_assert( NACT_IS_WINDOW( user_data ));
-	NactWindow *dialog = NACT_WINDOW( user_data );
-
-	NAActionProfile *edited = NA_ACTION_PROFILE( v_get_edited_profile( dialog ));
-	na_action_profile_set_parameters( edited, gtk_entry_get_text( entry ));
-
-	v_field_modified( dialog );
-}
-
-static void
-on_basenames_changed( GtkEntry *entry, gpointer user_data )
-{
-	g_assert( NACT_IS_WINDOW( user_data ));
-	NactWindow *dialog = NACT_WINDOW( user_data );
-
-	NAActionProfile *edited = NA_ACTION_PROFILE( v_get_edited_profile( dialog ));
-	const gchar *text = gtk_entry_get_text( entry );
-	GSList *basenames = text_to_basenames( text );
-	na_action_profile_set_basenames( edited, basenames );
-	na_utils_free_string_list( basenames );
-
-	v_field_modified( dialog );
-}
-
-static void
-on_scheme_selection_toggled( GtkCellRendererToggle *renderer, gchar *path, gpointer user_data )
-{
-	/*static const gchar *thisfn = "nact_iprofile_conditions_on_scheme_selection_changed";
-	g_debug( "%s: renderer=%p, path=%s, user_data=%p", thisfn, renderer, path, user_data );*/
-	g_assert( NACT_IS_WINDOW( user_data ));
-	NactWindow *dialog = NACT_WINDOW( user_data );
-
-	GtkTreeModel *model = get_schemes_tree_model( dialog );
-	GtkTreePath *tree_path = gtk_tree_path_new_from_string( path );
-	GtkTreeIter iter;
-	gboolean state;
-	gtk_tree_model_get_iter( model, &iter, tree_path );
-	gtk_tree_model_get( model, &iter, SCHEMES_CHECKBOX_COLUMN, &state, -1 );
-	gtk_list_store_set( GTK_LIST_STORE( model ), &iter, SCHEMES_CHECKBOX_COLUMN, !state, -1 );
-	gtk_tree_path_free( tree_path );
-
-	/* TODO set profile scheme selection */
-	/*NAActionProfile *edited = NA_ACTION_PROFILE( v_get_edited_profile( dialog ));*/
-	/*na_action_set_label( edited, gtk_entry_get_text( entry ));*/
-
-	v_field_modified( dialog );
-}
-
-static void
-on_scheme_keyword_edited( GtkCellRendererText *renderer, const gchar *path, const gchar *text, gpointer user_data )
-{
-	static const gchar *thisfn = "nact_iprofile_conditions_on_scheme_keyword_edited";
-	g_debug( "%s: renderer=%p, path=%s, text=%s, user_data=%p", thisfn, renderer, path, text, user_data );
-
-	g_assert( NACT_IS_WINDOW( user_data ));
-	NactWindow *dialog = NACT_WINDOW( user_data );
-
-	v_field_modified( dialog );
-}
-
-static void
-on_scheme_desc_edited( GtkCellRendererText *renderer, const gchar *path, const gchar *text, gpointer user_data )
-{
-	static const gchar *thisfn = "nact_iprofile_conditions_on_scheme_desc_edited";
-	g_debug( "%s: renderer=%p, path=%s, text=%s, user_data=%p", thisfn, renderer, path, text, user_data );
-
-	g_assert( NACT_IS_WINDOW( user_data ));
-	NactWindow *dialog = NACT_WINDOW( user_data );
-
-	v_field_modified( dialog );
-}
-
-static void
-on_scheme_list_selection_changed( GtkTreeSelection *selection, gpointer user_data )
-{
-	static const gchar *thisfn = "nact_iprofile_conditions_on_scheme_list_selection_changed";
-	g_debug( "%s: selection=%p, user_data=%p", thisfn, selection, user_data );
-
-	g_assert( NACT_IS_WINDOW( user_data ));
-	NactWindow *dialog = NACT_WINDOW( user_data );
-
-	v_field_modified( dialog );
-}
diff --git a/src/nact/nact-iprofile-conditions.h b/src/nact/nact-iprofile-conditions.h
index f79f038..456acda 100644
--- a/src/nact/nact-iprofile-conditions.h
+++ b/src/nact/nact-iprofile-conditions.h
@@ -67,6 +67,8 @@ GType    nact_iprofile_conditions_get_type( void );
 
 void     nact_iprofile_conditions_initial_load( NactWindow *dialog, NAActionProfile *profile );
 void     nact_iprofile_conditions_runtime_init( NactWindow *dialog, NAActionProfile *profile );
+void     nact_iprofile_conditions_all_widgets_showed( NactWindow *dialog );
+void     nact_iprofile_conditions_dispose( NactWindow *dialog );
 
 G_END_DECLS
 
diff --git a/src/nact/nautilus-actions-config.ui b/src/nact/nautilus-actions-config.ui
index e4ad3f9..a84c081 100644
--- a/src/nact/nautilus-actions-config.ui
+++ b/src/nact/nautilus-actions-config.ui
@@ -596,7 +596,6 @@
                           <object class="GtkLabel" id="LabelExample">
                             <property name="visible">True</property>
                             <property name="xalign">0</property>
-                            <property name="label" translatable="yes">&lt;i&gt;&lt;b&gt;&lt;span size="small"&gt;e.g., %s&lt;/span&gt;&lt;/b&gt;&lt;/i&gt;</property>
                             <property name="use_markup">True</property>
                             <property name="wrap">True</property>
                           </object>
@@ -1037,4 +1036,205 @@
       <action-widget response="-5">SaveButton</action-widget>
     </action-widgets>
   </object>
+  <object class="GtkWindow" id="LegendDialog">
+    <property name="resizable">False</property>
+    <property name="window_position">mouse</property>
+    <property name="type_hint">dialog</property>
+    <child>
+      <object class="GtkVBox" id="vbox11">
+        <property name="visible">True</property>
+        <property name="border_width">12</property>
+        <property name="spacing">6</property>
+        <child>
+          <object class="GtkHBox" id="hbox11">
+            <property name="visible">True</property>
+            <property name="spacing">6</property>
+            <child>
+              <object class="GtkImage" id="image9">
+                <property name="visible">True</property>
+                <property name="stock">gtk-help</property>
+                <property name="icon-size">4</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label25">
+                <property name="visible">True</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">&lt;span size="larger"&gt;&lt;b&gt;Parameter Legend&lt;/b&gt;&lt;/span&gt;</property>
+                <property name="use_markup">True</property>
+              </object>
+              <packing>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkHSeparator" id="hseparator1">
+            <property name="visible">True</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkVBox" id="vbox397">
+            <property name="visible">True</property>
+            <property name="spacing">6</property>
+            <child>
+              <object class="GtkLabel" id="label17">
+                <property name="visible">True</property>
+                <property name="xalign">0</property>
+                <property name="yalign">0</property>
+                <property name="label" translatable="yes">&lt;b&gt;%d&lt;/b&gt;: base folder of the selected file(s)</property>
+                <property name="use_markup">True</property>
+                <property name="wrap">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label21">
+                <property name="visible">True</property>
+                <property name="xalign">0</property>
+                <property name="yalign">0</property>
+                <property name="label" translatable="yes">&lt;b&gt;%f&lt;/b&gt;: the name of the selected file or the 1st one if many are selected</property>
+                <property name="use_markup">True</property>
+                <property name="wrap">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label18">
+                <property name="visible">True</property>
+                <property name="xalign">0</property>
+                <property name="yalign">0</property>
+                <property name="label" translatable="yes">&lt;b&gt;%h&lt;/b&gt;: hostname of the GVFS URI</property>
+                <property name="use_markup">True</property>
+                <property name="wrap">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label33">
+                <property name="visible">True</property>
+                <property name="xalign">0</property>
+                <property name="yalign">0</property>
+                <property name="label" translatable="yes">&lt;b&gt;%m&lt;/b&gt;: space-separated list of the basenames of the selected
+file(s)/folder(s)</property>
+                <property name="use_markup">True</property>
+                <property name="wrap">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">3</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label23">
+                <property name="visible">True</property>
+                <property name="xalign">0</property>
+                <property name="yalign">0</property>
+                <property name="label" translatable="yes">&lt;b&gt;%M&lt;/b&gt;: space-separated list of the selected file(s)/folder(s) with their full paths</property>
+                <property name="use_markup">True</property>
+                <property name="wrap">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">4</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label16">
+                <property name="visible">True</property>
+                <property name="xalign">0</property>
+                <property name="yalign">0</property>
+                <property name="label" translatable="yes">&lt;b&gt;%s&lt;/b&gt;: scheme of the GVFS URI</property>
+                <property name="use_markup">True</property>
+                <property name="wrap">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">5</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label15">
+                <property name="visible">True</property>
+                <property name="xalign">0</property>
+                <property name="yalign">0</property>
+                <property name="label" translatable="yes">&lt;b&gt;%u&lt;/b&gt;: GVFS URI</property>
+                <property name="use_markup">True</property>
+                <property name="wrap">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">6</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label20">
+                <property name="visible">True</property>
+                <property name="xalign">0</property>
+                <property name="yalign">0</property>
+                <property name="label" translatable="yes">&lt;b&gt;%U&lt;/b&gt;: username of the GVFS URI</property>
+                <property name="use_markup">True</property>
+                <property name="wrap">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">7</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label22">
+                <property name="visible">True</property>
+                <property name="xalign">0</property>
+                <property name="yalign">0</property>
+                <property name="label" translatable="yes">&lt;b&gt;%%&lt;/b&gt;: a percent sign</property>
+                <property name="use_markup">True</property>
+                <property name="wrap">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">8</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="position">2</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
 </interface>



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