[nautilus-actions] Define edition of scheme conditions



commit 853ffd0d15f9b52fa9502db872e5e311a4ce4918
Author: Pierre Wieser <pwieser trychlos org>
Date:   Wed Jun 9 22:58:37 2010 +0200

    Define edition of scheme conditions

 ChangeLog                                |   27 ++
 TODO                                     |    3 +
 src/api/na-core-utils.h                  |    1 +
 src/core/na-core-utils.c                 |   33 ++
 src/nact/Makefile.am                     |    2 +
 src/nact/nact-add-scheme-dialog.c        |  410 +++++++++++++++++++
 src/nact/nact-add-scheme-dialog.h        |   76 ++++
 src/nact/nact-add-scheme.ui              |   28 +-
 src/nact/nact-ibasenames-tab.c           |    1 -
 src/nact/nact-ifolders-tab.c             |   25 +-
 src/nact/nact-imimetypes-tab.c           |    1 -
 src/nact/nact-ischemes-tab.c             |   43 ++-
 src/nact/nact-main-menubar.c             |    2 +-
 src/nact/nact-match-list.c               |   76 ++--
 src/nact/nact-match-list.h               |    7 +-
 src/nact/nact-preferences-editor.c       |    6 +-
 src/nact/nact-preferences.ui             |    2 +-
 src/nact/nact-schemes-list.c             |  649 ++++++++++++++----------------
 src/nact/nact-schemes-list.h             |   56 +++-
 src/nact/nautilus-actions-config-tool.ui |  145 +++++--
 20 files changed, 1130 insertions(+), 463 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index a18e08c..2366e06 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,33 @@
 
 	* src/core/na-iabout.c: Update copyright notice.
 
+2010-06-09 Pierre Wieser <pwieser trychlos org>
+
+	* src/api/na-core-utils.h:
+	* src/api/na-core-utils.c (na_core_utils_slist_find_negated):
+	New function.
+
+	* src/nact/nact-add-scheme-dialog.c:
+	* src/nact/nact-add-scheme-dialog.h: New files.
+
+	* src/nact/Makefile.am: Updated accordingly.
+
+	* src/nact/nact-main-menubar.c: Update test for Gtk+ version.
+
+	* src/nact/nact-match-list.c:
+	* src/nact/nact-match-list.h: Remove on_add callback.
+
+	* src/nact/nact-ibasenames-tab.c:
+	* src/nact/nact-ifolders-tab.c:
+	* src/nact/nact-imimetypes-tab.c:
+	* src/nact/nact-ischemes-tab.c:
+	* src/nact/nact-preferences-editor.c: Updated accordingly.
+
+	* src/nact/nact-schemes-list.c:
+	* src/nact/nact-schemes-list.h
+	(nact_schemes_list_show_all, nact_schemes_list_get_current_scheme):
+	New functions.
+
 2010-06-07 Pierre Wieser <pwieser trychlos org>
 
 	* src/nact/nact-add-scheme.ui: New file.
diff --git a/TODO b/TODO
index 6b33fba..3f769b8 100644
--- a/TODO
+++ b/TODO
@@ -477,3 +477,6 @@ Parameter 	Description
   when version is recorded (as 1.4.1 or 2.0) then schemes is reliable
   when version is not recorded, it is a 2.30 serie, and scheme is not recorded when default (i.e. file)
   do not try to force anything than that, but this will have to be documented
+
+- ui.enhancement: let the user edit the current default schemes 
+  when adding from defaults for a #NAIContext
diff --git a/src/api/na-core-utils.h b/src/api/na-core-utils.h
index bb15faa..b438481 100644
--- a/src/api/na-core-utils.h
+++ b/src/api/na-core-utils.h
@@ -65,6 +65,7 @@ GSList  *na_core_utils_slist_remove_utf8( GSList *list, const gchar *string );
 gchar  **na_core_utils_slist_to_array( GSList *slist );
 gchar   *na_core_utils_slist_to_text( GSList *list );
 gboolean na_core_utils_slist_find( GSList *list, const gchar *str );
+gboolean na_core_utils_slist_find_negated( GSList *list, const gchar *str );
 gboolean na_core_utils_slist_are_equal( GSList *a, GSList *b );
 void     na_core_utils_slist_free( GSList *slist );
 
