[nautilus-actions] Implement a work-around for #589745



commit 5b122f4d34b30faeea9f085834976eac0aa55220
Author: Pierre Wieser <pwieser trychlos org>
Date:   Tue Aug 25 20:58:59 2009 +0200

    Implement a work-around for #589745

 ChangeLog                        |   13 ++++
 configure.ac                     |    2 +
 src/nact/nact-assistant-export.c |  110 +++++++++++++-----------------
 src/nact/nact-assistant-import.c |   72 ++++++++++---------
 src/nact/nact-assistant.c        |  142 ++++++++++++++++++++++++-------------
 src/nact/nact-assistant.h        |   14 +++-
 6 files changed, 203 insertions(+), 150 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index fbbfd6b..8687098 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2009-08-25 Pierre Wieser <pwieser trychlos org>
+
+	* configure.ac: Add a comment about bug #589745.
+
+	* src/nact/nact-assistant.c:
+	* src/nact/nact-assistant.h:
+	Implement a work-around for bug #589745 (apply message).
+	Remove on_escape_key_pressed() virtual function.
+
+	* nact/nact-assistant-export.c:
+	* src/nact/nact-assistant-import.c:
+	Can now do the operations in the on_assistant_apply() functions.
+
 2009-08-24 Pierre Wieser <pwieser trychlos org>
 
 	* Makefile.am:
diff --git a/configure.ac b/configure.ac
index 18c4706..aa635a3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -110,6 +110,8 @@ AM_GCONF_SOURCE_2
 # GLib >= 2.16: GVFS/GIO
 # Gtk  >= 2.12: GtkBuilder
 #
+# [nact-assistant] remove work-around for #589745 when Gtk+ >= 2.18
+#
 GLIB_REQUIRED=2.16.0
 GTK_REQUIRED=2.12.0
 NAUTILUS_EXTENSION=2.8.0
