[nautilus-actions] Define all new fields in the user interface
- From: Pierre Wieser <pwieser src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus-actions] Define all new fields in the user interface
- Date: Thu, 10 Jun 2010 22:35:30 +0000 (UTC)
commit 1f4a910e9bf3350724b5485a4573f5fc0b3d9807
Author: Pierre Wieser <pwieser trychlos org>
Date: Sat May 29 23:27:34 2010 +0200
Define all new fields in the user interface
Note: this commit is not compilable.
ChangeLog | 3 +
src/nact/Makefile.am | 10 +-
src/nact/nact-ibasenames-tab.c | 860 +++++++++++++++
src/nact/nact-ibasenames-tab.h | 71 ++
src/nact/nact-icommand-tab.c | 8 +-
src/nact/nact-iconditions-tab.c | 695 -------------
src/nact/nact-iconditions-tab.h | 74 --
src/nact/nact-ienvironment-tab.c | 860 +++++++++++++++
src/nact/nact-ienvironment-tab.h | 71 ++
src/nact/nact-iexecution-tab.c | 860 +++++++++++++++
src/nact/nact-iexecution-tab.h | 71 ++
src/nact/nact-imimetypes-tab.c | 860 +++++++++++++++
src/nact/nact-imimetypes-tab.h | 71 ++
src/nact/nautilus-actions-config-tool.ui | 1676 ++++++++++++++++++++++++++----
14 files changed, 5197 insertions(+), 993 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index cb391f5..173b7de 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,6 +10,9 @@
* configure.ac: Define GSEAL_ENABLED.
+ * src/nact/nautilus-actions-config-tool.ui:
+ Implement all new fields.
+
2010-05-26 Pierre Wieser <pwieser trychlos org>
* src/api/na-core-utils.h:
diff --git a/src/nact/Makefile.am b/src/nact/Makefile.am
index 28add0d..cb4af66 100644
--- a/src/nact/Makefile.am
+++ b/src/nact/Makefile.am
@@ -93,12 +93,18 @@ nautilus_actions_config_tool_SOURCES = \
nact-iactions-list-priv.h \
nact-iaction-tab.c \
nact-iaction-tab.h \
+ nact-ibasenames-tab.c \
+ nact-ibasenames-tab.h \
+ nact-ienvironment-tab.c \
+ nact-ienvironment-tab.h \
+ nact-iexecution-tab.c \
+ nact-iexecution-tab.h \
nact-ifolders-tab.c \
nact-ifolders-tab.h \
nact-icommand-tab.c \
nact-icommand-tab.h \
- nact-iconditions-tab.c \
- nact-iconditions-tab.h \
+ nact-imimetypes-tab.c \
+ nact-imimetypes-tab.h \
nact-iprefs.c \
nact-iprefs.h \
nact-iproperties-tab.c \
diff --git a/src/nact/nact-ibasenames-tab.c b/src/nact/nact-ibasenames-tab.c
new file mode 100644
index 0000000..24401c8
--- /dev/null
+++ b/src/nact/nact-ibasenames-tab.c
@@ -0,0 +1,860 @@
+/*
+ * 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 <glib/gi18n.h>
+#include <string.h>
+
+#include <api/na-core-utils.h>
+#include <api/na-object-api.h>
+
+#include <core/na-iprefs.h>
+
+#include "base-window.h"
+#include "base-iprefs.h"
+#include "nact-application.h"
+#include "nact-main-statusbar.h"
+#include "nact-gtk-utils.h"
+#include "nact-iprefs.h"
+#include "nact-iactions-list.h"
+#include "nact-main-tab.h"
+#include "nact-icommand-tab.h"
+#include "nact-iconditions-tab.h"
+#include "nact-ischemes-tab.h"
+
+/* private interface data
+ */
+struct NactICommandTabInterfacePrivate {
+ void *empty; /* so that gcc -pedantic is happy */
+};
+
+/* the GConf key used to read/write size and position of auxiliary dialogs
+ */
+#define IPREFS_LEGEND_DIALOG "icommand-legend-dialog"
+#define IPREFS_COMMAND_CHOOSER "icommand-command-chooser"
+#define IPREFS_FOLDER_URI "icommand-folder-uri"
+
+/* a data set in the LegendDialog GObject
+ */
+#define ICOMMAND_TAB_LEGEND_VISIBLE "nact-icommand-tab-legend-dialog-visible"
+#define ICOMMAND_TAB_STATUSBAR_CONTEXT "nact-icommand-tab-statusbar-context"
+
+static gboolean st_initialized = FALSE;
+static gboolean st_finalized = FALSE;
+static gboolean st_on_selection_change = FALSE;
+
+static GType register_type( void );
+static void interface_base_init( NactICommandTabInterface *klass );
+static void interface_base_finalize( NactICommandTabInterface *klass );
+
+static void on_iactions_list_column_edited( NactICommandTab *instance, NAObject *object, gchar *text, gint column );
+static void on_tab_updatable_selection_changed( NactICommandTab *instance, gint count_selected );
+static gboolean tab_set_sensitive( NactICommandTab *instance );
+
+static void check_for_label( NactICommandTab *instance, GtkEntry *entry, const gchar *label );
+static GtkWidget *get_label_entry( NactICommandTab *instance );
+static GtkButton *get_legend_button( NactICommandTab *instance );
+static GtkWindow *get_legend_dialog( NactICommandTab *instance );
+static GtkWidget *get_parameters_entry( NactICommandTab *instance );
+static GtkButton *get_path_button( NactICommandTab *instance );
+static GtkWidget *get_path_entry( NactICommandTab *instance );
+static void legend_dialog_show( NactICommandTab *instance );
+static void legend_dialog_hide( NactICommandTab *instance );
+static void on_label_changed( GtkEntry *entry, NactICommandTab *instance );
+static void on_legend_clicked( GtkButton *button, NactICommandTab *instance );
+static void on_parameters_changed( GtkEntry *entry, NactICommandTab *instance );
+static void on_path_browse( GtkButton *button, NactICommandTab *instance );
+static void on_path_changed( GtkEntry *entry, NactICommandTab *instance );
+static gchar *parse_parameters( NactICommandTab *instance );
+static void set_label_label( NactICommandTab *instance, const gchar *color );
+static void update_example_label( NactICommandTab *instance, NAObjectProfile *profile );
+
+GType
+nact_icommand_tab_get_type( void )
+{
+ static GType iface_type = 0;
+
+ if( !iface_type ){
+ iface_type = register_type();
+ }
+
+ return( iface_type );
+}
+
+static GType
+register_type( void )
+{
+ static const gchar *thisfn = "nact_icommand_tab_register_type";
+ GType type;
+
+ static const GTypeInfo info = {
+ sizeof( NactICommandTabInterface ),
+ ( GBaseInitFunc ) interface_base_init,
+ ( GBaseFinalizeFunc ) interface_base_finalize,
+ NULL,
+ NULL,
+ NULL,
+ 0,
+ 0,
+ NULL
+ };
+
+ g_debug( "%s", thisfn );
+
+ type = g_type_register_static( G_TYPE_INTERFACE, "NactICommandTab", &info, 0 );
+
+ g_type_interface_add_prerequisite( type, BASE_WINDOW_TYPE );
+
+ return( type );
+}
+
+static void
+interface_base_init( NactICommandTabInterface *klass )
+{
+ static const gchar *thisfn = "nact_icommand_tab_interface_base_init";
+
+ if( !st_initialized ){
+
+ g_debug( "%s: klass=%p", thisfn, ( void * ) klass );
+
+ klass->private = g_new0( NactICommandTabInterfacePrivate, 1 );
+
+ st_initialized = TRUE;
+ }
+}
+
+static void
+interface_base_finalize( NactICommandTabInterface *klass )
+{
+ static const gchar *thisfn = "nact_icommand_tab_interface_base_finalize";
+
+ if( st_initialized && !st_finalized ){
+
+ g_debug( "%s: klass=%p", thisfn, ( void * ) klass );
+
+ st_finalized = TRUE;
+
+ g_free( klass->private );
+ }
+}
+
+/**
+ * nact_icommand_tab_initial_load:
+ * @window: this #NactICommandTab instance.
+ *
+ * Initializes the tab widget at initial load.
+ *
+ * The GConf preference keys used in this tab were misnamed from v1.11.1
+ * up to and including v1.12.0. Starting with v1.12.1, these are migrated
+ * here, so that the normal code only makes use of 'good' keys.
+ */
+void
+nact_icommand_tab_initial_load_toplevel( NactICommandTab *instance )
+{
+ static const gchar *thisfn = "nact_icommand_tab_initial_load_toplevel";
+
+ g_debug( "%s: instance=%p", thisfn, ( void * ) instance );
+ g_return_if_fail( NACT_IS_ICOMMAND_TAB( instance ));
+
+ if( st_initialized && !st_finalized ){
+
+ nact_iprefs_migrate_key( BASE_WINDOW( instance ), "iconditions-legend-dialog", IPREFS_LEGEND_DIALOG );
+ nact_iprefs_migrate_key( BASE_WINDOW( instance ), "iconditions-command-chooser", IPREFS_COMMAND_CHOOSER );
+ nact_iprefs_migrate_key( BASE_WINDOW( instance ), "iconditions-folder-uri", IPREFS_FOLDER_URI );
+ }
+}
+
+/**
+ * nact_icommand_tab_runtime_init:
+ * @window: this #NactICommandTab instance.
+ *
+ * Initializes the tab widget at each time the widget will be displayed.
+ * Connect signals and setup runtime values.
+ */
+void
+nact_icommand_tab_runtime_init_toplevel( NactICommandTab *instance )
+{
+ static const gchar *thisfn = "nact_icommand_tab_runtime_init_toplevel";
+ GtkWidget *label_entry, *path_entry, *parameters_entry;
+ GtkButton *path_button, *legend_button;
+
+ g_debug( "%s: instance=%p", thisfn, ( void * ) instance );
+ g_return_if_fail( NACT_IS_ICOMMAND_TAB( instance ));
+
+ if( st_initialized && !st_finalized ){
+
+ label_entry = get_label_entry( instance );
+ base_window_signal_connect(
+ BASE_WINDOW( instance ),
+ G_OBJECT( label_entry ),
+ "changed",
+ G_CALLBACK( on_label_changed ));
+
+ path_entry = get_path_entry( instance );
+ base_window_signal_connect(
+ BASE_WINDOW( instance ),
+ G_OBJECT( path_entry ),
+ "changed",
+ G_CALLBACK( on_path_changed ));
+
+ path_button = get_path_button( instance );
+ base_window_signal_connect(
+ BASE_WINDOW( instance ),
+ G_OBJECT( path_button ),
+ "clicked",
+ G_CALLBACK( on_path_browse ));
+
+ parameters_entry = get_parameters_entry( instance );
+ base_window_signal_connect(
+ BASE_WINDOW( instance ),
+ G_OBJECT( parameters_entry ),
+ "changed",
+ G_CALLBACK( on_parameters_changed ));
+
+ legend_button = get_legend_button( instance );
+ base_window_signal_connect(
+ BASE_WINDOW( instance ),
+ G_OBJECT( legend_button ),
+ "clicked",
+ G_CALLBACK( on_legend_clicked ));
+
+ base_window_signal_connect(
+ BASE_WINDOW( instance ),
+ G_OBJECT( instance ),
+ MAIN_WINDOW_SIGNAL_SELECTION_CHANGED,
+ G_CALLBACK( on_tab_updatable_selection_changed ));
+
+ base_window_signal_connect(
+ BASE_WINDOW( instance ),
+ G_OBJECT( instance ),
+ IACTIONS_LIST_SIGNAL_COLUMN_EDITED,
+ G_CALLBACK( on_iactions_list_column_edited ));
+ }
+}
+
+void
+nact_icommand_tab_all_widgets_showed( NactICommandTab *instance )
+{
+ static const gchar *thisfn = "nact_icommand_tab_all_widgets_showed";
+
+ g_debug( "%s: instance=%p", thisfn, ( void * ) instance );
+ g_return_if_fail( NACT_IS_ICOMMAND_TAB( instance ));
+
+ if( st_initialized && !st_finalized ){
+ }
+}
+
+/**
+ * nact_icommand_tab_dispose:
+ * @window: this #NactICommandTab instance.
+ *
+ * Called at instance_dispose time.
+ */
+void
+nact_icommand_tab_dispose( NactICommandTab *instance )
+{
+ static const gchar *thisfn = "nact_icommand_tab_dispose";
+
+ g_debug( "%s: instance=%p", thisfn, ( void * ) instance );
+ g_return_if_fail( NACT_IS_ICOMMAND_TAB( instance ));
+
+ if( st_initialized && !st_finalized ){
+ legend_dialog_hide( instance );
+ }
+}
+
+static void
+on_iactions_list_column_edited( NactICommandTab *instance, NAObject *object, gchar *text, gint column )
+{
+ GtkWidget *label_widget;
+
+ g_return_if_fail( NACT_IS_ICOMMAND_TAB( instance ));
+
+ if( st_initialized && !st_finalized ){
+
+ if( NA_IS_OBJECT_PROFILE( object )){
+ label_widget = get_label_entry( instance );
+ gtk_entry_set_text( GTK_ENTRY( label_widget ), text );
+ }
+ }
+}
+
+static void
+on_tab_updatable_selection_changed( NactICommandTab *instance, gint count_selected )
+{
+ static const gchar *thisfn = "nact_icommand_tab_on_tab_updatable_selection_changed";
+ NAObjectItem *item;
+ NAObjectProfile *profile;
+ gboolean enable_tab;
+ GtkWidget *label_entry, *path_entry, *parameters_entry;
+ gchar *label, *path, *parameters;
+ gboolean editable;
+ GtkButton *path_button;
+ GtkButton *legend_button;
+
+ g_debug( "%s: instance=%p, count_selected=%d", thisfn, ( void * ) instance, count_selected );
+ g_return_if_fail( NACT_IS_ICOMMAND_TAB( instance ));
+
+ if( st_initialized && !st_finalized ){
+
+ st_on_selection_change = TRUE;
+
+ g_object_get(
+ G_OBJECT( instance ),
+ TAB_UPDATABLE_PROP_EDITED_ACTION, &item,
+ TAB_UPDATABLE_PROP_EDITED_PROFILE, &profile,
+ TAB_UPDATABLE_PROP_EDITABLE, &editable,
+ NULL );
+
+ enable_tab = tab_set_sensitive( instance );
+
+ label_entry = get_label_entry( instance );
+ label = profile ? na_object_get_label( profile ) : g_strdup( "" );
+ label = label ? label : g_strdup( "" );
+ gtk_entry_set_text( GTK_ENTRY( label_entry ), label );
+ check_for_label( instance, GTK_ENTRY( label_entry ), label );
+ g_free( label );
+ gtk_widget_set_sensitive( label_entry, profile != NULL );
+ nact_gtk_utils_set_editable( GTK_OBJECT( label_entry ), editable );
+
+ path_entry = get_path_entry( instance );
+ path = profile ? na_object_get_path( profile ) : g_strdup( "" );
+ path = path ? path : g_strdup( "" );
+ gtk_entry_set_text( GTK_ENTRY( path_entry ), path );
+ g_free( path );
+ gtk_widget_set_sensitive( path_entry, profile != NULL );
+ nact_gtk_utils_set_editable( GTK_OBJECT( path_entry ), editable );
+
+ path_button = get_path_button( instance );
+ gtk_widget_set_sensitive( GTK_WIDGET( path_button ), profile != NULL );
+ nact_gtk_utils_set_editable( GTK_OBJECT( path_button ), editable );
+
+ parameters_entry = get_parameters_entry( instance );
+ parameters = profile ? na_object_get_parameters( profile ) : g_strdup( "" );
+ parameters = parameters ? parameters : g_strdup( "" );
+ gtk_entry_set_text( GTK_ENTRY( parameters_entry ), parameters );
+ g_free( parameters );
+ gtk_widget_set_sensitive( parameters_entry, profile != NULL );
+ nact_gtk_utils_set_editable( GTK_OBJECT( parameters_entry ), editable );
+
+ legend_button = get_legend_button( instance );
+ gtk_widget_set_sensitive( GTK_WIDGET( legend_button ), profile != NULL );
+
+ st_on_selection_change = FALSE;
+ }
+}
+
+static gboolean
+tab_set_sensitive( NactICommandTab *instance )
+{
+ NAObjectProfile *profile;
+ gboolean enable_tab;
+
+ g_object_get(
+ G_OBJECT( instance ),
+ TAB_UPDATABLE_PROP_EDITED_PROFILE, &profile,
+ NULL );
+
+ enable_tab = ( profile != NULL );
+ nact_main_tab_enable_page( NACT_MAIN_WINDOW( instance ), TAB_COMMAND, enable_tab );
+
+ return( enable_tab );
+}
+
+static void
+check_for_label( NactICommandTab *instance, GtkEntry *entry, const gchar *label )
+{
+ NAObjectProfile *edited;
+
+ nact_main_statusbar_hide_status(
+ NACT_MAIN_WINDOW( instance ),
+ ICOMMAND_TAB_STATUSBAR_CONTEXT );
+
+ set_label_label( instance, "black" );
+
+ g_object_get(
+ G_OBJECT( instance ),
+ TAB_UPDATABLE_PROP_EDITED_PROFILE, &edited,
+ NULL );
+
+ if( edited && g_utf8_strlen( label, -1 ) == 0 ){
+
+ /* i18n: status bar message when the profile label is empty */
+ nact_main_statusbar_display_status(
+ NACT_MAIN_WINDOW( instance ),
+ ICOMMAND_TAB_STATUSBAR_CONTEXT,
+ _( "Caution: a label is mandatory for the profile." ));
+
+ set_label_label( instance, "red" );
+ }
+}
+
+static GtkWidget *
+get_label_entry( NactICommandTab *instance )
+{
+ return( base_window_get_widget( BASE_WINDOW( instance ), "ProfileLabelEntry" ));
+}
+
+static GtkButton *
+get_legend_button( NactICommandTab *instance )
+{
+ return( GTK_BUTTON( base_window_get_widget( BASE_WINDOW( instance ), "CommandLegendButton" )));
+}
+
+static GtkWindow *
+get_legend_dialog( NactICommandTab *instance )
+{
+ return( base_window_get_named_toplevel( BASE_WINDOW( instance ), "LegendDialog" ));
+}
+
+static GtkWidget *
+get_parameters_entry( NactICommandTab *instance )
+{
+ return( base_window_get_widget( BASE_WINDOW( instance ), "CommandParametersEntry" ));
+}
+
+static GtkButton *
+get_path_button( NactICommandTab *instance )
+{
+ return( GTK_BUTTON( base_window_get_widget( BASE_WINDOW( instance ), "CommandPathButton" )));
+}
+
+static GtkWidget *
+get_path_entry( NactICommandTab *instance )
+{
+ return( base_window_get_widget( BASE_WINDOW( instance ), "CommandPathEntry" ));
+}
+
+static void
+legend_dialog_hide( NactICommandTab *instance )
+{
+ GtkWindow *legend_dialog;
+ GtkButton *legend_button;
+ gboolean is_visible;
+
+ legend_dialog = get_legend_dialog( instance );
+ is_visible = ( gboolean ) GPOINTER_TO_INT(
+ g_object_get_data( G_OBJECT( legend_dialog ), ICOMMAND_TAB_LEGEND_VISIBLE ));
+
+ if( is_visible ){
+ g_assert( GTK_IS_WINDOW( legend_dialog ));
+ base_iprefs_save_named_window_position( BASE_WINDOW( instance ), legend_dialog, IPREFS_LEGEND_DIALOG );
+ gtk_widget_hide( GTK_WIDGET( legend_dialog ));
+
+ /* set the legend button state consistent for when the dialog is
+ * hidden by another mean (eg. close the edit profile dialog)
+ */
+ legend_button = get_legend_button( instance );
+ gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( legend_button ), FALSE );
+
+ g_object_set_data( G_OBJECT( legend_dialog ), ICOMMAND_TAB_LEGEND_VISIBLE, GINT_TO_POINTER( FALSE ));
+ }
+}
+
+static void
+legend_dialog_show( NactICommandTab *instance )
+{
+ GtkWindow *legend_dialog;
+ GtkWindow *toplevel;
+
+ legend_dialog = get_legend_dialog( instance );
+ gtk_window_set_deletable( legend_dialog, FALSE );
+
+ toplevel = base_window_get_toplevel( BASE_WINDOW( instance ));
+ gtk_window_set_transient_for( GTK_WINDOW( legend_dialog ), toplevel );
+
+ base_iprefs_position_named_window( BASE_WINDOW( instance ), legend_dialog, IPREFS_LEGEND_DIALOG );
+ gtk_widget_show( GTK_WIDGET( legend_dialog ));
+
+ g_object_set_data( G_OBJECT( legend_dialog ), ICOMMAND_TAB_LEGEND_VISIBLE, GINT_TO_POINTER( TRUE ));
+}
+
+static void
+on_label_changed( GtkEntry *entry, NactICommandTab *instance )
+{
+ NAObjectProfile *edited;
+ const gchar *label;
+
+ if( !st_on_selection_change ){
+
+ g_object_get(
+ G_OBJECT( instance ),
+ TAB_UPDATABLE_PROP_EDITED_PROFILE, &edited,
+ NULL );
+
+ if( edited ){
+ label = gtk_entry_get_text( entry );
+ na_object_set_label( edited, label );
+ g_signal_emit_by_name( G_OBJECT( instance ), TAB_UPDATABLE_SIGNAL_ITEM_UPDATED, edited, TRUE );
+ check_for_label( instance, entry, label );
+ }
+ }
+}
+
+static void
+on_legend_clicked( GtkButton *button, NactICommandTab *instance )
+{
+ if( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( button ))){
+ legend_dialog_show( instance );
+
+ } else {
+ legend_dialog_hide( instance );
+ }
+}
+
+static void
+on_parameters_changed( GtkEntry *entry, NactICommandTab *instance )
+{
+ NAObjectProfile *edited;
+
+ if( !st_on_selection_change ){
+
+ g_object_get(
+ G_OBJECT( instance ),
+ TAB_UPDATABLE_PROP_EDITED_PROFILE, &edited,
+ NULL );
+
+ if( edited ){
+ na_object_set_parameters( edited, gtk_entry_get_text( entry ));
+ g_signal_emit_by_name( G_OBJECT( instance ), TAB_UPDATABLE_SIGNAL_ITEM_UPDATED, edited, FALSE );
+ update_example_label( instance, edited );
+ }
+ }
+}
+
+static void
+on_path_browse( GtkButton *button, NactICommandTab *instance )
+{
+ gboolean set_current_location = FALSE;
+ gchar *uri = NULL;
+ NactApplication *application;
+ NAUpdater *updater;
+ GtkWindow *toplevel;
+ GtkWidget *dialog;
+ GtkWidget *path_entry;
+ const gchar *path;
+ gchar *filename;
+
+ application = NACT_APPLICATION( base_window_get_application( BASE_WINDOW( instance )));
+ updater = nact_application_get_updater( application );
+ toplevel = base_window_get_toplevel( BASE_WINDOW( instance ));
+
+ dialog = gtk_file_chooser_dialog_new(
+ _( "Choosing a command" ),
+ toplevel,
+ GTK_FILE_CHOOSER_ACTION_OPEN,
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
+ NULL
+ );
+
+ base_iprefs_position_named_window( BASE_WINDOW( instance ), GTK_WINDOW( dialog ), IPREFS_COMMAND_CHOOSER );
+
+ path_entry = get_path_entry( instance );
+ path = gtk_entry_get_text( GTK_ENTRY( path_entry ));
+
+ if( path && strlen( path )){
+ set_current_location = gtk_file_chooser_set_filename( GTK_FILE_CHOOSER( dialog ), path );
+
+ } else {
+ uri = na_iprefs_read_string( NA_IPREFS( updater ), IPREFS_FOLDER_URI, "file:///bin" );
+ gtk_file_chooser_set_current_folder_uri( GTK_FILE_CHOOSER( dialog ), uri );
+ g_free( uri );
+ }
+
+ if( gtk_dialog_run( GTK_DIALOG( dialog )) == GTK_RESPONSE_ACCEPT ){
+ filename = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER( dialog ));
+ gtk_entry_set_text( GTK_ENTRY( path_entry ), filename );
+ g_free (filename);
+ }
+
+ uri = gtk_file_chooser_get_current_folder_uri( GTK_FILE_CHOOSER( dialog ));
+ nact_iprefs_write_string( BASE_WINDOW( instance ), IPREFS_FOLDER_URI, uri );
+ g_free( uri );
+
+ base_iprefs_save_named_window_position( BASE_WINDOW( instance ), GTK_WINDOW( dialog ), IPREFS_COMMAND_CHOOSER );
+
+ gtk_widget_destroy( dialog );
+}
+
+static void
+on_path_changed( GtkEntry *entry, NactICommandTab *instance )
+{
+ NAObjectProfile *edited;
+
+ if( !st_on_selection_change ){
+
+ g_object_get(
+ G_OBJECT( instance ),
+ TAB_UPDATABLE_PROP_EDITED_PROFILE, &edited,
+ NULL );
+
+ if( edited ){
+
+ na_object_set_path( edited, gtk_entry_get_text( entry ));
+ g_signal_emit_by_name( G_OBJECT( instance ), TAB_UPDATABLE_SIGNAL_ITEM_UPDATED, edited, FALSE );
+ update_example_label( instance, edited );
+ }
+ }
+}
+
+/*
+ * Valid parameters :
+ *
+ * %d : base dir of the (first) selected file(s)/folder(s)
+ * %f : the name of the (firstà selected file/folder
+ * %h : hostname of the (first) URI
+ * %m : list of the basename of the selected files/directories separated by space.
+ * %M : list of the selected files/directories with their complete path separated by space.
+ * %p : port number of the (first) URI
+ * %R : space-separated list of selected URIs
+ * %s : scheme of the (first) URI
+ * %u : (first) URI
+ * %U : username of the (first) URI
+ * %% : a percent sign
+ */
+static gchar *
+parse_parameters( NactICommandTab *instance )
+{
+ GString *tmp_string = g_string_new( "" );
+
+ /* i18n notes: example strings for the command preview */
+ gchar *ex_path = _( "/path/to" );
+ gchar *ex_files[] = { N_( "file1.txt" ), N_( "file2.txt" ), NULL };
+ gchar *ex_dirs[] = { N_(" folder1" ), N_( "folder2" ), NULL };
+ gchar *ex_mixed[] = { N_(" file1.txt" ), N_( "folder1" ), NULL };
+ gchar *ex_scheme_default = "file";
+ gchar *ex_host_default = _( "test.example.net" );
+ gchar *ex_one_file = _( "file.txt" );
+ gchar *ex_one_dir = _( "folder" );
+ gchar *ex_port_default = _( "8080" );
+ gchar *ex_one = NULL;
+ gchar *ex_list = NULL;
+ gchar *ex_path_list = NULL;
+ gchar *ex_uri_file1 = _( "file:///path/to/file1.text" );
+ gchar *ex_uri_file2 = _( "file:///path/to/file2.text" );
+ gchar *ex_uri_folder1 = _( "file:///path/to/a/dir" );
+ gchar *ex_uri_folder2 = _( "file:///path/to/another/dir" );
+ gchar *ex_uri_list = NULL;
+ gchar *ex_scheme;
+ gchar *ex_host;
+ gboolean is_file, is_dir;
+ gboolean accept_multiple;
+ GSList *scheme_list;
+ guint iter_inc;
+
+ const gchar *command = gtk_entry_get_text( GTK_ENTRY( get_path_entry( instance )));
+ const gchar *param_template = gtk_entry_get_text( GTK_ENTRY( get_parameters_entry( instance )));
+
+ gchar *iter = g_strdup( param_template );
+ gchar *old_iter = iter;
+ gchar *tmp;
+ gchar *separator;
+ gchar *start;
+
+ g_string_append_printf( tmp_string, "%s ", command );
+
+ /*nact_iconditions_tab_get_isfiledir( NACT_ICONDITIONS_TAB( instance ), &is_file, &is_dir );
+ accept_multiple = nact_iconditions_tab_get_multiple( NACT_ICONDITIONS_TAB( instance ));*/
+ is_file = TRUE;
+ is_dir = TRUE;
+ accept_multiple = TRUE;
+
+ scheme_list = nact_ischemes_tab_get_schemes( NACT_ISCHEMES_TAB( instance ));
+
+ separator = g_strdup_printf( " %s/", ex_path );
+ start = g_strdup_printf( "%s/", ex_path );
+
+ if( accept_multiple ){
+ if( is_file && is_dir ){
+ ex_one = ex_files[0];
+ ex_list = na_core_utils_gstring_joinv( NULL, " ", ex_mixed );
+ ex_path_list = na_core_utils_gstring_joinv( start, separator, ex_mixed );
+ ex_uri_list = g_strjoin( " ", ex_uri_file1, ex_uri_folder1, NULL );
+
+ } else if( is_dir ){
+ ex_one = ex_dirs[0];
+ ex_list = na_core_utils_gstring_joinv( NULL, " ", ex_dirs );
+ ex_path_list = na_core_utils_gstring_joinv( start, separator, ex_dirs );
+ ex_uri_list = g_strjoin( " ", ex_uri_folder1, ex_uri_folder2, NULL );
+
+ } else if( is_file ){
+ ex_one = ex_files[0];
+ ex_list = na_core_utils_gstring_joinv( NULL, " ", ex_files );
+ ex_path_list = na_core_utils_gstring_joinv( start, separator, ex_files );
+ ex_uri_list = g_strjoin( " ", ex_uri_file1, ex_uri_file2, NULL );
+ }
+ } else {
+ if( is_dir && !is_file ){
+ ex_one = ex_one_dir;
+ ex_uri_list = g_strdup( ex_uri_folder1 );
+
+ } else {
+ ex_one = ex_one_file;
+ ex_uri_list = g_strdup( ex_uri_file1 );
+ }
+ ex_list = g_strdup( ex_one );
+ ex_path_list = g_strjoin( "/", ex_path, ex_one, NULL );
+ }
+
+ g_free (start);
+ g_free (separator);
+
+ if( scheme_list != NULL ){
+ ex_scheme = ( gchar * ) scheme_list->data;
+ if( g_ascii_strcasecmp( ex_scheme, "file" ) == 0 ){
+ if( g_slist_length( scheme_list ) > 1 ){
+ ex_scheme = ( gchar * ) scheme_list->next->data;
+ ex_host = ex_host_default;
+ } else {
+ ex_host = "";
+ }
+ } else {
+ ex_host = ex_host_default;
+ }
+ } else {
+ ex_scheme = ex_scheme_default;
+ ex_host = "";
+ }
+
+ while(( iter = g_strstr_len( iter, strlen( iter ), "%" ))){
+ tmp_string = g_string_append_len( tmp_string, old_iter, strlen( old_iter ) - strlen( iter ));
+ iter_inc = 1;
+ switch( iter[1] ){
+
+ case 'd': /* base dir of the (first) selected file(s)/folder(s) */
+ tmp_string = g_string_append( tmp_string, ex_path );
+ break;
+
+ case 'f': /* the basename of the (first) selected file/folder */
+ tmp_string = g_string_append( tmp_string, ex_one );
+ break;
+
+ case 'h': /* hostname of the (first) URI */
+ tmp_string = g_string_append( tmp_string, ex_host );
+ break;
+
+ case 'm': /* list of the basename of the selected files/directories separated by space */
+ tmp_string = g_string_append( tmp_string, ex_list );
+ break;
+
+ case 'M': /* list of the selected files/directories with their complete path separated by space. */
+ tmp_string = g_string_append( tmp_string, ex_path_list );
+ break;
+
+ case 'p': /* port number of the (first) URI */
+ tmp_string = g_string_append( tmp_string, ex_port_default );
+ break;
+
+ case 'R': /* space-separated list of selected URIs */
+ tmp_string = g_string_append( tmp_string, ex_uri_list );
+ break;
+
+ case 's': /* scheme of the (first) URI */
+ tmp_string = g_string_append( tmp_string, ex_scheme );
+ break;
+
+ case 'u': /* (first) URI */
+ tmp = g_strjoin( NULL, ex_scheme, "://", ex_path, "/", ex_one, NULL );
+ tmp_string = g_string_append( tmp_string, tmp );
+ g_free( tmp );
+ break;
+
+ case 'U': /* username of the GVfs URI */
+ tmp_string = g_string_append( tmp_string, "root" );
+ break;
+
+ case '%': /* a percent sign */
+ tmp_string = g_string_append_c( tmp_string, '%' );
+ break;
+
+ default:
+ iter_inc = 1;
+ break;
+ }
+ iter += iter_inc; /* skip the % sign and the character after. */
+ old_iter = iter; /* store the new start of the string */
+ }
+ tmp_string = g_string_append_len( tmp_string, old_iter, strlen( old_iter ));
+
+ na_core_utils_slist_free( scheme_list );
+
+ g_free( ex_list );
+ g_free( ex_path_list );
+ g_free( ex_uri_list );
+ g_free( iter );
+
+ return( g_string_free( tmp_string, FALSE ));
+}
+
+static void
+set_label_label( NactICommandTab *instance, const gchar *color_str )
+{
+ GtkWidget *label;
+ GdkColor color;
+
+ label = base_window_get_widget( BASE_WINDOW( instance ), "ProfileLabelLabel" );
+ gdk_color_parse( color_str, &color );
+ gtk_widget_modify_fg( label, GTK_STATE_NORMAL, &color );
+}
+
+static void
+update_example_label( NactICommandTab *instance, NAObjectProfile *profile )
+{
+ /*static const char *thisfn = "nact_iconditions_update_example_label";*/
+ gchar *newlabel;
+ gchar *parameters;
+ GtkWidget *example_widget;
+
+ example_widget = base_window_get_widget( BASE_WINDOW( instance ), "CommandExampleLabel" );
+
+ if( profile ){
+ parameters = parse_parameters( instance );
+ /*g_debug( "%s: parameters=%s", thisfn, parameters );*/
+
+ /* convert special xml chars (&, <, >,...) to avoid warnings
+ * generated by Pango parser
+ */
+ /* i18n: command-line example: e.g., /bin/ls file1.txt file2.txt */
+ newlabel = g_markup_printf_escaped(
+ "<i><b><span size=\"small\">%s %s</span></b></i>", _( "e.g.," ), parameters );
+
+ g_free( parameters );
+
+ } else {
+ newlabel = g_strdup( "" );
+ }
+
+ gtk_label_set_label( GTK_LABEL( example_widget ), newlabel );
+ g_free( newlabel );
+}
diff --git a/src/nact/nact-ibasenames-tab.h b/src/nact/nact-ibasenames-tab.h
new file mode 100644
index 0000000..122725d
--- /dev/null
+++ b/src/nact/nact-ibasenames-tab.h
@@ -0,0 +1,71 @@
+/*
+ * 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_ICOMMAND_TAB_H__
+#define __NACT_ICOMMAND_TAB_H__
+
+/**
+ * SECTION: nact_icommand_tab
+ * @short_description: #NactICommandTab interface declaration.
+ * @include: nact/nact-icommand-tab.h
+ *
+ * This interface implements all the widgets which define the
+ * actual action to be executed.
+ */
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define NACT_ICOMMAND_TAB_TYPE ( nact_icommand_tab_get_type())
+#define NACT_ICOMMAND_TAB( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, NACT_ICOMMAND_TAB_TYPE, NactICommandTab ))
+#define NACT_IS_ICOMMAND_TAB( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, NACT_ICOMMAND_TAB_TYPE ))
+#define NACT_ICOMMAND_TAB_GET_INTERFACE( instance ) ( G_TYPE_INSTANCE_GET_INTERFACE(( instance ), NACT_ICOMMAND_TAB_TYPE, NactICommandTabInterface ))
+
+typedef struct NactICommandTab NactICommandTab;
+
+typedef struct NactICommandTabInterfacePrivate NactICommandTabInterfacePrivate;
+
+typedef struct {
+ GTypeInterface parent;
+ NactICommandTabInterfacePrivate *private;
+}
+ NactICommandTabInterface;
+
+GType nact_icommand_tab_get_type( void );
+
+void nact_icommand_tab_initial_load_toplevel( NactICommandTab *instance );
+void nact_icommand_tab_runtime_init_toplevel( NactICommandTab *instance );
+void nact_icommand_tab_all_widgets_showed( NactICommandTab *instance );
+void nact_icommand_tab_dispose( NactICommandTab *instance );
+
+G_END_DECLS
+
+#endif /* __NACT_ICOMMAND_TAB_H__ */
diff --git a/src/nact/nact-icommand-tab.c b/src/nact/nact-icommand-tab.c
index bab2d53..24401c8 100644
--- a/src/nact/nact-icommand-tab.c
+++ b/src/nact/nact-icommand-tab.c
@@ -684,8 +684,12 @@ parse_parameters( NactICommandTab *instance )
g_string_append_printf( tmp_string, "%s ", command );
- nact_iconditions_tab_get_isfiledir( NACT_ICONDITIONS_TAB( instance ), &is_file, &is_dir );
- accept_multiple = nact_iconditions_tab_get_multiple( NACT_ICONDITIONS_TAB( instance ));
+ /*nact_iconditions_tab_get_isfiledir( NACT_ICONDITIONS_TAB( instance ), &is_file, &is_dir );
+ accept_multiple = nact_iconditions_tab_get_multiple( NACT_ICONDITIONS_TAB( instance ));*/
+ is_file = TRUE;
+ is_dir = TRUE;
+ accept_multiple = TRUE;
+
scheme_list = nact_ischemes_tab_get_schemes( NACT_ISCHEMES_TAB( instance ));
separator = g_strdup_printf( " %s/", ex_path );
diff --git a/src/nact/nact-ienvironment-tab.c b/src/nact/nact-ienvironment-tab.c
new file mode 100644
index 0000000..24401c8
--- /dev/null
+++ b/src/nact/nact-ienvironment-tab.c
@@ -0,0 +1,860 @@
+/*
+ * 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 <glib/gi18n.h>
+#include <string.h>
+
+#include <api/na-core-utils.h>
+#include <api/na-object-api.h>
+
+#include <core/na-iprefs.h>
+
+#include "base-window.h"
+#include "base-iprefs.h"
+#include "nact-application.h"
+#include "nact-main-statusbar.h"
+#include "nact-gtk-utils.h"
+#include "nact-iprefs.h"
+#include "nact-iactions-list.h"
+#include "nact-main-tab.h"
+#include "nact-icommand-tab.h"
+#include "nact-iconditions-tab.h"
+#include "nact-ischemes-tab.h"
+
+/* private interface data
+ */
+struct NactICommandTabInterfacePrivate {
+ void *empty; /* so that gcc -pedantic is happy */
+};
+
+/* the GConf key used to read/write size and position of auxiliary dialogs
+ */
+#define IPREFS_LEGEND_DIALOG "icommand-legend-dialog"
+#define IPREFS_COMMAND_CHOOSER "icommand-command-chooser"
+#define IPREFS_FOLDER_URI "icommand-folder-uri"
+
+/* a data set in the LegendDialog GObject
+ */
+#define ICOMMAND_TAB_LEGEND_VISIBLE "nact-icommand-tab-legend-dialog-visible"
+#define ICOMMAND_TAB_STATUSBAR_CONTEXT "nact-icommand-tab-statusbar-context"
+
+static gboolean st_initialized = FALSE;
+static gboolean st_finalized = FALSE;
+static gboolean st_on_selection_change = FALSE;
+
+static GType register_type( void );
+static void interface_base_init( NactICommandTabInterface *klass );
+static void interface_base_finalize( NactICommandTabInterface *klass );
+
+static void on_iactions_list_column_edited( NactICommandTab *instance, NAObject *object, gchar *text, gint column );
+static void on_tab_updatable_selection_changed( NactICommandTab *instance, gint count_selected );
+static gboolean tab_set_sensitive( NactICommandTab *instance );
+
+static void check_for_label( NactICommandTab *instance, GtkEntry *entry, const gchar *label );
+static GtkWidget *get_label_entry( NactICommandTab *instance );
+static GtkButton *get_legend_button( NactICommandTab *instance );
+static GtkWindow *get_legend_dialog( NactICommandTab *instance );
+static GtkWidget *get_parameters_entry( NactICommandTab *instance );
+static GtkButton *get_path_button( NactICommandTab *instance );
+static GtkWidget *get_path_entry( NactICommandTab *instance );
+static void legend_dialog_show( NactICommandTab *instance );
+static void legend_dialog_hide( NactICommandTab *instance );
+static void on_label_changed( GtkEntry *entry, NactICommandTab *instance );
+static void on_legend_clicked( GtkButton *button, NactICommandTab *instance );
+static void on_parameters_changed( GtkEntry *entry, NactICommandTab *instance );
+static void on_path_browse( GtkButton *button, NactICommandTab *instance );
+static void on_path_changed( GtkEntry *entry, NactICommandTab *instance );
+static gchar *parse_parameters( NactICommandTab *instance );
+static void set_label_label( NactICommandTab *instance, const gchar *color );
+static void update_example_label( NactICommandTab *instance, NAObjectProfile *profile );
+
+GType
+nact_icommand_tab_get_type( void )
+{
+ static GType iface_type = 0;
+
+ if( !iface_type ){
+ iface_type = register_type();
+ }
+
+ return( iface_type );
+}
+
+static GType
+register_type( void )
+{
+ static const gchar *thisfn = "nact_icommand_tab_register_type";
+ GType type;
+
+ static const GTypeInfo info = {
+ sizeof( NactICommandTabInterface ),
+ ( GBaseInitFunc ) interface_base_init,
+ ( GBaseFinalizeFunc ) interface_base_finalize,
+ NULL,
+ NULL,
+ NULL,
+ 0,
+ 0,
+ NULL
+ };
+
+ g_debug( "%s", thisfn );
+
+ type = g_type_register_static( G_TYPE_INTERFACE, "NactICommandTab", &info, 0 );
+
+ g_type_interface_add_prerequisite( type, BASE_WINDOW_TYPE );
+
+ return( type );
+}
+
+static void
+interface_base_init( NactICommandTabInterface *klass )
+{
+ static const gchar *thisfn = "nact_icommand_tab_interface_base_init";
+
+ if( !st_initialized ){
+
+ g_debug( "%s: klass=%p", thisfn, ( void * ) klass );
+
+ klass->private = g_new0( NactICommandTabInterfacePrivate, 1 );
+
+ st_initialized = TRUE;
+ }
+}
+
+static void
+interface_base_finalize( NactICommandTabInterface *klass )
+{
+ static const gchar *thisfn = "nact_icommand_tab_interface_base_finalize";
+
+ if( st_initialized && !st_finalized ){
+
+ g_debug( "%s: klass=%p", thisfn, ( void * ) klass );
+
+ st_finalized = TRUE;
+
+ g_free( klass->private );
+ }
+}
+
+/**
+ * nact_icommand_tab_initial_load:
+ * @window: this #NactICommandTab instance.
+ *
+ * Initializes the tab widget at initial load.
+ *
+ * The GConf preference keys used in this tab were misnamed from v1.11.1
+ * up to and including v1.12.0. Starting with v1.12.1, these are migrated
+ * here, so that the normal code only makes use of 'good' keys.
+ */
+void
+nact_icommand_tab_initial_load_toplevel( NactICommandTab *instance )
+{
+ static const gchar *thisfn = "nact_icommand_tab_initial_load_toplevel";
+
+ g_debug( "%s: instance=%p", thisfn, ( void * ) instance );
+ g_return_if_fail( NACT_IS_ICOMMAND_TAB( instance ));
+
+ if( st_initialized && !st_finalized ){
+
+ nact_iprefs_migrate_key( BASE_WINDOW( instance ), "iconditions-legend-dialog", IPREFS_LEGEND_DIALOG );
+ nact_iprefs_migrate_key( BASE_WINDOW( instance ), "iconditions-command-chooser", IPREFS_COMMAND_CHOOSER );
+ nact_iprefs_migrate_key( BASE_WINDOW( instance ), "iconditions-folder-uri", IPREFS_FOLDER_URI );
+ }
+}
+
+/**
+ * nact_icommand_tab_runtime_init:
+ * @window: this #NactICommandTab instance.
+ *
+ * Initializes the tab widget at each time the widget will be displayed.
+ * Connect signals and setup runtime values.
+ */
+void
+nact_icommand_tab_runtime_init_toplevel( NactICommandTab *instance )
+{
+ static const gchar *thisfn = "nact_icommand_tab_runtime_init_toplevel";
+ GtkWidget *label_entry, *path_entry, *parameters_entry;
+ GtkButton *path_button, *legend_button;
+
+ g_debug( "%s: instance=%p", thisfn, ( void * ) instance );
+ g_return_if_fail( NACT_IS_ICOMMAND_TAB( instance ));
+
+ if( st_initialized && !st_finalized ){
+
+ label_entry = get_label_entry( instance );
+ base_window_signal_connect(
+ BASE_WINDOW( instance ),
+ G_OBJECT( label_entry ),
+ "changed",
+ G_CALLBACK( on_label_changed ));
+
+ path_entry = get_path_entry( instance );
+ base_window_signal_connect(
+ BASE_WINDOW( instance ),
+ G_OBJECT( path_entry ),
+ "changed",
+ G_CALLBACK( on_path_changed ));
+
+ path_button = get_path_button( instance );
+ base_window_signal_connect(
+ BASE_WINDOW( instance ),
+ G_OBJECT( path_button ),
+ "clicked",
+ G_CALLBACK( on_path_browse ));
+
+ parameters_entry = get_parameters_entry( instance );
+ base_window_signal_connect(
+ BASE_WINDOW( instance ),
+ G_OBJECT( parameters_entry ),
+ "changed",
+ G_CALLBACK( on_parameters_changed ));
+
+ legend_button = get_legend_button( instance );
+ base_window_signal_connect(
+ BASE_WINDOW( instance ),
+ G_OBJECT( legend_button ),
+ "clicked",
+ G_CALLBACK( on_legend_clicked ));
+
+ base_window_signal_connect(
+ BASE_WINDOW( instance ),
+ G_OBJECT( instance ),
+ MAIN_WINDOW_SIGNAL_SELECTION_CHANGED,
+ G_CALLBACK( on_tab_updatable_selection_changed ));
+
+ base_window_signal_connect(
+ BASE_WINDOW( instance ),
+ G_OBJECT( instance ),
+ IACTIONS_LIST_SIGNAL_COLUMN_EDITED,
+ G_CALLBACK( on_iactions_list_column_edited ));
+ }
+}
+
+void
+nact_icommand_tab_all_widgets_showed( NactICommandTab *instance )
+{
+ static const gchar *thisfn = "nact_icommand_tab_all_widgets_showed";
+
+ g_debug( "%s: instance=%p", thisfn, ( void * ) instance );
+ g_return_if_fail( NACT_IS_ICOMMAND_TAB( instance ));
+
+ if( st_initialized && !st_finalized ){
+ }
+}
+
+/**
+ * nact_icommand_tab_dispose:
+ * @window: this #NactICommandTab instance.
+ *
+ * Called at instance_dispose time.
+ */
+void
+nact_icommand_tab_dispose( NactICommandTab *instance )
+{
+ static const gchar *thisfn = "nact_icommand_tab_dispose";
+
+ g_debug( "%s: instance=%p", thisfn, ( void * ) instance );
+ g_return_if_fail( NACT_IS_ICOMMAND_TAB( instance ));
+
+ if( st_initialized && !st_finalized ){
+ legend_dialog_hide( instance );
+ }
+}
+
+static void
+on_iactions_list_column_edited( NactICommandTab *instance, NAObject *object, gchar *text, gint column )
+{
+ GtkWidget *label_widget;
+
+ g_return_if_fail( NACT_IS_ICOMMAND_TAB( instance ));
+
+ if( st_initialized && !st_finalized ){
+
+ if( NA_IS_OBJECT_PROFILE( object )){
+ label_widget = get_label_entry( instance );
+ gtk_entry_set_text( GTK_ENTRY( label_widget ), text );
+ }
+ }
+}
+
+static void
+on_tab_updatable_selection_changed( NactICommandTab *instance, gint count_selected )
+{
+ static const gchar *thisfn = "nact_icommand_tab_on_tab_updatable_selection_changed";
+ NAObjectItem *item;
+ NAObjectProfile *profile;
+ gboolean enable_tab;
+ GtkWidget *label_entry, *path_entry, *parameters_entry;
+ gchar *label, *path, *parameters;
+ gboolean editable;
+ GtkButton *path_button;
+ GtkButton *legend_button;
+
+ g_debug( "%s: instance=%p, count_selected=%d", thisfn, ( void * ) instance, count_selected );
+ g_return_if_fail( NACT_IS_ICOMMAND_TAB( instance ));
+
+ if( st_initialized && !st_finalized ){
+
+ st_on_selection_change = TRUE;
+
+ g_object_get(
+ G_OBJECT( instance ),
+ TAB_UPDATABLE_PROP_EDITED_ACTION, &item,
+ TAB_UPDATABLE_PROP_EDITED_PROFILE, &profile,
+ TAB_UPDATABLE_PROP_EDITABLE, &editable,
+ NULL );
+
+ enable_tab = tab_set_sensitive( instance );
+
+ label_entry = get_label_entry( instance );
+ label = profile ? na_object_get_label( profile ) : g_strdup( "" );
+ label = label ? label : g_strdup( "" );
+ gtk_entry_set_text( GTK_ENTRY( label_entry ), label );
+ check_for_label( instance, GTK_ENTRY( label_entry ), label );
+ g_free( label );
+ gtk_widget_set_sensitive( label_entry, profile != NULL );
+ nact_gtk_utils_set_editable( GTK_OBJECT( label_entry ), editable );
+
+ path_entry = get_path_entry( instance );
+ path = profile ? na_object_get_path( profile ) : g_strdup( "" );
+ path = path ? path : g_strdup( "" );
+ gtk_entry_set_text( GTK_ENTRY( path_entry ), path );
+ g_free( path );
+ gtk_widget_set_sensitive( path_entry, profile != NULL );
+ nact_gtk_utils_set_editable( GTK_OBJECT( path_entry ), editable );
+
+ path_button = get_path_button( instance );
+ gtk_widget_set_sensitive( GTK_WIDGET( path_button ), profile != NULL );
+ nact_gtk_utils_set_editable( GTK_OBJECT( path_button ), editable );
+
+ parameters_entry = get_parameters_entry( instance );
+ parameters = profile ? na_object_get_parameters( profile ) : g_strdup( "" );
+ parameters = parameters ? parameters : g_strdup( "" );
+ gtk_entry_set_text( GTK_ENTRY( parameters_entry ), parameters );
+ g_free( parameters );
+ gtk_widget_set_sensitive( parameters_entry, profile != NULL );
+ nact_gtk_utils_set_editable( GTK_OBJECT( parameters_entry ), editable );
+
+ legend_button = get_legend_button( instance );
+ gtk_widget_set_sensitive( GTK_WIDGET( legend_button ), profile != NULL );
+
+ st_on_selection_change = FALSE;
+ }
+}
+
+static gboolean
+tab_set_sensitive( NactICommandTab *instance )
+{
+ NAObjectProfile *profile;
+ gboolean enable_tab;
+
+ g_object_get(
+ G_OBJECT( instance ),
+ TAB_UPDATABLE_PROP_EDITED_PROFILE, &profile,
+ NULL );
+
+ enable_tab = ( profile != NULL );
+ nact_main_tab_enable_page( NACT_MAIN_WINDOW( instance ), TAB_COMMAND, enable_tab );
+
+ return( enable_tab );
+}
+
+static void
+check_for_label( NactICommandTab *instance, GtkEntry *entry, const gchar *label )
+{
+ NAObjectProfile *edited;
+
+ nact_main_statusbar_hide_status(
+ NACT_MAIN_WINDOW( instance ),
+ ICOMMAND_TAB_STATUSBAR_CONTEXT );
+
+ set_label_label( instance, "black" );
+
+ g_object_get(
+ G_OBJECT( instance ),
+ TAB_UPDATABLE_PROP_EDITED_PROFILE, &edited,
+ NULL );
+
+ if( edited && g_utf8_strlen( label, -1 ) == 0 ){
+
+ /* i18n: status bar message when the profile label is empty */
+ nact_main_statusbar_display_status(
+ NACT_MAIN_WINDOW( instance ),
+ ICOMMAND_TAB_STATUSBAR_CONTEXT,
+ _( "Caution: a label is mandatory for the profile." ));
+
+ set_label_label( instance, "red" );
+ }
+}
+
+static GtkWidget *
+get_label_entry( NactICommandTab *instance )
+{
+ return( base_window_get_widget( BASE_WINDOW( instance ), "ProfileLabelEntry" ));
+}
+
+static GtkButton *
+get_legend_button( NactICommandTab *instance )
+{
+ return( GTK_BUTTON( base_window_get_widget( BASE_WINDOW( instance ), "CommandLegendButton" )));
+}
+
+static GtkWindow *
+get_legend_dialog( NactICommandTab *instance )
+{
+ return( base_window_get_named_toplevel( BASE_WINDOW( instance ), "LegendDialog" ));
+}
+
+static GtkWidget *
+get_parameters_entry( NactICommandTab *instance )
+{
+ return( base_window_get_widget( BASE_WINDOW( instance ), "CommandParametersEntry" ));
+}
+
+static GtkButton *
+get_path_button( NactICommandTab *instance )
+{
+ return( GTK_BUTTON( base_window_get_widget( BASE_WINDOW( instance ), "CommandPathButton" )));
+}
+
+static GtkWidget *
+get_path_entry( NactICommandTab *instance )
+{
+ return( base_window_get_widget( BASE_WINDOW( instance ), "CommandPathEntry" ));
+}
+
+static void
+legend_dialog_hide( NactICommandTab *instance )
+{
+ GtkWindow *legend_dialog;
+ GtkButton *legend_button;
+ gboolean is_visible;
+
+ legend_dialog = get_legend_dialog( instance );
+ is_visible = ( gboolean ) GPOINTER_TO_INT(
+ g_object_get_data( G_OBJECT( legend_dialog ), ICOMMAND_TAB_LEGEND_VISIBLE ));
+
+ if( is_visible ){
+ g_assert( GTK_IS_WINDOW( legend_dialog ));
+ base_iprefs_save_named_window_position( BASE_WINDOW( instance ), legend_dialog, IPREFS_LEGEND_DIALOG );
+ gtk_widget_hide( GTK_WIDGET( legend_dialog ));
+
+ /* set the legend button state consistent for when the dialog is
+ * hidden by another mean (eg. close the edit profile dialog)
+ */
+ legend_button = get_legend_button( instance );
+ gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( legend_button ), FALSE );
+
+ g_object_set_data( G_OBJECT( legend_dialog ), ICOMMAND_TAB_LEGEND_VISIBLE, GINT_TO_POINTER( FALSE ));
+ }
+}
+
+static void
+legend_dialog_show( NactICommandTab *instance )
+{
+ GtkWindow *legend_dialog;
+ GtkWindow *toplevel;
+
+ legend_dialog = get_legend_dialog( instance );
+ gtk_window_set_deletable( legend_dialog, FALSE );
+
+ toplevel = base_window_get_toplevel( BASE_WINDOW( instance ));
+ gtk_window_set_transient_for( GTK_WINDOW( legend_dialog ), toplevel );
+
+ base_iprefs_position_named_window( BASE_WINDOW( instance ), legend_dialog, IPREFS_LEGEND_DIALOG );
+ gtk_widget_show( GTK_WIDGET( legend_dialog ));
+
+ g_object_set_data( G_OBJECT( legend_dialog ), ICOMMAND_TAB_LEGEND_VISIBLE, GINT_TO_POINTER( TRUE ));
+}
+
+static void
+on_label_changed( GtkEntry *entry, NactICommandTab *instance )
+{
+ NAObjectProfile *edited;
+ const gchar *label;
+
+ if( !st_on_selection_change ){
+
+ g_object_get(
+ G_OBJECT( instance ),
+ TAB_UPDATABLE_PROP_EDITED_PROFILE, &edited,
+ NULL );
+
+ if( edited ){
+ label = gtk_entry_get_text( entry );
+ na_object_set_label( edited, label );
+ g_signal_emit_by_name( G_OBJECT( instance ), TAB_UPDATABLE_SIGNAL_ITEM_UPDATED, edited, TRUE );
+ check_for_label( instance, entry, label );
+ }
+ }
+}
+
+static void
+on_legend_clicked( GtkButton *button, NactICommandTab *instance )
+{
+ if( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( button ))){
+ legend_dialog_show( instance );
+
+ } else {
+ legend_dialog_hide( instance );
+ }
+}
+
+static void
+on_parameters_changed( GtkEntry *entry, NactICommandTab *instance )
+{
+ NAObjectProfile *edited;
+
+ if( !st_on_selection_change ){
+
+ g_object_get(
+ G_OBJECT( instance ),
+ TAB_UPDATABLE_PROP_EDITED_PROFILE, &edited,
+ NULL );
+
+ if( edited ){
+ na_object_set_parameters( edited, gtk_entry_get_text( entry ));
+ g_signal_emit_by_name( G_OBJECT( instance ), TAB_UPDATABLE_SIGNAL_ITEM_UPDATED, edited, FALSE );
+ update_example_label( instance, edited );
+ }
+ }
+}
+
+static void
+on_path_browse( GtkButton *button, NactICommandTab *instance )
+{
+ gboolean set_current_location = FALSE;
+ gchar *uri = NULL;
+ NactApplication *application;
+ NAUpdater *updater;
+ GtkWindow *toplevel;
+ GtkWidget *dialog;
+ GtkWidget *path_entry;
+ const gchar *path;
+ gchar *filename;
+
+ application = NACT_APPLICATION( base_window_get_application( BASE_WINDOW( instance )));
+ updater = nact_application_get_updater( application );
+ toplevel = base_window_get_toplevel( BASE_WINDOW( instance ));
+
+ dialog = gtk_file_chooser_dialog_new(
+ _( "Choosing a command" ),
+ toplevel,
+ GTK_FILE_CHOOSER_ACTION_OPEN,
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
+ NULL
+ );
+
+ base_iprefs_position_named_window( BASE_WINDOW( instance ), GTK_WINDOW( dialog ), IPREFS_COMMAND_CHOOSER );
+
+ path_entry = get_path_entry( instance );
+ path = gtk_entry_get_text( GTK_ENTRY( path_entry ));
+
+ if( path && strlen( path )){
+ set_current_location = gtk_file_chooser_set_filename( GTK_FILE_CHOOSER( dialog ), path );
+
+ } else {
+ uri = na_iprefs_read_string( NA_IPREFS( updater ), IPREFS_FOLDER_URI, "file:///bin" );
+ gtk_file_chooser_set_current_folder_uri( GTK_FILE_CHOOSER( dialog ), uri );
+ g_free( uri );
+ }
+
+ if( gtk_dialog_run( GTK_DIALOG( dialog )) == GTK_RESPONSE_ACCEPT ){
+ filename = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER( dialog ));
+ gtk_entry_set_text( GTK_ENTRY( path_entry ), filename );
+ g_free (filename);
+ }
+
+ uri = gtk_file_chooser_get_current_folder_uri( GTK_FILE_CHOOSER( dialog ));
+ nact_iprefs_write_string( BASE_WINDOW( instance ), IPREFS_FOLDER_URI, uri );
+ g_free( uri );
+
+ base_iprefs_save_named_window_position( BASE_WINDOW( instance ), GTK_WINDOW( dialog ), IPREFS_COMMAND_CHOOSER );
+
+ gtk_widget_destroy( dialog );
+}
+
+static void
+on_path_changed( GtkEntry *entry, NactICommandTab *instance )
+{
+ NAObjectProfile *edited;
+
+ if( !st_on_selection_change ){
+
+ g_object_get(
+ G_OBJECT( instance ),
+ TAB_UPDATABLE_PROP_EDITED_PROFILE, &edited,
+ NULL );
+
+ if( edited ){
+
+ na_object_set_path( edited, gtk_entry_get_text( entry ));
+ g_signal_emit_by_name( G_OBJECT( instance ), TAB_UPDATABLE_SIGNAL_ITEM_UPDATED, edited, FALSE );
+ update_example_label( instance, edited );
+ }
+ }
+}
+
+/*
+ * Valid parameters :
+ *
+ * %d : base dir of the (first) selected file(s)/folder(s)
+ * %f : the name of the (firstà selected file/folder
+ * %h : hostname of the (first) URI
+ * %m : list of the basename of the selected files/directories separated by space.
+ * %M : list of the selected files/directories with their complete path separated by space.
+ * %p : port number of the (first) URI
+ * %R : space-separated list of selected URIs
+ * %s : scheme of the (first) URI
+ * %u : (first) URI
+ * %U : username of the (first) URI
+ * %% : a percent sign
+ */
+static gchar *
+parse_parameters( NactICommandTab *instance )
+{
+ GString *tmp_string = g_string_new( "" );
+
+ /* i18n notes: example strings for the command preview */
+ gchar *ex_path = _( "/path/to" );
+ gchar *ex_files[] = { N_( "file1.txt" ), N_( "file2.txt" ), NULL };
+ gchar *ex_dirs[] = { N_(" folder1" ), N_( "folder2" ), NULL };
+ gchar *ex_mixed[] = { N_(" file1.txt" ), N_( "folder1" ), NULL };
+ gchar *ex_scheme_default = "file";
+ gchar *ex_host_default = _( "test.example.net" );
+ gchar *ex_one_file = _( "file.txt" );
+ gchar *ex_one_dir = _( "folder" );
+ gchar *ex_port_default = _( "8080" );
+ gchar *ex_one = NULL;
+ gchar *ex_list = NULL;
+ gchar *ex_path_list = NULL;
+ gchar *ex_uri_file1 = _( "file:///path/to/file1.text" );
+ gchar *ex_uri_file2 = _( "file:///path/to/file2.text" );
+ gchar *ex_uri_folder1 = _( "file:///path/to/a/dir" );
+ gchar *ex_uri_folder2 = _( "file:///path/to/another/dir" );
+ gchar *ex_uri_list = NULL;
+ gchar *ex_scheme;
+ gchar *ex_host;
+ gboolean is_file, is_dir;
+ gboolean accept_multiple;
+ GSList *scheme_list;
+ guint iter_inc;
+
+ const gchar *command = gtk_entry_get_text( GTK_ENTRY( get_path_entry( instance )));
+ const gchar *param_template = gtk_entry_get_text( GTK_ENTRY( get_parameters_entry( instance )));
+
+ gchar *iter = g_strdup( param_template );
+ gchar *old_iter = iter;
+ gchar *tmp;
+ gchar *separator;
+ gchar *start;
+
+ g_string_append_printf( tmp_string, "%s ", command );
+
+ /*nact_iconditions_tab_get_isfiledir( NACT_ICONDITIONS_TAB( instance ), &is_file, &is_dir );
+ accept_multiple = nact_iconditions_tab_get_multiple( NACT_ICONDITIONS_TAB( instance ));*/
+ is_file = TRUE;
+ is_dir = TRUE;
+ accept_multiple = TRUE;
+
+ scheme_list = nact_ischemes_tab_get_schemes( NACT_ISCHEMES_TAB( instance ));
+
+ separator = g_strdup_printf( " %s/", ex_path );
+ start = g_strdup_printf( "%s/", ex_path );
+
+ if( accept_multiple ){
+ if( is_file && is_dir ){
+ ex_one = ex_files[0];
+ ex_list = na_core_utils_gstring_joinv( NULL, " ", ex_mixed );
+ ex_path_list = na_core_utils_gstring_joinv( start, separator, ex_mixed );
+ ex_uri_list = g_strjoin( " ", ex_uri_file1, ex_uri_folder1, NULL );
+
+ } else if( is_dir ){
+ ex_one = ex_dirs[0];
+ ex_list = na_core_utils_gstring_joinv( NULL, " ", ex_dirs );
+ ex_path_list = na_core_utils_gstring_joinv( start, separator, ex_dirs );
+ ex_uri_list = g_strjoin( " ", ex_uri_folder1, ex_uri_folder2, NULL );
+
+ } else if( is_file ){
+ ex_one = ex_files[0];
+ ex_list = na_core_utils_gstring_joinv( NULL, " ", ex_files );
+ ex_path_list = na_core_utils_gstring_joinv( start, separator, ex_files );
+ ex_uri_list = g_strjoin( " ", ex_uri_file1, ex_uri_file2, NULL );
+ }
+ } else {
+ if( is_dir && !is_file ){
+ ex_one = ex_one_dir;
+ ex_uri_list = g_strdup( ex_uri_folder1 );
+
+ } else {
+ ex_one = ex_one_file;
+ ex_uri_list = g_strdup( ex_uri_file1 );
+ }
+ ex_list = g_strdup( ex_one );
+ ex_path_list = g_strjoin( "/", ex_path, ex_one, NULL );
+ }
+
+ g_free (start);
+ g_free (separator);
+
+ if( scheme_list != NULL ){
+ ex_scheme = ( gchar * ) scheme_list->data;
+ if( g_ascii_strcasecmp( ex_scheme, "file" ) == 0 ){
+ if( g_slist_length( scheme_list ) > 1 ){
+ ex_scheme = ( gchar * ) scheme_list->next->data;
+ ex_host = ex_host_default;
+ } else {
+ ex_host = "";
+ }
+ } else {
+ ex_host = ex_host_default;
+ }
+ } else {
+ ex_scheme = ex_scheme_default;
+ ex_host = "";
+ }
+
+ while(( iter = g_strstr_len( iter, strlen( iter ), "%" ))){
+ tmp_string = g_string_append_len( tmp_string, old_iter, strlen( old_iter ) - strlen( iter ));
+ iter_inc = 1;
+ switch( iter[1] ){
+
+ case 'd': /* base dir of the (first) selected file(s)/folder(s) */
+ tmp_string = g_string_append( tmp_string, ex_path );
+ break;
+
+ case 'f': /* the basename of the (first) selected file/folder */
+ tmp_string = g_string_append( tmp_string, ex_one );
+ break;
+
+ case 'h': /* hostname of the (first) URI */
+ tmp_string = g_string_append( tmp_string, ex_host );
+ break;
+
+ case 'm': /* list of the basename of the selected files/directories separated by space */
+ tmp_string = g_string_append( tmp_string, ex_list );
+ break;
+
+ case 'M': /* list of the selected files/directories with their complete path separated by space. */
+ tmp_string = g_string_append( tmp_string, ex_path_list );
+ break;
+
+ case 'p': /* port number of the (first) URI */
+ tmp_string = g_string_append( tmp_string, ex_port_default );
+ break;
+
+ case 'R': /* space-separated list of selected URIs */
+ tmp_string = g_string_append( tmp_string, ex_uri_list );
+ break;
+
+ case 's': /* scheme of the (first) URI */
+ tmp_string = g_string_append( tmp_string, ex_scheme );
+ break;
+
+ case 'u': /* (first) URI */
+ tmp = g_strjoin( NULL, ex_scheme, "://", ex_path, "/", ex_one, NULL );
+ tmp_string = g_string_append( tmp_string, tmp );
+ g_free( tmp );
+ break;
+
+ case 'U': /* username of the GVfs URI */
+ tmp_string = g_string_append( tmp_string, "root" );
+ break;
+
+ case '%': /* a percent sign */
+ tmp_string = g_string_append_c( tmp_string, '%' );
+ break;
+
+ default:
+ iter_inc = 1;
+ break;
+ }
+ iter += iter_inc; /* skip the % sign and the character after. */
+ old_iter = iter; /* store the new start of the string */
+ }
+ tmp_string = g_string_append_len( tmp_string, old_iter, strlen( old_iter ));
+
+ na_core_utils_slist_free( scheme_list );
+
+ g_free( ex_list );
+ g_free( ex_path_list );
+ g_free( ex_uri_list );
+ g_free( iter );
+
+ return( g_string_free( tmp_string, FALSE ));
+}
+
+static void
+set_label_label( NactICommandTab *instance, const gchar *color_str )
+{
+ GtkWidget *label;
+ GdkColor color;
+
+ label = base_window_get_widget( BASE_WINDOW( instance ), "ProfileLabelLabel" );
+ gdk_color_parse( color_str, &color );
+ gtk_widget_modify_fg( label, GTK_STATE_NORMAL, &color );
+}
+
+static void
+update_example_label( NactICommandTab *instance, NAObjectProfile *profile )
+{
+ /*static const char *thisfn = "nact_iconditions_update_example_label";*/
+ gchar *newlabel;
+ gchar *parameters;
+ GtkWidget *example_widget;
+
+ example_widget = base_window_get_widget( BASE_WINDOW( instance ), "CommandExampleLabel" );
+
+ if( profile ){
+ parameters = parse_parameters( instance );
+ /*g_debug( "%s: parameters=%s", thisfn, parameters );*/
+
+ /* convert special xml chars (&, <, >,...) to avoid warnings
+ * generated by Pango parser
+ */
+ /* i18n: command-line example: e.g., /bin/ls file1.txt file2.txt */
+ newlabel = g_markup_printf_escaped(
+ "<i><b><span size=\"small\">%s %s</span></b></i>", _( "e.g.," ), parameters );
+
+ g_free( parameters );
+
+ } else {
+ newlabel = g_strdup( "" );
+ }
+
+ gtk_label_set_label( GTK_LABEL( example_widget ), newlabel );
+ g_free( newlabel );
+}
diff --git a/src/nact/nact-ienvironment-tab.h b/src/nact/nact-ienvironment-tab.h
new file mode 100644
index 0000000..122725d
--- /dev/null
+++ b/src/nact/nact-ienvironment-tab.h
@@ -0,0 +1,71 @@
+/*
+ * 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_ICOMMAND_TAB_H__
+#define __NACT_ICOMMAND_TAB_H__
+
+/**
+ * SECTION: nact_icommand_tab
+ * @short_description: #NactICommandTab interface declaration.
+ * @include: nact/nact-icommand-tab.h
+ *
+ * This interface implements all the widgets which define the
+ * actual action to be executed.
+ */
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define NACT_ICOMMAND_TAB_TYPE ( nact_icommand_tab_get_type())
+#define NACT_ICOMMAND_TAB( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, NACT_ICOMMAND_TAB_TYPE, NactICommandTab ))
+#define NACT_IS_ICOMMAND_TAB( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, NACT_ICOMMAND_TAB_TYPE ))
+#define NACT_ICOMMAND_TAB_GET_INTERFACE( instance ) ( G_TYPE_INSTANCE_GET_INTERFACE(( instance ), NACT_ICOMMAND_TAB_TYPE, NactICommandTabInterface ))
+
+typedef struct NactICommandTab NactICommandTab;
+
+typedef struct NactICommandTabInterfacePrivate NactICommandTabInterfacePrivate;
+
+typedef struct {
+ GTypeInterface parent;
+ NactICommandTabInterfacePrivate *private;
+}
+ NactICommandTabInterface;
+
+GType nact_icommand_tab_get_type( void );
+
+void nact_icommand_tab_initial_load_toplevel( NactICommandTab *instance );
+void nact_icommand_tab_runtime_init_toplevel( NactICommandTab *instance );
+void nact_icommand_tab_all_widgets_showed( NactICommandTab *instance );
+void nact_icommand_tab_dispose( NactICommandTab *instance );
+
+G_END_DECLS
+
+#endif /* __NACT_ICOMMAND_TAB_H__ */
diff --git a/src/nact/nact-iexecution-tab.c b/src/nact/nact-iexecution-tab.c
new file mode 100644
index 0000000..24401c8
--- /dev/null
+++ b/src/nact/nact-iexecution-tab.c
@@ -0,0 +1,860 @@
+/*
+ * 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 <glib/gi18n.h>
+#include <string.h>
+
+#include <api/na-core-utils.h>
+#include <api/na-object-api.h>
+
+#include <core/na-iprefs.h>
+
+#include "base-window.h"
+#include "base-iprefs.h"
+#include "nact-application.h"
+#include "nact-main-statusbar.h"
+#include "nact-gtk-utils.h"
+#include "nact-iprefs.h"
+#include "nact-iactions-list.h"
+#include "nact-main-tab.h"
+#include "nact-icommand-tab.h"
+#include "nact-iconditions-tab.h"
+#include "nact-ischemes-tab.h"
+
+/* private interface data
+ */
+struct NactICommandTabInterfacePrivate {
+ void *empty; /* so that gcc -pedantic is happy */
+};
+
+/* the GConf key used to read/write size and position of auxiliary dialogs
+ */
+#define IPREFS_LEGEND_DIALOG "icommand-legend-dialog"
+#define IPREFS_COMMAND_CHOOSER "icommand-command-chooser"
+#define IPREFS_FOLDER_URI "icommand-folder-uri"
+
+/* a data set in the LegendDialog GObject
+ */
+#define ICOMMAND_TAB_LEGEND_VISIBLE "nact-icommand-tab-legend-dialog-visible"
+#define ICOMMAND_TAB_STATUSBAR_CONTEXT "nact-icommand-tab-statusbar-context"
+
+static gboolean st_initialized = FALSE;
+static gboolean st_finalized = FALSE;
+static gboolean st_on_selection_change = FALSE;
+
+static GType register_type( void );
+static void interface_base_init( NactICommandTabInterface *klass );
+static void interface_base_finalize( NactICommandTabInterface *klass );
+
+static void on_iactions_list_column_edited( NactICommandTab *instance, NAObject *object, gchar *text, gint column );
+static void on_tab_updatable_selection_changed( NactICommandTab *instance, gint count_selected );
+static gboolean tab_set_sensitive( NactICommandTab *instance );
+
+static void check_for_label( NactICommandTab *instance, GtkEntry *entry, const gchar *label );
+static GtkWidget *get_label_entry( NactICommandTab *instance );
+static GtkButton *get_legend_button( NactICommandTab *instance );
+static GtkWindow *get_legend_dialog( NactICommandTab *instance );
+static GtkWidget *get_parameters_entry( NactICommandTab *instance );
+static GtkButton *get_path_button( NactICommandTab *instance );
+static GtkWidget *get_path_entry( NactICommandTab *instance );
+static void legend_dialog_show( NactICommandTab *instance );
+static void legend_dialog_hide( NactICommandTab *instance );
+static void on_label_changed( GtkEntry *entry, NactICommandTab *instance );
+static void on_legend_clicked( GtkButton *button, NactICommandTab *instance );
+static void on_parameters_changed( GtkEntry *entry, NactICommandTab *instance );
+static void on_path_browse( GtkButton *button, NactICommandTab *instance );
+static void on_path_changed( GtkEntry *entry, NactICommandTab *instance );
+static gchar *parse_parameters( NactICommandTab *instance );
+static void set_label_label( NactICommandTab *instance, const gchar *color );
+static void update_example_label( NactICommandTab *instance, NAObjectProfile *profile );
+
+GType
+nact_icommand_tab_get_type( void )
+{
+ static GType iface_type = 0;
+
+ if( !iface_type ){
+ iface_type = register_type();
+ }
+
+ return( iface_type );
+}
+
+static GType
+register_type( void )
+{
+ static const gchar *thisfn = "nact_icommand_tab_register_type";
+ GType type;
+
+ static const GTypeInfo info = {
+ sizeof( NactICommandTabInterface ),
+ ( GBaseInitFunc ) interface_base_init,
+ ( GBaseFinalizeFunc ) interface_base_finalize,
+ NULL,
+ NULL,
+ NULL,
+ 0,
+ 0,
+ NULL
+ };
+
+ g_debug( "%s", thisfn );
+
+ type = g_type_register_static( G_TYPE_INTERFACE, "NactICommandTab", &info, 0 );
+
+ g_type_interface_add_prerequisite( type, BASE_WINDOW_TYPE );
+
+ return( type );
+}
+
+static void
+interface_base_init( NactICommandTabInterface *klass )
+{
+ static const gchar *thisfn = "nact_icommand_tab_interface_base_init";
+
+ if( !st_initialized ){
+
+ g_debug( "%s: klass=%p", thisfn, ( void * ) klass );
+
+ klass->private = g_new0( NactICommandTabInterfacePrivate, 1 );
+
+ st_initialized = TRUE;
+ }
+}
+
+static void
+interface_base_finalize( NactICommandTabInterface *klass )
+{
+ static const gchar *thisfn = "nact_icommand_tab_interface_base_finalize";
+
+ if( st_initialized && !st_finalized ){
+
+ g_debug( "%s: klass=%p", thisfn, ( void * ) klass );
+
+ st_finalized = TRUE;
+
+ g_free( klass->private );
+ }
+}
+
+/**
+ * nact_icommand_tab_initial_load:
+ * @window: this #NactICommandTab instance.
+ *
+ * Initializes the tab widget at initial load.
+ *
+ * The GConf preference keys used in this tab were misnamed from v1.11.1
+ * up to and including v1.12.0. Starting with v1.12.1, these are migrated
+ * here, so that the normal code only makes use of 'good' keys.
+ */
+void
+nact_icommand_tab_initial_load_toplevel( NactICommandTab *instance )
+{
+ static const gchar *thisfn = "nact_icommand_tab_initial_load_toplevel";
+
+ g_debug( "%s: instance=%p", thisfn, ( void * ) instance );
+ g_return_if_fail( NACT_IS_ICOMMAND_TAB( instance ));
+
+ if( st_initialized && !st_finalized ){
+
+ nact_iprefs_migrate_key( BASE_WINDOW( instance ), "iconditions-legend-dialog", IPREFS_LEGEND_DIALOG );
+ nact_iprefs_migrate_key( BASE_WINDOW( instance ), "iconditions-command-chooser", IPREFS_COMMAND_CHOOSER );
+ nact_iprefs_migrate_key( BASE_WINDOW( instance ), "iconditions-folder-uri", IPREFS_FOLDER_URI );
+ }
+}
+
+/**
+ * nact_icommand_tab_runtime_init:
+ * @window: this #NactICommandTab instance.
+ *
+ * Initializes the tab widget at each time the widget will be displayed.
+ * Connect signals and setup runtime values.
+ */
+void
+nact_icommand_tab_runtime_init_toplevel( NactICommandTab *instance )
+{
+ static const gchar *thisfn = "nact_icommand_tab_runtime_init_toplevel";
+ GtkWidget *label_entry, *path_entry, *parameters_entry;
+ GtkButton *path_button, *legend_button;
+
+ g_debug( "%s: instance=%p", thisfn, ( void * ) instance );
+ g_return_if_fail( NACT_IS_ICOMMAND_TAB( instance ));
+
+ if( st_initialized && !st_finalized ){
+
+ label_entry = get_label_entry( instance );
+ base_window_signal_connect(
+ BASE_WINDOW( instance ),
+ G_OBJECT( label_entry ),
+ "changed",
+ G_CALLBACK( on_label_changed ));
+
+ path_entry = get_path_entry( instance );
+ base_window_signal_connect(
+ BASE_WINDOW( instance ),
+ G_OBJECT( path_entry ),
+ "changed",
+ G_CALLBACK( on_path_changed ));
+
+ path_button = get_path_button( instance );
+ base_window_signal_connect(
+ BASE_WINDOW( instance ),
+ G_OBJECT( path_button ),
+ "clicked",
+ G_CALLBACK( on_path_browse ));
+
+ parameters_entry = get_parameters_entry( instance );
+ base_window_signal_connect(
+ BASE_WINDOW( instance ),
+ G_OBJECT( parameters_entry ),
+ "changed",
+ G_CALLBACK( on_parameters_changed ));
+
+ legend_button = get_legend_button( instance );
+ base_window_signal_connect(
+ BASE_WINDOW( instance ),
+ G_OBJECT( legend_button ),
+ "clicked",
+ G_CALLBACK( on_legend_clicked ));
+
+ base_window_signal_connect(
+ BASE_WINDOW( instance ),
+ G_OBJECT( instance ),
+ MAIN_WINDOW_SIGNAL_SELECTION_CHANGED,
+ G_CALLBACK( on_tab_updatable_selection_changed ));
+
+ base_window_signal_connect(
+ BASE_WINDOW( instance ),
+ G_OBJECT( instance ),
+ IACTIONS_LIST_SIGNAL_COLUMN_EDITED,
+ G_CALLBACK( on_iactions_list_column_edited ));
+ }
+}
+
+void
+nact_icommand_tab_all_widgets_showed( NactICommandTab *instance )
+{
+ static const gchar *thisfn = "nact_icommand_tab_all_widgets_showed";
+
+ g_debug( "%s: instance=%p", thisfn, ( void * ) instance );
+ g_return_if_fail( NACT_IS_ICOMMAND_TAB( instance ));
+
+ if( st_initialized && !st_finalized ){
+ }
+}
+
+/**
+ * nact_icommand_tab_dispose:
+ * @window: this #NactICommandTab instance.
+ *
+ * Called at instance_dispose time.
+ */
+void
+nact_icommand_tab_dispose( NactICommandTab *instance )
+{
+ static const gchar *thisfn = "nact_icommand_tab_dispose";
+
+ g_debug( "%s: instance=%p", thisfn, ( void * ) instance );
+ g_return_if_fail( NACT_IS_ICOMMAND_TAB( instance ));
+
+ if( st_initialized && !st_finalized ){
+ legend_dialog_hide( instance );
+ }
+}
+
+static void
+on_iactions_list_column_edited( NactICommandTab *instance, NAObject *object, gchar *text, gint column )
+{
+ GtkWidget *label_widget;
+
+ g_return_if_fail( NACT_IS_ICOMMAND_TAB( instance ));
+
+ if( st_initialized && !st_finalized ){
+
+ if( NA_IS_OBJECT_PROFILE( object )){
+ label_widget = get_label_entry( instance );
+ gtk_entry_set_text( GTK_ENTRY( label_widget ), text );
+ }
+ }
+}
+
+static void
+on_tab_updatable_selection_changed( NactICommandTab *instance, gint count_selected )
+{
+ static const gchar *thisfn = "nact_icommand_tab_on_tab_updatable_selection_changed";
+ NAObjectItem *item;
+ NAObjectProfile *profile;
+ gboolean enable_tab;
+ GtkWidget *label_entry, *path_entry, *parameters_entry;
+ gchar *label, *path, *parameters;
+ gboolean editable;
+ GtkButton *path_button;
+ GtkButton *legend_button;
+
+ g_debug( "%s: instance=%p, count_selected=%d", thisfn, ( void * ) instance, count_selected );
+ g_return_if_fail( NACT_IS_ICOMMAND_TAB( instance ));
+
+ if( st_initialized && !st_finalized ){
+
+ st_on_selection_change = TRUE;
+
+ g_object_get(
+ G_OBJECT( instance ),
+ TAB_UPDATABLE_PROP_EDITED_ACTION, &item,
+ TAB_UPDATABLE_PROP_EDITED_PROFILE, &profile,
+ TAB_UPDATABLE_PROP_EDITABLE, &editable,
+ NULL );
+
+ enable_tab = tab_set_sensitive( instance );
+
+ label_entry = get_label_entry( instance );
+ label = profile ? na_object_get_label( profile ) : g_strdup( "" );
+ label = label ? label : g_strdup( "" );
+ gtk_entry_set_text( GTK_ENTRY( label_entry ), label );
+ check_for_label( instance, GTK_ENTRY( label_entry ), label );
+ g_free( label );
+ gtk_widget_set_sensitive( label_entry, profile != NULL );
+ nact_gtk_utils_set_editable( GTK_OBJECT( label_entry ), editable );
+
+ path_entry = get_path_entry( instance );
+ path = profile ? na_object_get_path( profile ) : g_strdup( "" );
+ path = path ? path : g_strdup( "" );
+ gtk_entry_set_text( GTK_ENTRY( path_entry ), path );
+ g_free( path );
+ gtk_widget_set_sensitive( path_entry, profile != NULL );
+ nact_gtk_utils_set_editable( GTK_OBJECT( path_entry ), editable );
+
+ path_button = get_path_button( instance );
+ gtk_widget_set_sensitive( GTK_WIDGET( path_button ), profile != NULL );
+ nact_gtk_utils_set_editable( GTK_OBJECT( path_button ), editable );
+
+ parameters_entry = get_parameters_entry( instance );
+ parameters = profile ? na_object_get_parameters( profile ) : g_strdup( "" );
+ parameters = parameters ? parameters : g_strdup( "" );
+ gtk_entry_set_text( GTK_ENTRY( parameters_entry ), parameters );
+ g_free( parameters );
+ gtk_widget_set_sensitive( parameters_entry, profile != NULL );
+ nact_gtk_utils_set_editable( GTK_OBJECT( parameters_entry ), editable );
+
+ legend_button = get_legend_button( instance );
+ gtk_widget_set_sensitive( GTK_WIDGET( legend_button ), profile != NULL );
+
+ st_on_selection_change = FALSE;
+ }
+}
+
+static gboolean
+tab_set_sensitive( NactICommandTab *instance )
+{
+ NAObjectProfile *profile;
+ gboolean enable_tab;
+
+ g_object_get(
+ G_OBJECT( instance ),
+ TAB_UPDATABLE_PROP_EDITED_PROFILE, &profile,
+ NULL );
+
+ enable_tab = ( profile != NULL );
+ nact_main_tab_enable_page( NACT_MAIN_WINDOW( instance ), TAB_COMMAND, enable_tab );
+
+ return( enable_tab );
+}
+
+static void
+check_for_label( NactICommandTab *instance, GtkEntry *entry, const gchar *label )
+{
+ NAObjectProfile *edited;
+
+ nact_main_statusbar_hide_status(
+ NACT_MAIN_WINDOW( instance ),
+ ICOMMAND_TAB_STATUSBAR_CONTEXT );
+
+ set_label_label( instance, "black" );
+
+ g_object_get(
+ G_OBJECT( instance ),
+ TAB_UPDATABLE_PROP_EDITED_PROFILE, &edited,
+ NULL );
+
+ if( edited && g_utf8_strlen( label, -1 ) == 0 ){
+
+ /* i18n: status bar message when the profile label is empty */
+ nact_main_statusbar_display_status(
+ NACT_MAIN_WINDOW( instance ),
+ ICOMMAND_TAB_STATUSBAR_CONTEXT,
+ _( "Caution: a label is mandatory for the profile." ));
+
+ set_label_label( instance, "red" );
+ }
+}
+
+static GtkWidget *
+get_label_entry( NactICommandTab *instance )
+{
+ return( base_window_get_widget( BASE_WINDOW( instance ), "ProfileLabelEntry" ));
+}
+
+static GtkButton *
+get_legend_button( NactICommandTab *instance )
+{
+ return( GTK_BUTTON( base_window_get_widget( BASE_WINDOW( instance ), "CommandLegendButton" )));
+}
+
+static GtkWindow *
+get_legend_dialog( NactICommandTab *instance )
+{
+ return( base_window_get_named_toplevel( BASE_WINDOW( instance ), "LegendDialog" ));
+}
+
+static GtkWidget *
+get_parameters_entry( NactICommandTab *instance )
+{
+ return( base_window_get_widget( BASE_WINDOW( instance ), "CommandParametersEntry" ));
+}
+
+static GtkButton *
+get_path_button( NactICommandTab *instance )
+{
+ return( GTK_BUTTON( base_window_get_widget( BASE_WINDOW( instance ), "CommandPathButton" )));
+}
+
+static GtkWidget *
+get_path_entry( NactICommandTab *instance )
+{
+ return( base_window_get_widget( BASE_WINDOW( instance ), "CommandPathEntry" ));
+}
+
+static void
+legend_dialog_hide( NactICommandTab *instance )
+{
+ GtkWindow *legend_dialog;
+ GtkButton *legend_button;
+ gboolean is_visible;
+
+ legend_dialog = get_legend_dialog( instance );
+ is_visible = ( gboolean ) GPOINTER_TO_INT(
+ g_object_get_data( G_OBJECT( legend_dialog ), ICOMMAND_TAB_LEGEND_VISIBLE ));
+
+ if( is_visible ){
+ g_assert( GTK_IS_WINDOW( legend_dialog ));
+ base_iprefs_save_named_window_position( BASE_WINDOW( instance ), legend_dialog, IPREFS_LEGEND_DIALOG );
+ gtk_widget_hide( GTK_WIDGET( legend_dialog ));
+
+ /* set the legend button state consistent for when the dialog is
+ * hidden by another mean (eg. close the edit profile dialog)
+ */
+ legend_button = get_legend_button( instance );
+ gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( legend_button ), FALSE );
+
+ g_object_set_data( G_OBJECT( legend_dialog ), ICOMMAND_TAB_LEGEND_VISIBLE, GINT_TO_POINTER( FALSE ));
+ }
+}
+
+static void
+legend_dialog_show( NactICommandTab *instance )
+{
+ GtkWindow *legend_dialog;
+ GtkWindow *toplevel;
+
+ legend_dialog = get_legend_dialog( instance );
+ gtk_window_set_deletable( legend_dialog, FALSE );
+
+ toplevel = base_window_get_toplevel( BASE_WINDOW( instance ));
+ gtk_window_set_transient_for( GTK_WINDOW( legend_dialog ), toplevel );
+
+ base_iprefs_position_named_window( BASE_WINDOW( instance ), legend_dialog, IPREFS_LEGEND_DIALOG );
+ gtk_widget_show( GTK_WIDGET( legend_dialog ));
+
+ g_object_set_data( G_OBJECT( legend_dialog ), ICOMMAND_TAB_LEGEND_VISIBLE, GINT_TO_POINTER( TRUE ));
+}
+
+static void
+on_label_changed( GtkEntry *entry, NactICommandTab *instance )
+{
+ NAObjectProfile *edited;
+ const gchar *label;
+
+ if( !st_on_selection_change ){
+
+ g_object_get(
+ G_OBJECT( instance ),
+ TAB_UPDATABLE_PROP_EDITED_PROFILE, &edited,
+ NULL );
+
+ if( edited ){
+ label = gtk_entry_get_text( entry );
+ na_object_set_label( edited, label );
+ g_signal_emit_by_name( G_OBJECT( instance ), TAB_UPDATABLE_SIGNAL_ITEM_UPDATED, edited, TRUE );
+ check_for_label( instance, entry, label );
+ }
+ }
+}
+
+static void
+on_legend_clicked( GtkButton *button, NactICommandTab *instance )
+{
+ if( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( button ))){
+ legend_dialog_show( instance );
+
+ } else {
+ legend_dialog_hide( instance );
+ }
+}
+
+static void
+on_parameters_changed( GtkEntry *entry, NactICommandTab *instance )
+{
+ NAObjectProfile *edited;
+
+ if( !st_on_selection_change ){
+
+ g_object_get(
+ G_OBJECT( instance ),
+ TAB_UPDATABLE_PROP_EDITED_PROFILE, &edited,
+ NULL );
+
+ if( edited ){
+ na_object_set_parameters( edited, gtk_entry_get_text( entry ));
+ g_signal_emit_by_name( G_OBJECT( instance ), TAB_UPDATABLE_SIGNAL_ITEM_UPDATED, edited, FALSE );
+ update_example_label( instance, edited );
+ }
+ }
+}
+
+static void
+on_path_browse( GtkButton *button, NactICommandTab *instance )
+{
+ gboolean set_current_location = FALSE;
+ gchar *uri = NULL;
+ NactApplication *application;
+ NAUpdater *updater;
+ GtkWindow *toplevel;
+ GtkWidget *dialog;
+ GtkWidget *path_entry;
+ const gchar *path;
+ gchar *filename;
+
+ application = NACT_APPLICATION( base_window_get_application( BASE_WINDOW( instance )));
+ updater = nact_application_get_updater( application );
+ toplevel = base_window_get_toplevel( BASE_WINDOW( instance ));
+
+ dialog = gtk_file_chooser_dialog_new(
+ _( "Choosing a command" ),
+ toplevel,
+ GTK_FILE_CHOOSER_ACTION_OPEN,
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
+ NULL
+ );
+
+ base_iprefs_position_named_window( BASE_WINDOW( instance ), GTK_WINDOW( dialog ), IPREFS_COMMAND_CHOOSER );
+
+ path_entry = get_path_entry( instance );
+ path = gtk_entry_get_text( GTK_ENTRY( path_entry ));
+
+ if( path && strlen( path )){
+ set_current_location = gtk_file_chooser_set_filename( GTK_FILE_CHOOSER( dialog ), path );
+
+ } else {
+ uri = na_iprefs_read_string( NA_IPREFS( updater ), IPREFS_FOLDER_URI, "file:///bin" );
+ gtk_file_chooser_set_current_folder_uri( GTK_FILE_CHOOSER( dialog ), uri );
+ g_free( uri );
+ }
+
+ if( gtk_dialog_run( GTK_DIALOG( dialog )) == GTK_RESPONSE_ACCEPT ){
+ filename = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER( dialog ));
+ gtk_entry_set_text( GTK_ENTRY( path_entry ), filename );
+ g_free (filename);
+ }
+
+ uri = gtk_file_chooser_get_current_folder_uri( GTK_FILE_CHOOSER( dialog ));
+ nact_iprefs_write_string( BASE_WINDOW( instance ), IPREFS_FOLDER_URI, uri );
+ g_free( uri );
+
+ base_iprefs_save_named_window_position( BASE_WINDOW( instance ), GTK_WINDOW( dialog ), IPREFS_COMMAND_CHOOSER );
+
+ gtk_widget_destroy( dialog );
+}
+
+static void
+on_path_changed( GtkEntry *entry, NactICommandTab *instance )
+{
+ NAObjectProfile *edited;
+
+ if( !st_on_selection_change ){
+
+ g_object_get(
+ G_OBJECT( instance ),
+ TAB_UPDATABLE_PROP_EDITED_PROFILE, &edited,
+ NULL );
+
+ if( edited ){
+
+ na_object_set_path( edited, gtk_entry_get_text( entry ));
+ g_signal_emit_by_name( G_OBJECT( instance ), TAB_UPDATABLE_SIGNAL_ITEM_UPDATED, edited, FALSE );
+ update_example_label( instance, edited );
+ }
+ }
+}
+
+/*
+ * Valid parameters :
+ *
+ * %d : base dir of the (first) selected file(s)/folder(s)
+ * %f : the name of the (firstà selected file/folder
+ * %h : hostname of the (first) URI
+ * %m : list of the basename of the selected files/directories separated by space.
+ * %M : list of the selected files/directories with their complete path separated by space.
+ * %p : port number of the (first) URI
+ * %R : space-separated list of selected URIs
+ * %s : scheme of the (first) URI
+ * %u : (first) URI
+ * %U : username of the (first) URI
+ * %% : a percent sign
+ */
+static gchar *
+parse_parameters( NactICommandTab *instance )
+{
+ GString *tmp_string = g_string_new( "" );
+
+ /* i18n notes: example strings for the command preview */
+ gchar *ex_path = _( "/path/to" );
+ gchar *ex_files[] = { N_( "file1.txt" ), N_( "file2.txt" ), NULL };
+ gchar *ex_dirs[] = { N_(" folder1" ), N_( "folder2" ), NULL };
+ gchar *ex_mixed[] = { N_(" file1.txt" ), N_( "folder1" ), NULL };
+ gchar *ex_scheme_default = "file";
+ gchar *ex_host_default = _( "test.example.net" );
+ gchar *ex_one_file = _( "file.txt" );
+ gchar *ex_one_dir = _( "folder" );
+ gchar *ex_port_default = _( "8080" );
+ gchar *ex_one = NULL;
+ gchar *ex_list = NULL;
+ gchar *ex_path_list = NULL;
+ gchar *ex_uri_file1 = _( "file:///path/to/file1.text" );
+ gchar *ex_uri_file2 = _( "file:///path/to/file2.text" );
+ gchar *ex_uri_folder1 = _( "file:///path/to/a/dir" );
+ gchar *ex_uri_folder2 = _( "file:///path/to/another/dir" );
+ gchar *ex_uri_list = NULL;
+ gchar *ex_scheme;
+ gchar *ex_host;
+ gboolean is_file, is_dir;
+ gboolean accept_multiple;
+ GSList *scheme_list;
+ guint iter_inc;
+
+ const gchar *command = gtk_entry_get_text( GTK_ENTRY( get_path_entry( instance )));
+ const gchar *param_template = gtk_entry_get_text( GTK_ENTRY( get_parameters_entry( instance )));
+
+ gchar *iter = g_strdup( param_template );
+ gchar *old_iter = iter;
+ gchar *tmp;
+ gchar *separator;
+ gchar *start;
+
+ g_string_append_printf( tmp_string, "%s ", command );
+
+ /*nact_iconditions_tab_get_isfiledir( NACT_ICONDITIONS_TAB( instance ), &is_file, &is_dir );
+ accept_multiple = nact_iconditions_tab_get_multiple( NACT_ICONDITIONS_TAB( instance ));*/
+ is_file = TRUE;
+ is_dir = TRUE;
+ accept_multiple = TRUE;
+
+ scheme_list = nact_ischemes_tab_get_schemes( NACT_ISCHEMES_TAB( instance ));
+
+ separator = g_strdup_printf( " %s/", ex_path );
+ start = g_strdup_printf( "%s/", ex_path );
+
+ if( accept_multiple ){
+ if( is_file && is_dir ){
+ ex_one = ex_files[0];
+ ex_list = na_core_utils_gstring_joinv( NULL, " ", ex_mixed );
+ ex_path_list = na_core_utils_gstring_joinv( start, separator, ex_mixed );
+ ex_uri_list = g_strjoin( " ", ex_uri_file1, ex_uri_folder1, NULL );
+
+ } else if( is_dir ){
+ ex_one = ex_dirs[0];
+ ex_list = na_core_utils_gstring_joinv( NULL, " ", ex_dirs );
+ ex_path_list = na_core_utils_gstring_joinv( start, separator, ex_dirs );
+ ex_uri_list = g_strjoin( " ", ex_uri_folder1, ex_uri_folder2, NULL );
+
+ } else if( is_file ){
+ ex_one = ex_files[0];
+ ex_list = na_core_utils_gstring_joinv( NULL, " ", ex_files );
+ ex_path_list = na_core_utils_gstring_joinv( start, separator, ex_files );
+ ex_uri_list = g_strjoin( " ", ex_uri_file1, ex_uri_file2, NULL );
+ }
+ } else {
+ if( is_dir && !is_file ){
+ ex_one = ex_one_dir;
+ ex_uri_list = g_strdup( ex_uri_folder1 );
+
+ } else {
+ ex_one = ex_one_file;
+ ex_uri_list = g_strdup( ex_uri_file1 );
+ }
+ ex_list = g_strdup( ex_one );
+ ex_path_list = g_strjoin( "/", ex_path, ex_one, NULL );
+ }
+
+ g_free (start);
+ g_free (separator);
+
+ if( scheme_list != NULL ){
+ ex_scheme = ( gchar * ) scheme_list->data;
+ if( g_ascii_strcasecmp( ex_scheme, "file" ) == 0 ){
+ if( g_slist_length( scheme_list ) > 1 ){
+ ex_scheme = ( gchar * ) scheme_list->next->data;
+ ex_host = ex_host_default;
+ } else {
+ ex_host = "";
+ }
+ } else {
+ ex_host = ex_host_default;
+ }
+ } else {
+ ex_scheme = ex_scheme_default;
+ ex_host = "";
+ }
+
+ while(( iter = g_strstr_len( iter, strlen( iter ), "%" ))){
+ tmp_string = g_string_append_len( tmp_string, old_iter, strlen( old_iter ) - strlen( iter ));
+ iter_inc = 1;
+ switch( iter[1] ){
+
+ case 'd': /* base dir of the (first) selected file(s)/folder(s) */
+ tmp_string = g_string_append( tmp_string, ex_path );
+ break;
+
+ case 'f': /* the basename of the (first) selected file/folder */
+ tmp_string = g_string_append( tmp_string, ex_one );
+ break;
+
+ case 'h': /* hostname of the (first) URI */
+ tmp_string = g_string_append( tmp_string, ex_host );
+ break;
+
+ case 'm': /* list of the basename of the selected files/directories separated by space */
+ tmp_string = g_string_append( tmp_string, ex_list );
+ break;
+
+ case 'M': /* list of the selected files/directories with their complete path separated by space. */
+ tmp_string = g_string_append( tmp_string, ex_path_list );
+ break;
+
+ case 'p': /* port number of the (first) URI */
+ tmp_string = g_string_append( tmp_string, ex_port_default );
+ break;
+
+ case 'R': /* space-separated list of selected URIs */
+ tmp_string = g_string_append( tmp_string, ex_uri_list );
+ break;
+
+ case 's': /* scheme of the (first) URI */
+ tmp_string = g_string_append( tmp_string, ex_scheme );
+ break;
+
+ case 'u': /* (first) URI */
+ tmp = g_strjoin( NULL, ex_scheme, "://", ex_path, "/", ex_one, NULL );
+ tmp_string = g_string_append( tmp_string, tmp );
+ g_free( tmp );
+ break;
+
+ case 'U': /* username of the GVfs URI */
+ tmp_string = g_string_append( tmp_string, "root" );
+ break;
+
+ case '%': /* a percent sign */
+ tmp_string = g_string_append_c( tmp_string, '%' );
+ break;
+
+ default:
+ iter_inc = 1;
+ break;
+ }
+ iter += iter_inc; /* skip the % sign and the character after. */
+ old_iter = iter; /* store the new start of the string */
+ }
+ tmp_string = g_string_append_len( tmp_string, old_iter, strlen( old_iter ));
+
+ na_core_utils_slist_free( scheme_list );
+
+ g_free( ex_list );
+ g_free( ex_path_list );
+ g_free( ex_uri_list );
+ g_free( iter );
+
+ return( g_string_free( tmp_string, FALSE ));
+}
+
+static void
+set_label_label( NactICommandTab *instance, const gchar *color_str )
+{
+ GtkWidget *label;
+ GdkColor color;
+
+ label = base_window_get_widget( BASE_WINDOW( instance ), "ProfileLabelLabel" );
+ gdk_color_parse( color_str, &color );
+ gtk_widget_modify_fg( label, GTK_STATE_NORMAL, &color );
+}
+
+static void
+update_example_label( NactICommandTab *instance, NAObjectProfile *profile )
+{
+ /*static const char *thisfn = "nact_iconditions_update_example_label";*/
+ gchar *newlabel;
+ gchar *parameters;
+ GtkWidget *example_widget;
+
+ example_widget = base_window_get_widget( BASE_WINDOW( instance ), "CommandExampleLabel" );
+
+ if( profile ){
+ parameters = parse_parameters( instance );
+ /*g_debug( "%s: parameters=%s", thisfn, parameters );*/
+
+ /* convert special xml chars (&, <, >,...) to avoid warnings
+ * generated by Pango parser
+ */
+ /* i18n: command-line example: e.g., /bin/ls file1.txt file2.txt */
+ newlabel = g_markup_printf_escaped(
+ "<i><b><span size=\"small\">%s %s</span></b></i>", _( "e.g.," ), parameters );
+
+ g_free( parameters );
+
+ } else {
+ newlabel = g_strdup( "" );
+ }
+
+ gtk_label_set_label( GTK_LABEL( example_widget ), newlabel );
+ g_free( newlabel );
+}
diff --git a/src/nact/nact-iexecution-tab.h b/src/nact/nact-iexecution-tab.h
new file mode 100644
index 0000000..122725d
--- /dev/null
+++ b/src/nact/nact-iexecution-tab.h
@@ -0,0 +1,71 @@
+/*
+ * 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_ICOMMAND_TAB_H__
+#define __NACT_ICOMMAND_TAB_H__
+
+/**
+ * SECTION: nact_icommand_tab
+ * @short_description: #NactICommandTab interface declaration.
+ * @include: nact/nact-icommand-tab.h
+ *
+ * This interface implements all the widgets which define the
+ * actual action to be executed.
+ */
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define NACT_ICOMMAND_TAB_TYPE ( nact_icommand_tab_get_type())
+#define NACT_ICOMMAND_TAB( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, NACT_ICOMMAND_TAB_TYPE, NactICommandTab ))
+#define NACT_IS_ICOMMAND_TAB( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, NACT_ICOMMAND_TAB_TYPE ))
+#define NACT_ICOMMAND_TAB_GET_INTERFACE( instance ) ( G_TYPE_INSTANCE_GET_INTERFACE(( instance ), NACT_ICOMMAND_TAB_TYPE, NactICommandTabInterface ))
+
+typedef struct NactICommandTab NactICommandTab;
+
+typedef struct NactICommandTabInterfacePrivate NactICommandTabInterfacePrivate;
+
+typedef struct {
+ GTypeInterface parent;
+ NactICommandTabInterfacePrivate *private;
+}
+ NactICommandTabInterface;
+
+GType nact_icommand_tab_get_type( void );
+
+void nact_icommand_tab_initial_load_toplevel( NactICommandTab *instance );
+void nact_icommand_tab_runtime_init_toplevel( NactICommandTab *instance );
+void nact_icommand_tab_all_widgets_showed( NactICommandTab *instance );
+void nact_icommand_tab_dispose( NactICommandTab *instance );
+
+G_END_DECLS
+
+#endif /* __NACT_ICOMMAND_TAB_H__ */
diff --git a/src/nact/nact-imimetypes-tab.c b/src/nact/nact-imimetypes-tab.c
new file mode 100644
index 0000000..24401c8
--- /dev/null
+++ b/src/nact/nact-imimetypes-tab.c
@@ -0,0 +1,860 @@
+/*
+ * 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 <glib/gi18n.h>
+#include <string.h>
+
+#include <api/na-core-utils.h>
+#include <api/na-object-api.h>
+
+#include <core/na-iprefs.h>
+
+#include "base-window.h"
+#include "base-iprefs.h"
+#include "nact-application.h"
+#include "nact-main-statusbar.h"
+#include "nact-gtk-utils.h"
+#include "nact-iprefs.h"
+#include "nact-iactions-list.h"
+#include "nact-main-tab.h"
+#include "nact-icommand-tab.h"
+#include "nact-iconditions-tab.h"
+#include "nact-ischemes-tab.h"
+
+/* private interface data
+ */
+struct NactICommandTabInterfacePrivate {
+ void *empty; /* so that gcc -pedantic is happy */
+};
+
+/* the GConf key used to read/write size and position of auxiliary dialogs
+ */
+#define IPREFS_LEGEND_DIALOG "icommand-legend-dialog"
+#define IPREFS_COMMAND_CHOOSER "icommand-command-chooser"
+#define IPREFS_FOLDER_URI "icommand-folder-uri"
+
+/* a data set in the LegendDialog GObject
+ */
+#define ICOMMAND_TAB_LEGEND_VISIBLE "nact-icommand-tab-legend-dialog-visible"
+#define ICOMMAND_TAB_STATUSBAR_CONTEXT "nact-icommand-tab-statusbar-context"
+
+static gboolean st_initialized = FALSE;
+static gboolean st_finalized = FALSE;
+static gboolean st_on_selection_change = FALSE;
+
+static GType register_type( void );
+static void interface_base_init( NactICommandTabInterface *klass );
+static void interface_base_finalize( NactICommandTabInterface *klass );
+
+static void on_iactions_list_column_edited( NactICommandTab *instance, NAObject *object, gchar *text, gint column );
+static void on_tab_updatable_selection_changed( NactICommandTab *instance, gint count_selected );
+static gboolean tab_set_sensitive( NactICommandTab *instance );
+
+static void check_for_label( NactICommandTab *instance, GtkEntry *entry, const gchar *label );
+static GtkWidget *get_label_entry( NactICommandTab *instance );
+static GtkButton *get_legend_button( NactICommandTab *instance );
+static GtkWindow *get_legend_dialog( NactICommandTab *instance );
+static GtkWidget *get_parameters_entry( NactICommandTab *instance );
+static GtkButton *get_path_button( NactICommandTab *instance );
+static GtkWidget *get_path_entry( NactICommandTab *instance );
+static void legend_dialog_show( NactICommandTab *instance );
+static void legend_dialog_hide( NactICommandTab *instance );
+static void on_label_changed( GtkEntry *entry, NactICommandTab *instance );
+static void on_legend_clicked( GtkButton *button, NactICommandTab *instance );
+static void on_parameters_changed( GtkEntry *entry, NactICommandTab *instance );
+static void on_path_browse( GtkButton *button, NactICommandTab *instance );
+static void on_path_changed( GtkEntry *entry, NactICommandTab *instance );
+static gchar *parse_parameters( NactICommandTab *instance );
+static void set_label_label( NactICommandTab *instance, const gchar *color );
+static void update_example_label( NactICommandTab *instance, NAObjectProfile *profile );
+
+GType
+nact_icommand_tab_get_type( void )
+{
+ static GType iface_type = 0;
+
+ if( !iface_type ){
+ iface_type = register_type();
+ }
+
+ return( iface_type );
+}
+
+static GType
+register_type( void )
+{
+ static const gchar *thisfn = "nact_icommand_tab_register_type";
+ GType type;
+
+ static const GTypeInfo info = {
+ sizeof( NactICommandTabInterface ),
+ ( GBaseInitFunc ) interface_base_init,
+ ( GBaseFinalizeFunc ) interface_base_finalize,
+ NULL,
+ NULL,
+ NULL,
+ 0,
+ 0,
+ NULL
+ };
+
+ g_debug( "%s", thisfn );
+
+ type = g_type_register_static( G_TYPE_INTERFACE, "NactICommandTab", &info, 0 );
+
+ g_type_interface_add_prerequisite( type, BASE_WINDOW_TYPE );
+
+ return( type );
+}
+
+static void
+interface_base_init( NactICommandTabInterface *klass )
+{
+ static const gchar *thisfn = "nact_icommand_tab_interface_base_init";
+
+ if( !st_initialized ){
+
+ g_debug( "%s: klass=%p", thisfn, ( void * ) klass );
+
+ klass->private = g_new0( NactICommandTabInterfacePrivate, 1 );
+
+ st_initialized = TRUE;
+ }
+}
+
+static void
+interface_base_finalize( NactICommandTabInterface *klass )
+{
+ static const gchar *thisfn = "nact_icommand_tab_interface_base_finalize";
+
+ if( st_initialized && !st_finalized ){
+
+ g_debug( "%s: klass=%p", thisfn, ( void * ) klass );
+
+ st_finalized = TRUE;
+
+ g_free( klass->private );
+ }
+}
+
+/**
+ * nact_icommand_tab_initial_load:
+ * @window: this #NactICommandTab instance.
+ *
+ * Initializes the tab widget at initial load.
+ *
+ * The GConf preference keys used in this tab were misnamed from v1.11.1
+ * up to and including v1.12.0. Starting with v1.12.1, these are migrated
+ * here, so that the normal code only makes use of 'good' keys.
+ */
+void
+nact_icommand_tab_initial_load_toplevel( NactICommandTab *instance )
+{
+ static const gchar *thisfn = "nact_icommand_tab_initial_load_toplevel";
+
+ g_debug( "%s: instance=%p", thisfn, ( void * ) instance );
+ g_return_if_fail( NACT_IS_ICOMMAND_TAB( instance ));
+
+ if( st_initialized && !st_finalized ){
+
+ nact_iprefs_migrate_key( BASE_WINDOW( instance ), "iconditions-legend-dialog", IPREFS_LEGEND_DIALOG );
+ nact_iprefs_migrate_key( BASE_WINDOW( instance ), "iconditions-command-chooser", IPREFS_COMMAND_CHOOSER );
+ nact_iprefs_migrate_key( BASE_WINDOW( instance ), "iconditions-folder-uri", IPREFS_FOLDER_URI );
+ }
+}
+
+/**
+ * nact_icommand_tab_runtime_init:
+ * @window: this #NactICommandTab instance.
+ *
+ * Initializes the tab widget at each time the widget will be displayed.
+ * Connect signals and setup runtime values.
+ */
+void
+nact_icommand_tab_runtime_init_toplevel( NactICommandTab *instance )
+{
+ static const gchar *thisfn = "nact_icommand_tab_runtime_init_toplevel";
+ GtkWidget *label_entry, *path_entry, *parameters_entry;
+ GtkButton *path_button, *legend_button;
+
+ g_debug( "%s: instance=%p", thisfn, ( void * ) instance );
+ g_return_if_fail( NACT_IS_ICOMMAND_TAB( instance ));
+
+ if( st_initialized && !st_finalized ){
+
+ label_entry = get_label_entry( instance );
+ base_window_signal_connect(
+ BASE_WINDOW( instance ),
+ G_OBJECT( label_entry ),
+ "changed",
+ G_CALLBACK( on_label_changed ));
+
+ path_entry = get_path_entry( instance );
+ base_window_signal_connect(
+ BASE_WINDOW( instance ),
+ G_OBJECT( path_entry ),
+ "changed",
+ G_CALLBACK( on_path_changed ));
+
+ path_button = get_path_button( instance );
+ base_window_signal_connect(
+ BASE_WINDOW( instance ),
+ G_OBJECT( path_button ),
+ "clicked",
+ G_CALLBACK( on_path_browse ));
+
+ parameters_entry = get_parameters_entry( instance );
+ base_window_signal_connect(
+ BASE_WINDOW( instance ),
+ G_OBJECT( parameters_entry ),
+ "changed",
+ G_CALLBACK( on_parameters_changed ));
+
+ legend_button = get_legend_button( instance );
+ base_window_signal_connect(
+ BASE_WINDOW( instance ),
+ G_OBJECT( legend_button ),
+ "clicked",
+ G_CALLBACK( on_legend_clicked ));
+
+ base_window_signal_connect(
+ BASE_WINDOW( instance ),
+ G_OBJECT( instance ),
+ MAIN_WINDOW_SIGNAL_SELECTION_CHANGED,
+ G_CALLBACK( on_tab_updatable_selection_changed ));
+
+ base_window_signal_connect(
+ BASE_WINDOW( instance ),
+ G_OBJECT( instance ),
+ IACTIONS_LIST_SIGNAL_COLUMN_EDITED,
+ G_CALLBACK( on_iactions_list_column_edited ));
+ }
+}
+
+void
+nact_icommand_tab_all_widgets_showed( NactICommandTab *instance )
+{
+ static const gchar *thisfn = "nact_icommand_tab_all_widgets_showed";
+
+ g_debug( "%s: instance=%p", thisfn, ( void * ) instance );
+ g_return_if_fail( NACT_IS_ICOMMAND_TAB( instance ));
+
+ if( st_initialized && !st_finalized ){
+ }
+}
+
+/**
+ * nact_icommand_tab_dispose:
+ * @window: this #NactICommandTab instance.
+ *
+ * Called at instance_dispose time.
+ */
+void
+nact_icommand_tab_dispose( NactICommandTab *instance )
+{
+ static const gchar *thisfn = "nact_icommand_tab_dispose";
+
+ g_debug( "%s: instance=%p", thisfn, ( void * ) instance );
+ g_return_if_fail( NACT_IS_ICOMMAND_TAB( instance ));
+
+ if( st_initialized && !st_finalized ){
+ legend_dialog_hide( instance );
+ }
+}
+
+static void
+on_iactions_list_column_edited( NactICommandTab *instance, NAObject *object, gchar *text, gint column )
+{
+ GtkWidget *label_widget;
+
+ g_return_if_fail( NACT_IS_ICOMMAND_TAB( instance ));
+
+ if( st_initialized && !st_finalized ){
+
+ if( NA_IS_OBJECT_PROFILE( object )){
+ label_widget = get_label_entry( instance );
+ gtk_entry_set_text( GTK_ENTRY( label_widget ), text );
+ }
+ }
+}
+
+static void
+on_tab_updatable_selection_changed( NactICommandTab *instance, gint count_selected )
+{
+ static const gchar *thisfn = "nact_icommand_tab_on_tab_updatable_selection_changed";
+ NAObjectItem *item;
+ NAObjectProfile *profile;
+ gboolean enable_tab;
+ GtkWidget *label_entry, *path_entry, *parameters_entry;
+ gchar *label, *path, *parameters;
+ gboolean editable;
+ GtkButton *path_button;
+ GtkButton *legend_button;
+
+ g_debug( "%s: instance=%p, count_selected=%d", thisfn, ( void * ) instance, count_selected );
+ g_return_if_fail( NACT_IS_ICOMMAND_TAB( instance ));
+
+ if( st_initialized && !st_finalized ){
+
+ st_on_selection_change = TRUE;
+
+ g_object_get(
+ G_OBJECT( instance ),
+ TAB_UPDATABLE_PROP_EDITED_ACTION, &item,
+ TAB_UPDATABLE_PROP_EDITED_PROFILE, &profile,
+ TAB_UPDATABLE_PROP_EDITABLE, &editable,
+ NULL );
+
+ enable_tab = tab_set_sensitive( instance );
+
+ label_entry = get_label_entry( instance );
+ label = profile ? na_object_get_label( profile ) : g_strdup( "" );
+ label = label ? label : g_strdup( "" );
+ gtk_entry_set_text( GTK_ENTRY( label_entry ), label );
+ check_for_label( instance, GTK_ENTRY( label_entry ), label );
+ g_free( label );
+ gtk_widget_set_sensitive( label_entry, profile != NULL );
+ nact_gtk_utils_set_editable( GTK_OBJECT( label_entry ), editable );
+
+ path_entry = get_path_entry( instance );
+ path = profile ? na_object_get_path( profile ) : g_strdup( "" );
+ path = path ? path : g_strdup( "" );
+ gtk_entry_set_text( GTK_ENTRY( path_entry ), path );
+ g_free( path );
+ gtk_widget_set_sensitive( path_entry, profile != NULL );
+ nact_gtk_utils_set_editable( GTK_OBJECT( path_entry ), editable );
+
+ path_button = get_path_button( instance );
+ gtk_widget_set_sensitive( GTK_WIDGET( path_button ), profile != NULL );
+ nact_gtk_utils_set_editable( GTK_OBJECT( path_button ), editable );
+
+ parameters_entry = get_parameters_entry( instance );
+ parameters = profile ? na_object_get_parameters( profile ) : g_strdup( "" );
+ parameters = parameters ? parameters : g_strdup( "" );
+ gtk_entry_set_text( GTK_ENTRY( parameters_entry ), parameters );
+ g_free( parameters );
+ gtk_widget_set_sensitive( parameters_entry, profile != NULL );
+ nact_gtk_utils_set_editable( GTK_OBJECT( parameters_entry ), editable );
+
+ legend_button = get_legend_button( instance );
+ gtk_widget_set_sensitive( GTK_WIDGET( legend_button ), profile != NULL );
+
+ st_on_selection_change = FALSE;
+ }
+}
+
+static gboolean
+tab_set_sensitive( NactICommandTab *instance )
+{
+ NAObjectProfile *profile;
+ gboolean enable_tab;
+
+ g_object_get(
+ G_OBJECT( instance ),
+ TAB_UPDATABLE_PROP_EDITED_PROFILE, &profile,
+ NULL );
+
+ enable_tab = ( profile != NULL );
+ nact_main_tab_enable_page( NACT_MAIN_WINDOW( instance ), TAB_COMMAND, enable_tab );
+
+ return( enable_tab );
+}
+
+static void
+check_for_label( NactICommandTab *instance, GtkEntry *entry, const gchar *label )
+{
+ NAObjectProfile *edited;
+
+ nact_main_statusbar_hide_status(
+ NACT_MAIN_WINDOW( instance ),
+ ICOMMAND_TAB_STATUSBAR_CONTEXT );
+
+ set_label_label( instance, "black" );
+
+ g_object_get(
+ G_OBJECT( instance ),
+ TAB_UPDATABLE_PROP_EDITED_PROFILE, &edited,
+ NULL );
+
+ if( edited && g_utf8_strlen( label, -1 ) == 0 ){
+
+ /* i18n: status bar message when the profile label is empty */
+ nact_main_statusbar_display_status(
+ NACT_MAIN_WINDOW( instance ),
+ ICOMMAND_TAB_STATUSBAR_CONTEXT,
+ _( "Caution: a label is mandatory for the profile." ));
+
+ set_label_label( instance, "red" );
+ }
+}
+
+static GtkWidget *
+get_label_entry( NactICommandTab *instance )
+{
+ return( base_window_get_widget( BASE_WINDOW( instance ), "ProfileLabelEntry" ));
+}
+
+static GtkButton *
+get_legend_button( NactICommandTab *instance )
+{
+ return( GTK_BUTTON( base_window_get_widget( BASE_WINDOW( instance ), "CommandLegendButton" )));
+}
+
+static GtkWindow *
+get_legend_dialog( NactICommandTab *instance )
+{
+ return( base_window_get_named_toplevel( BASE_WINDOW( instance ), "LegendDialog" ));
+}
+
+static GtkWidget *
+get_parameters_entry( NactICommandTab *instance )
+{
+ return( base_window_get_widget( BASE_WINDOW( instance ), "CommandParametersEntry" ));
+}
+
+static GtkButton *
+get_path_button( NactICommandTab *instance )
+{
+ return( GTK_BUTTON( base_window_get_widget( BASE_WINDOW( instance ), "CommandPathButton" )));
+}
+
+static GtkWidget *
+get_path_entry( NactICommandTab *instance )
+{
+ return( base_window_get_widget( BASE_WINDOW( instance ), "CommandPathEntry" ));
+}
+
+static void
+legend_dialog_hide( NactICommandTab *instance )
+{
+ GtkWindow *legend_dialog;
+ GtkButton *legend_button;
+ gboolean is_visible;
+
+ legend_dialog = get_legend_dialog( instance );
+ is_visible = ( gboolean ) GPOINTER_TO_INT(
+ g_object_get_data( G_OBJECT( legend_dialog ), ICOMMAND_TAB_LEGEND_VISIBLE ));
+
+ if( is_visible ){
+ g_assert( GTK_IS_WINDOW( legend_dialog ));
+ base_iprefs_save_named_window_position( BASE_WINDOW( instance ), legend_dialog, IPREFS_LEGEND_DIALOG );
+ gtk_widget_hide( GTK_WIDGET( legend_dialog ));
+
+ /* set the legend button state consistent for when the dialog is
+ * hidden by another mean (eg. close the edit profile dialog)
+ */
+ legend_button = get_legend_button( instance );
+ gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( legend_button ), FALSE );
+
+ g_object_set_data( G_OBJECT( legend_dialog ), ICOMMAND_TAB_LEGEND_VISIBLE, GINT_TO_POINTER( FALSE ));
+ }
+}
+
+static void
+legend_dialog_show( NactICommandTab *instance )
+{
+ GtkWindow *legend_dialog;
+ GtkWindow *toplevel;
+
+ legend_dialog = get_legend_dialog( instance );
+ gtk_window_set_deletable( legend_dialog, FALSE );
+
+ toplevel = base_window_get_toplevel( BASE_WINDOW( instance ));
+ gtk_window_set_transient_for( GTK_WINDOW( legend_dialog ), toplevel );
+
+ base_iprefs_position_named_window( BASE_WINDOW( instance ), legend_dialog, IPREFS_LEGEND_DIALOG );
+ gtk_widget_show( GTK_WIDGET( legend_dialog ));
+
+ g_object_set_data( G_OBJECT( legend_dialog ), ICOMMAND_TAB_LEGEND_VISIBLE, GINT_TO_POINTER( TRUE ));
+}
+
+static void
+on_label_changed( GtkEntry *entry, NactICommandTab *instance )
+{
+ NAObjectProfile *edited;
+ const gchar *label;
+
+ if( !st_on_selection_change ){
+
+ g_object_get(
+ G_OBJECT( instance ),
+ TAB_UPDATABLE_PROP_EDITED_PROFILE, &edited,
+ NULL );
+
+ if( edited ){
+ label = gtk_entry_get_text( entry );
+ na_object_set_label( edited, label );
+ g_signal_emit_by_name( G_OBJECT( instance ), TAB_UPDATABLE_SIGNAL_ITEM_UPDATED, edited, TRUE );
+ check_for_label( instance, entry, label );
+ }
+ }
+}
+
+static void
+on_legend_clicked( GtkButton *button, NactICommandTab *instance )
+{
+ if( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( button ))){
+ legend_dialog_show( instance );
+
+ } else {
+ legend_dialog_hide( instance );
+ }
+}
+
+static void
+on_parameters_changed( GtkEntry *entry, NactICommandTab *instance )
+{
+ NAObjectProfile *edited;
+
+ if( !st_on_selection_change ){
+
+ g_object_get(
+ G_OBJECT( instance ),
+ TAB_UPDATABLE_PROP_EDITED_PROFILE, &edited,
+ NULL );
+
+ if( edited ){
+ na_object_set_parameters( edited, gtk_entry_get_text( entry ));
+ g_signal_emit_by_name( G_OBJECT( instance ), TAB_UPDATABLE_SIGNAL_ITEM_UPDATED, edited, FALSE );
+ update_example_label( instance, edited );
+ }
+ }
+}
+
+static void
+on_path_browse( GtkButton *button, NactICommandTab *instance )
+{
+ gboolean set_current_location = FALSE;
+ gchar *uri = NULL;
+ NactApplication *application;
+ NAUpdater *updater;
+ GtkWindow *toplevel;
+ GtkWidget *dialog;
+ GtkWidget *path_entry;
+ const gchar *path;
+ gchar *filename;
+
+ application = NACT_APPLICATION( base_window_get_application( BASE_WINDOW( instance )));
+ updater = nact_application_get_updater( application );
+ toplevel = base_window_get_toplevel( BASE_WINDOW( instance ));
+
+ dialog = gtk_file_chooser_dialog_new(
+ _( "Choosing a command" ),
+ toplevel,
+ GTK_FILE_CHOOSER_ACTION_OPEN,
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
+ NULL
+ );
+
+ base_iprefs_position_named_window( BASE_WINDOW( instance ), GTK_WINDOW( dialog ), IPREFS_COMMAND_CHOOSER );
+
+ path_entry = get_path_entry( instance );
+ path = gtk_entry_get_text( GTK_ENTRY( path_entry ));
+
+ if( path && strlen( path )){
+ set_current_location = gtk_file_chooser_set_filename( GTK_FILE_CHOOSER( dialog ), path );
+
+ } else {
+ uri = na_iprefs_read_string( NA_IPREFS( updater ), IPREFS_FOLDER_URI, "file:///bin" );
+ gtk_file_chooser_set_current_folder_uri( GTK_FILE_CHOOSER( dialog ), uri );
+ g_free( uri );
+ }
+
+ if( gtk_dialog_run( GTK_DIALOG( dialog )) == GTK_RESPONSE_ACCEPT ){
+ filename = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER( dialog ));
+ gtk_entry_set_text( GTK_ENTRY( path_entry ), filename );
+ g_free (filename);
+ }
+
+ uri = gtk_file_chooser_get_current_folder_uri( GTK_FILE_CHOOSER( dialog ));
+ nact_iprefs_write_string( BASE_WINDOW( instance ), IPREFS_FOLDER_URI, uri );
+ g_free( uri );
+
+ base_iprefs_save_named_window_position( BASE_WINDOW( instance ), GTK_WINDOW( dialog ), IPREFS_COMMAND_CHOOSER );
+
+ gtk_widget_destroy( dialog );
+}
+
+static void
+on_path_changed( GtkEntry *entry, NactICommandTab *instance )
+{
+ NAObjectProfile *edited;
+
+ if( !st_on_selection_change ){
+
+ g_object_get(
+ G_OBJECT( instance ),
+ TAB_UPDATABLE_PROP_EDITED_PROFILE, &edited,
+ NULL );
+
+ if( edited ){
+
+ na_object_set_path( edited, gtk_entry_get_text( entry ));
+ g_signal_emit_by_name( G_OBJECT( instance ), TAB_UPDATABLE_SIGNAL_ITEM_UPDATED, edited, FALSE );
+ update_example_label( instance, edited );
+ }
+ }
+}
+
+/*
+ * Valid parameters :
+ *
+ * %d : base dir of the (first) selected file(s)/folder(s)
+ * %f : the name of the (firstà selected file/folder
+ * %h : hostname of the (first) URI
+ * %m : list of the basename of the selected files/directories separated by space.
+ * %M : list of the selected files/directories with their complete path separated by space.
+ * %p : port number of the (first) URI
+ * %R : space-separated list of selected URIs
+ * %s : scheme of the (first) URI
+ * %u : (first) URI
+ * %U : username of the (first) URI
+ * %% : a percent sign
+ */
+static gchar *
+parse_parameters( NactICommandTab *instance )
+{
+ GString *tmp_string = g_string_new( "" );
+
+ /* i18n notes: example strings for the command preview */
+ gchar *ex_path = _( "/path/to" );
+ gchar *ex_files[] = { N_( "file1.txt" ), N_( "file2.txt" ), NULL };
+ gchar *ex_dirs[] = { N_(" folder1" ), N_( "folder2" ), NULL };
+ gchar *ex_mixed[] = { N_(" file1.txt" ), N_( "folder1" ), NULL };
+ gchar *ex_scheme_default = "file";
+ gchar *ex_host_default = _( "test.example.net" );
+ gchar *ex_one_file = _( "file.txt" );
+ gchar *ex_one_dir = _( "folder" );
+ gchar *ex_port_default = _( "8080" );
+ gchar *ex_one = NULL;
+ gchar *ex_list = NULL;
+ gchar *ex_path_list = NULL;
+ gchar *ex_uri_file1 = _( "file:///path/to/file1.text" );
+ gchar *ex_uri_file2 = _( "file:///path/to/file2.text" );
+ gchar *ex_uri_folder1 = _( "file:///path/to/a/dir" );
+ gchar *ex_uri_folder2 = _( "file:///path/to/another/dir" );
+ gchar *ex_uri_list = NULL;
+ gchar *ex_scheme;
+ gchar *ex_host;
+ gboolean is_file, is_dir;
+ gboolean accept_multiple;
+ GSList *scheme_list;
+ guint iter_inc;
+
+ const gchar *command = gtk_entry_get_text( GTK_ENTRY( get_path_entry( instance )));
+ const gchar *param_template = gtk_entry_get_text( GTK_ENTRY( get_parameters_entry( instance )));
+
+ gchar *iter = g_strdup( param_template );
+ gchar *old_iter = iter;
+ gchar *tmp;
+ gchar *separator;
+ gchar *start;
+
+ g_string_append_printf( tmp_string, "%s ", command );
+
+ /*nact_iconditions_tab_get_isfiledir( NACT_ICONDITIONS_TAB( instance ), &is_file, &is_dir );
+ accept_multiple = nact_iconditions_tab_get_multiple( NACT_ICONDITIONS_TAB( instance ));*/
+ is_file = TRUE;
+ is_dir = TRUE;
+ accept_multiple = TRUE;
+
+ scheme_list = nact_ischemes_tab_get_schemes( NACT_ISCHEMES_TAB( instance ));
+
+ separator = g_strdup_printf( " %s/", ex_path );
+ start = g_strdup_printf( "%s/", ex_path );
+
+ if( accept_multiple ){
+ if( is_file && is_dir ){
+ ex_one = ex_files[0];
+ ex_list = na_core_utils_gstring_joinv( NULL, " ", ex_mixed );
+ ex_path_list = na_core_utils_gstring_joinv( start, separator, ex_mixed );
+ ex_uri_list = g_strjoin( " ", ex_uri_file1, ex_uri_folder1, NULL );
+
+ } else if( is_dir ){
+ ex_one = ex_dirs[0];
+ ex_list = na_core_utils_gstring_joinv( NULL, " ", ex_dirs );
+ ex_path_list = na_core_utils_gstring_joinv( start, separator, ex_dirs );
+ ex_uri_list = g_strjoin( " ", ex_uri_folder1, ex_uri_folder2, NULL );
+
+ } else if( is_file ){
+ ex_one = ex_files[0];
+ ex_list = na_core_utils_gstring_joinv( NULL, " ", ex_files );
+ ex_path_list = na_core_utils_gstring_joinv( start, separator, ex_files );
+ ex_uri_list = g_strjoin( " ", ex_uri_file1, ex_uri_file2, NULL );
+ }
+ } else {
+ if( is_dir && !is_file ){
+ ex_one = ex_one_dir;
+ ex_uri_list = g_strdup( ex_uri_folder1 );
+
+ } else {
+ ex_one = ex_one_file;
+ ex_uri_list = g_strdup( ex_uri_file1 );
+ }
+ ex_list = g_strdup( ex_one );
+ ex_path_list = g_strjoin( "/", ex_path, ex_one, NULL );
+ }
+
+ g_free (start);
+ g_free (separator);
+
+ if( scheme_list != NULL ){
+ ex_scheme = ( gchar * ) scheme_list->data;
+ if( g_ascii_strcasecmp( ex_scheme, "file" ) == 0 ){
+ if( g_slist_length( scheme_list ) > 1 ){
+ ex_scheme = ( gchar * ) scheme_list->next->data;
+ ex_host = ex_host_default;
+ } else {
+ ex_host = "";
+ }
+ } else {
+ ex_host = ex_host_default;
+ }
+ } else {
+ ex_scheme = ex_scheme_default;
+ ex_host = "";
+ }
+
+ while(( iter = g_strstr_len( iter, strlen( iter ), "%" ))){
+ tmp_string = g_string_append_len( tmp_string, old_iter, strlen( old_iter ) - strlen( iter ));
+ iter_inc = 1;
+ switch( iter[1] ){
+
+ case 'd': /* base dir of the (first) selected file(s)/folder(s) */
+ tmp_string = g_string_append( tmp_string, ex_path );
+ break;
+
+ case 'f': /* the basename of the (first) selected file/folder */
+ tmp_string = g_string_append( tmp_string, ex_one );
+ break;
+
+ case 'h': /* hostname of the (first) URI */
+ tmp_string = g_string_append( tmp_string, ex_host );
+ break;
+
+ case 'm': /* list of the basename of the selected files/directories separated by space */
+ tmp_string = g_string_append( tmp_string, ex_list );
+ break;
+
+ case 'M': /* list of the selected files/directories with their complete path separated by space. */
+ tmp_string = g_string_append( tmp_string, ex_path_list );
+ break;
+
+ case 'p': /* port number of the (first) URI */
+ tmp_string = g_string_append( tmp_string, ex_port_default );
+ break;
+
+ case 'R': /* space-separated list of selected URIs */
+ tmp_string = g_string_append( tmp_string, ex_uri_list );
+ break;
+
+ case 's': /* scheme of the (first) URI */
+ tmp_string = g_string_append( tmp_string, ex_scheme );
+ break;
+
+ case 'u': /* (first) URI */
+ tmp = g_strjoin( NULL, ex_scheme, "://", ex_path, "/", ex_one, NULL );
+ tmp_string = g_string_append( tmp_string, tmp );
+ g_free( tmp );
+ break;
+
+ case 'U': /* username of the GVfs URI */
+ tmp_string = g_string_append( tmp_string, "root" );
+ break;
+
+ case '%': /* a percent sign */
+ tmp_string = g_string_append_c( tmp_string, '%' );
+ break;
+
+ default:
+ iter_inc = 1;
+ break;
+ }
+ iter += iter_inc; /* skip the % sign and the character after. */
+ old_iter = iter; /* store the new start of the string */
+ }
+ tmp_string = g_string_append_len( tmp_string, old_iter, strlen( old_iter ));
+
+ na_core_utils_slist_free( scheme_list );
+
+ g_free( ex_list );
+ g_free( ex_path_list );
+ g_free( ex_uri_list );
+ g_free( iter );
+
+ return( g_string_free( tmp_string, FALSE ));
+}
+
+static void
+set_label_label( NactICommandTab *instance, const gchar *color_str )
+{
+ GtkWidget *label;
+ GdkColor color;
+
+ label = base_window_get_widget( BASE_WINDOW( instance ), "ProfileLabelLabel" );
+ gdk_color_parse( color_str, &color );
+ gtk_widget_modify_fg( label, GTK_STATE_NORMAL, &color );
+}
+
+static void
+update_example_label( NactICommandTab *instance, NAObjectProfile *profile )
+{
+ /*static const char *thisfn = "nact_iconditions_update_example_label";*/
+ gchar *newlabel;
+ gchar *parameters;
+ GtkWidget *example_widget;
+
+ example_widget = base_window_get_widget( BASE_WINDOW( instance ), "CommandExampleLabel" );
+
+ if( profile ){
+ parameters = parse_parameters( instance );
+ /*g_debug( "%s: parameters=%s", thisfn, parameters );*/
+
+ /* convert special xml chars (&, <, >,...) to avoid warnings
+ * generated by Pango parser
+ */
+ /* i18n: command-line example: e.g., /bin/ls file1.txt file2.txt */
+ newlabel = g_markup_printf_escaped(
+ "<i><b><span size=\"small\">%s %s</span></b></i>", _( "e.g.," ), parameters );
+
+ g_free( parameters );
+
+ } else {
+ newlabel = g_strdup( "" );
+ }
+
+ gtk_label_set_label( GTK_LABEL( example_widget ), newlabel );
+ g_free( newlabel );
+}
diff --git a/src/nact/nact-imimetypes-tab.h b/src/nact/nact-imimetypes-tab.h
new file mode 100644
index 0000000..122725d
--- /dev/null
+++ b/src/nact/nact-imimetypes-tab.h
@@ -0,0 +1,71 @@
+/*
+ * 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_ICOMMAND_TAB_H__
+#define __NACT_ICOMMAND_TAB_H__
+
+/**
+ * SECTION: nact_icommand_tab
+ * @short_description: #NactICommandTab interface declaration.
+ * @include: nact/nact-icommand-tab.h
+ *
+ * This interface implements all the widgets which define the
+ * actual action to be executed.
+ */
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define NACT_ICOMMAND_TAB_TYPE ( nact_icommand_tab_get_type())
+#define NACT_ICOMMAND_TAB( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, NACT_ICOMMAND_TAB_TYPE, NactICommandTab ))
+#define NACT_IS_ICOMMAND_TAB( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, NACT_ICOMMAND_TAB_TYPE ))
+#define NACT_ICOMMAND_TAB_GET_INTERFACE( instance ) ( G_TYPE_INSTANCE_GET_INTERFACE(( instance ), NACT_ICOMMAND_TAB_TYPE, NactICommandTabInterface ))
+
+typedef struct NactICommandTab NactICommandTab;
+
+typedef struct NactICommandTabInterfacePrivate NactICommandTabInterfacePrivate;
+
+typedef struct {
+ GTypeInterface parent;
+ NactICommandTabInterfacePrivate *private;
+}
+ NactICommandTabInterface;
+
+GType nact_icommand_tab_get_type( void );
+
+void nact_icommand_tab_initial_load_toplevel( NactICommandTab *instance );
+void nact_icommand_tab_runtime_init_toplevel( NactICommandTab *instance );
+void nact_icommand_tab_all_widgets_showed( NactICommandTab *instance );
+void nact_icommand_tab_dispose( NactICommandTab *instance );
+
+G_END_DECLS
+
+#endif /* __NACT_ICOMMAND_TAB_H__ */
diff --git a/src/nact/nautilus-actions-config-tool.ui b/src/nact/nautilus-actions-config-tool.ui
index 5cad068..e1b9955 100644
--- a/src/nact/nautilus-actions-config-tool.ui
+++ b/src/nact/nautilus-actions-config-tool.ui
@@ -138,6 +138,7 @@
<object class="GtkNotebook" id="MainNotebook">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="scrollable">True</property>
<child>
<object class="GtkVBox" id="vbox3">
<property name="visible">True</property>
@@ -166,7 +167,7 @@
<property name="visible">True</property>
<property name="n_rows">3</property>
<property name="n_columns">2</property>
- <property name="column_spacing">5</property>
+ <property name="column_spacing">6</property>
<child>
<object class="GtkCheckButton" id="ActionTargetSelectionButton">
<property name="label" translatable="yes">Display item in _selection context menu</property>
@@ -249,7 +250,7 @@ Menus are always candidate if they contain at least one action.</property>
<property name="visible">True</property>
<property name="n_rows">3</property>
<property name="n_columns">2</property>
- <property name="column_spacing">5</property>
+ <property name="column_spacing">6</property>
<child>
<object class="GtkCheckButton" id="ActionTargetToolbarButton">
<property name="label" translatable="yes">Display item in the _toolbar</property>
@@ -329,8 +330,8 @@ Menus are never displayed in the toolbar.</property>
<property name="visible">True</property>
<property name="n_rows">2</property>
<property name="n_columns">2</property>
- <property name="column_spacing">5</property>
- <property name="row_spacing">4</property>
+ <property name="column_spacing">6</property>
+ <property name="row_spacing">3</property>
<child>
<object class="GtkLabel" id="ActionTooltipLabel">
<property name="visible">True</property>
@@ -552,10 +553,10 @@ Menus are never displayed in the toolbar.</property>
<child>
<object class="GtkTable" id="table2">
<property name="visible">True</property>
- <property name="n_rows">3</property>
+ <property name="n_rows">4</property>
<property name="n_columns">3</property>
<property name="column_spacing">6</property>
- <property name="row_spacing">6</property>
+ <property name="row_spacing">3</property>
<child>
<object class="GtkLabel" id="CommandPathLabel">
<property name="visible">True</property>
@@ -658,6 +659,55 @@ Menus are never displayed in the toolbar.</property>
</packing>
</child>
<child>
+ <object class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">_Working directory :</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="WorkingDirectoryEntry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="tooltip_text" translatable="yes">The working directory the program should be started in.
+Parameters may appear in Path value, and will be substituted at runtime.
+Defaults to base directory of the current selection, which happens to be the value of "%d" parameter.
+</property>
+ <property name="invisible_char">●</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="CommandWorkingDirectoryButton">
+ <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="tooltip_text" translatable="yes">Click to choose a working directory from the folder chooser dialog.</property>
+ <property name="image">image4</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_options"></property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
<placeholder/>
</child>
<child>
@@ -681,6 +731,75 @@ Menus are never displayed in the toolbar.</property>
<property name="position">1</property>
</packing>
</child>
+ <child>
+ <object class="GtkFrame" id="frame12">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkAlignment" id="alignment12">
+ <property name="visible">True</property>
+ <property name="top_padding">6</property>
+ <property name="bottom_padding">6</property>
+ <property name="left_padding">12</property>
+ <property name="right_padding">6</property>
+ <child>
+ <object class="GtkHBox" id="hbox10">
+ <property name="visible">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label17">
+ <property name="visible">True</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">_Count :</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="ConditionsCountSigneCombobox">
+ <property name="visible">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="ConditionsCountNumberEntry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label12">
+ <property name="visible">True</property>
+ <property name="xpad">5</property>
+ <property name="label" translatable="yes"><b>Appears if selection contains</b></property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="position">1</property>
@@ -700,22 +819,22 @@ Defining several profiles lets you have several commands, each applying with a d
</packing>
</child>
<child>
- <object class="GtkVBox" id="vbox6">
+ <object class="GtkVBox" id="vbox40">
<property name="visible">True</property>
<property name="border_width">6</property>
<property name="orientation">vertical</property>
<property name="spacing">10</property>
<child>
- <object class="GtkVBox" id="vbox10">
+ <object class="GtkVBox" id="vbox41">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">10</property>
<child>
- <object class="GtkLabel" id="label2">
+ <object class="GtkLabel" id="label66">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="xpad">10</property>
- <property name="label" translatable="yes"><b>Appears if folder's path is one or inside one of these</b></property>
+ <property name="label" translatable="yes"><b>Appears if each basename matches one of these</b></property>
<property name="use_markup">True</property>
</object>
<packing>
@@ -724,27 +843,25 @@ Defining several profiles lets you have several commands, each applying with a d
</packing>
</child>
<child>
- <object class="GtkHBox" id="hbox9">
+ <object class="GtkHBox" id="hbox19">
<property name="visible">True</property>
<property name="spacing">6</property>
<child>
- <object class="GtkVBox" id="vbox11">
+ <object class="GtkVBox" id="vbox43">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">10</property>
<child>
- <object class="GtkScrolledWindow" id="scrolledwindow2">
+ <object class="GtkScrolledWindow" id="scrolledwindow10">
<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">
+ <object class="GtkTreeView" id="BasenamesTreeview">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="tooltip_text" translatable="yes">List of paths for which the current item will be displayed.
-"/" means "all the paths".</property>
</object>
</child>
</object>
@@ -758,18 +875,17 @@ 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="vbox44">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
- <object class="GtkButton" id="AddFolderButton">
+ <object class="GtkButton" id="AddBasenameButton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="tooltip_text" translatable="yes">Click to add a new folder URI.</property>
<child>
- <object class="GtkImage" id="image4">
+ <object class="GtkImage" id="image19">
<property name="visible">True</property>
<property name="stock">gtk-add</property>
</object>
@@ -782,13 +898,12 @@ Defining several profiles lets you have several commands, each applying with a d
</packing>
</child>
<child>
- <object class="GtkButton" id="RemoveFolderButton">
+ <object class="GtkButton" id="RemoveBasenameButton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="tooltip_text" translatable="yes">Click to remove the selected folder URI.</property>
<child>
- <object class="GtkImage" id="image5">
+ <object class="GtkImage" id="image20">
<property name="visible">True</property>
<property name="stock">gtk-remove</property>
</object>
@@ -817,16 +932,140 @@ Defining several profiles lets you have several commands, each applying with a d
<property name="position">0</property>
</packing>
</child>
+ <child>
+ <object class="GtkVBox" id="vbox42">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">10</property>
+ <child>
+ <object class="GtkLabel" id="label67">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="xpad">10</property>
+ <property name="label" translatable="yes"><b>Does not appear if a basename matches one of these</b></property>
+ <property name="use_markup">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox20">
+ <property name="visible">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkVBox" id="vbox45">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">10</property>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow11">
+ <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="NoBasenamesTreeview">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox46">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkButton" id="AddNoBasenameButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <child>
+ <object class="GtkImage" id="image21">
+ <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="RemoveNoBasenameButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <child>
+ <object class="GtkImage" id="image22">
+ <property name="visible">True</property>
+ <property name="stock">gtk-remove</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="ConditionsMatchcaseButton1">
+ <property name="label" translatable="yes">Match _case</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="padding">6</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child type="tab">
- <object class="GtkLabel" id="label16">
+ <object class="GtkLabel" id="label65">
<property name="visible">True</property>
- <property name="tooltip_text" translatable="yes">This tab lets you precisely choose in which folders this profile will apply.</property>
- <property name="label" translatable="yes">_Folders</property>
+ <property name="label" translatable="yes">_Basenames</property>
<property name="use_underline">True</property>
</object>
<packing>
@@ -835,291 +1074,483 @@ Defining several profiles lets you have several commands, each applying with a d
</packing>
</child>
<child>
- <object class="GtkVBox" id="vbox9">
+ <object class="GtkVBox" id="vbox30">
<property name="visible">True</property>
<property name="border_width">6</property>
<property name="orientation">vertical</property>
<property name="spacing">10</property>
<child>
- <object class="GtkFrame" id="frame11">
+ <object class="GtkVBox" id="vbox32">
<property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">in</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">10</property>
<child>
- <object class="GtkAlignment" id="alignment11">
+ <object class="GtkLabel" id="label62">
<property name="visible">True</property>
- <property name="top_padding">6</property>
- <property name="bottom_padding">6</property>
- <property name="left_padding">12</property>
- <property name="right_padding">6</property>
+ <property name="xalign">0</property>
+ <property name="xpad">10</property>
+ <property name="label" translatable="yes"><b>Appears if all selected mimetypes are in this list</b></property>
+ <property name="use_markup">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox16">
+ <property name="visible">True</property>
+ <property name="spacing">6</property>
<child>
- <object class="GtkTable" id="table3">
+ <object class="GtkVBox" id="vbox33">
<property name="visible">True</property>
- <property name="n_rows">3</property>
- <property name="n_columns">2</property>
- <property name="column_spacing">6</property>
- <property name="row_spacing">3</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">10</property>
<child>
- <object class="GtkLabel" id="ConditionsFilenamesLabel">
+ <object class="GtkScrolledWindow" id="scrolledwindow8">
<property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="label" translatable="yes">_Filenames :</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">ConditionsFilenamesEntry</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="MimetypesTreeview">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </object>
+ </child>
</object>
<packing>
- <property name="x_options">GTK_FILL</property>
+ <property name="position">0</property>
</packing>
</child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox18">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
<child>
- <object class="GtkLabel" id="ConditionsMimetypesLabel">
+ <object class="GtkButton" id="AddMimetypeButton">
<property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="label" translatable="yes">_Mimetypes :</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">ConditionsMimetypesEntry</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <child>
+ <object class="GtkImage" id="image14">
+ <property name="visible">True</property>
+ <property name="stock">gtk-add</property>
+ </object>
+ </child>
</object>
<packing>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">GTK_FILL</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkEntry" id="ConditionsFilenamesEntry">
+ <object class="GtkButton" id="RemoveMimetypeButton">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="tooltip_text" translatable="yes">A string with wildcards (? or *) that will be used to match the filenames. You can set several filename patterns by separating them with a semi-colon (;).</property>
- <property name="invisible_char">●</property>
+ <property name="receives_default">True</property>
+ <child>
+ <object class="GtkImage" id="image15">
+ <property name="visible">True</property>
+ <property name="stock">gtk-remove</property>
+ </object>
+ </child>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
</packing>
</child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox31">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">10</property>
+ <child>
+ <object class="GtkLabel" id="label63">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="xpad">10</property>
+ <property name="label" translatable="yes"><b>Does not appears if one mimetype is in this list</b></property>
+ <property name="use_markup">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox17">
+ <property name="visible">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkVBox" id="vbox37">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">10</property>
<child>
- <object class="GtkEntry" id="ConditionsMimetypesEntry">
+ <object class="GtkScrolledWindow" id="scrolledwindow9">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="tooltip_text" translatable="yes">A string with wildcards (? or *) that will be used to match the mimetypes of files. You can set several mimetype patterns by separating them with a semi-colon (;).</property>
- <property name="invisible_char">●</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTreeView" id="NoMimetypesTreeview">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </object>
+ </child>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
+ <property name="position">0</property>
</packing>
</child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox19">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
<child>
- <object class="GtkCheckButton" id="ConditionsMatchcaseButton">
- <property name="label" translatable="yes">Match _case</property>
+ <object class="GtkButton" id="AddNoMimetypeButton">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip_text" translatable="yes">If selected, the filename patterns will be matched case sensitive (eg, *.jpg will not match photo.JPG).</property>
- <property name="use_underline">True</property>
- <property name="xalign">0</property>
- <property name="active">True</property>
- <property name="draw_indicator">True</property>
+ <property name="receives_default">True</property>
+ <child>
+ <object class="GtkImage" id="image">
+ <property name="visible">True</property>
+ <property name="stock">gtk-add</property>
+ </object>
+ </child>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <placeholder/>
+ <object class="GtkButton" id="RemoveNoMimetypeButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <child>
+ <object class="GtkImage" id="image18">
+ <property name="visible">True</property>
+ <property name="stock">gtk-remove</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
</child>
</object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
</child>
</object>
- </child>
- <child type="label">
- <object class="GtkLabel" id="label10">
- <property name="visible">True</property>
- <property name="xpad">5</property>
- <property name="label" translatable="yes"><b>Appears if file matches</b></property>
- <property name="use_markup">True</property>
- </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
</child>
</object>
<packing>
- <property name="expand">False</property>
- <property name="position">0</property>
+ <property name="position">1</property>
</packing>
</child>
+ </object>
+ <packing>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="label8">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Mimetypes</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="position">5</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox6">
+ <property name="visible">True</property>
+ <property name="border_width">6</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">10</property>
<child>
- <object class="GtkFrame" id="frame12">
+ <object class="GtkVBox" id="vbox10">
<property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">in</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">10</property>
<child>
- <object class="GtkAlignment" id="alignment12">
+ <object class="GtkLabel" id="label2">
<property name="visible">True</property>
- <property name="top_padding">6</property>
- <property name="bottom_padding">6</property>
- <property name="left_padding">12</property>
- <property name="right_padding">6</property>
+ <property name="xalign">0</property>
+ <property name="xpad">10</property>
+ <property name="label" translatable="yes"><b>Appears if folder's path is one or inside one of these</b></property>
+ <property name="use_markup">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox9">
+ <property name="visible">True</property>
+ <property name="spacing">6</property>
<child>
- <object class="GtkVBox" id="vbox4">
+ <object class="GtkVBox" id="vbox11">
<property name="visible">True</property>
<property name="orientation">vertical</property>
- <property name="spacing">6</property>
+ <property name="spacing">10</property>
<child>
- <object class="GtkHBox" id="hbox4">
+ <object class="GtkScrolledWindow" id="scrolledwindow2">
<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="GtkRadioButton" id="ConditionsOnlyFilesButton">
- <property name="label" translatable="yes">Only _files</property>
+ <object class="GtkTreeView" id="FoldersTreeview">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip_text" translatable="yes">If selected, item will appear in the Nautilus context menu if and only if the selection contains only files.</property>
- <property name="use_underline">True</property>
- <property name="xalign">0</property>
- <property name="active">True</property>
- <property name="draw_indicator">True</property>
+ <property name="tooltip_text" translatable="yes">List of paths for which the current item will be displayed.
+"/" means "all the paths".</property>
</object>
- <packing>
- <property name="position">0</property>
- </packing>
</child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox8">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkButton" id="AddFolderButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="tooltip_text" translatable="yes">Click to add a new folder URI.</property>
<child>
- <object class="GtkRadioButton" id="ConditionsOnlyFoldersButton">
- <property name="label" translatable="yes">Only f_olders</property>
+ <object class="GtkImage" id="image10">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip_text" translatable="yes">If selected, item will appear in the Nautilus context menu if and only if the selection contains only folders.</property>
- <property name="use_underline">True</property>
- <property name="xalign">0</property>
- <property name="draw_indicator">True</property>
- <property name="group">ConditionsOnlyFilesButton</property>
+ <property name="stock">gtk-add</property>
</object>
- <packing>
- <property name="position">1</property>
- </packing>
</child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="RemoveFolderButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="tooltip_text" translatable="yes">Click to remove the selected folder URI.</property>
<child>
- <object class="GtkRadioButton" id="ConditionsBothButton">
- <property name="label" translatable="yes">_Both</property>
+ <object class="GtkImage" id="image11">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip_text" translatable="yes">If selected, item will always appear in the Nautilus context menu.</property>
- <property name="use_underline">True</property>
- <property name="xalign">0</property>
- <property name="draw_indicator">True</property>
- <property name="group">ConditionsOnlyFilesButton</property>
+ <property name="stock">gtk-remove</property>
</object>
- <packing>
- <property name="position">2</property>
- </packing>
</child>
</object>
<packing>
- <property name="position">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
</packing>
</child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox29">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">10</property>
+ <child>
+ <object class="GtkLabel" id="label64">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="xpad">10</property>
+ <property name="label" translatable="yes"><b>Does not appears if folder's path is one or inside one of these</b></property>
+ <property name="use_markup">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox5">
+ <property name="visible">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkVBox" id="vbox38">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">10</property>
<child>
- <object class="GtkCheckButton" id="ConditionsMultipleButton">
- <property name="label" translatable="yes">Appears if selection has m_ultiple files or folders</property>
+ <object class="GtkScrolledWindow" id="scrolledwindow7">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip_text" translatable="yes">If selected, item will always appear in the Nautilus context menu. Else it will appear if and only if the selection contains only one file or folder.</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">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="NoFoldersTreeview">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </object>
+ </child>
</object>
<packing>
- <property name="position">1</property>
+ <property name="position">0</property>
</packing>
</child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox39">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
<child>
- <object class="GtkHBox" id="hbox10">
+ <object class="GtkButton" id="AddNoFolderButton">
<property name="visible">True</property>
- <property name="tooltip_text" translatable="yes">Item will appear in Nautilus context menu if the count of the selection satisfies this relation.</property>
- <property name="spacing">6</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
<child>
- <object class="GtkLabel" id="label17">
+ <object class="GtkImage" id="image12">
<property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="label" translatable="yes">_Count :</property>
- <property name="use_underline">True</property>
+ <property name="stock">gtk-add</property>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="position">0</property>
- </packing>
</child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="RemoveNoFolderButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
<child>
- <object class="GtkHBox" id="hbox12">
+ <object class="GtkImage" id="image13">
<property name="visible">True</property>
- <child>
- <object class="GtkComboBox" id="ConditionsCountSigneCombobox">
- <property name="visible">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="ConditionsCountNumberEntry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">●</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">1</property>
- </packing>
- </child>
+ <property name="stock">gtk-remove</property>
</object>
- <packing>
- <property name="position">1</property>
- </packing>
</child>
</object>
<packing>
- <property name="position">2</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
</packing>
</child>
</object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
</child>
</object>
- </child>
- <child type="label">
- <object class="GtkLabel" id="label12">
- <property name="visible">True</property>
- <property name="xpad">5</property>
- <property name="label" translatable="yes"><b>Appears if selection contains</b></property>
- <property name="use_markup">True</property>
- </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
</child>
</object>
<packing>
- <property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
- <property name="position">3</property>
+ <property name="position">4</property>
</packing>
</child>
<child type="tab">
- <object class="GtkLabel" id="label6">
+ <object class="GtkLabel" id="label16">
<property name="visible">True</property>
- <property name="tooltip_text" translatable="yes">This tab lets you determine when the action will appear in the Nautilus context menu, depending of the nature and the number of selected items.</property>
- <property name="label" translatable="yes">C_onditions</property>
+ <property name="tooltip_text" translatable="yes">This tab lets you precisely choose in which folders this profile will apply.</property>
+ <property name="label" translatable="yes">_Folders</property>
<property name="use_underline">True</property>
</object>
<packing>
- <property name="position">3</property>
+ <property name="position">4</property>
<property name="tab_fill">False</property>
</packing>
</child>
@@ -1139,7 +1570,7 @@ Defining several profiles lets you have several commands, each applying with a d
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="xpad">10</property>
- <property name="label" translatable="yes"><b>Appears if scheme is in this list</b></property>
+ <property name="label" translatable="yes"><b>Appears if scheme is checked in this list</b></property>
<property name="use_markup">True</property>
</object>
<packing>
@@ -1234,9 +1665,111 @@ Defining several profiles lets you have several commands, each applying with a d
<property name="position">0</property>
</packing>
</child>
+ <child>
+ <object class="GtkVBox" id="vbox28">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">10</property>
+ <child>
+ <object class="GtkLabel" id="label60">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="xpad">10</property>
+ <property name="label" translatable="yes"><b>Does not appear if scheme is checked in this list</b></property>
+ <property name="use_markup">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox4">
+ <property name="visible">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow6">
+ <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="NoSchemesTreeView">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="headers_visible">False</property>
+ <property name="rules_hint">True</property>
+ <property name="show_expanders">False</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox4">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkButton" id="AddNoSchemeButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <child>
+ <object class="GtkImage" id="image7">
+ <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="RemoveNoSchemeButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <child>
+ <object class="GtkImage" id="image8">
+ <property name="visible">True</property>
+ <property name="stock">gtk-remove</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
</object>
<packing>
- <property name="position">4</property>
+ <property name="position">5</property>
</packing>
</child>
<child type="tab">
@@ -1247,7 +1780,622 @@ Defining several profiles lets you have several commands, each applying with a d
<property name="use_underline">True</property>
</object>
<packing>
- <property name="position">4</property>
+ <property name="position">5</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox25">
+ <property name="visible">True</property>
+ <property name="border_width">6</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">10</property>
+ <child>
+ <object class="GtkFrame" id="frame4">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkAlignment" id="alignment4">
+ <property name="visible">True</property>
+ <property name="top_padding">6</property>
+ <property name="bottom_padding">6</property>
+ <property name="left_padding">12</property>
+ <property name="right_padding">6</property>
+ <child>
+ <object class="GtkVBox" id="vbox26">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">3</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label48">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Item may appear depending of the desktop environment.</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox14">
+ <property name="visible">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkVBox" id="vbox27">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkRadioButton" id="ShowAlwaysButton">
+ <property name="label" translatable="yes">_Always appears</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="OnlyShowButton">
+ <property name="label" translatable="yes">_Only appears in selected environments</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">ShowAlwaysButton</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="DoNotShowButton">
+ <property name="label" translatable="yes">_Never appears in selected environments</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">ShowAlwaysButton</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow5">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <child>
+ <object class="GtkTreeView" id="EnvironmentsTreeView">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="headers_visible">False</property>
+ <property name="rules_hint">True</property>
+ <property name="show_expanders">False</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label47">
+ <property name="visible">True</property>
+ <property name="xpad">5</property>
+ <property name="label" translatable="yes"><b>Desktop environment</b></property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="frame5">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkAlignment" id="alignment5">
+ <property name="visible">True</property>
+ <property name="top_padding">6</property>
+ <property name="bottom_padding">6</property>
+ <property name="left_padding">12</property>
+ <property name="right_padding">6</property>
+ <child>
+ <object class="GtkTable" id="table10">
+ <property name="visible">True</property>
+ <property name="n_rows">4</property>
+ <property name="n_columns">3</property>
+ <property name="column_spacing">6</property>
+ <property name="row_spacing">3</property>
+ <child>
+ <object class="GtkLabel" id="label55">
+ <property name="visible">True</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">Appears if the file is e_xecutable :</property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkEntry" id="TryExecEntry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="TryExecButton">
+ <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">image5</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="x_options"></property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label56">
+ <property name="visible">True</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">Appears if the name is _registered on D-Bus :</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="ShowIfRegisteredEntry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label57">
+ <property name="visible">True</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">Appears if the command outputs "_true" :</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="ShowIfTrueEntry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label6">
+ <property name="visible">True</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">Appears if the _binary is running :</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="ShowIfRunningEntry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="ShowIfRunningButton">
+ <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">image6</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_options"></property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label51">
+ <property name="visible">True</property>
+ <property name="xpad">5</property>
+ <property name="label" translatable="yes"><b>Pre-requisites</b></property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="position">6</property>
+ </packing>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="label58">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Environment</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="position">6</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox15">
+ <property name="visible">True</property>
+ <property name="border_width">6</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">10</property>
+ <child>
+ <object class="GtkFrame" id="frame1">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="top_padding">6</property>
+ <property name="bottom_padding">6</property>
+ <property name="left_padding">12</property>
+ <property name="right_padding">6</property>
+ <child>
+ <object class="GtkTable" id="table9">
+ <property name="visible">True</property>
+ <property name="n_rows">4</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">6</property>
+ <child>
+ <object class="GtkRadioButton" id="ExecutionModeNormal">
+ <property name="label" translatable="yes">_Normal</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="ExecutionModeTerminal">
+ <property name="label" translatable="yes">In a _terminal</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">ExecutionModeNormal</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="ExecutionModeEmbedded">
+ <property name="label" translatable="yes">_Embedded</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">ExecutionModeNormal</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="ExecutionModeDisplayOutput">
+ <property name="label" translatable="yes">_Display output</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">ExecutionModeNormal</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label45">
+ <property name="visible">True</property>
+ </object>
+ <packing>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label40">
+ <property name="visible">True</property>
+ <property name="xpad">5</property>
+ <property name="label" translatable="yes"><b>Execution mode</b></property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="frame3">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkAlignment" id="alignment3">
+ <property name="visible">True</property>
+ <property name="top_padding">6</property>
+ <property name="bottom_padding">6</property>
+ <property name="left_padding">12</property>
+ <property name="right_padding">6</property>
+ <child>
+ <object class="GtkTable" id="table8">
+ <property name="visible">True</property>
+ <property name="n_rows">3</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">6</property>
+ <property name="row_spacing">3</property>
+ <child>
+ <object class="GtkCheckButton" id="StartupNotifyButton">
+ <property name="label" translatable="yes">Startup _notify</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label43">
+ <property name="visible">True</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">Startup Window Manager _class :</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="StartupWMClassEntry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label42">
+ <property name="visible">True</property>
+ <property name="xpad">5</property>
+ <property name="label" translatable="yes"><b>Startup mode</b></property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="frame2">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkAlignment" id="alignment2">
+ <property name="visible">True</property>
+ <property name="top_padding">6</property>
+ <property name="bottom_padding">6</property>
+ <property name="left_padding">12</property>
+ <property name="right_padding">6</property>
+ <child>
+ <object class="GtkHBox" id="hbox13">
+ <property name="visible">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label44">
+ <property name="visible">True</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">Executer as _user :</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="ExecuteAsEntry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label41">
+ <property name="visible">True</property>
+ <property name="xpad">5</property>
+ <property name="label" translatable="yes"><b>Execute as user</b></property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">7</property>
+ </packing>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="label50">
+ <property name="visible">True</property>
+ <property name="tooltip_text" translatable="yes">This advanced tab lets you precisely choose on which schemes the selection will apply.</property>
+ <property name="label" translatable="yes">E_xecution</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="position">5</property>
<property name="tab_fill">False</property>
</packing>
</child>
@@ -1272,9 +2420,10 @@ Defining several profiles lets you have several commands, each applying with a d
<child>
<object class="GtkTable" id="table4">
<property name="visible">True</property>
- <property name="n_rows">5</property>
+ <property name="n_rows">6</property>
<property name="n_columns">2</property>
- <property name="column_spacing">5</property>
+ <property name="column_spacing">6</property>
+ <property name="row_spacing">3</property>
<child>
<object class="GtkLabel" id="ActionItemID">
<property name="visible">True</property>
@@ -1285,8 +2434,8 @@ Defining several profiles lets you have several commands, each applying with a d
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
@@ -1297,8 +2446,8 @@ Defining several profiles lets you have several commands, each applying with a d
<property name="label" translatable="yes">Id. :</property>
</object>
<packing>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
@@ -1309,8 +2458,8 @@ Defining several profiles lets you have several commands, each applying with a d
<property name="label" translatable="yes">I/O provider :</property>
</object>
<packing>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
@@ -1322,8 +2471,8 @@ Defining several profiles lets you have several commands, each applying with a d
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
</packing>
</child>
<child>
@@ -1387,6 +2536,44 @@ Defining several profiles lets you have several commands, each applying with a d
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label39">
+ <property name="visible">True</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">Suggested _shortcut :</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox15">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkButton" id="SuggestedShortcutButton">
+ <property name="label" translatable="yes">None</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
</packing>
@@ -1415,26 +2602,19 @@ Defining several profiles lets you have several commands, each applying with a d
<property name="position">0</property>
</packing>
</child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
</object>
<packing>
- <property name="position">5</property>
+ <property name="position">8</property>
</packing>
</child>
<child type="tab">
- <object class="GtkLabel" id="label50">
+ <object class="GtkLabel" id="label59">
<property name="visible">True</property>
- <property name="tooltip_text" translatable="yes">This advanced tab lets you precisely choose on which schemes the selection will apply.</property>
<property name="label" translatable="yes">_Properties</property>
<property name="use_underline">True</property>
</object>
<packing>
- <property name="position">4</property>
+ <property name="position">6</property>
<property name="tab_fill">False</property>
</packing>
</child>
@@ -1547,6 +2727,42 @@ 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>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <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>
@@ -1556,15 +2772,15 @@ Defining several profiles lets you have several commands, each applying with a d
</packing>
</child>
<child>
- <object class="GtkVBox" id="vbox18">
+ <object class="GtkVBox" id="vbox34">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkFileChooserWidget" id="ImportFileChooser">
<property name="visible">True</property>
<property name="preview_widget_active">False</property>
- <property name="select_multiple">True</property>
<property name="local_only">False</property>
+ <property name="select_multiple">True</property>
<property name="use_preview_label">False</property>
</object>
<packing>
@@ -1577,7 +2793,7 @@ Defining several profiles lets you have several commands, each applying with a d
</packing>
</child>
<child>
- <object class="GtkVBox" id="vbox19">
+ <object class="GtkVBox" id="vbox35">
<property name="visible">True</property>
<property name="border_width">10</property>
<property name="orientation">vertical</property>
@@ -1623,7 +2839,7 @@ Defining several profiles lets you have several commands, each applying with a d
</packing>
</child>
<child>
- <object class="GtkHBox" id="hbox5">
+ <object class="GtkHBox" id="hbox18">
<property name="visible">True</property>
<child>
<object class="GtkLabel" id="NoImportLabel">
@@ -2357,11 +3573,24 @@ Be warned: this mode may be dangerous. You will not be prompted another time.</p
<property name="stock">gtk-index</property>
<property name="icon-size">1</property>
</object>
+ <object class="GtkImage" id="image4">
+ <property name="visible">True</property>
+ <property name="stock">gtk-find-and-replace</property>
+ </object>
+ <object class="GtkImage" id="image5">
+ <property name="visible">True</property>
+ <property name="stock">gtk-find-and-replace</property>
+ </object>
+ <object class="GtkImage" id="image6">
+ <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"/>
</widgets>
</object>
<object class="GtkSizeGroup" id="CommandButtonSizeGroup">
@@ -2386,4 +3615,11 @@ Be warned: this mode may be dangerous. You will not be prompted another time.</p
<widget name="ConditionsFilenamesLabel"/>
</widgets>
</object>
+ <object class="GtkSizeGroup" id="ExecutionModeSizeGroup">
+ <widgets>
+ <widget name="label45"/>
+ <widget name="label44"/>
+ <widget name="label43"/>
+ </widgets>
+ </object>
</interface>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]