diff --git a/src/core/na-core-utils.c b/src/core/na-core-utils.c
index 37e49b7..7755df2 100644
--- a/src/core/na-core-utils.c
+++ b/src/core/na-core-utils.c
@@ -470,6 +470,39 @@ na_core_utils_slist_find( GSList *list, const gchar *str )
 }
 
 /**
+ * na_core_utils_slist_find_negated:
+ * @list: the GSList of strings to be searched.
+ * @str: the searched string.
+ *
+ * Search for a string in a string list which may contain nagated items.
+ *
+ * Returns: %TRUE if the string has been found in list.
+ */
+gboolean
+na_core_utils_slist_find_negated( GSList *list, const gchar *str )
+{
+	GSList *il;
+
+	for( il = list ; il ; il = il->next ){
+		const gchar *istr = g_strstrip( g_strdup( ( const gchar * ) il->data ));
+
+		if( istr[0] == '!' ){
+			gchar *istrdup = g_strdup( istr+1 );
+			int match = na_core_utils_str_collate( str, istrdup );
+			g_free( istrdup );
+			if( match == 0 ){
+				return( TRUE );
+			}
+
+		} else if( na_core_utils_str_collate( str, istr ) == 0 ){
+				return( TRUE );
+		}
+	}
+
+	return( FALSE );
+}
+
+/**
  * na_core_utils_slist_are_equal:
  * @first: a GSList of strings.
  * @second: another GSList of strings to be compared with @first.
diff --git a/src/nact/Makefile.am b/src/nact/Makefile.am
index 44b63cc..cb1bcad 100644
--- a/src/nact/Makefile.am
+++ b/src/nact/Makefile.am
@@ -70,6 +70,8 @@ nautilus_actions_config_tool_SOURCES = \
 	egg-sm-client-xsmp.c								\
 	egg-tree-multi-dnd.c								\
 	egg-tree-multi-dnd.h								\
+	nact-add-scheme-dialog.c							\
+	nact-add-scheme-dialog.h							\
 	nact-application.c									\
 	nact-application.h									\
 	nact-assistant-export.c								\
diff --git a/src/nact/nact-add-scheme-dialog.c b/src/nact/nact-add-scheme-dialog.c
new file mode 100644
index 0000000..1491d8b
--- /dev/null
+++ b/src/nact/nact-add-scheme-dialog.c
@@ -0,0 +1,410 @@
+/*
+ * Nautilus Actions
+ * A Nautilus extension which offers configurable context menu actions.
+ *
+ * Copyright (C) 2005 The GNOME Foundation
+ * Copyright (C) 2006, 2007, 2008 Frederic Ruaudel and others (see AUTHORS)
+ * Copyright (C) 2009, 2010 Pierre Wieser and others (see AUTHORS)
+ *
+ * This Program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this Library; see the file COPYING.  If not,
+ * write to the Free Software Foundation, Inc., 59 Temple Place,
+ * Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Authors:
+ *   Frederic Ruaudel <grumz grumz net>
+ *   Rodrigo Moya <rodrigo gnome-db org>
+ *   Pierre Wieser <pwieser trychlos org>
+ *   ... and many others (see AUTHORS)
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <api/na-core-utils.h>
+
+#include "nact-schemes-list.h"
+#include "nact-add-scheme-dialog.h"
+
+/* private class data
+ */
+struct NactAddSchemeDialogClassPrivate {
+	void *empty;						/* so that gcc -pedantic is happy */
+};
+
+/* private instance data
+ */
+struct NactAddSchemeDialogPrivate {
+	gboolean dispose_has_run;
+	GSList  *already_used;
+	gchar   *scheme;
+};
+
+static GObjectClass *st_parent_class = NULL;
+
+static GType    register_type( void );
+static void     class_init( NactAddSchemeDialogClass *klass );
+static void     instance_init( GTypeInstance *instance, gpointer klass );
+static void     instance_dispose( GObject *dialog );
+static void     instance_finalize( GObject *dialog );
+
+static NactAddSchemeDialog *add_scheme_dialog_new( BaseWindow *parent );
+
+static gchar   *base_get_iprefs_window_id( const BaseWindow *window );
+static gchar   *base_get_dialog_name( const BaseWindow *window );
+static gchar   *base_get_ui_filename( const BaseWindow *dialog );
+static void     on_base_initial_load_dialog( NactAddSchemeDialog *editor, gpointer user_data );
+static void     on_base_runtime_init_dialog( NactAddSchemeDialog *editor, gpointer user_data );
+static void     on_base_all_widgets_showed( NactAddSchemeDialog *editor, gpointer user_data );
+static void     on_cancel_clicked( GtkButton *button, NactAddSchemeDialog *editor );
+static void     on_ok_clicked( GtkButton *button, NactAddSchemeDialog *editor );
+static void     on_selection_changed( const gchar *scheme, gboolean used, NactAddSchemeDialog *dialog );
+static gboolean base_dialog_response( GtkDialog *dialog, gint code, BaseWindow *window );
+static void     validate_dialog( NactAddSchemeDialog *editor );
+
+GType
+nact_add_scheme_dialog_get_type( void )
+{
+	static GType dialog_type = 0;
+
+	if( !dialog_type ){
+		dialog_type = register_type();
+	}
+
+	return( dialog_type );
+}
+
+static GType
+register_type( void )
+{
+	static const gchar *thisfn = "nact_add_scheme_dialog_register_type";
+	GType type;
+
+	static GTypeInfo info = {
+		sizeof( NactAddSchemeDialogClass ),
+		( GBaseInitFunc ) NULL,
+		( GBaseFinalizeFunc ) NULL,
+		( GClassInitFunc ) class_init,
+		NULL,
+		NULL,
+		sizeof( NactAddSchemeDialog ),
+		0,
+		( GInstanceInitFunc ) instance_init
+	};
+
+	g_debug( "%s", thisfn );
+
+	type = g_type_register_static( BASE_DIALOG_TYPE, "NactAddSchemeDialog", &info, 0 );
+
+	return( type );
+}
+
+static void
+class_init( NactAddSchemeDialogClass *klass )
+{
+	static const gchar *thisfn = "nact_add_scheme_dialog_class_init";
+	GObjectClass *object_class;
+	BaseWindowClass *base_class;
+
+	g_debug( "%s: klass=%p", thisfn, ( void * ) klass );
+
+	st_parent_class = g_type_class_peek_parent( klass );
+
+	object_class = G_OBJECT_CLASS( klass );
+	object_class->dispose = instance_dispose;
+	object_class->finalize = instance_finalize;
+
+	klass->private = g_new0( NactAddSchemeDialogClassPrivate, 1 );
+
+	base_class = BASE_WINDOW_CLASS( klass );
+	base_class->dialog_response = base_dialog_response;
+	base_class->get_toplevel_name = base_get_dialog_name;
+	base_class->get_iprefs_window_id = base_get_iprefs_window_id;
+	base_class->get_ui_filename = base_get_ui_filename;
+}
+
+static void
+instance_init( GTypeInstance *instance, gpointer klass )
+{
+	static const gchar *thisfn = "nact_add_scheme_dialog_instance_init";
+	NactAddSchemeDialog *self;
+
+	g_return_if_fail( NACT_IS_ADD_SCHEME_DIALOG( instance ));
+	g_debug( "%s: instance=%p, klass=%p", thisfn, ( void * ) instance, ( void * ) klass );
+	self = NACT_ADD_SCHEME_DIALOG( instance );
+
+	self->private = g_new0( NactAddSchemeDialogPrivate, 1 );
+
+	base_window_signal_connect(
+			BASE_WINDOW( instance ),
+			G_OBJECT( instance ),
+			BASE_WINDOW_SIGNAL_INITIAL_LOAD,
+			G_CALLBACK( on_base_initial_load_dialog ));
+
+	base_window_signal_connect(
+			BASE_WINDOW( instance ),
+			G_OBJECT( instance ),
+			BASE_WINDOW_SIGNAL_RUNTIME_INIT,
+			G_CALLBACK( on_base_runtime_init_dialog ));
+
+	base_window_signal_connect(
+			BASE_WINDOW( instance ),
+			G_OBJECT( instance ),
+			BASE_WINDOW_SIGNAL_ALL_WIDGETS_SHOWED,
+			G_CALLBACK( on_base_all_widgets_showed));
+
+	self->private->dispose_has_run = FALSE;
+	self->private->scheme = NULL;
+}
+
+static void
+instance_dispose( GObject *dialog )
+{
+	static const gchar *thisfn = "nact_add_scheme_dialog_instance_dispose";
+	NactAddSchemeDialog *self;
+	GtkTreeView *listview;
+	GtkTreeModel *model;
+	GtkTreeSelection *selection;
+
+	g_return_if_fail( NACT_IS_ADD_SCHEME_DIALOG( dialog ));
+	g_debug( "%s: dialog=%p", thisfn, ( void * ) dialog );
+	self = NACT_ADD_SCHEME_DIALOG( dialog );
+
+	if( !self->private->dispose_has_run ){
+
+		self->private->dispose_has_run = TRUE;
+
+		listview = GTK_TREE_VIEW( base_window_get_widget( BASE_WINDOW( dialog ), "SchemesTreeView" ));
+		model = gtk_tree_view_get_model( listview );
+		selection = gtk_tree_view_get_selection( listview );
+		gtk_tree_selection_unselect_all( selection );
+		gtk_list_store_clear( GTK_LIST_STORE( model ));
+
+		/* chain up to the parent class */
+		if( G_OBJECT_CLASS( st_parent_class )->dispose ){
+			G_OBJECT_CLASS( st_parent_class )->dispose( dialog );
+		}
+	}
+}
+
+static void
+instance_finalize( GObject *dialog )
+{
+	static const gchar *thisfn = "nact_add_scheme_dialog_instance_finalize";
+	NactAddSchemeDialog *self;
+
+	g_return_if_fail( NACT_IS_ADD_SCHEME_DIALOG( dialog ));
+	g_debug( "%s: dialog=%p", thisfn, ( void * ) dialog );
+	self = NACT_ADD_SCHEME_DIALOG( dialog );
+
+	na_core_utils_slist_free( self->private->already_used );
+	g_free( self->private->scheme );
+
+	g_free( self->private );
+
+	/* chain call to parent class */
+	if( G_OBJECT_CLASS( st_parent_class )->finalize ){
+		G_OBJECT_CLASS( st_parent_class )->finalize( dialog );
+	}
+}
+
+/*
+ * Returns a newly allocated NactAddSchemeDialog object.
+ *
+ * @parent: the BaseWindow parent of this dialog (usually, the main
+ * toplevel window of the application).
+ */
+static NactAddSchemeDialog *
+add_scheme_dialog_new( BaseWindow *parent )
+{
+	return( g_object_new( NACT_ADD_SCHEME_DIALOG_TYPE, BASE_WINDOW_PROP_PARENT, parent, NULL ));
+}
+
+/**
+ * nact_add_scheme_dialog_run:
+ * @parent: the BaseWindow parent of this dialog
+ *  (usually the NactMainWindow).
+ * @schemes: list of already used schemes.
+ *
+ * Initializes and runs the dialog.
+ *
+ * Returns: the selected scheme, as a newly allocated string which should
+ * be g_free() by the caller, or NULL.
+ */
+gchar *
+nact_add_scheme_dialog_run( BaseWindow *parent, GSList *schemes )
+{
+	static const gchar *thisfn = "nact_add_scheme_dialog_run";
+	NactAddSchemeDialog *dialog;
+	gchar *scheme;
+
+	g_debug( "%s: parent=%p", thisfn, ( void * ) parent );
+
+	g_return_val_if_fail( BASE_IS_WINDOW( parent ), NULL );
+
+	dialog = add_scheme_dialog_new( parent );
+	dialog->private->already_used = na_core_utils_slist_duplicate( schemes );
+
+	base_window_run( BASE_WINDOW( dialog ));
+
+	scheme = g_strdup( dialog->private->scheme );
+
+	g_object_unref( dialog );
+
+	return( scheme );
+}
+
+static gchar *
+base_get_iprefs_window_id( const BaseWindow *window )
+{
+	return( g_strdup( "add-scheme-dialog" ));
+}
+
+static gchar *
+base_get_dialog_name( const BaseWindow *window )
+{
+	return( g_strdup( "AddSchemeDialog" ));
+}
+
+static gchar *
+base_get_ui_filename( const BaseWindow *dialog )
+{
+	return( g_strdup( PKGDATADIR "/nact-add-scheme.ui" ));
+}
+
+static void
+on_base_initial_load_dialog( NactAddSchemeDialog *dialog, gpointer user_data )
+{
+	static const gchar *thisfn = "nact_add_scheme_dialog_on_initial_load_dialog";
+	GtkTreeView *listview;
+
+	g_return_if_fail( NACT_IS_ADD_SCHEME_DIALOG( dialog ));
+
+	if( !dialog->private->dispose_has_run ){
+		g_debug( "%s: dialog=%p, user_data=%p", thisfn, ( void * ) dialog, ( void * ) user_data );
+
+		listview = GTK_TREE_VIEW( base_window_get_widget( BASE_WINDOW( dialog ), "SchemesTreeView" ));
+		nact_schemes_list_create_model( listview, SCHEMES_LIST_FOR_ADD_FROM_DEFAULTS );
+	}
+}
+
+static void
+on_base_runtime_init_dialog( NactAddSchemeDialog *dialog, gpointer user_data )
+{
+	static const gchar *thisfn = "nact_add_scheme_dialog_on_runtime_init_dialog";
+	GtkTreeView *listview;
+
+	g_return_if_fail( NACT_IS_ADD_SCHEME_DIALOG( dialog ));
+
+	if( !dialog->private->dispose_has_run ){
+		g_debug( "%s: dialog=%p, user_data=%p", thisfn, ( void * ) dialog, ( void * ) user_data );
+
+		listview = GTK_TREE_VIEW( base_window_get_widget( BASE_WINDOW( dialog ), "SchemesTreeView" ));
+		nact_schemes_list_init_view( listview, BASE_WINDOW( dialog ), ( pf_new_selection_cb ) on_selection_changed, ( void * ) dialog );
+
+		nact_schemes_list_setup_values( BASE_WINDOW( dialog ), dialog->private->already_used );
+
+		/* dialog buttons
+		 */
+		base_window_signal_connect_by_name(
+				BASE_WINDOW( dialog ),
+				"CancelButton",
+				"clicked",
+				G_CALLBACK( on_cancel_clicked ));
+
+		base_window_signal_connect_by_name(
+				BASE_WINDOW( dialog ),
+				"OKButton",
+				"clicked",
+				G_CALLBACK( on_ok_clicked ));
+	}
+}
+
+static void
+on_base_all_widgets_showed( NactAddSchemeDialog *dialog, gpointer user_data )
+{
+	static const gchar *thisfn = "nact_add_scheme_dialog_on_all_widgets_showed";
+
+	g_return_if_fail( NACT_IS_ADD_SCHEME_DIALOG( dialog ));
+
+	if( !dialog->private->dispose_has_run ){
+		g_debug( "%s: dialog=%p, user_data=%p", thisfn, ( void * ) dialog, ( void * ) user_data );
+
+		nact_schemes_list_show_all( BASE_WINDOW( dialog ));
+	}
+}
+
+static void
+on_cancel_clicked( GtkButton *button, NactAddSchemeDialog *dialog )
+{
+	GtkWindow *toplevel = base_window_get_toplevel( BASE_WINDOW( dialog ));
+
+	gtk_dialog_response( GTK_DIALOG( toplevel ), GTK_RESPONSE_CLOSE );
+}
+
+static void
+on_ok_clicked( GtkButton *button, NactAddSchemeDialog *dialog )
+{
+	GtkWindow *toplevel = base_window_get_toplevel( BASE_WINDOW( dialog ));
+
+	gtk_dialog_response( GTK_DIALOG( toplevel ), GTK_RESPONSE_OK );
+}
+
+/*
+ * this function is a callback, called from nact-schemes-list:on_selection_changed
+ * this let us validate/invalidate the OK button
+ */
+static void
+on_selection_changed( const gchar *scheme, gboolean used, NactAddSchemeDialog *dialog )
+{
+	GtkWidget *button;
+
+	button = base_window_get_widget( BASE_WINDOW( dialog ), "OKButton" );
+	gtk_widget_set_sensitive( button, !used );
+}
+
+static void
+validate_dialog( NactAddSchemeDialog *dialog )
+{
+	dialog->private->scheme = nact_schemes_list_get_current_scheme( BASE_WINDOW( dialog ));
+}
+
+static gboolean
+base_dialog_response( GtkDialog *dialog_box, gint code, BaseWindow *window )
+{
+	static const gchar *thisfn = "nact_add_scheme_dialog_on_dialog_response";
+	NactAddSchemeDialog *dialog;
+
+	g_return_val_if_fail( NACT_IS_ADD_SCHEME_DIALOG( window ), FALSE );
+
+	dialog = NACT_ADD_SCHEME_DIALOG( window );
+
+	if( !dialog->private->dispose_has_run ){
+		g_debug( "%s: dialog_box=%p, code=%d, window=%p", thisfn, ( void * ) dialog_box, code, ( void * ) window );
+
+		switch( code ){
+			case GTK_RESPONSE_OK:
+				validate_dialog( dialog );
+
+			case GTK_RESPONSE_NONE:
+			case GTK_RESPONSE_DELETE_EVENT:
+			case GTK_RESPONSE_CLOSE:
+			case GTK_RESPONSE_CANCEL:
+				return( TRUE );
+				break;
+		}
+	}
+
+	return( FALSE );
+}
diff --git a/src/nact/nact-add-scheme-dialog.h b/src/nact/nact-add-scheme-dialog.h
new file mode 100644
index 0000000..e8835c5
--- /dev/null
+++ b/src/nact/nact-add-scheme-dialog.h
@@ -0,0 +1,76 @@
+/*
+ * Nautilus Actions
+ * A Nautilus extension which offers configurable context menu actions.
+ *
+ * Copyright (C) 2005 The GNOME Foundation
+ * Copyright (C) 2006, 2007, 2008 Frederic Ruaudel and others (see AUTHORS)
+ * Copyright (C) 2009, 2010 Pierre Wieser and others (see AUTHORS)
+ *
+ * This Program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this Library; see the file COPYING.  If not,
+ * write to the Free Software Foundation, Inc., 59 Temple Place,
+ * Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Authors:
+ *   Frederic Ruaudel <grumz grumz net>
+ *   Rodrigo Moya <rodrigo gnome-db org>
+ *   Pierre Wieser <pwieser trychlos org>
+ *   ... and many others (see AUTHORS)
+ */
+
+#ifndef __NACT_ADD_SCHEME_DIALOG_H__
+#define __NACT_ADD_SCHEME_DIALOG_H__
+
+/**
+ * SECTION: nact_add_scheme_dialog
+ * @short_description: #NactAddSchemeDialog class definition.
+ * @include: nact/nact-add-scheme-dialog.h
+ *
+ * The dialog let the user pick a scheme from the default list
+ * when adding a new scheme to a profile (resp. an action, a menu).
+ */
+
+#include "base-dialog.h"
+
+G_BEGIN_DECLS
+
+#define NACT_ADD_SCHEME_DIALOG_TYPE					( nact_add_scheme_dialog_get_type())
+#define NACT_ADD_SCHEME_DIALOG( object )			( G_TYPE_CHECK_INSTANCE_CAST( object, NACT_ADD_SCHEME_DIALOG_TYPE, NactAddSchemeDialog ))
+#define NACT_ADD_SCHEME_DIALOG_CLASS( klass )		( G_TYPE_CHECK_CLASS_CAST( klass, NACT_ADD_SCHEME_DIALOG_TYPE, NactAddSchemeDialogClass ))
+#define NACT_IS_ADD_SCHEME_DIALOG( object )			( G_TYPE_CHECK_INSTANCE_TYPE( object, NACT_ADD_SCHEME_DIALOG_TYPE ))
+#define NACT_IS_ADD_SCHEME_DIALOG_CLASS( klass )	( G_TYPE_CHECK_CLASS_TYPE(( klass ), NACT_ADD_SCHEME_DIALOG_TYPE ))
+#define NACT_ADD_SCHEME_DIALOG_GET_CLASS( object )	( G_TYPE_INSTANCE_GET_CLASS(( object ), NACT_ADD_SCHEME_DIALOG_TYPE, NactAddSchemeDialogClass ))
+
+typedef struct NactAddSchemeDialogPrivate      NactAddSchemeDialogPrivate;
+
+typedef struct {
+	BaseDialog                  parent;
+	NactAddSchemeDialogPrivate *private;
+}
+	NactAddSchemeDialog;
+
+typedef struct NactAddSchemeDialogClassPrivate NactAddSchemeDialogClassPrivate;
+
+typedef struct {
+	BaseDialogClass                  parent;
+	NactAddSchemeDialogClassPrivate *private;
+}
+	NactAddSchemeDialogClass;
+
+GType  nact_add_scheme_dialog_get_type( void );
+
+gchar *nact_add_scheme_dialog_run( BaseWindow *parent, GSList *schemes );
+
+G_END_DECLS
+
+#endif /* __NACT_ADD_SCHEME_DIALOG_H__ */
diff --git a/src/nact/nact-add-scheme.ui b/src/nact/nact-add-scheme.ui
index ea7febc..bbed867 100644
--- a/src/nact/nact-add-scheme.ui
+++ b/src/nact/nact-add-scheme.ui
@@ -77,7 +77,21 @@
                               </packing>
                             </child>
                             <child>