diff --git a/src/nact/nact-assistant-export.c b/src/nact/nact-assistant-export.c
index 041f409..ddc6a74 100644
--- a/src/nact/nact-assistant-export.c
+++ b/src/nact/nact-assistant-export.c
@@ -133,8 +133,6 @@ static void            assist_initial_load_exportdone( NactAssistantExport *wind
 static void            assist_runtime_init_exportdone( NactAssistantExport *window, GtkAssistant *assistant );
 static void            assist_prepare_exportdone( NactAssistantExport *window, GtkAssistant *assistant, GtkWidget *page );
 
-static void            do_export( NactAssistantExport *window );
-
 #ifdef NA_MAINTAINER_MODE
 static void              dump( NactAssistantExport *window );
 #endif
@@ -392,18 +390,58 @@ on_all_widgets_showed( BaseWindow *dialog )
  * As of 1.11, nact_gconf_writer doesn't return any error message.
  * An error is simply indicated by returning a null filename.
  * So we provide a general error message.
- *
- * apply signal is ran from the confirm page _after_ the prepare signal
- * of the summary page ; it is so almost useless to do anything here if
- * we want show the result on the summary...
- *
- * see http://bugzilla.gnome.org/show_bug.cgi?id=589745
  */
 static void
-on_apply( NactAssistant *window, GtkAssistant *assistant )
+on_apply( NactAssistant *wnd, GtkAssistant *assistant )
 {
 	static const gchar *thisfn = "nact_assistant_export_on_apply";
-	g_debug( "%s: window=%p, assistant=%p", thisfn, ( void * ) window, ( void * ) assistant );
+	NactAssistantExport *window;
+	GSList *actions, *ia;
+	gchar *msg = NULL;
+	gchar *reason = NULL;
+	gchar *tmp, *fname;
+	NAAction *action;
+
+	g_debug( "%s: window=%p, assistant=%p", thisfn, ( void * ) wnd, ( void * ) assistant );
+	g_assert( NACT_IS_ASSISTANT_EXPORT( wnd ));
+	window = NACT_ASSISTANT_EXPORT( wnd );
+
+	actions = nact_iactions_list_get_selected_actions( NACT_WINDOW( window ));
+
+	g_assert( window->private->uri && strlen( window->private->uri ));
+
+	for( ia = actions ; ia ; ia = ia->next ){
+		action = NA_ACTION( ia->data );
+		fname = na_xml_writer_export( action, window->private->uri, window->private->format, &msg );
+
+		if( fname && strlen( fname )){
+			window->private->fnames = g_slist_prepend( window->private->fnames, fname );
+			g_debug( "%s: fname=%s", thisfn, fname );
+
+		} else {
+			window->private->errors += 1;
+			if( msg ){
+				if( reason ){
+					tmp = g_strdup_printf( "%s\n", reason );
+					g_free( reason );
+					reason = tmp;
+				}
+				tmp = g_strdup_printf( "%s%s", reason, msg );
+				g_free( reason );
+				reason = tmp;
+				g_free( msg );
+			}
+		}
+	}
+
+	if( window->private->errors ){
+		if( !reason ){
+			reason = g_strdup( _( "You may not have writing permissions on selected folder." ));
+		}
+		window->private->reason = reason;
+	}
+
+	g_slist_free( actions );
 }
 
 static void
@@ -777,8 +815,6 @@ assist_prepare_exportdone( NactAssistantExport *window, GtkAssistant *assistant,
 	g_debug( "%s: window=%p, assistant=%p, page=%p",
 			thisfn, ( void * ) window, ( void * ) assistant, ( void * ) page );
 
-	do_export( window );
-
 #ifdef NA_MAINTAINER_MODE
 	dump( window );
 #endif
@@ -829,56 +865,6 @@ assist_prepare_exportdone( NactAssistantExport *window, GtkAssistant *assistant,
 	nact_assistant_set_warn_on_cancel( NACT_ASSISTANT( window ), FALSE );
 }
 
-static void
-do_export( NactAssistantExport *window )
-{
-	static const gchar *thisfn = "nact_assistant_export_do_export";
-	GSList *actions, *ia;
-	gchar *msg = NULL;
-	gchar *reason = NULL;
-	gchar *tmp, *fname;
-	NAAction *action;
-
-	g_debug( "%s: window=%p", thisfn, ( void * ) window );
-
-	actions = nact_iactions_list_get_selected_actions( NACT_WINDOW( window ));
-
-	g_assert( window->private->uri && strlen( window->private->uri ));
-
-	for( ia = actions ; ia ; ia = ia->next ){
-		action = NA_ACTION( ia->data );
-		fname = na_xml_writer_export( action, window->private->uri, window->private->format, &msg );
-
-		if( fname && strlen( fname )){
-			window->private->fnames = g_slist_prepend( window->private->fnames, fname );
-			g_debug( "%s: fname=%s", thisfn, fname );
-
-		} else {
-			window->private->errors += 1;
-			if( msg ){
-				if( reason ){
-					tmp = g_strdup_printf( "%s\n", reason );
-					g_free( reason );
-					reason = tmp;
-				}
-				tmp = g_strdup_printf( "%s%s", reason, msg );
-				g_free( reason );
-				reason = tmp;
-				g_free( msg );
-			}
-		}
-	}
-
-	if( window->private->errors ){
-		if( !reason ){
-			reason = g_strdup( _( "You may not have writing permissions on selected folder." ));
-		}
-		window->private->reason = reason;
-	}
-
-	g_slist_free( actions );
-}
-
 #ifdef NA_MAINTAINER_MODE
 static void
 dump( NactAssistantExport *window )
diff --git a/src/nact/nact-assistant-import.c b/src/nact/nact-assistant-import.c
index dc3d1e3..f8b8372 100644
--- a/src/nact/nact-assistant-import.c
+++ b/src/nact/nact-assistant-import.c
@@ -99,10 +99,10 @@ static void     runtime_init_intro( NactAssistantImport *window, GtkAssistant *a
 static void     runtime_init_file_selector( NactAssistantImport *window, GtkAssistant *assistant );
 static void     on_file_selection_changed( GtkFileChooser *chooser, gpointer user_data );
 static gboolean has_readable_files( GSList *uris );
+static void     on_apply( NactAssistant *window, GtkAssistant *assistant );
 static void     on_prepare( NactAssistant *window, GtkAssistant *assistant, GtkWidget *page );
 static void     prepare_confirm( NactAssistantImport *window, GtkAssistant *assistant, GtkWidget *page );
 static void     prepare_importdone( NactAssistantImport *window, GtkAssistant *assistant, GtkWidget *page );
-static void     do_import( NactAssistantImport *window, GtkAssistant *assistant );
 static void     free_results( GSList *list );
 
 GType
@@ -169,6 +169,7 @@ class_init( NactAssistantImportClass *klass )
 	nact_class->get_iprefs_window_id = do_get_iprefs_window_id;
 
 	assist_class = NACT_ASSISTANT_CLASS( klass );
+	assist_class->on_assistant_apply = on_apply;
 	assist_class->on_assistant_prepare = on_prepare;
 }
 
@@ -416,6 +417,41 @@ has_readable_files( GSList *uris )
 }
 
 static void
+on_apply( NactAssistant *wnd, GtkAssistant *assistant )
+{
+	static const gchar *thisfn = "nact_assistant_import_on_apply";
+	NactAssistantImport *window;
+	GtkWidget *chooser;
+	GSList *uris, *is, *msg;
+	NAAction *action;
+	ImportUriStruct *str;
+
+	g_debug( "%s: window=%p, assistant=%p", thisfn, ( void * ) wnd, ( void * ) assistant );
+	g_assert( NACT_IS_ASSISTANT_IMPORT( wnd ));
+	window = NACT_ASSISTANT_IMPORT( wnd );
+
+	chooser = gtk_assistant_get_nth_page( assistant, ASSIST_PAGE_FILES_SELECTION );
+	uris = gtk_file_chooser_get_uris( GTK_FILE_CHOOSER( chooser ));
+
+	for( is = uris ; is ; is = is->next ){
+
+		msg = NULL;
+		action = nact_xml_reader_import( NACT_WINDOW( window ), ( const gchar * ) is->data, &msg );
+
+		str = g_new0( ImportUriStruct, 1 );
+		str->uri = g_strdup(( const gchar * ) is->data );
+		str->action = action;
+		str->msg = na_utils_duplicate_string_list( msg );
+
+		window->private->results = g_slist_prepend( window->private->results, str );
+
+		na_utils_free_string_list( msg );
+	}
+
+	na_utils_free_string_list( uris );
+}
+
+static void
 on_prepare( NactAssistant *window, GtkAssistant *assistant, GtkWidget *page )
 {
 	static const gchar *thisfn = "nact_assistant_import_on_prepare";
@@ -485,8 +521,6 @@ prepare_importdone( NactAssistantImport *window, GtkAssistant *assistant, GtkWid
 	g_debug( "%s: window=%p, assistant=%p, page=%p",
 			thisfn, ( void * ) window, ( void * ) assistant, ( void * ) page );
 
-	do_import( window, assistant );
-
 	/* i18n: result of the import assistant */
 	text = g_strdup( _( "Selected files have been imported:" ));
 
@@ -546,38 +580,6 @@ prepare_importdone( NactAssistantImport *window, GtkAssistant *assistant, GtkWid
 }
 
 static void
-do_import( NactAssistantImport *window, GtkAssistant *assistant )
-{
-	static const gchar *thisfn = "nact_assistant_import_do_import";
-	GtkWidget *chooser;
-	GSList *uris, *is, *msg;
-	NAAction *action;
-	ImportUriStruct *str;
-
-	g_debug( "%s: window=%p", thisfn, ( void * ) window );
-
-	chooser = gtk_assistant_get_nth_page( assistant, ASSIST_PAGE_FILES_SELECTION );
-	uris = gtk_file_chooser_get_uris( GTK_FILE_CHOOSER( chooser ));
-
-	for( is = uris ; is ; is = is->next ){
-
-		msg = NULL;
-		action = nact_xml_reader_import( NACT_WINDOW( window ), ( const gchar * ) is->data, &msg );
-
-		str = g_new0( ImportUriStruct, 1 );
-		str->uri = g_strdup(( const gchar * ) is->data );
-		str->action = action;
-		str->msg = na_utils_duplicate_string_list( msg );
-
-		window->private->results = g_slist_prepend( window->private->results, str );
-
-		na_utils_free_string_list( msg );
-	}
-
-	na_utils_free_string_list( uris );
-}
-
-static void
 free_results( GSList *list )
 {
 	GSList *is;
diff --git a/src/nact/nact-assistant.c b/src/nact/nact-assistant.c
index e414c6f..000289f 100644
--- a/src/nact/nact-assistant.c
+++ b/src/nact/nact-assistant.c
@@ -50,6 +50,7 @@ struct NactAssistantClassPrivate {
 struct NactAssistantPrivate {
 	gboolean dispose_has_run;
 	gboolean warn_on_cancel;
+	gboolean apply_has_run;
 };
 
 /* instance properties
@@ -72,14 +73,18 @@ static void       instance_finalize( GObject *application );
 
 static GtkWindow *get_dialog( BaseWindow *window, const gchar *name );
 
-static void       v_assistant_apply( GtkAssistant *assistant, gpointer user_data );
-static void       v_assistant_cancel( GtkAssistant *assistant, gpointer user_data );
-static void       v_assistant_close( GtkAssistant *assistant, gpointer user_data );
-static void       v_assistant_prepare( GtkAssistant *assistant, GtkWidget *page, gpointer user_data );
+static void       v_assistant_apply( GtkAssistant *assistant, NactAssistant *window );
+static void       v_assistant_cancel( GtkAssistant *assistant, NactAssistant *window );
+static void       v_assistant_close( GtkAssistant *assistant, NactAssistant *window );
+static void       v_assistant_prepare( GtkAssistant *assistant, GtkWidget *page, NactAssistant *window );
+
+static void       on_apply_message( GtkAssistant *assistant, NactAssistant *window );
+static void       on_cancel_message( GtkAssistant *assistant, NactAssistant *window );
+static void       on_close_message( GtkAssistant *assistant, NactAssistant *window );
+static void       on_prepare_message( GtkAssistant *assistant, GtkWidget *page, NactAssistant *window );
 
 static void       on_runtime_init_toplevel( BaseWindow *window );
 static gboolean   on_key_pressed_event( GtkWidget *widget, GdkEventKey *event, gpointer user_data );
-static gboolean   on_escape_key_pressed( GtkWidget *widget, GdkEventKey *event, gpointer user_data );
 static void       do_assistant_apply( NactAssistant *window, GtkAssistant *assistant );
 static void       do_assistant_cancel( NactAssistant *window, GtkAssistant *assistant );
 static void       do_assistant_close( NactAssistant *window, GtkAssistant *assistant );
@@ -154,10 +159,9 @@ class_init( NactAssistantClass *klass )
 	base_class->get_dialog = get_dialog;
 	base_class->runtime_init_toplevel = on_runtime_init_toplevel;
 
-	klass->on_escape_key_pressed = on_escape_key_pressed;
 	klass->on_assistant_apply = do_assistant_apply;
-	klass->on_assistant_close = do_assistant_close;
 	klass->on_assistant_cancel = do_assistant_cancel;
+	klass->on_assistant_close = do_assistant_close;
 	klass->on_assistant_prepare = do_assistant_prepare;
 }
 
@@ -175,6 +179,8 @@ instance_init( GTypeInstance *instance, gpointer klass )
 	self->private = g_new0( NactAssistantPrivate, 1 );
 
 	self->private->dispose_has_run = FALSE;
+	self->private->warn_on_cancel = FALSE;
+	self->private->apply_has_run = FALSE;
 }
 
 static void
@@ -294,54 +300,105 @@ nact_assistant_set_warn_on_cancel( NactAssistant *window, gboolean warn )
 }
 
 static void
-v_assistant_apply( GtkAssistant *assistant, gpointer user_data )
+v_assistant_apply( GtkAssistant *assistant, NactAssistant *window )
 {
-	g_assert( NACT_IS_ASSISTANT( user_data ));
+	g_assert( NACT_IS_ASSISTANT( window ));
 
-	if( NACT_ASSISTANT_GET_CLASS( user_data )->on_assistant_apply ){
-		NACT_ASSISTANT_GET_CLASS( user_data )->on_assistant_apply( NACT_ASSISTANT( user_data ), assistant );
+	if( NACT_ASSISTANT_GET_CLASS( window )->on_assistant_apply ){
+		NACT_ASSISTANT_GET_CLASS( window )->on_assistant_apply( window, assistant );
 	} else {
-		do_assistant_apply( NACT_ASSISTANT( user_data ), assistant );
+		do_assistant_apply( window, assistant );
 	}
+
+	window->private->apply_has_run = TRUE;
 }
 
 static void
-v_assistant_cancel( GtkAssistant *assistant, gpointer user_data )
+v_assistant_cancel( GtkAssistant *assistant, NactAssistant *window )
 {
-	g_assert( NACT_IS_ASSISTANT( user_data ));
+	g_assert( NACT_IS_ASSISTANT( window ));
 
-	if( NACT_ASSISTANT_GET_CLASS( user_data )->on_assistant_cancel ){
-		NACT_ASSISTANT_GET_CLASS( user_data )->on_assistant_cancel( NACT_ASSISTANT( user_data ), assistant );
+	if( NACT_ASSISTANT_GET_CLASS( window )->on_assistant_cancel ){
+		NACT_ASSISTANT_GET_CLASS( window )->on_assistant_cancel( window, assistant );
 	} else {
-		do_assistant_cancel( NACT_ASSISTANT( user_data ), assistant );
+		do_assistant_cancel( window, assistant );
 	}
 }
 
 static void
-v_assistant_close( GtkAssistant *assistant, gpointer user_data )
+v_assistant_close( GtkAssistant *assistant, NactAssistant *window )
 {
-	g_assert( NACT_IS_ASSISTANT( user_data ));
+	g_assert( NACT_IS_ASSISTANT( window ));
 
-	if( NACT_ASSISTANT_GET_CLASS( user_data )->on_assistant_close ){
-		NACT_ASSISTANT_GET_CLASS( user_data )->on_assistant_close( NACT_ASSISTANT( user_data ), assistant );
+	if( NACT_ASSISTANT_GET_CLASS( window )->on_assistant_close ){
+		NACT_ASSISTANT_GET_CLASS( window )->on_assistant_close( window, assistant );
 	} else {
-		do_assistant_close( NACT_ASSISTANT( user_data ), assistant );
+		do_assistant_close( window, assistant );
 	}
 }
 
 static void
-v_assistant_prepare( GtkAssistant *assistant, GtkWidget *page, gpointer user_data )
+v_assistant_prepare( GtkAssistant *assistant, GtkWidget *page, NactAssistant *window )
 {
-	g_assert( NACT_IS_ASSISTANT( user_data ));
+	g_assert( NACT_IS_ASSISTANT( window ));
 
-	if( NACT_ASSISTANT_GET_CLASS( user_data )->on_assistant_prepare ){
-		NACT_ASSISTANT_GET_CLASS( user_data )->on_assistant_prepare( NACT_ASSISTANT( user_data ), assistant, page );
+	if( NACT_ASSISTANT_GET_CLASS( window )->on_assistant_prepare ){
+		NACT_ASSISTANT_GET_CLASS( window )->on_assistant_prepare( window, assistant, page );
 	} else {
-		do_assistant_prepare( NACT_ASSISTANT( user_data ), assistant, page );
+		do_assistant_prepare( window, assistant, page );
+	}
+}
+
+/*
+ * starting with Gtk+ 2.18, this work-around will become useless
+ * so message handlers could safely be the v_xxx functions
+ */
+static void
+on_apply_message( GtkAssistant *assistant, NactAssistant *window )
+{
+	if( !window->private->apply_has_run ){
+		v_assistant_apply( assistant, window );
 	}
 }
 
 static void
+on_cancel_message( GtkAssistant *assistant, NactAssistant *window )
+{
+	v_assistant_cancel( assistant, window );
+}
+
+static void
+on_close_message( GtkAssistant *assistant, NactAssistant *window )
+{
+	v_assistant_close( assistant, window );
+}
+
+static void
+on_prepare_message( GtkAssistant *assistant, GtkWidget *page, NactAssistant *window )
+{
+	static const gchar *thisfn = "nact_assistant_on_prepare_message";
+	GtkAssistantPageType type;
+
+	g_debug( "%s: assistant=%p, page=%p, window=%p",
+			thisfn, ( void * ) assistant, ( void * ) page, ( void * ) window );
+
+	type = gtk_assistant_get_page_type( assistant, page );
+
+	switch( type ){
+		case GTK_ASSISTANT_PAGE_SUMMARY:
+			if( !window->private->apply_has_run ){
+				v_assistant_apply( assistant, window );
+			}
+			break;
+
+		default:
+			break;
+	}
+
+	v_assistant_prepare( assistant, page, window );
+}
+
+static void
 on_runtime_init_toplevel( BaseWindow *window )
 {
 	static const gchar *thisfn = "nact_assistant_on_runtime_init_toplevel";
@@ -359,10 +416,10 @@ on_runtime_init_toplevel( BaseWindow *window )
 	g_assert( GTK_IS_ASSISTANT( toplevel ));
 
 	nact_window_signal_connect( NACT_WINDOW( window ), G_OBJECT( toplevel ), "key-press-event", G_CALLBACK( on_key_pressed_event ));
-	nact_window_signal_connect( NACT_WINDOW( window ), G_OBJECT( toplevel ), "cancel", G_CALLBACK( v_assistant_cancel ));
-	nact_window_signal_connect( NACT_WINDOW( window ), G_OBJECT( toplevel ), "close", G_CALLBACK( v_assistant_close ));
-	nact_window_signal_connect( NACT_WINDOW( window ), G_OBJECT( toplevel ), "prepare", G_CALLBACK( v_assistant_prepare ));
-	nact_window_signal_connect( NACT_WINDOW( window ), G_OBJECT( toplevel ), "apply", G_CALLBACK( v_assistant_apply ));
+	nact_window_signal_connect( NACT_WINDOW( window ), G_OBJECT( toplevel ), "apply", G_CALLBACK( on_apply_message ));
+	nact_window_signal_connect( NACT_WINDOW( window ), G_OBJECT( toplevel ), "cancel", G_CALLBACK( on_cancel_message ));
+	nact_window_signal_connect( NACT_WINDOW( window ), G_OBJECT( toplevel ), "close", G_CALLBACK( on_close_message ));
+	nact_window_signal_connect( NACT_WINDOW( window ), G_OBJECT( toplevel ), "prepare", G_CALLBACK( on_prepare_message ));
 
 	nact_assistant_set_warn_on_cancel( NACT_ASSISTANT( window ), TRUE );
 }
@@ -372,33 +429,18 @@ on_key_pressed_event( GtkWidget *widget, GdkEventKey *event, gpointer user_data
 {
 	/*static const gchar *thisfn = "nact_assistant_on_key_pressed_event";
 	g_debug( "%s: widget=%p, event=%p, user_data=%p", thisfn, widget, event, user_data );*/
-
 	gboolean stop = FALSE;
+	GtkWindow *toplevel;
 
 	if( event->keyval == GDK_Escape ){
-		if( NACT_ASSISTANT_GET_CLASS( user_data )->on_escape_key_pressed ){
-			stop = NACT_ASSISTANT_GET_CLASS( user_data )->on_escape_key_pressed( widget, event, user_data );
-		}
+		toplevel = base_window_get_toplevel_dialog( BASE_WINDOW( user_data ));
+		g_signal_emit_by_name( toplevel, "cancel", toplevel );
+		stop = TRUE;
 	}
 
 	return( stop );
 }
 
-static gboolean
-on_escape_key_pressed( GtkWidget *widget, GdkEventKey *event, gpointer user_data )
-{
-	static const gchar *thisfn = "nact_assistant_on_escape_key_pressed";
-	GtkWindow *toplevel;
-
-	g_debug( "%s: widget=%p, event=%p, user_data=%p",
-			thisfn, ( void * ) widget, ( void * ) event, ( void * ) user_data );
-
-	toplevel = base_window_get_toplevel_dialog( BASE_WINDOW( user_data ));
-	v_assistant_cancel( GTK_ASSISTANT( toplevel ), user_data );
-
-	return( TRUE );
-}
-
 static void
 do_assistant_apply( NactAssistant *window, GtkAssistant *assistant )
 {
diff --git a/src/nact/nact-assistant.h b/src/nact/nact-assistant.h
index ccdc312..8a0fbe5 100644
--- a/src/nact/nact-assistant.h
+++ b/src/nact/nact-assistant.h
@@ -31,11 +31,20 @@
 #ifndef __NACT_ASSISTANT_H__
 #define __NACT_ASSISTANT_H__
 
-/*
- * NactAssistant class definition.
+/**
+ * SECTION: nact_assistant
+ * @short_description: #NactAssistant class definition.
+ * @include: nact/nact-assistant.h
  *
  * This class is derived from NactWindow class, and serves as a base
  * class for all Nautilus Actions assistants.
+ *
+ * Note: as a work-around to #589745 (Apply message in GtkAssistant),
+ * we may trigger "on_assistant_apply" function from the
+ * "on_prepare_message" handler.
+ * The provided patch has been applied on 2009-08-07, and released in
+ * Gtk+ 2.17.7. So, this work-around will can be safely removed when
+ * minimal Gtk+ version will be 2.18 or later.
  */
 
 #include "nact-window.h"
@@ -64,7 +73,6 @@ typedef struct {
 	NactAssistantClassPrivate *private;
 
 	/* api */
-	gboolean ( *on_escape_key_pressed )( GtkWidget *widget, GdkEventKey *event, gpointer data );
 	void     ( *on_assistant_apply )   ( NactAssistant *window, GtkAssistant *assistant );
 	void     ( *on_assistant_cancel )  ( NactAssistant *window, GtkAssistant *assistant );
 	void     ( *on_assistant_close )   ( NactAssistant *window, GtkAssistant *assistant );



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