-                              <placeholder/>
+                              <object class="GtkButton" id="RemoveSchemeButton">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">True</property>
+                                <child>
+                                  <object class="GtkImage" id="image2">
+                                    <property name="visible">True</property>
+                                    <property name="stock">gtk-remove</property>
+                                  </object>
+                                </child>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="position">1</property>
+                              </packing>
                             </child>
                           </object>
                           <packing>
@@ -91,17 +105,7 @@
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkCheckButton" id="AddToPreferencesButton">
-                        <property name="label" translatable="yes">Add new scheme to default schemes</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="draw_indicator">True</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="position">1</property>
-                      </packing>
+                      <placeholder/>
                     </child>
                   </object>
                 </child>
diff --git a/src/nact/nact-ibasenames-tab.c b/src/nact/nact-ibasenames-tab.c
index 24ba4f3..32ece40 100644
--- a/src/nact/nact-ibasenames-tab.c
+++ b/src/nact/nact-ibasenames-tab.c
@@ -161,7 +161,6 @@ 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 6ccb68b..9ca5de1 100644
--- a/src/nact/nact-ifolders-tab.c
+++ b/src/nact/nact-ifolders-tab.c
@@ -67,7 +67,7 @@ static GType   register_type( void );
 static void    interface_base_init( NactIFoldersTabInterface *klass );
 static void    interface_base_finalize( NactIFoldersTabInterface *klass );
 
-static void    on_add_folder_clicked( GtkButton *button, MatchListStr *data );
+static void    on_browse_folder_clicked( GtkButton *button, BaseWindow *window );
 static void    on_tab_updatable_selection_changed( NactIFoldersTab *instance, gint count_selected );
 static void    on_tab_updatable_enable_tab( NactIFoldersTab *instance, NAObjectItem *item );
 
@@ -166,7 +166,6 @@ nact_ifolders_tab_initial_load_toplevel( NactIFoldersTab *instance )
 				list, add, remove,
 				( pget_filters ) get_folders,
 				( pset_filters ) set_folders,
-				( pon_add_callback ) on_add_folder_clicked,
 				_( "Folder filter" ));
 	}
 }
@@ -175,6 +174,7 @@ void
 nact_ifolders_tab_runtime_init_toplevel( NactIFoldersTab *instance )
 {
 	static const gchar *thisfn = "nact_ifolders_tab_runtime_init_toplevel";
+	GtkWidget *button;
 
 	g_return_if_fail( NACT_IS_IFOLDERS_TAB( instance ));
 
@@ -195,6 +195,13 @@ nact_ifolders_tab_runtime_init_toplevel( NactIFoldersTab *instance )
 				G_CALLBACK( on_tab_updatable_enable_tab ));
 
 		nact_match_list_init_view( BASE_WINDOW( instance ), ITAB_NAME );
+
+		button = base_window_get_widget( BASE_WINDOW( instance ), "FolderBrowseButton" );
+		base_window_signal_connect(
+				BASE_WINDOW( instance ),
+				G_OBJECT( button ),
+				"clicked",
+				G_CALLBACK( on_browse_folder_clicked ));
 	}
 }
 
@@ -227,7 +234,7 @@ nact_ifolders_tab_dispose( NactIFoldersTab *instance )
 }
 
 static void
-on_add_folder_clicked( GtkButton *button, MatchListStr *data )
+on_browse_folder_clicked( GtkButton *button, BaseWindow *window )
 {
 #if 0
 	/* this is the code I sent to gtk-app-devel list
@@ -261,7 +268,7 @@ on_add_folder_clicked( GtkButton *button, MatchListStr *data )
 	NAUpdater *updater;
 
 	path = NULL;
-	toplevel = base_window_get_toplevel( data->window );
+	toplevel = base_window_get_toplevel( window );
 
 	/* i18n: title of the FileChoose dialog when selecting an URI which
 	 * will be compare to Nautilus 'current_folder'
@@ -273,10 +280,10 @@ on_add_folder_clicked( GtkButton *button, MatchListStr *data )
 			GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
 			NULL );
 
-	application = NACT_APPLICATION( base_window_get_application( data->window ));
+	application = NACT_APPLICATION( base_window_get_application( window ));
 	updater = nact_application_get_updater( application );
 
-	base_iprefs_position_named_window( data->window, GTK_WINDOW( dialog ), IPREFS_FOLDERS_DIALOG );
+	base_iprefs_position_named_window( window, GTK_WINDOW( dialog ), IPREFS_FOLDERS_DIALOG );
 
 	path = na_iprefs_read_string( NA_IPREFS( updater ), IPREFS_FOLDERS_PATH, "/" );
 	if( path && g_utf8_strlen( path, -1 )){
@@ -286,14 +293,14 @@ on_add_folder_clicked( GtkButton *button, MatchListStr *data )
 
 	if( gtk_dialog_run( GTK_DIALOG( dialog )) == GTK_RESPONSE_ACCEPT ){
 		path = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER( dialog ));
-		nact_iprefs_write_string( data->window, IPREFS_FOLDERS_PATH, path );
+		nact_iprefs_write_string( window, IPREFS_FOLDERS_PATH, path );
 
-		nact_match_list_insert_row( data, path, FALSE, FALSE );
+		nact_match_list_insert_row( window, ITAB_NAME, path, FALSE, FALSE );
 
 		g_free( path );
 	}
 
-	base_iprefs_save_named_window_position( data->window, GTK_WINDOW( dialog ), IPREFS_FOLDERS_DIALOG );
+	base_iprefs_save_named_window_position( window, GTK_WINDOW( dialog ), IPREFS_FOLDERS_DIALOG );
 
 	gtk_widget_destroy( dialog );
 }
diff --git a/src/nact/nact-imimetypes-tab.c b/src/nact/nact-imimetypes-tab.c
index 92c14bb..e8e8c58 100644
--- a/src/nact/nact-imimetypes-tab.c
+++ b/src/nact/nact-imimetypes-tab.c
@@ -159,7 +159,6 @@ 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 67b1034..5a005a6 100644
--- a/src/nact/nact-ischemes-tab.c
+++ b/src/nact/nact-ischemes-tab.c
@@ -34,10 +34,12 @@
 
 #include <glib/gi18n.h>
 
+#include <api/na-core-utils.h>
 #include <api/na-object-api.h>
 
 #include "nact-main-tab.h"
 #include "nact-match-list.h"
+#include "nact-add-scheme-dialog.h"
 #include "nact-ischemes-tab.h"
 
 /* private interface data
@@ -55,6 +57,7 @@ static GType   register_type( void );
 static void    interface_base_init( NactISchemesTabInterface *klass );
 static void    interface_base_finalize( NactISchemesTabInterface *klass );
 
+static void    on_add_from_defaults( GtkButton *button, BaseWindow *window );
 static void    on_tab_updatable_selection_changed( BaseWindow *window, gint count_selected );
 static void    on_tab_updatable_enable_tab( BaseWindow *window, NAObjectItem *item );
 
@@ -153,7 +156,6 @@ nact_ischemes_tab_initial_load_toplevel( NactISchemesTab *instance )
 				list, add, remove,
 				( pget_filters ) get_schemes,
 				( pset_filters ) set_schemes,
-				NULL,
 				_( "Scheme filter" ));
 	}
 }
@@ -162,6 +164,7 @@ void
 nact_ischemes_tab_runtime_init_toplevel( NactISchemesTab *instance )
 {
 	static const gchar *thisfn = "nact_ischemes_tab_runtime_init_toplevel";
+	GtkWidget *button;
 
 	g_return_if_fail( NACT_IS_ISCHEMES_TAB( instance ));
 
@@ -182,6 +185,13 @@ nact_ischemes_tab_runtime_init_toplevel( NactISchemesTab *instance )
 				G_CALLBACK( on_tab_updatable_enable_tab ));
 
 		nact_match_list_init_view( BASE_WINDOW( instance ), ITAB_NAME );
+
+		button = base_window_get_widget( BASE_WINDOW( instance ), "AddFromDefaultButton" );
+		base_window_signal_connect(
+				BASE_WINDOW( instance ),
+				G_OBJECT( button ),
+				"clicked",
+				G_CALLBACK( on_add_from_defaults ));
 	}
 }
 
@@ -193,7 +203,6 @@ nact_ischemes_tab_all_widgets_showed( NactISchemesTab *instance )
 	g_return_if_fail( NACT_IS_ISCHEMES_TAB( instance ));
 
 	if( st_initialized && !st_finalized ){
-
 		g_debug( "%s: instance=%p", thisfn, ( void * ) instance );
 	}
 }
@@ -206,7 +215,6 @@ nact_ischemes_tab_dispose( NactISchemesTab *instance )
 	g_return_if_fail( NACT_IS_ISCHEMES_TAB( instance ));
 
 	if( st_initialized && !st_finalized ){
-
 		g_debug( "%s: instance=%p", thisfn, ( void * ) instance );
 
 		nact_match_list_dispose( BASE_WINDOW( instance ), ITAB_NAME );
@@ -214,6 +222,35 @@ nact_ischemes_tab_dispose( NactISchemesTab *instance )
 }
 
 static void
+on_add_from_defaults( GtkButton *button, BaseWindow *window )
+{
+	GSList *schemes;
+	gchar *new_scheme;
+	NAObjectItem *item;
+	NAObjectProfile *profile;
+	NAIContext *context;
+
+	g_object_get(
+			G_OBJECT( window ),
+			TAB_UPDATABLE_PROP_EDITED_ACTION, &item,
+			TAB_UPDATABLE_PROP_EDITED_PROFILE, &profile,
+			NULL );
+
+	context = ( profile ? NA_ICONTEXT( profile ) : ( NAIContext * ) item );
+
+	if( context ){
+		schemes = na_object_get_schemes( context );
+		new_scheme = nact_add_scheme_dialog_run( window, schemes );
+		na_core_utils_slist_free( schemes );
+
+		if( new_scheme ){
+			nact_match_list_insert_row( window, ITAB_NAME, new_scheme, FALSE, FALSE );
+			g_free( new_scheme );
+		}
+	}
+}
+
+static void
 on_tab_updatable_selection_changed( BaseWindow *window, gint count_selected )
 {
 	nact_match_list_on_selection_changed( window, ITAB_NAME, count_selected );
diff --git a/src/nact/nact-main-menubar.c b/src/nact/nact-main-menubar.c
index d45f60d..36e1ac5 100644
--- a/src/nact/nact-main-menubar.c
+++ b/src/nact/nact-main-menubar.c
@@ -77,7 +77,7 @@ enum {
  * same thing
  */
 #undef GTK_HAS_ACTIVATABLE
-#if(( GTK_MAJOR_VERSION > 2 ) || ( GTK_MINOR_VERSION >= 16 ))
+#if(( GTK_MAJOR_VERSION > 2 ) || ( GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION >= 16 ))
 	#define GTK_HAS_ACTIVATABLE
 #endif
 
diff --git a/src/nact/nact-match-list.c b/src/nact/nact-match-list.c
index c652649..9155768 100644
--- a/src/nact/nact-match-list.c
+++ b/src/nact/nact-match-list.c
@@ -68,6 +68,7 @@ static void     add_filter( MatchListStr *data, const gchar *filter, const gchar
 static void     delete_current_row( MatchListStr *data );
 static void     edit_inline( MatchListStr *data );
 static void     insert_new_row( MatchListStr *data );
+static void     insert_new_row_data( MatchListStr *data, const gchar *filter, gboolean match, gboolean no_match );
 static void     iter_for_setup( gchar *filter, GtkTreeModel *model );
 static void     sort_on_column( GtkTreeViewColumn *treeviewcolumn, MatchListStr *data, guint colid );
 static gboolean tab_set_sensitive( MatchListStr *data );
@@ -91,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, pon_add_callback pon_add,
+		pget_filters pget, pset_filters pset,
 		const gchar *item_header )
 {
 	MatchListStr *data;
@@ -108,7 +109,6 @@ 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;
@@ -232,7 +232,7 @@ nact_match_list_init_view( BaseWindow *window, const gchar *tab_name )
 			window,
 			G_OBJECT( data->addbutton ),
 			"clicked",
-			data->pon_add ? G_CALLBACK( data->pon_add ) : G_CALLBACK( on_add_filter_clicked ),
+			G_CALLBACK( on_add_filter_clicked ),
 			data );
 
 	base_window_signal_connect_with_data(
@@ -360,7 +360,8 @@ nact_match_list_on_enable_tab( BaseWindow *window, const gchar *tab_name, NAObje
 
 /**
  * nact_match_list_insert_row:
- * @data: the #MatchListStr structure.
+ * @window: the #BaseWindow window which contains the view.
+ * @tab_name: a string constant which identifies this page.
  * @filter: the item to add.
  * @match: whether the 'must match' column is checked.
  * @not_match: whether the 'must not match' column is checked.
@@ -368,36 +369,14 @@ nact_match_list_on_enable_tab( BaseWindow *window, const gchar *tab_name, NAObje
  * Add a new row to the list view.
  */
 void
-nact_match_list_insert_row( MatchListStr *data, const gchar *filter, gboolean match, gboolean not_match )
+nact_match_list_insert_row( BaseWindow *window, const gchar *tab_name, const gchar *filter, gboolean match, gboolean not_match )
 {
-	GtkTreeModel *model;
-	GtkTreeIter iter;
-	GtkTreePath *path;
-	GtkTreeViewColumn *column;
-
-	g_return_if_fail( !( match && not_match ));
-
-	model = gtk_tree_view_get_model( data->listview );
-
-	gtk_list_store_insert_with_values( GTK_LIST_STORE( model ), &iter, 0,
-			/* i18n notes : new filter for a new row in a match/no matchlist */
-			ITEM_COLUMN, filter,
-			MUST_MATCH_COLUMN, match,
-			MUST_NOT_MATCH_COLUMN, not_match,
-			-1 );
-
-	path = gtk_tree_model_get_path( model, &iter );
-	column = gtk_tree_view_get_column( data->listview, ITEM_COLUMN );
-	gtk_tree_view_set_cursor( data->listview, path, column, TRUE );
-	gtk_tree_path_free( path );
+	MatchListStr *data;
 
-	if( match ){
-		add_filter( data, filter, "" );
-	}
+	data = ( MatchListStr * ) g_object_get_data( G_OBJECT( window ), tab_name );
+	g_return_if_fail( data != NULL );
 
-	if( not_match ){
-		add_filter( data, filter, "!" );
-	}
+	insert_new_row_data( data, filter, match, not_match );
 }
 
 /**
@@ -777,7 +756,40 @@ edit_inline( MatchListStr *data )
 static void
 insert_new_row( MatchListStr *data )
 {
-	nact_match_list_insert_row( data, _( "new-filter" ), FALSE, FALSE );
+	insert_new_row_data( data, _( "new-filter" ), FALSE, FALSE );
+}
+
+static void
+insert_new_row_data( MatchListStr *data, const gchar *filter, gboolean match, gboolean not_match )
+{
+	GtkTreeModel *model;
+	GtkTreeIter iter;
+	GtkTreePath *path;
+	GtkTreeViewColumn *column;
+
+	g_return_if_fail( !( match && not_match ));
+
+	model = gtk_tree_view_get_model( data->listview );
+
+	gtk_list_store_insert_with_values( GTK_LIST_STORE( model ), &iter, 0,
+			/* i18n notes : new filter for a new row in a match/no matchlist */
+			ITEM_COLUMN, filter,
+			MUST_MATCH_COLUMN, match,
+			MUST_NOT_MATCH_COLUMN, not_match,
+			-1 );
+
+	path = gtk_tree_model_get_path( model, &iter );
+	column = gtk_tree_view_get_column( data->listview, ITEM_COLUMN );
+	gtk_tree_view_set_cursor( data->listview, path, column, TRUE );
+	gtk_tree_path_free( path );
+
+	if( match ){
+		add_filter( data, filter, "" );
+	}
+
+	if( not_match ){
+		add_filter( data, filter, "!" );
+	}
 }
 
 static void
diff --git a/src/nact/nact-match-list.h b/src/nact/nact-match-list.h
index b1d18f4..0361427 100644
--- a/src/nact/nact-match-list.h
+++ b/src/nact/nact-match-list.h
@@ -43,7 +43,6 @@ G_BEGIN_DECLS
 
 typedef GSList * ( *pget_filters )( void * );
 typedef void     ( *pset_filters )( void *, GSList * );
-typedef void     ( *pon_add_callback )( GtkButton *button, void *user_data );
 
 typedef struct {
 	BaseWindow      *window;
@@ -53,7 +52,6 @@ typedef struct {
 	GtkWidget       *removebutton;
 	pget_filters     pget;
 	pset_filters     pset;
-	pon_add_callback pon_add;
 	gchar           *item_header;
 	gboolean         editable;
 	guint            sort_column;
@@ -64,7 +62,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, pon_add_callback pon_add,
+		pget_filters pget, pset_filters pset,
 		const gchar *item_header );
 
 void  nact_match_list_init_view           ( BaseWindow *window, const gchar *tab_name );
@@ -75,7 +73,8 @@ void  nact_match_list_on_selection_changed( BaseWindow *window, const gchar *tab
 void  nact_match_list_on_enable_tab       ( BaseWindow *window, const gchar *tab_name,
 		NAObjectItem *item );
 
-void  nact_match_list_insert_row( MatchListStr *data, const gchar *filter, gboolean match, gboolean not_match );
+void  nact_match_list_insert_row          ( BaseWindow *window, const gchar *tab_name,
+		const gchar *filter, gboolean match, gboolean not_match );
 
 void  nact_match_list_dispose             ( BaseWindow *window, const gchar *tab_name );
 
diff --git a/src/nact/nact-preferences-editor.c b/src/nact/nact-preferences-editor.c
index f8b0216..77c535e 100644
--- a/src/nact/nact-preferences-editor.c
+++ b/src/nact/nact-preferences-editor.c
@@ -289,7 +289,7 @@ on_base_initial_load_dialog( NactPreferencesEditor *editor, gpointer user_data )
 	nact_export_format_init_display( NA_PIVOT( updater ), container, EXPORT_FORMAT_DISPLAY_PREFERENCES );
 
 	listview = GTK_TREE_VIEW( base_window_get_widget( BASE_WINDOW( editor ), "SchemesTreeView" ));
-	nact_schemes_list_create_model( listview, FALSE );
+	nact_schemes_list_create_model( listview, SCHEMES_LIST_FOR_PREFERENCES );
 
 	listview = GTK_TREE_VIEW( base_window_get_widget( BASE_WINDOW( editor ), "ProvidersTreeView" ));
 	nact_providers_list_create_model( listview );
@@ -406,7 +406,7 @@ on_base_runtime_init_dialog( NactPreferencesEditor *editor, gpointer user_data )
 	/* fifth tab: default schemes
 	 */
 	listview = GTK_TREE_VIEW( base_window_get_widget( BASE_WINDOW( editor ), "SchemesTreeView" ));
-	nact_schemes_list_init_view( listview, BASE_WINDOW( editor ));
+	nact_schemes_list_init_view( listview, BASE_WINDOW( editor ), NULL, NULL );
 
 	/* sixth tab: I/O providers priorities
 	 */
@@ -437,6 +437,8 @@ on_base_all_widgets_showed( NactPreferencesEditor *editor, gpointer user_data )
 	g_debug( "%s: editor=%p, user_data=%p", thisfn, ( void * ) editor, ( void * ) user_data );
 	notebook = GTK_NOTEBOOK( base_window_get_widget( BASE_WINDOW( editor ), "PreferencesNotebook" ));
 	gtk_notebook_set_current_page( notebook, 0 );
+
+	nact_schemes_list_show_all( BASE_WINDOW( editor ));
 }
 
 static void
diff --git a/src/nact/nact-preferences.ui b/src/nact/nact-preferences.ui
index 10827b5..c0a637e 100644
--- a/src/nact/nact-preferences.ui
+++ b/src/nact/nact-preferences.ui
@@ -666,7 +666,7 @@ You can add a new scheme by clicking on the '+' button.</property>
                       <object class="GtkLabel" id="label55">
                         <property name="visible">True</property>
                         <property name="xpad">5</property>
-                        <property name="label" translatable="yes">&lt;b&gt;Default schemes&lt;/b&gt;</property>
+                        <property name="label" translatable="yes">&lt;b&gt;Common schemes&lt;/b&gt;</property>
                         <property name="use_markup">True</property>
                       </object>
                     </child>
diff --git a/src/nact/nact-schemes-list.c b/src/nact/nact-schemes-list.c
index 8cf5907..e8ec4b7 100644
--- a/src/nact/nact-schemes-list.c
+++ b/src/nact/nact-schemes-list.c
@@ -46,84 +46,92 @@
 #include "nact-main-tab.h"
 #include "nact-schemes-list.h"
 
-/* column ordering
+/* data attached to the treeview widget on initial load
+ * at this time, only treeview and mode are set
+ * on runtime init, the current window is associated to the widget,
+ *  and so, indirectly, to this data
+ * at this time, window is set
+ */
+typedef struct {
+	GtkTreeView        *treeview;		/* set when allocating the data */
+	guint               mode;			/* set when creating the model */
+	BaseWindow         *window;			/* set when initializating the view */
+	pf_new_selection_cb pf_on_sel_changed;
+	void               *user_data;
+}
+	SchemesListData;
+
+/* column ordering in the model
  */
 enum {
-	SCHEMES_CHECKBOX_COLUMN = 0,
-	SCHEMES_KEYWORD_COLUMN,
+	SCHEMES_KEYWORD_COLUMN = 0,
 	SCHEMES_DESC_COLUMN,
+	SCHEMES_ALREADY_USED_COLUMN,
 	SCHEMES_N_COLUMN
 };
 
-#define SCHEMES_LIST_FOR_ACTION			"nact-schemes-list-for-action"
-#define SCHEMES_LIST_EDITABLE			"nact-schemes-list-editable"
+#define SCHEMES_LIST_DATA				"nact-schemes-list-data"
 #define SCHEMES_LIST_TREEVIEW			"nact-schemes-list-treeview"
 
-static gboolean st_on_selection_change = FALSE;
+static void             init_view_setup_defaults( SchemesListData *data );
+static GSList          *init_view_get_default_list( SchemesListData *data );
+static GSList          *init_view_get_default_default_list( SchemesListData *data );
+static void             init_view_connect_signals( SchemesListData *data );
+static void             init_view_select_first_row( SchemesListData *data );
 
-static void       init_view_setup_defaults( GtkTreeView *treeview, BaseWindow *window );
-static GSList    *get_default_schemes_list( BaseWindow *window );
-static GSList    *get_default_default_schemes_list( BaseWindow *window );
-static void       init_view_connect_signals( GtkTreeView *treeview, BaseWindow *window );
-static void       init_view_select_first_row( GtkTreeView *treeview );
+static gboolean         setup_values_iter( GtkTreeModel *model, GtkTreePath *path, GtkTreeIter* iter, GSList *schemes );
 
-static void       iter_for_setup( gchar *scheme, GtkTreeModel *model );
-static gboolean   iter_for_get( GtkTreeModel* scheme_model, GtkTreePath *path, GtkTreeIter* iter, GSList **schemes_list );
-static GSList    *get_list_schemes( GtkTreeView *treeview );
-static gboolean   get_list_schemes_iter( GtkTreeModel *model, GtkTreePath *path, GtkTreeIter* iter, GSList **list );
+static GSList          *get_list_schemes( GtkTreeView *treeview );
+static gboolean         get_list_schemes_iter( GtkTreeModel *model, GtkTreePath *path, GtkTreeIter* iter, GSList **list );
 
-static gboolean   on_key_pressed_event( GtkWidget *widget, GdkEventKey *event, BaseWindow *window );
-static void       on_selection_changed( GtkTreeSelection *selection, BaseWindow *window );
-static void       on_add_clicked( GtkButton *button, BaseWindow *window );
-static void       on_remove_clicked( GtkButton *button, BaseWindow *window );
-static void       on_desc_edited( GtkCellRendererText *renderer, const gchar *path, const gchar *text, BaseWindow *window );
-static void       on_keyword_edited( GtkCellRendererText *renderer, const gchar *path, const gchar *text, BaseWindow *window );
-static void       on_active_toggled( GtkCellRendererToggle *renderer, gchar *path, BaseWindow *window );
+static gboolean         on_key_pressed_event( GtkWidget *widget, GdkEventKey *event, BaseWindow *window );
+static void             on_selection_changed( GtkTreeSelection *selection, BaseWindow *window );
+static void             on_add_clicked( GtkButton *button, BaseWindow *window );
+static void             on_remove_clicked( GtkButton *button, BaseWindow *window );
+static void             on_desc_edited( GtkCellRendererText *renderer, const gchar *path, const gchar *text, BaseWindow *window );
+static void             on_keyword_edited( GtkCellRendererText *renderer, const gchar *path, const gchar *text, BaseWindow *window );
 
-static void       edit_cell( BaseWindow *window, const gchar *path_string, const gchar *text, gint column, gboolean *state, gchar **old_text );
-static void       edit_inline( BaseWindow *window );
-static void       insert_new_row( BaseWindow *window );
-static void       delete_row( BaseWindow *window );
+static void             edit_cell( BaseWindow *window, const gchar *path_string, const gchar *text, gint column, gboolean *state, gchar **old_text );
+static void             edit_inline( BaseWindow *window );
+static void             insert_new_row( BaseWindow *window );
+static void             delete_row( BaseWindow *window );
+static void             display_keyword( GtkTreeViewColumn *column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, SchemesListData *data );
+static void             display_description( GtkTreeViewColumn *column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, SchemesListData *data );
+static void             display_label( GtkTreeViewColumn *column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, SchemesListData *data, guint column_id );
 
-static GtkButton *get_add_button( BaseWindow *window );
-static GtkButton *get_remove_button( BaseWindow *window );
+static GtkButton       *get_add_button( BaseWindow *window );
+static GtkButton       *get_remove_button( BaseWindow *window );
+static SchemesListData *get_schemes_list_data( GtkTreeView *treeview );
 
 /**
  * nact_schemes_list_create_schemes_list:
  * @treeview: the #GtkTreeView.
- * @for_action: whether we are opening this listview as properties for
- *  an action, or just as a simple schemes list for preferences edition.
- *  In this later case, we don't display the 'active scheme' checkbox.
+ * @mode: whether we are opening this listview for preferences edition,
+ *  or to add a new scheme from the default list.
  *
  * Create the treeview model when initially loading the widget from
- * the UI manager.
+ * the UI manager. Associates the SchemesListData structure to the widget.
  */
 void
-nact_schemes_list_create_model( GtkTreeView *treeview, gboolean for_action )
+nact_schemes_list_create_model( GtkTreeView *treeview, guint mode )
 {
 	static const char *thisfn = "nact_schemes_list_create_model";
 	GtkListStore *model;
-	GtkCellRenderer *toggled_cell;
 	GtkTreeViewColumn *column;
 	GtkCellRenderer *text_cell;
 	GtkTreeSelection *selection;
+	SchemesListData *data;
 
-	g_debug( "%s: treeview=%p, for_action=%s", thisfn, ( void * ) treeview, for_action ? "True":"False" );
 	g_return_if_fail( GTK_IS_TREE_VIEW( treeview ));
+	g_debug( "%s: treeview=%p, mode=%d", thisfn, ( void * ) treeview, mode );
 
-	model = gtk_list_store_new( SCHEMES_N_COLUMN, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING );
+	data = get_schemes_list_data( treeview );
+	data->mode = mode;
+
+	model = gtk_list_store_new( SCHEMES_N_COLUMN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN );
 	gtk_tree_view_set_model( treeview, GTK_TREE_MODEL( model ));
 	g_object_unref( model );
 
-	toggled_cell = gtk_cell_renderer_toggle_new();
-	column = gtk_tree_view_column_new_with_attributes(
-			"scheme-selected",
-			toggled_cell,
-			"active", SCHEMES_CHECKBOX_COLUMN,
-			NULL );
-	gtk_tree_view_append_column( treeview, column );
-	g_object_set( G_OBJECT( column ), "visible", GUINT_TO_POINTER( for_action ), NULL );
-
 	text_cell = gtk_cell_renderer_text_new();
 	column = gtk_tree_view_column_new_with_attributes(
 			"scheme-code",
@@ -132,7 +140,8 @@ nact_schemes_list_create_model( GtkTreeView *treeview, gboolean for_action )
 			NULL );
 	gtk_tree_view_append_column( treeview, column );
 	gtk_tree_sortable_set_sort_column_id( GTK_TREE_SORTABLE( model ), SCHEMES_KEYWORD_COLUMN, GTK_SORT_ASCENDING );
-	nact_gtk_utils_set_editable( GTK_OBJECT( column ), TRUE );
+	gtk_tree_view_column_set_cell_data_func(
+			column, text_cell, ( GtkTreeCellDataFunc ) display_keyword, data, NULL );
 
 	text_cell = gtk_cell_renderer_text_new();
 	column = gtk_tree_view_column_new_with_attributes(
@@ -141,70 +150,77 @@ nact_schemes_list_create_model( GtkTreeView *treeview, gboolean for_action )
 			"text", SCHEMES_DESC_COLUMN,
 			NULL );
 	gtk_tree_view_append_column( treeview, column );
-	nact_gtk_utils_set_editable( GTK_OBJECT( column ), !for_action );
+	gtk_tree_view_column_set_cell_data_func(
+			column, text_cell, ( GtkTreeCellDataFunc ) display_description, data, NULL );
 
 	gtk_tree_view_set_headers_visible( treeview, FALSE );
 
 	selection = gtk_tree_view_get_selection( treeview );
 	gtk_tree_selection_set_mode( selection, GTK_SELECTION_BROWSE );
-
-	g_object_set_data( G_OBJECT( treeview ), SCHEMES_LIST_FOR_ACTION, GUINT_TO_POINTER( for_action ));
 }
 
 /**
  * nact_schemes_list_init_view:
  * @treeview: the #GtkTreeView.
  * @window: the parent #BaseWindow which embeds the view.
+ * @pf: a callback function which will be called on selection change.
+ * @user_data: user data to be passed to the callback function.
  *
- * Connects signals at runtime initialization of the widget, and setup
- * current default values.
+ * Connects signals at runtime initialization of the widget, and displays
+ * the current default list of schemes.
  *
- * This is the only initialization needed when editing the default
- * schemes preferences. Contrarily, editing a #NAObjetItem schemes
- * properties also requires #nact_schemes_list_setup_values().
+ * When mode is for preferences, this is all that is required for runtime
+ * initialization.
+ *
+ * When mode is for add from defaults, i.e. when editing #NAIContext schemes
+ * conditions, then #nact_schemes_list_setup_values() must also be called in
+ * order to actually setup the already used schemes.
  */
 void
-nact_schemes_list_init_view( GtkTreeView *treeview, BaseWindow *window )
+nact_schemes_list_init_view( GtkTreeView *treeview, BaseWindow *window, pf_new_selection_cb pf, void *user_data )
 {
 	static const gchar *thisfn = "nact_schemes_list_init_view";
-	GtkButton *button;
+	SchemesListData *data;
+
+	g_debug( "%s: treeview=%p, window=%p",
+			thisfn,
+			( void * ) treeview,
+			( void * ) window );
 
-	g_debug( "%s: treeview=%p, window=%p", thisfn, ( void * ) treeview, ( void * ) window );
 	g_return_if_fail( BASE_IS_WINDOW( window ));
 	g_return_if_fail( GTK_IS_TREE_VIEW( treeview ));
 
 	g_object_set_data( G_OBJECT( window ), SCHEMES_LIST_TREEVIEW, treeview );
-	g_object_set_data( G_OBJECT( treeview ), SCHEMES_LIST_EDITABLE, GUINT_TO_POINTER( TRUE ));
-
-	init_view_setup_defaults( treeview, window );
-	init_view_connect_signals( treeview, window );
 
-	button = get_add_button( window );
-	gtk_widget_set_sensitive( GTK_WIDGET( button ), TRUE );
+	data = get_schemes_list_data( treeview );
+	data->window = window;
+	data->pf_on_sel_changed = pf;
+	data->user_data = user_data;
 
-	init_view_select_first_row( treeview );
+	init_view_setup_defaults( data );
+	init_view_connect_signals( data );
 }
 
 static void
-init_view_setup_defaults( GtkTreeView *treeview, BaseWindow *window )
+init_view_setup_defaults( SchemesListData *data )
 {
 	GtkListStore *model;
 	GSList *schemes, *iter;
 	GtkTreeIter row;
 	gchar **tokens;
 
-	model = GTK_LIST_STORE( gtk_tree_view_get_model( treeview ));
+	model = GTK_LIST_STORE( gtk_tree_view_get_model( data->treeview ));
 
-	schemes = get_default_schemes_list( window );
+	schemes = init_view_get_default_list( data );
 
 	for( iter = schemes ; iter ; iter = iter->next ){
 
 		tokens = g_strsplit(( gchar * ) iter->data, "|", 2 );
 		gtk_list_store_append( model, &row );
 		gtk_list_store_set( model, &row,
-				SCHEMES_CHECKBOX_COLUMN, FALSE,
 				SCHEMES_KEYWORD_COLUMN, tokens[0],
 				SCHEMES_DESC_COLUMN, tokens[1],
+				SCHEMES_ALREADY_USED_COLUMN, FALSE,
 				-1 );
 		g_strfreev( tokens );
 	}
@@ -217,24 +233,25 @@ init_view_setup_defaults( GtkTreeView *treeview, BaseWindow *window )
  * the returned list must be released with #na_core_utils_slist_free()
  */
 static GSList *
-get_default_schemes_list( BaseWindow *window )
+init_view_get_default_list( SchemesListData *data )
 {
 	GSList *list = NULL;
 	NactApplication *application;
 	NAUpdater *updater;
 
-	application = NACT_APPLICATION( base_window_get_application( window ));
+	application = NACT_APPLICATION( base_window_get_application( data->window ));
 	updater = nact_application_get_updater( application );
 	list = na_iprefs_read_string_list( NA_IPREFS( updater ), "schemes", NULL );
+
 	if( !list ){
-		list = get_default_default_schemes_list( window );
+		list = init_view_get_default_default_list( data );
 	}
 
 	return( list );
 }
 
 static GSList *
-get_default_default_schemes_list( BaseWindow *window )
+init_view_get_default_default_list( SchemesListData *data )
 {
 	GSList *list = NULL;
 
@@ -253,183 +270,186 @@ get_default_default_schemes_list( BaseWindow *window )
 }
 
 static void
-init_view_connect_signals( GtkTreeView *treeview, BaseWindow *window )
+init_view_connect_signals( SchemesListData *data )
 {
 	GtkTreeViewColumn *column;
 	GList *renderers;
 	GtkButton *add_button, *remove_button;
 
-	column = gtk_tree_view_get_column( treeview, SCHEMES_CHECKBOX_COLUMN );
-	renderers = gtk_cell_layout_get_cells( GTK_CELL_LAYOUT( column ));
-	base_window_signal_connect(
-			window,
-			G_OBJECT( renderers->data ),
-			"toggled",
-			G_CALLBACK( on_active_toggled ));
-
-	column = gtk_tree_view_get_column( treeview, SCHEMES_KEYWORD_COLUMN );
-	renderers = gtk_cell_layout_get_cells( GTK_CELL_LAYOUT( column ));
-	base_window_signal_connect(
-			window,
-			G_OBJECT( renderers->data ),
-			"edited",
-			G_CALLBACK( on_keyword_edited ));
-
-	column = gtk_tree_view_get_column( treeview, SCHEMES_DESC_COLUMN );
-	renderers = gtk_cell_layout_get_cells( GTK_CELL_LAYOUT( column ));
-	base_window_signal_connect(
-			window,
-			G_OBJECT( renderers->data ),
-			"edited",
-			G_CALLBACK( on_desc_edited ));
-
-	add_button = get_add_button( window );
 	base_window_signal_connect(
-			window,
-			G_OBJECT( add_button ),
-			"clicked",
-			G_CALLBACK( on_add_clicked ));
-
-	remove_button = get_remove_button( window );
-	base_window_signal_connect(
-			window,
-			G_OBJECT( remove_button ),
-			"clicked",
-			G_CALLBACK( on_remove_clicked ));
-
-	base_window_signal_connect(
-			window,
-			G_OBJECT( gtk_tree_view_get_selection( treeview )),
+			data->window,
+			G_OBJECT( gtk_tree_view_get_selection( data->treeview )),
 			"changed",
 			G_CALLBACK( on_selection_changed ));
 
-	base_window_signal_connect(
-			window,
-			G_OBJECT( treeview ),
-			"key-press-event",
-			G_CALLBACK( on_key_pressed_event ));
+	if( data->mode == SCHEMES_LIST_FOR_PREFERENCES ){
+
+		column = gtk_tree_view_get_column( data->treeview, SCHEMES_KEYWORD_COLUMN );
+		renderers = gtk_cell_layout_get_cells( GTK_CELL_LAYOUT( column ));
+		base_window_signal_connect(
+				data->window,
+				G_OBJECT( renderers->data ),
+				"edited",
+				G_CALLBACK( on_keyword_edited ));
+
+		column = gtk_tree_view_get_column( data->treeview, SCHEMES_DESC_COLUMN );
+		renderers = gtk_cell_layout_get_cells( GTK_CELL_LAYOUT( column ));
+		base_window_signal_connect(
+				data->window,
+				G_OBJECT( renderers->data ),
+				"edited",
+				G_CALLBACK( on_desc_edited ));
+
+		add_button = get_add_button( data->window );
+		base_window_signal_connect(
+				data->window,
+				G_OBJECT( add_button ),
+				"clicked",
+				G_CALLBACK( on_add_clicked ));
+
+		remove_button = get_remove_button( data->window );
+		base_window_signal_connect(
+				data->window,
+				G_OBJECT( remove_button ),
+				"clicked",
+				G_CALLBACK( on_remove_clicked ));
+
+		base_window_signal_connect(
+				data->window,
+				G_OBJECT( data->treeview ),
+				"key-press-event",
+				G_CALLBACK( on_key_pressed_event ));
+	}
 }
 
 static void
-init_view_select_first_row( GtkTreeView *treeview )
+init_view_select_first_row( SchemesListData *data )
 {
 	GtkTreeSelection *selection;
 	GtkTreePath *path;
 
 	path = gtk_tree_path_new_first();
-	selection = gtk_tree_view_get_selection( treeview );
+	selection = gtk_tree_view_get_selection( data->treeview );
 	gtk_tree_selection_select_path( selection, path );
 	gtk_tree_path_free( path );
 }
 
 /**
- * nact_schemes_list_setup_values:
- * @treeview: the #GtkTreeView.
- * @schemes: the schemes of the current item to be displayed, or %NULL.
- * @sensitive: whether the widget should be sensitive.
- * @editable: Whether the schemes list is editable or not.
+ * nact_schemes_list_save_values:
+ * @window: the #BaseWindow which embeds this treeview.
+ * @schemes: a #GSList of already used schemes.
  *
- * Setup schemes of the current item if any.
+ * Set the used schemes for the current #NAIContext.
  */
 void
-nact_schemes_list_setup_values( GtkTreeView *treeview, BaseWindow *window, GSList *schemes, gboolean sensitive, gboolean editable )
+nact_schemes_list_setup_values( BaseWindow *window, GSList *schemes )
 {
-	static const gchar *thisfn = "nact_schemes_list_setup_values";
+	GtkTreeView *treeview;
 	GtkTreeModel *model;
-	GtkTreeSelection *selection;
-	GtkTreeViewColumn *column;
-	GtkWidget *widget;
-
-	g_debug( "%s: treeview=%p, schemes=%p (count=%d), sensitive=%s, editable=%s",
-			thisfn, ( void * ) treeview, ( void * ) schemes, schemes ? g_slist_length( schemes ) : 0,
-			sensitive ? "True":"False", editable ? "True":"False" );
-	g_return_if_fail( GTK_IS_TREE_VIEW( treeview ));
-	g_return_if_fail( BASE_IS_WINDOW( window ));
-
-	st_on_selection_change = TRUE;
-
-	g_object_set_data( G_OBJECT( treeview ), SCHEMES_LIST_EDITABLE, GUINT_TO_POINTER(( guint ) editable ));
 
+	treeview = GTK_TREE_VIEW( g_object_get_data( G_OBJECT( window ), SCHEMES_LIST_TREEVIEW ));
 	model = gtk_tree_view_get_model( treeview );
-	selection = gtk_tree_view_get_selection( treeview );
-
-	gtk_tree_selection_unselect_all( selection );
-	gtk_list_store_clear( GTK_LIST_STORE( model ));
-
-	if( schemes ){
-		init_view_setup_defaults( treeview, window );
-		g_slist_foreach( schemes, ( GFunc ) iter_for_setup, model );
-	}
-
-	gtk_widget_set_sensitive( GTK_WIDGET( treeview ), sensitive );
+	gtk_tree_model_foreach( model, ( GtkTreeModelForeachFunc ) setup_values_iter, schemes );
+}
 
-	column = gtk_tree_view_get_column( treeview, SCHEMES_KEYWORD_COLUMN );
-	nact_gtk_utils_set_editable( GTK_OBJECT( column ), editable );
+static gboolean
+setup_values_iter( GtkTreeModel *model, GtkTreePath *path, GtkTreeIter* iter, GSList *schemes )
+{
+	gchar *keyword;
+	gchar *description, *new_description;
+	gboolean used;
 
-	widget = GTK_WIDGET( get_add_button( window ));
-	gtk_widget_set_sensitive( widget, sensitive );
-	nact_gtk_utils_set_editable( GTK_OBJECT( widget ), editable );
+	gtk_tree_model_get( model, iter, SCHEMES_KEYWORD_COLUMN, &keyword, SCHEMES_DESC_COLUMN, &description, SCHEMES_ALREADY_USED_COLUMN, &used, -1 );
 
-	widget = GTK_WIDGET( get_remove_button( window ));
-	gtk_widget_set_sensitive( widget, sensitive );
-	nact_gtk_utils_set_editable( GTK_OBJECT( widget ), editable );
+	if( na_core_utils_slist_find_negated( schemes, keyword )){
+		/* i18n: add a comment when a scheme is already used by current item */
+		new_description = g_strdup_printf( _( "%s (already used)"), description );
+		used = TRUE;
+		gtk_list_store_set( GTK_LIST_STORE( model ), iter, SCHEMES_DESC_COLUMN, new_description, SCHEMES_ALREADY_USED_COLUMN, used, -1 );
+		g_free( new_description );
+	}
 
-	st_on_selection_change = FALSE;
+	g_free( description );
+	g_free( keyword );
 
-	init_view_select_first_row( treeview );
+	return( FALSE ); /* don't stop looping */
 }
 
-static void
-iter_for_setup( gchar *scheme, GtkTreeModel *model )
+/**
+ * nact_schemes_list_show_all:
+ * @window: the #BaseWindow which embeds this treeview.
+ *
+ * Update visibility of widgets after all widgets are showed.
+ */
+void
+nact_schemes_list_show_all( BaseWindow *window )
 {
-	GtkTreeIter iter;
-	gboolean iter_ok = FALSE;
-	gboolean found = FALSE;
-	gchar *i_scheme;
-
-	iter_ok = gtk_tree_model_get_iter_first( model, &iter );
+	GtkTreeView *listview;
+	SchemesListData *data;
+	GtkButton *button;
 
-	while( iter_ok && !found ){
-		gtk_tree_model_get( model, &iter, SCHEMES_KEYWORD_COLUMN, &i_scheme, -1 );
+	g_return_if_fail( BASE_IS_WINDOW( window ));
 
-		if( g_ascii_strcasecmp( scheme, i_scheme) == 0 ){
-			gtk_list_store_set( GTK_LIST_STORE( model ), &iter, SCHEMES_CHECKBOX_COLUMN, TRUE, -1 );
-			found = TRUE;
-		}
+	listview = GTK_TREE_VIEW( g_object_get_data( G_OBJECT( window ), SCHEMES_LIST_TREEVIEW ));
+	data = get_schemes_list_data( listview );
 
-		g_free( i_scheme );
-		iter_ok = gtk_tree_model_iter_next( model, &iter );
+	button = get_add_button( window );
+#if(( GTK_MAJOR_VERSION > 2 ) || ( GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION >= 18 ))
+	gtk_widget_set_visible( GTK_WIDGET( button ), data->mode == SCHEMES_LIST_FOR_PREFERENCES );
+#else
+	if( data->mode == SCHEMES_LIST_FOR_PREFERENCES ){
+		gtk_widget_show( GTK_WIDGET( button ));
+	} else {
+		gtk_widget_hide( GTK_WIDGET( button ));
 	}
+#endif
+	gtk_widget_set_sensitive( GTK_WIDGET( button ), data->mode == SCHEMES_LIST_FOR_PREFERENCES );
 
-	if( !found ){
-		gtk_list_store_append( GTK_LIST_STORE( model ), &iter );
-		gtk_list_store_set(
-				GTK_LIST_STORE( model ),
-				&iter,
-				SCHEMES_CHECKBOX_COLUMN, TRUE,
-				SCHEMES_KEYWORD_COLUMN, scheme,
-				SCHEMES_DESC_COLUMN, "",
-				-1 );
+	button = get_remove_button( window );
+#if(( GTK_MAJOR_VERSION > 2 ) || ( GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION >= 18 ))
+	gtk_widget_set_visible( GTK_WIDGET( button ), data->mode == SCHEMES_LIST_FOR_PREFERENCES );
+#else
+	if( data->mode == SCHEMES_LIST_FOR_PREFERENCES ){
+		gtk_widget_show( GTK_WIDGET( button ));
+	} else {
+		gtk_widget_hide( GTK_WIDGET( button ));
 	}
+#endif
+	gtk_widget_set_sensitive( GTK_WIDGET( button ), FALSE );
+
+	init_view_select_first_row( data );
 }
 
 /**
- * nact_schemes_list_get_schemes:
- * @treeview: the #GtkTreeView.
+ * nact_schemes_list_get_current_scheme:
+ * @window: the #BaseWindow which embeds this treeview.
  *
- * Returns selected schemes as a list of strings.
- * The caller should call #na_core_utils_slist_free() after use.
+ * Returns: the currently selected scheme, if any, as a newly allocated
+ * string which should be g_free() by the caller.
  */
-GSList *
-nact_schemes_list_get_schemes( GtkTreeView *treeview )
+gchar *
+nact_schemes_list_get_current_scheme( BaseWindow *window )
 {
-	GSList *list = NULL;
+	GtkTreeView *treeview;
+	GtkTreeSelection *selection;
 	GtkTreeModel *model;
+	GList *rows;
+	GtkTreePath *path;
+	GtkTreeIter iter;
+	gchar *keyword;
 
-	model = gtk_tree_view_get_model( treeview );
-	gtk_tree_model_foreach( model, ( GtkTreeModelForeachFunc ) iter_for_get, &list );
+	treeview = GTK_TREE_VIEW( g_object_get_data( G_OBJECT( window ), SCHEMES_LIST_TREEVIEW ));
+	selection = gtk_tree_view_get_selection( treeview );
+	rows = gtk_tree_selection_get_selected_rows( selection, &model );
+	keyword = NULL;
 
-	return( list );
+	if( g_list_length( rows ) == 1 ){
+		path = ( GtkTreePath * ) rows->data;
+		gtk_tree_model_get_iter( model, &iter, path );
+		gtk_tree_model_get( model, &iter, SCHEMES_KEYWORD_COLUMN, &keyword, -1 );
+	}
+
+	return( keyword );
 }
 
 /**
@@ -451,9 +471,9 @@ nact_schemes_list_save_defaults( BaseWindow *window )
 
 	treeview = GTK_TREE_VIEW( g_object_get_data( G_OBJECT( window ), SCHEMES_LIST_TREEVIEW ));
 	schemes = get_list_schemes( treeview );
+
 	application = NACT_APPLICATION( base_window_get_application( window ));
 	updater = nact_application_get_updater( application );
-
 	na_iprefs_write_string_list( NA_IPREFS( updater ), "schemes", schemes );
 
 	na_core_utils_slist_free( schemes );
@@ -510,54 +530,28 @@ nact_schemes_list_dispose( BaseWindow *window )
 	gtk_list_store_clear( GTK_LIST_STORE( model ));
 }
 
-/*
- * CommandExampleLabel is updated each time a field is modified
- * And at each time, we need the list of selected schemes
- */
-static gboolean
-iter_for_get( GtkTreeModel* model, GtkTreePath *path, GtkTreeIter* iter, GSList **schemes_list )
-{
-	gboolean toggle_state;
-	gchar* scheme;
-
-	gtk_tree_model_get( model, iter, SCHEMES_CHECKBOX_COLUMN, &toggle_state, SCHEMES_KEYWORD_COLUMN, &scheme, -1 );
-
-	if( toggle_state ){
-		( *schemes_list ) = g_slist_append(( *schemes_list ), scheme );
-	}
-
-	return( FALSE ); /* don't stop looping */
-}
-
 static gboolean
 on_key_pressed_event( GtkWidget *widget, GdkEventKey *event, BaseWindow *window )
 {
 	gboolean stop;
-	GtkTreeView *treeview;
-	gboolean editable;
 
 	/*g_debug( "nact_schemes_list_on_key_pressed_event" );*/
 
 	stop = FALSE;
-	treeview = GTK_TREE_VIEW( g_object_get_data( G_OBJECT( window ), SCHEMES_LIST_TREEVIEW ));
-	editable = ( gboolean ) GPOINTER_TO_UINT( g_object_get_data( G_OBJECT( treeview ), SCHEMES_LIST_EDITABLE ));
 
-	if( editable ){
-
-		if( event->keyval == GDK_F2 ){
-			edit_inline( window );
-			stop = TRUE;
-		}
+	if( event->keyval == GDK_F2 ){
+		edit_inline( window );
+		stop = TRUE;
+	}
 
-		if( event->keyval == GDK_Insert || event->keyval == GDK_KP_Insert ){
-			insert_new_row( window );
-			stop = TRUE;
-		}
+	if( event->keyval == GDK_Insert || event->keyval == GDK_KP_Insert ){
+		insert_new_row( window );
+		stop = TRUE;
+	}
 
-		if( event->keyval == GDK_Delete || event->keyval == GDK_KP_Delete ){
-			delete_row( window );
-			stop = TRUE;
-		}
+	if( event->keyval == GDK_Delete || event->keyval == GDK_KP_Delete ){
+		delete_row( window );
+		stop = TRUE;
 	}
 
 	return( stop );
@@ -567,22 +561,39 @@ static void
 on_selection_changed( GtkTreeSelection *selection, BaseWindow *window )
 {
 	/*static const gchar *thisfn = "nact_schemes_list_on_selection_changed";*/
-	GtkTreeView *treeview;
-	gboolean editable;
 	GtkButton *button;
+	GtkTreeView *listview;
+	SchemesListData *data;
+	GtkTreeModel *model;
+	GList *rows;
+	GtkTreePath *path;
+	GtkTreeIter iter;
+	gchar *keyword;
+	gboolean used;
 
 	/*g_debug( "%s: selection=%p, window=%p", thisfn, ( void * ) selection, ( void * ) window );*/
 
-	/*g_debug( "%s: getting data on window=%p", thisfn, ( void * ) window );*/
-	treeview = GTK_TREE_VIEW( g_object_get_data( G_OBJECT( window ), SCHEMES_LIST_TREEVIEW ));
+	button = get_remove_button( window );
+	gtk_widget_set_sensitive( GTK_WIDGET( button ), gtk_tree_selection_count_selected_rows( selection ) > 0);
+
+	listview = GTK_TREE_VIEW( g_object_get_data( G_OBJECT( window ), SCHEMES_LIST_TREEVIEW ));
+	data = ( SchemesListData * ) g_object_get_data( G_OBJECT( listview ), SCHEMES_LIST_DATA );
 
-	/*g_debug( "%s: getting data on treeview=%p", thisfn, ( void * ) treeview );*/
-	editable = ( gboolean ) GPOINTER_TO_UINT( g_object_get_data( G_OBJECT( treeview ), SCHEMES_LIST_EDITABLE ));
-	/*g_debug( "%s: editable=%s, selected_rows=%d",
-			thisfn, editable ? "True":"False", gtk_tree_selection_count_selected_rows( selection ));*/
+	if( data->pf_on_sel_changed ){
+		rows = gtk_tree_selection_get_selected_rows( selection, &model );
+		keyword = NULL;
+		used = FALSE;
 
-	button = get_remove_button( window );
-	gtk_widget_set_sensitive( GTK_WIDGET( button ), editable && gtk_tree_selection_count_selected_rows( selection ) > 0);
+		if( g_list_length( rows ) == 1 ){
+			path = ( GtkTreePath * ) rows->data;
+			gtk_tree_model_get_iter( model, &iter, path );
+			gtk_tree_model_get( model, &iter, SCHEMES_KEYWORD_COLUMN, &keyword, SCHEMES_ALREADY_USED_COLUMN, &used, -1 );
+		}
+
+		data->pf_on_sel_changed( keyword, used, data->user_data );
+
+		g_free( keyword );
+	}
 }
 
 static void
@@ -597,9 +608,6 @@ on_remove_clicked( GtkButton *button, BaseWindow *window )
 	delete_row( window );
 }
 
-/*
- * do not allow edition of scheme description when editing an action
- */
 static void
 on_desc_edited( GtkCellRendererText *renderer, const gchar *path, const gchar *text, BaseWindow *window )
 {
@@ -614,76 +622,7 @@ on_desc_edited( GtkCellRendererText *renderer, const gchar *path, const gchar *t
 static void
 on_keyword_edited( GtkCellRendererText *renderer, const gchar *path, const gchar *text, BaseWindow *window )
 {
-	gboolean state = FALSE;
-	gchar *old_text = NULL;
-	NAObjectProfile *edited;
-
-	edit_cell( window, path, text, SCHEMES_KEYWORD_COLUMN, &state, &old_text );
-
-	if( state ){
-		/*g_debug( "%s: old_scheme=%s", thisfn, old_text );*/
-		if( g_object_class_find_property( G_OBJECT_GET_CLASS( window ), TAB_UPDATABLE_PROP_EDITED_PROFILE )){
-			g_object_get(
-					G_OBJECT( window ),
-					TAB_UPDATABLE_PROP_EDITED_PROFILE, &edited,
-					NULL );
-			if( edited ){
-				na_object_set_scheme( edited, old_text, FALSE );
-				na_object_set_scheme( edited, text, TRUE );
-				g_signal_emit_by_name( G_OBJECT( window ), TAB_UPDATABLE_SIGNAL_ITEM_UPDATED, edited, FALSE );
-			}
-		}
-	}
-
-	g_free( old_text );
-}
-
-static void
-on_active_toggled( GtkCellRendererToggle *renderer, gchar *path, BaseWindow *window )
-{
-	GtkTreeView *treeview;
-	gboolean editable;
-	NAObjectProfile *edited;
-	GtkTreeModel *model;
-	GtkTreeIter iter;
-	GtkTreePath *tree_path;
-	gboolean state;
-	gchar *scheme;
-
-	if( !st_on_selection_change ){
-
-		treeview = GTK_TREE_VIEW( g_object_get_data( G_OBJECT( window ), SCHEMES_LIST_TREEVIEW ));
-		editable = ( gboolean ) GPOINTER_TO_UINT( g_object_get_data( G_OBJECT( treeview ), SCHEMES_LIST_EDITABLE ));
-		model = gtk_tree_view_get_model( treeview );
-		tree_path = gtk_tree_path_new_from_string( path );
-		gtk_tree_model_get_iter( model, &iter, tree_path );
-		gtk_tree_path_free( tree_path );
-		gtk_tree_model_get( model, &iter, SCHEMES_CHECKBOX_COLUMN, &state, SCHEMES_KEYWORD_COLUMN, &scheme, -1 );
-
-			/* gtk_tree_model_get: returns the previous state
-			g_debug( "%s: gtk_tree_model_get returns keyword=%s state=%s", thisfn, scheme, state ? "True":"False" );*/
-
-		if( !editable ){
-			g_signal_handlers_block_by_func(( gpointer ) renderer, on_active_toggled, window );
-			gtk_cell_renderer_toggle_set_active( renderer, state );
-			g_signal_handlers_unblock_by_func(( gpointer ) renderer, on_active_toggled, window );
-
-		} else {
-			gtk_list_store_set( GTK_LIST_STORE( model ), &iter, SCHEMES_CHECKBOX_COLUMN, !state, -1 );
-			if( g_object_class_find_property( G_OBJECT_GET_CLASS( window ), TAB_UPDATABLE_PROP_EDITED_PROFILE )){
-				g_object_get(
-						G_OBJECT( window ),
-						TAB_UPDATABLE_PROP_EDITED_PROFILE, &edited,
-						NULL );
-				if( edited ){
-					na_object_set_scheme( edited, scheme, !state );
-					g_signal_emit_by_name( G_OBJECT( window ), TAB_UPDATABLE_SIGNAL_ITEM_UPDATED, edited, FALSE );
-				}
-			}
-		}
-
-		g_free( scheme );
-	}
+	edit_cell( window, path, text, SCHEMES_KEYWORD_COLUMN, NULL, NULL );
 }
 
 static void
@@ -701,15 +640,12 @@ edit_cell( BaseWindow *window, const gchar *path_string, const gchar *text, gint
 	gtk_tree_path_free( path );
 
 	if( state && old_text ){
-		gtk_tree_model_get( model, &iter, SCHEMES_CHECKBOX_COLUMN, state, SCHEMES_KEYWORD_COLUMN, old_text, -1 );
+		gtk_tree_model_get( model, &iter, SCHEMES_ALREADY_USED_COLUMN, state, SCHEMES_KEYWORD_COLUMN, old_text, -1 );
 	}
 
 	gtk_list_store_set( GTK_LIST_STORE( model ), &iter, column, text, -1 );
 }
 
-/*
- * do not allow edition of scheme description when editing an action
- */
 static void
 edit_inline( BaseWindow *window )
 {
@@ -742,19 +678,17 @@ insert_new_row( BaseWindow *window )
 	GtkTreeView *listview;
 	GtkTreeModel *model;
 	GtkTreeIter iter;
-	gboolean for_action;
 	GtkTreePath *path;
 	GtkTreeViewColumn *column;
 
 	listview = GTK_TREE_VIEW( g_object_get_data( G_OBJECT( window ), SCHEMES_LIST_TREEVIEW ));
 	model = gtk_tree_view_get_model( listview );
-	for_action = ( gboolean ) GPOINTER_TO_UINT( g_object_get_data( G_OBJECT( listview ), SCHEMES_LIST_FOR_ACTION ));
 
 	gtk_list_store_insert_with_values( GTK_LIST_STORE( model ), &iter, 0,
-			SCHEMES_CHECKBOX_COLUMN, FALSE,
 			/* i18n notes : scheme name set for a new entry in the scheme list */
 			SCHEMES_KEYWORD_COLUMN, _( "new-scheme" ),
-			SCHEMES_DESC_COLUMN, for_action ? "" : _( "New scheme description" ),
+			SCHEMES_DESC_COLUMN, _( "New scheme description" ),
+			SCHEMES_ALREADY_USED_COLUMN, FALSE,
 			-1 );
 
 	path = gtk_tree_model_get_path( model, &iter );
@@ -766,15 +700,12 @@ insert_new_row( BaseWindow *window )
 static void
 delete_row( BaseWindow *window )
 {
-	NAObjectProfile *edited;
 	GtkTreeView *listview;
 	GtkTreeSelection *selection;
 	GtkTreeModel *model;
 	GList *rows;
 	GtkTreeIter iter;
 	GtkTreePath *path;
-	gboolean toggle_state;
-	gchar *scheme;
 
 	listview = GTK_TREE_VIEW( g_object_get_data( G_OBJECT( window ), SCHEMES_LIST_TREEVIEW ));
 	selection = gtk_tree_view_get_selection( listview );
@@ -785,29 +716,10 @@ delete_row( BaseWindow *window )
 	if( g_list_length( rows ) == 1 ){
 		path = ( GtkTreePath * ) rows->data;
 		gtk_tree_model_get_iter( model, &iter, path );
-		gtk_tree_model_get( model, &iter,
-				SCHEMES_CHECKBOX_COLUMN, &toggle_state,
-				SCHEMES_KEYWORD_COLUMN, &scheme, -1 );
 		gtk_list_store_remove( GTK_LIST_STORE( model ), &iter );
 
-		if( toggle_state ){
-			if( g_object_class_find_property( G_OBJECT_GET_CLASS( window ), TAB_UPDATABLE_PROP_EDITED_PROFILE )){
-				g_object_get(
-						G_OBJECT( window ),
-						TAB_UPDATABLE_PROP_EDITED_PROFILE, &edited,
-						NULL );
-				if( edited ){
-					na_object_set_scheme( edited, scheme, FALSE );
-					g_signal_emit_by_name( G_OBJECT( window ), TAB_UPDATABLE_SIGNAL_ITEM_UPDATED, edited, FALSE );
-				}
-			}
-		}
-
-		g_free( scheme );
-
 		if( gtk_tree_model_get_iter( model, &iter, path ) ||
 			gtk_tree_path_prev( path )){
-
 			gtk_tree_view_set_cursor( listview, path, NULL, FALSE );
 		}
 	}
@@ -816,6 +728,31 @@ delete_row( BaseWindow *window )
 	g_list_free( rows );
 }
 
+static void
+display_keyword( GtkTreeViewColumn *column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, SchemesListData *data )
+{
+	display_label( column, cell, model, iter, data, SCHEMES_KEYWORD_COLUMN );
+}
+
+static void
+display_description( GtkTreeViewColumn *column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, SchemesListData *data )
+{
+	display_label( column, cell, model, iter, data, SCHEMES_DESC_COLUMN );
+}
+
+static void
+display_label( GtkTreeViewColumn *column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, SchemesListData *data, guint column_id )
+{
+	gboolean used;
+
+	gtk_tree_model_get( model, iter, SCHEMES_ALREADY_USED_COLUMN, &used, -1 );
+	g_object_set( cell, "style-set", FALSE, NULL );
+
+	if( used ){
+		g_object_set( cell, "style", PANGO_STYLE_ITALIC, "style-set", TRUE, NULL );
+	}
+}
+
 static GtkButton *
 get_add_button( BaseWindow *window )
 {
@@ -835,3 +772,19 @@ get_remove_button( BaseWindow *window )
 
 	return( button );
 }
+
+static SchemesListData *
+get_schemes_list_data( GtkTreeView *treeview )
+{
+	SchemesListData *data;
+
+	data = ( SchemesListData * ) g_object_get_data( G_OBJECT( treeview ), SCHEMES_LIST_DATA );
+
+	if( data == NULL ){
+		data = g_new0( SchemesListData, 1 );
+		g_object_set_data( G_OBJECT( treeview ), SCHEMES_LIST_DATA, data );
+		data->treeview = treeview;
+	}
+
+	return( data );
+}
diff --git a/src/nact/nact-schemes-list.h b/src/nact/nact-schemes-list.h
index e27af7a..8daab9e 100644
--- a/src/nact/nact-schemes-list.h
+++ b/src/nact/nact-schemes-list.h
@@ -31,18 +31,62 @@
 #ifndef __NACT_SCHEMES_LIST_H__
 #define __NACT_SCHEMES_LIST_H__
 
+/**
+ * SECTION: nact_schemes_list
+ * @short_description: Schemes list view management.
+ * @include: nact/nact-schemes-list.h
+ *
+ * This set of functions manages the schemes list view.
+ *
+ * Up to 2.30.x, two modes were possible:
+ * - for action: the full list is displayed, and a check box is made active
+ *   when the scheme is actually selected in the profile.
+ *   Adding a scheme insert an editable new row (without the description).
+ *   Inline edition of the scheme is possible.
+ *   Removing a scheme is possible.
+ * - in preferences, when editing the default list of schemes
+ *   the 'active' checkbox is not displayed
+ *   the two columns 'scheme' and 'description' are editable inline
+ *   adding/removing a scheme is possible
+ *
+ * Starting with 2.31.x serie (future 3.0), the scheme conditions of a
+ * #NAIContext are handled by nact-match-list.{c,h} set of function.
+ * This set of functions is only used:
+ *  a) to edit the preferences
+ *     add/remove scheme
+ *     edit keyword and description
+ *     In this mode, the widget is embedded in the Preferences notebook.
+ *     Modifications are saved when user clicks the global OK button.
+ *  b) to select a scheme from the default list
+ *     schemes already used by the current #NAIContext are marked as used
+ *     edition of the current list is not available
+ *     In this mode, widget is embedded in a dedicated #NactAddSchemeDialog
+ *     dialog box
+ *     OK returns the current selection (only available if current scheme
+ *     is not already used)
+ *     Cancel returns NULL.
+ */
+
 #include <gtk/gtk.h>
 
 #include "base-window.h"
 
 G_BEGIN_DECLS
 
-void    nact_schemes_list_create_model( GtkTreeView *treeview, gboolean for_action );
-void    nact_schemes_list_init_view( GtkTreeView *treeview, BaseWindow *window );
-void    nact_schemes_list_setup_values( GtkTreeView *treeview, BaseWindow *window, GSList *schemes, gboolean sensitive, gboolean editable );
-GSList *nact_schemes_list_get_schemes( GtkTreeView *treeview );
-void    nact_schemes_list_save_defaults( BaseWindow *window );
-void    nact_schemes_list_dispose( BaseWindow *window );
+typedef void ( *pf_new_selection_cb )( const gchar *, gboolean, void * );
+
+enum {
+	SCHEMES_LIST_FOR_PREFERENCES = 1,
+	SCHEMES_LIST_FOR_ADD_FROM_DEFAULTS
+};
+
+void    nact_schemes_list_create_model      ( GtkTreeView *treeview, guint mode );
+void    nact_schemes_list_init_view         ( GtkTreeView *treeview, BaseWindow *window, pf_new_selection_cb pf, void *user_data );
+void    nact_schemes_list_setup_values      ( BaseWindow *window, GSList *schemes );
+void    nact_schemes_list_show_all          ( BaseWindow *window );
+gchar  *nact_schemes_list_get_current_scheme( BaseWindow *window );
+void    nact_schemes_list_save_defaults     ( BaseWindow *window );
+void    nact_schemes_list_dispose           ( BaseWindow *window );
 
 G_END_DECLS
 
diff --git a/src/nact/nautilus-actions-config-tool.ui b/src/nact/nautilus-actions-config-tool.ui
index 15fd21c..b5a4c64 100644
--- a/src/nact/nautilus-actions-config-tool.ui
+++ b/src/nact/nautilus-actions-config-tool.ui
@@ -1108,27 +1108,17 @@ Defining several profiles lets you have several commands, each applying with a d
                                         <property name="visible">True</property>
                                         <property name="spacing">6</property>
                                         <child>
-                                          <object class="GtkVBox" id="vbox11">
+                                          <object class="GtkScrolledWindow" id="scrolledwindow2">
                                             <property name="visible">True</property>
-                                            <property name="orientation">vertical</property>
-                                            <property name="spacing">10</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="hscrollbar_policy">automatic</property>
+                                            <property name="vscrollbar_policy">automatic</property>
+                                            <property name="shadow_type">in</property>
                                             <child>
-                                              <object class="GtkScrolledWindow" id="scrolledwindow2">
+                                              <object class="GtkTreeView" id="FoldersTreeview">
                                                 <property name="visible">True</property>
                                                 <property name="can_focus">True</property>
-                                                <property name="hscrollbar_policy">automatic</property>
-                                                <property name="vscrollbar_policy">automatic</property>
-                                                <property name="shadow_type">in</property>
-                                                <child>
-                                                  <object class="GtkTreeView" id="FoldersTreeview">
-                                                    <property name="visible">True</property>
-                                                    <property name="can_focus">True</property>
-                                                  </object>
-                                                </child>
                                               </object>
-                                              <packing>
-                                                <property name="position">0</property>
-                                              </packing>
                                             </child>
                                           </object>
                                           <packing>
@@ -1136,20 +1126,46 @@ Defining several profiles lets you have several commands, each applying with a d
                                           </packing>
                                         </child>
                                         <child>
-                                          <object class="GtkVBox" id="vbox8">
+                                          <object class="GtkVBox" id="vbox4">
                                             <property name="visible">True</property>
                                             <property name="orientation">vertical</property>
-                                            <property name="spacing">6</property>
+                                            <property name="spacing">12</property>
                                             <child>
-                                              <object class="GtkButton" id="AddFolderButton">
+                                              <object class="GtkVBox" id="vbox8">
                                                 <property name="visible">True</property>
-                                                <property name="can_focus">True</property>
-                                                <property name="receives_default">True</property>
+                                                <property name="orientation">vertical</property>
+                                                <property name="spacing">6</property>
                                                 <child>
-                                                  <object class="GtkImage" id="image10">
+                                                  <object class="GtkButton" id="AddFolderButton">
                                                     <property name="visible">True</property>
-                                                    <property name="stock">gtk-add</property>
+                                                    <property name="can_focus">True</property>
+                                                    <property name="receives_default">True</property>
+                                                    <child>
+                                                      <object class="GtkImage" id="image10">
+                                                        <property name="visible">True</property>
+                                                        <property name="stock">gtk-add</property>
+                                                      </object>
+                                                    </child>
                                                   </object>
+                                                  <packing>
+                                                    <property name="expand">False</property>
+                                                    <property name="fill">False</property>
+                                                    <property name="position">0</property>
+                                                  </packing>
+                                                </child>
+                                                <child>
+                                                  <object class="GtkButton" id="FolderBrowseButton">
+                                                    <property name="label" translatable="yes">_Browse...</property>
+                                                    <property name="visible">True</property>
+                                                    <property name="can_focus">True</property>
+                                                    <property name="receives_default">True</property>
+                                                    <property name="image">FolderBrowseImage</property>
+                                                    <property name="use_underline">True</property>
+                                                  </object>
+                                                  <packing>
+                                                    <property name="expand">False</property>
+                                                    <property name="position">1</property>
+                                                  </packing>
                                                 </child>
                                               </object>
                                               <packing>
@@ -1283,20 +1299,46 @@ Defining several profiles lets you have several commands, each applying with a d
                                           </packing>
                                         </child>
                                         <child>
-                                          <object class="GtkVBox" id="vbox345">
+                                          <object class="GtkVBox" id="vbox10">
                                             <property name="visible">True</property>
                                             <property name="orientation">vertical</property>
-                                            <property name="spacing">6</property>
+                                            <property name="spacing">12</property>
                                             <child>
-                                              <object class="GtkButton" id="AddSchemeButton">
+                                              <object class="GtkVBox" id="vbox19">
                                                 <property name="visible">True</property>
-                                                <property name="can_focus">True</property>
-                                                <property name="receives_default">True</property>
+                                                <property name="orientation">vertical</property>
+                                                <property name="spacing">6</property>
                                                 <child>
-                                                  <object class="GtkImage" id="image16">
+                                                  <object class="GtkButton" id="AddSchemeButton">
                                                     <property name="visible">True</property>
-                                                    <property name="stock">gtk-add</property>
+                                                    <property name="can_focus">True</property>
+                                                    <property name="receives_default">True</property>
+                                                    <child>
+                                                      <object class="GtkImage" id="image16">
+                                                        <property name="visible">True</property>
+                                                        <property name="stock">gtk-add</property>
+                                                      </object>
+                                                    </child>
                                                   </object>
+                                                  <packing>
+                                                    <property name="expand">False</property>
+                                                    <property name="fill">False</property>
+                                                    <property name="position">0</property>
+                                                  </packing>
+                                                </child>
+                                                <child>
+                                                  <object class="GtkButton" id="AddFromDefaultButton">
+                                                    <property name="label" translatable="yes">A_dd from common...</property>
+                                                    <property name="visible">True</property>
+                                                    <property name="can_focus">True</property>
+                                                    <property name="receives_default">True</property>
+                                                    <property name="image">SchemeBrowseImage</property>
+                                                    <property name="use_underline">True</property>
+                                                  </object>
+                                                  <packing>
+                                                    <property name="expand">False</property>
+                                                    <property name="position">1</property>
+                                                  </packing>
                                                 </child>
                                               </object>
                                               <packing>
@@ -2553,6 +2595,15 @@ Defining several profiles lets you have several commands, each applying with a d
       <placeholder/>
     </child>
     <child>
+      <placeholder/>
+    </child>
+    <child>
+      <placeholder/>
+    </child>
+    <child>
+      <placeholder/>
+    </child>
+    <child>
       <object class="GtkLabel" id="label3">
         <property name="visible">True</property>
         <property name="label" translatable="yes">This assistant will guide you through the process of importing items, actions or menus.</property>
@@ -2570,8 +2621,8 @@ Defining several profiles lets you have several commands, each applying with a d
             <property name="visible">True</property>
             <property name="use_preview_label">False</property>
             <property name="local_only">False</property>
-            <property name="select_multiple">True</property>
             <property name="preview_widget_active">False</property>
+            <property name="select_multiple">True</property>
           </object>
           <packing>
             <property name="position">0</property>
@@ -3360,41 +3411,49 @@ Be warned: this mode may be dangerous. You will not be prompted another time.</p
     <property name="visible">True</property>
     <property name="stock">gtk-find-and-replace</property>
   </object>
+  <object class="GtkImage" id="FolderBrowseImage">
+    <property name="visible">True</property>
+    <property name="stock">gtk-find-and-replace</property>
+  </object>
+  <object class="GtkImage" id="SchemeBrowseImage">
+    <property name="visible">True</property>
+    <property name="stock">gtk-find-and-replace</property>
+  </object>
   <object class="GtkSizeGroup" id="CommandLabelSizeGroup">
     <widgets>
-      <widget name="ProfileLabelLabel"/>
-      <widget name="CommandPathLabel"/>
-      <widget name="CommandParametersLabel"/>
       <widget name="label4"/>
+      <widget name="CommandParametersLabel"/>
+      <widget name="CommandPathLabel"/>
+      <widget name="ProfileLabelLabel"/>
     </widgets>
   </object>
   <object class="GtkSizeGroup" id="CommandButtonSizeGroup">
     <widgets>
-      <widget name="CommandPathButton"/>
       <widget name="CommandLegendButton"/>
+      <widget name="CommandPathButton"/>
     </widgets>
   </object>
   <object class="GtkSizeGroup" id="ActionLabelSizeGroup">
     <widgets>
-      <widget name="ActionIconLabel"/>
-      <widget name="ActionTooltipLabel"/>
-      <widget name="ActionToolbarLabelLabel"/>
       <widget name="ActionMenuLabelLabel"/>
+      <widget name="ActionToolbarLabelLabel"/>
+      <widget name="ActionTooltipLabel"/>
+      <widget name="ActionIconLabel"/>
     </widgets>
   </object>
   <object class="GtkSizeGroup" id="ExecutionModeSizeGroup">
     <widgets>
-      <widget name="label45"/>
-      <widget name="label44"/>
       <widget name="label43"/>
+      <widget name="label44"/>
+      <widget name="label45"/>
     </widgets>
   </object>
   <object class="GtkSizeGroup" id="PropertiesLabelSizeGroup">
     <widgets>
-      <widget name="label19"/>
-      <widget name="label49"/>
-      <widget name="label39"/>
       <widget name="label18"/>
+      <widget name="label39"/>
+      <widget name="label49"/>
+      <widget name="label19"/>
     </widgets>
   </object>
 </interface>



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