[nautilus-actions] All dialogs connect to base signal from instance_constructed() method



commit 2337d433ddb514f7dd7897f4f387ddc9a10f5a33
Author: Pierre Wieser <pwieser trychlos org>
Date:   Mon Jan 16 23:18:15 2012 +0100

    All dialogs connect to base signal from instance_constructed() method

 ChangeLog                             |    8 ++
 src/nact/nact-add-capability-dialog.c |   76 ++++++++++++++-----
 src/nact/nact-add-scheme-dialog.c     |   76 ++++++++++++++-----
 src/nact/nact-confirm-logout.c        |   66 +++++++++++++----
 src/nact/nact-export-ask.c            |   61 +++++++++++----
 src/nact/nact-icon-chooser.c          |  133 ++++++++++++++++++++++++---------
 src/nact/nact-preferences-editor.c    |   68 ++++++++++++++---
 7 files changed, 371 insertions(+), 117 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 976cdc7..37daad0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2012-01-16 Pierre Wieser <pwieser trychlos org>
 
+	* src/nact/nact-add-capability-dialog.c:
+	* src/nact/nact-add-scheme-dialog.c:
+	* src/nact/nact-confirm-logout.c:
+	* src/nact/nact-export-ask.c:
+	* src/nact/nact-icon-chooser.c:
+	* src/nact/nact-preferences-editor.c:
+	Connect to base signals from instance_contructed().
+
 	* src/nact/base-isession.c (client_quit_requested_cb): Add debug trace.
 
 	* src/nact/nact-main-window.c
diff --git a/src/nact/nact-add-capability-dialog.c b/src/nact/nact-add-capability-dialog.c
index 6c9ece2..b12812f 100644
--- a/src/nact/nact-add-capability-dialog.c
+++ b/src/nact/nact-add-capability-dialog.c
@@ -89,12 +89,13 @@ static GObjectClass *st_parent_class   = NULL;
 static GType    register_type( void );
 static void     class_init( NactAddCapabilityDialogClass *klass );
 static void     instance_init( GTypeInstance *instance, gpointer klass );
+static void     instance_constructed( GObject *dialog );
 static void     instance_dispose( GObject *dialog );
 static void     instance_finalize( GObject *dialog );
 
-static void     on_base_initialize_gtk_toplevel( NactAddCapabilityDialog *editor, GtkDialog *toplevel );
-static void     on_base_initialize_base_window( NactAddCapabilityDialog *editor );
-static void     on_base_all_widgets_showed( NactAddCapabilityDialog *editor );
+static void     on_base_initialize_gtk( NactAddCapabilityDialog *editor, GtkDialog *toplevel, gpointer user_data );
+static void     on_base_initialize_window( NactAddCapabilityDialog *editor, gpointer user_data );
+static void     on_base_show_widgets( NactAddCapabilityDialog *editor, gpointer user_data );
 static gboolean on_button_press_event( GtkWidget *widget, GdkEventButton *event, NactAddCapabilityDialog *editor );
 static void     on_cancel_clicked( GtkButton *button, NactAddCapabilityDialog *editor );
 static void     on_ok_clicked( GtkButton *button, NactAddCapabilityDialog *editor );
@@ -156,6 +157,7 @@ class_init( NactAddCapabilityDialogClass *klass )
 	st_parent_class = g_type_class_peek_parent( klass );
 
 	object_class = G_OBJECT_CLASS( klass );
+	object_class->constructed = instance_constructed;
 	object_class->dispose = instance_dispose;
 	object_class->finalize = instance_finalize;
 
@@ -179,17 +181,47 @@ instance_init( GTypeInstance *instance, gpointer klass )
 
 	self->private = g_new0( NactAddCapabilityDialogPrivate, 1 );
 
-	base_window_signal_connect( BASE_WINDOW( instance ),
-			G_OBJECT( instance ), BASE_SIGNAL_INITIALIZE_GTK, G_CALLBACK( on_base_initialize_gtk_toplevel ));
+	self->private->dispose_has_run = FALSE;
+	self->private->capability = NULL;
+}
+
+static void
+instance_constructed( GObject *dialog )
+{
+	static const gchar *thisfn = "nact_add_capability_dialog_instance_constructed";
+	NactAddCapabilityDialogPrivate *priv;
 
-	base_window_signal_connect( BASE_WINDOW( instance ),
-			G_OBJECT( instance ), BASE_SIGNAL_INITIALIZE_WINDOW, G_CALLBACK( on_base_initialize_base_window ));
+	g_return_if_fail( NACT_IS_ADD_CAPABILITY_DIALOG( dialog ));
 
-	base_window_signal_connect( BASE_WINDOW( instance ),
-			G_OBJECT( instance ), BASE_SIGNAL_SHOW_WIDGETS, G_CALLBACK( on_base_all_widgets_showed));
+	priv = NACT_ADD_CAPABILITY_DIALOG( dialog )->private;
 
-	self->private->dispose_has_run = FALSE;
-	self->private->capability = NULL;
+	if( !priv->dispose_has_run ){
+
+		/* chain up to the parent class */
+		if( G_OBJECT_CLASS( st_parent_class )->constructed ){
+			G_OBJECT_CLASS( st_parent_class )->constructed( dialog );
+		}
+
+		g_debug( "%s: dialog=%p (%s)", thisfn, ( void * ) dialog, G_OBJECT_TYPE_NAME( dialog ));
+
+		base_window_signal_connect(
+				BASE_WINDOW( dialog ),
+				G_OBJECT( dialog ),
+				BASE_SIGNAL_INITIALIZE_GTK,
+				G_CALLBACK( on_base_initialize_gtk ));
+
+		base_window_signal_connect(
+				BASE_WINDOW( dialog ),
+				G_OBJECT( dialog ),
+				BASE_SIGNAL_INITIALIZE_WINDOW,
+				G_CALLBACK( on_base_initialize_window ));
+
+		base_window_signal_connect(
+				BASE_WINDOW( dialog ),
+				G_OBJECT( dialog ),
+				BASE_SIGNAL_SHOW_WIDGETS,
+				G_CALLBACK( on_base_show_widgets ));
+	}
 }
 
 static void
@@ -288,9 +320,9 @@ nact_add_capability_dialog_run( BaseWindow *parent, GSList *capabilities )
 }
 
 static void
-on_base_initialize_gtk_toplevel( NactAddCapabilityDialog *dialog, GtkDialog *toplevel )
+on_base_initialize_gtk( NactAddCapabilityDialog *dialog, GtkDialog *toplevel, gpointer user_data )
 {
-	static const gchar *thisfn = "nact_add_capability_dialog_on_base_initialize_gtk_toplevel";
+	static const gchar *thisfn = "nact_add_capability_dialog_on_base_initialize_gtk";
 	GtkTreeView *listview;
 	GtkTreeModel *model;
 	GtkTreeViewColumn *column;
@@ -300,7 +332,9 @@ on_base_initialize_gtk_toplevel( NactAddCapabilityDialog *dialog, GtkDialog *top
 	g_return_if_fail( NACT_IS_ADD_CAPABILITY_DIALOG( dialog ));
 
 	if( !dialog->private->dispose_has_run ){
-		g_debug( "%s: dialog=%p, toplevel=%p", thisfn, ( void * ) dialog, ( void * ) toplevel );
+
+		g_debug( "%s: dialog=%p, toplevel=%p, user_data=%p",
+				thisfn, ( void * ) dialog, ( void * ) toplevel, ( void * ) user_data );
 
 		listview = GTK_TREE_VIEW( base_window_get_widget( BASE_WINDOW( dialog ), "CapabilitiesTreeView" ));
 
@@ -341,9 +375,9 @@ on_base_initialize_gtk_toplevel( NactAddCapabilityDialog *dialog, GtkDialog *top
 }
 
 static void
-on_base_initialize_base_window( NactAddCapabilityDialog *dialog )
+on_base_initialize_window( NactAddCapabilityDialog *dialog, gpointer user_data )
 {
-	static const gchar *thisfn = "nact_add_capability_dialog_on_base_initialize_base_window";
+	static const gchar *thisfn = "nact_add_capability_dialog_on_base_initialize_window";
 	GtkTreeView *listview;
 	GtkListStore *model;
 	GtkTreeIter row;
@@ -352,7 +386,8 @@ on_base_initialize_base_window( NactAddCapabilityDialog *dialog )
 	g_return_if_fail( NACT_IS_ADD_CAPABILITY_DIALOG( dialog ));
 
 	if( !dialog->private->dispose_has_run ){
-		g_debug( "%s: dialog=%p", thisfn, ( void * ) dialog );
+
+		g_debug( "%s: dialog=%p, user_data=%p", thisfn, ( void * ) dialog, ( void * ) user_data );
 
 		listview = GTK_TREE_VIEW( base_window_get_widget( BASE_WINDOW( dialog ), "CapabilitiesTreeView" ));
 		model = GTK_LIST_STORE( gtk_tree_view_get_model( listview ));
@@ -384,9 +419,9 @@ on_base_initialize_base_window( NactAddCapabilityDialog *dialog )
 }
 
 static void
-on_base_all_widgets_showed( NactAddCapabilityDialog *dialog )
+on_base_show_widgets( NactAddCapabilityDialog *dialog, gpointer user_data )
 {
-	static const gchar *thisfn = "nact_add_capability_dialog_on_base_all_widgets_showed";
+	static const gchar *thisfn = "nact_add_capability_dialog_on_base_show_widgets";
 	GtkTreeView *listview;
 	GtkTreePath *path;
 	GtkTreeSelection *selection;
@@ -394,7 +429,8 @@ on_base_all_widgets_showed( NactAddCapabilityDialog *dialog )
 	g_return_if_fail( NACT_IS_ADD_CAPABILITY_DIALOG( dialog ));
 
 	if( !dialog->private->dispose_has_run ){
-		g_debug( "%s: dialog=%p", thisfn, ( void * ) dialog );
+
+		g_debug( "%s: dialog=%p, user_data=%p", thisfn, ( void * ) dialog, ( void * ) user_data );
 
 		listview = GTK_TREE_VIEW( base_window_get_widget( BASE_WINDOW( dialog ), "CapabilitiesTreeView" ));
 		path = gtk_tree_path_new_first();
diff --git a/src/nact/nact-add-scheme-dialog.c b/src/nact/nact-add-scheme-dialog.c
index ffd87e8..e4013b3 100644
--- a/src/nact/nact-add-scheme-dialog.c
+++ b/src/nact/nact-add-scheme-dialog.c
@@ -64,12 +64,13 @@ static GObjectClass *st_parent_class   = NULL;
 static GType    register_type( void );
 static void     class_init( NactAddSchemeDialogClass *klass );
 static void     instance_init( GTypeInstance *instance, gpointer klass );
+static void     instance_constructed( GObject *dialog );
 static void     instance_dispose( GObject *dialog );
 static void     instance_finalize( GObject *dialog );
 
-static void     on_base_initialize_gtk_toplevel( NactAddSchemeDialog *editor, GtkDialog *toplevel );
-static void     on_base_initialize_base_window( NactAddSchemeDialog *editor );
-static void     on_base_all_widgets_showed( NactAddSchemeDialog *editor );
+static void     on_base_initialize_gtk( NactAddSchemeDialog *editor, GtkDialog *toplevel, gpointer user_data );
+static void     on_base_initialize_window( NactAddSchemeDialog *editor, gpointer user_data );
+static void     on_base_show_widgets( NactAddSchemeDialog *editor, gpointer user_data );
 static gboolean on_button_press_event( GtkWidget *widget, GdkEventButton *event, NactAddSchemeDialog *dialog );
 static void     on_cancel_clicked( GtkButton *button, NactAddSchemeDialog *editor );
 static void     on_ok_clicked( GtkButton *button, NactAddSchemeDialog *editor );
@@ -127,6 +128,7 @@ class_init( NactAddSchemeDialogClass *klass )
 	st_parent_class = g_type_class_peek_parent( klass );
 
 	object_class = G_OBJECT_CLASS( klass );
+	object_class->constructed = instance_constructed;
 	object_class->dispose = instance_dispose;
 	object_class->finalize = instance_finalize;
 
@@ -150,17 +152,47 @@ instance_init( GTypeInstance *instance, gpointer klass )
 
 	self->private = g_new0( NactAddSchemeDialogPrivate, 1 );
 
-	base_window_signal_connect( BASE_WINDOW( instance ),
-			G_OBJECT( instance ), BASE_SIGNAL_INITIALIZE_GTK, G_CALLBACK( on_base_initialize_gtk_toplevel ));
+	self->private->dispose_has_run = FALSE;
+	self->private->scheme = NULL;
+}
 
-	base_window_signal_connect( BASE_WINDOW( instance ),
-			G_OBJECT( instance ), BASE_SIGNAL_INITIALIZE_WINDOW, G_CALLBACK( on_base_initialize_base_window ));
+static void
+instance_constructed( GObject *dialog )
+{
+	static const gchar *thisfn = "nact_add_scheme_dialog_instance_constructed";
+	NactAddSchemeDialogPrivate *priv;
 
-	base_window_signal_connect( BASE_WINDOW( instance ),
-			G_OBJECT( instance ), BASE_SIGNAL_SHOW_WIDGETS, G_CALLBACK( on_base_all_widgets_showed));
+	g_return_if_fail( NACT_IS_ADD_SCHEME_DIALOG( dialog ));
 
-	self->private->dispose_has_run = FALSE;
-	self->private->scheme = NULL;
+	priv = NACT_ADD_SCHEME_DIALOG( dialog )->private;
+
+	if( !priv->dispose_has_run ){
+
+		/* chain up to the parent class */
+		if( G_OBJECT_CLASS( st_parent_class )->constructed ){
+			G_OBJECT_CLASS( st_parent_class )->constructed( dialog );
+		}
+
+		g_debug( "%s: dialog=%p (%s)", thisfn, ( void * ) dialog, G_OBJECT_TYPE_NAME( dialog ));
+
+		base_window_signal_connect(
+				BASE_WINDOW( dialog ),
+				G_OBJECT( dialog ),
+				BASE_SIGNAL_INITIALIZE_GTK,
+				G_CALLBACK( on_base_initialize_gtk ));
+
+		base_window_signal_connect(
+				BASE_WINDOW( dialog ),
+				G_OBJECT( dialog ),
+				BASE_SIGNAL_INITIALIZE_WINDOW,
+				G_CALLBACK( on_base_initialize_window ));
+
+		base_window_signal_connect(
+				BASE_WINDOW( dialog ),
+				G_OBJECT( dialog ),
+				BASE_SIGNAL_SHOW_WIDGETS,
+				G_CALLBACK( on_base_show_widgets ));
+	}
 }
 
 static void
@@ -260,15 +292,17 @@ nact_add_scheme_dialog_run( BaseWindow *parent, GSList *schemes )
 }
 
 static void
-on_base_initialize_gtk_toplevel( NactAddSchemeDialog *dialog, GtkDialog *toplevel )
+on_base_initialize_gtk( NactAddSchemeDialog *dialog, GtkDialog *toplevel, gpointer user_data )
 {
-	static const gchar *thisfn = "nact_add_scheme_dialog_on_base_initialize_gtk_toplevel";
+	static const gchar *thisfn = "nact_add_scheme_dialog_on_base_initialize_gtk";
 	GtkTreeView *listview;
 
 	g_return_if_fail( NACT_IS_ADD_SCHEME_DIALOG( dialog ));
 
 	if( !dialog->private->dispose_has_run ){
-		g_debug( "%s: dialog=%p, toplevel=%p", thisfn, ( void * ) dialog, ( void * ) toplevel );
+
+		g_debug( "%s: dialog=%p, toplevel=%p, user_data=%p",
+				thisfn, ( void * ) dialog, ( void * ) toplevel, ( void * ) user_data );
 
 		listview = GTK_TREE_VIEW( base_window_get_widget( BASE_WINDOW( dialog ), "SchemesTreeView" ));
 		nact_schemes_list_create_model( listview, SCHEMES_LIST_FOR_ADD_FROM_DEFAULTS );
@@ -280,15 +314,16 @@ on_base_initialize_gtk_toplevel( NactAddSchemeDialog *dialog, GtkDialog *topleve
 }
 
 static void
-on_base_initialize_base_window( NactAddSchemeDialog *dialog )
+on_base_initialize_window( NactAddSchemeDialog *dialog, gpointer user_data )
 {
-	static const gchar *thisfn = "nact_add_scheme_dialog_on_base_initialize_base_window";
+	static const gchar *thisfn = "nact_add_scheme_dialog_on_base_initialize_window";
 	GtkTreeView *listview;
 
 	g_return_if_fail( NACT_IS_ADD_SCHEME_DIALOG( dialog ));
 
 	if( !dialog->private->dispose_has_run ){
-		g_debug( "%s: dialog=%p", thisfn, ( void * ) dialog );
+
+		g_debug( "%s: dialog=%p, user_data=%p", thisfn, ( void * ) dialog, ( void * ) user_data );
 
 		listview = GTK_TREE_VIEW( base_window_get_widget( BASE_WINDOW( dialog ), "SchemesTreeView" ));
 		nact_schemes_list_init_view( listview, BASE_WINDOW( dialog ), ( pf_new_selection_cb ) on_selection_changed, ( void * ) dialog );
@@ -319,14 +354,15 @@ on_base_initialize_base_window( NactAddSchemeDialog *dialog )
 }
 
 static void
-on_base_all_widgets_showed( NactAddSchemeDialog *dialog )
+on_base_show_widgets( NactAddSchemeDialog *dialog, gpointer user_data )
 {
-	static const gchar *thisfn = "nact_add_scheme_dialog_on_base_all_widgets_showed";
+	static const gchar *thisfn = "nact_add_scheme_dialog_on_base_show_widgets";
 
 	g_return_if_fail( NACT_IS_ADD_SCHEME_DIALOG( dialog ));
 
 	if( !dialog->private->dispose_has_run ){
-		g_debug( "%s: dialog=%p", thisfn, ( void * ) dialog );
+
+		g_debug( "%s: dialog=%p, user_data=%p", thisfn, ( void * ) dialog, ( void * ) user_data );
 
 		nact_schemes_list_show_all( BASE_WINDOW( dialog ));
 	}
diff --git a/src/nact/nact-confirm-logout.c b/src/nact/nact-confirm-logout.c
index ee31801..70da08e 100644
--- a/src/nact/nact-confirm-logout.c
+++ b/src/nact/nact-confirm-logout.c
@@ -62,10 +62,11 @@ static BaseDialogClass *st_parent_class   = NULL;
 static GType    register_type( void );
 static void     class_init( NactConfirmLogoutClass *klass );
 static void     instance_init( GTypeInstance *instance, gpointer klass );
+static void     instance_constructed( GObject *dialog );
 static void     instance_dispose( GObject *dialog );
 static void     instance_finalize( GObject *dialog );
 
-static void     on_base_initialize_base_window( NactConfirmLogout *editor );
+static void     on_base_initialize_window( NactConfirmLogout *editor, gpointer user_data );
 static void     on_quit_without_saving_clicked( GtkButton *button, NactConfirmLogout *editor );
 static void     on_cancel_clicked( GtkButton *button, NactConfirmLogout *editor );
 static void     on_save_and_quit_clicked( GtkButton *button, NactConfirmLogout *editor );
@@ -119,6 +120,7 @@ class_init( NactConfirmLogoutClass *klass )
 	st_parent_class = g_type_class_peek_parent( klass );
 
 	object_class = G_OBJECT_CLASS( klass );
+	object_class->constructed = instance_constructed;
 	object_class->dispose = instance_dispose;
 	object_class->finalize = instance_finalize;
 
@@ -138,13 +140,37 @@ instance_init( GTypeInstance *instance, gpointer klass )
 
 	self->private = g_new0( NactConfirmLogoutPrivate, 1 );
 
-	base_window_signal_connect( BASE_WINDOW( instance ),
-			G_OBJECT( instance ), BASE_SIGNAL_INITIALIZE_WINDOW, G_CALLBACK( on_base_initialize_base_window ));
-
 	self->private->dispose_has_run = FALSE;
 }
 
 static void
+instance_constructed( GObject *dialog )
+{
+	static const gchar *thisfn = "nact_confirm_logout_instance_constructed";
+	NactConfirmLogoutPrivate *priv;
+
+	g_return_if_fail( NACT_IS_CONFIRM_LOGOUT( dialog ));
+
+	priv = NACT_CONFIRM_LOGOUT( dialog )->private;
+
+	if( !priv->dispose_has_run ){
+
+		/* chain up to the parent class */
+		if( G_OBJECT_CLASS( st_parent_class )->constructed ){
+			G_OBJECT_CLASS( st_parent_class )->constructed( dialog );
+		}
+
+		g_debug( "%s: dialog=%p (%s)", thisfn, ( void * ) dialog, G_OBJECT_TYPE_NAME( dialog ));
+
+		base_window_signal_connect(
+				BASE_WINDOW( dialog ),
+				G_OBJECT( dialog ),
+				BASE_SIGNAL_INITIALIZE_WINDOW,
+				G_CALLBACK( on_base_initialize_window ));
+	}
+}
+
+static void
 instance_dispose( GObject *dialog )
 {
 	static const gchar *thisfn = "nact_confirm_logout_instance_dispose";
@@ -217,23 +243,33 @@ nact_confirm_logout_run( NactMainWindow *parent )
 }
 
 static void
-on_base_initialize_base_window( NactConfirmLogout *dialog )
+on_base_initialize_window( NactConfirmLogout *dialog, gpointer user_data )
 {
-	static const gchar *thisfn = "nact_confirm_logout_on_base_initialize_base_window";
+	static const gchar *thisfn = "nact_confirm_logout_on_base_initialize_window";
 
 	g_return_if_fail( NACT_IS_CONFIRM_LOGOUT( dialog ));
 
 	if( !dialog->private->dispose_has_run ){
-		g_debug( "%s: dialog=%p", thisfn, ( void * ) dialog );
-
-		base_window_signal_connect_by_name( BASE_WINDOW( dialog ),
-				"QuitNoSaveButton", "clicked", G_CALLBACK( on_quit_without_saving_clicked ));
-
-		base_window_signal_connect_by_name( BASE_WINDOW( dialog ),
-				"CancelQuitButton", "clicked", G_CALLBACK( on_cancel_clicked ));
 
-		base_window_signal_connect_by_name( BASE_WINDOW( dialog ),
-				"SaveQuitButton", "clicked", G_CALLBACK( on_save_and_quit_clicked ));
+		g_debug( "%s: dialog=%p, user_data=%p", thisfn, ( void * ) dialog, ( void * ) user_data );
+
+		base_window_signal_connect_by_name(
+				BASE_WINDOW( dialog ),
+				"QuitNoSaveButton",
+				"clicked",
+				G_CALLBACK( on_quit_without_saving_clicked ));
+
+		base_window_signal_connect_by_name(
+				BASE_WINDOW( dialog ),
+				"CancelQuitButton",
+				"clicked",
+				G_CALLBACK( on_cancel_clicked ));
+
+		base_window_signal_connect_by_name(
+				BASE_WINDOW( dialog ),
+				"SaveQuitButton",
+				"clicked",
+				G_CALLBACK( on_save_and_quit_clicked ));
 	}
 }
 
diff --git a/src/nact/nact-export-ask.c b/src/nact/nact-export-ask.c
index 7912786..9597643 100644
--- a/src/nact/nact-export-ask.c
+++ b/src/nact/nact-export-ask.c
@@ -77,10 +77,12 @@ static void     ioptions_list_iface_init( NAIOptionsListInterface *iface, void *
 static GList   *ioptions_list_get_formats( const NAIOptionsList *instance, GtkWidget *container );
 static void     ioptions_list_free_formats( const NAIOptionsList *instance, GtkWidget *container, GList *formats );
 static void     instance_init( GTypeInstance *instance, gpointer klass );
+static void     instance_constructed( GObject *dialog );
 static void     instance_dispose( GObject *dialog );
 static void     instance_finalize( GObject *dialog );
-static void     on_base_initialize_gtk( NactExportAsk *editor, GtkDialog *toplevel );
-static void     on_base_initialize_window( NactExportAsk *editor );
+
+static void     on_base_initialize_gtk( NactExportAsk *editor, GtkDialog *toplevel, gpointer user_data );
+static void     on_base_initialize_window( NactExportAsk *editor, gpointer user_data );
 static void     keep_choice_on_toggled( GtkToggleButton *button, NactExportAsk *editor );
 static void     on_cancel_clicked( GtkButton *button, NactExportAsk *editor );
 static void     on_ok_clicked( GtkButton *button, NactExportAsk *editor );
@@ -142,6 +144,7 @@ class_init( NactExportAskClass *klass )
 	st_parent_class = g_type_class_peek_parent( klass );
 
 	object_class = G_OBJECT_CLASS( klass );
+	object_class->constructed = instance_constructed;
 	object_class->dispose = instance_dispose;
 	object_class->finalize = instance_finalize;
 
@@ -198,19 +201,40 @@ instance_init( GTypeInstance *instance, gpointer klass )
 
 	self->private = g_new0( NactExportAskPrivate, 1 );
 
-	base_window_signal_connect(
-			BASE_WINDOW( instance ),
-			G_OBJECT( instance ),
-			BASE_SIGNAL_INITIALIZE_GTK,
-			G_CALLBACK( on_base_initialize_gtk ));
+	self->private->dispose_has_run = FALSE;
+}
+
+static void
+instance_constructed( GObject *dialog )
+{
+	static const gchar *thisfn = "nact_export_ask_instance_constructed";
+	NactExportAskPrivate *priv;
+
+	g_return_if_fail( NACT_IS_EXPORT_ASK( dialog ));
 
-	base_window_signal_connect(
-			BASE_WINDOW( instance ),
-			G_OBJECT( instance ),
-			BASE_SIGNAL_INITIALIZE_WINDOW,
-			G_CALLBACK( on_base_initialize_window ));
+	priv = NACT_EXPORT_ASK( dialog )->private;
 
-	self->private->dispose_has_run = FALSE;
+	if( !priv->dispose_has_run ){
+
+		/* chain up to the parent class */
+		if( G_OBJECT_CLASS( st_parent_class )->constructed ){
+			G_OBJECT_CLASS( st_parent_class )->constructed( dialog );
+		}
+
+		g_debug( "%s: dialog=%p (%s)", thisfn, ( void * ) dialog, G_OBJECT_TYPE_NAME( dialog ));
+
+		base_window_signal_connect(
+				BASE_WINDOW( dialog ),
+				G_OBJECT( dialog ),
+				BASE_SIGNAL_INITIALIZE_GTK,
+				G_CALLBACK( on_base_initialize_gtk ));
+
+		base_window_signal_connect(
+				BASE_WINDOW( dialog ),
+				G_OBJECT( dialog ),
+				BASE_SIGNAL_INITIALIZE_WINDOW,
+				G_CALLBACK( on_base_initialize_window ));
+	}
 }
 
 static void
@@ -339,7 +363,7 @@ nact_export_ask_user( BaseWindow *parent, NAObjectItem *item, gboolean first )
 }
 
 static void
-on_base_initialize_gtk( NactExportAsk *editor, GtkDialog *toplevel )
+on_base_initialize_gtk( NactExportAsk *editor, GtkDialog *toplevel, gpointer user_data )
 {
 	static const gchar *thisfn = "nact_export_ask_on_base_initialize_gtk";
 	GtkWidget *container;
@@ -347,7 +371,9 @@ on_base_initialize_gtk( NactExportAsk *editor, GtkDialog *toplevel )
 	g_return_if_fail( NACT_IS_EXPORT_ASK( editor ));
 
 	if( !editor->private->dispose_has_run ){
-		g_debug( "%s: editor=%p, toplevel=%p", thisfn, ( void * ) editor, ( void * ) toplevel );
+
+		g_debug( "%s: dialog=%p, toplevel=%p, user_data=%p",
+				thisfn, ( void * ) editor, ( void * ) toplevel, ( void * ) user_data );
 
 		container = base_window_get_widget( BASE_WINDOW( editor ), "ExportFormatAskVBox" );
 		na_ioptions_list_gtk_init( NA_IOPTIONS_LIST( editor ), container, FALSE );
@@ -359,7 +385,7 @@ on_base_initialize_gtk( NactExportAsk *editor, GtkDialog *toplevel )
 }
 
 static void
-on_base_initialize_window( NactExportAsk *editor )
+on_base_initialize_window( NactExportAsk *editor, gpointer user_data )
 {
 	static const gchar *thisfn = "nact_export_ask_on_base_initialize_window";
 	gchar *item_label, *label;
@@ -371,7 +397,8 @@ on_base_initialize_window( NactExportAsk *editor )
 	priv = editor->private;
 
 	if( !priv->dispose_has_run ){
-		g_debug( "%s: editor=%p", thisfn, ( void * ) editor );
+
+		g_debug( "%s: dialog=%p, user_data=%p", thisfn, ( void * ) editor, ( void * ) user_data );
 
 		item_label = na_object_get_label( priv->item );
 
diff --git a/src/nact/nact-icon-chooser.c b/src/nact/nact-icon-chooser.c
index 3c786c8..f7652a5 100644
--- a/src/nact/nact-icon-chooser.c
+++ b/src/nact/nact-icon-chooser.c
@@ -99,16 +99,17 @@ static BaseDialogClass *st_parent_class   = NULL;
 static GType         register_type( void );
 static void          class_init( NactIconChooserClass *klass );
 static void          instance_init( GTypeInstance *instance, gpointer klass );
+static void          instance_constructed( GObject *dialog );
 static void          instance_dispose( GObject *dialog );
 static void          instance_finalize( GObject *dialog );
 
-static void          on_base_initialize_gtk_toplevel( NactIconChooser *editor, GtkDialog *toplevel );
+static void          on_base_initialize_gtk( NactIconChooser *editor, GtkDialog *toplevel, gpointer user_data );
 static void          do_initialize_themed_icons( NactIconChooser *editor );
 static void          do_initialize_icons_by_path( NactIconChooser *editor );
-static void          on_base_initialize_base_window( NactIconChooser *editor );
+static void          on_base_initialize_window( NactIconChooser *editor, gpointer user_data );
 static void          fillup_themed_icons( NactIconChooser *editor );
 static void          fillup_icons_by_path( NactIconChooser *editor );
-static void          on_base_all_widgets_showed( NactIconChooser *editor );
+static void          on_base_show_widgets( NactIconChooser *editor, gpointer user_data );
 
 static void          on_cancel_clicked( GtkButton *button, NactIconChooser *editor );
 static void          on_ok_clicked( GtkButton *button, NactIconChooser *editor );
@@ -176,6 +177,7 @@ class_init( NactIconChooserClass *klass )
 	st_parent_class = g_type_class_peek_parent( klass );
 
 	object_class = G_OBJECT_CLASS( klass );
+	object_class->constructed = instance_constructed;
 	object_class->dispose = instance_dispose;
 	object_class->finalize = instance_finalize;
 
@@ -200,16 +202,46 @@ instance_init( GTypeInstance *instance, gpointer klass )
 
 	self->private = g_new0( NactIconChooserPrivate, 1 );
 
-	base_window_signal_connect( BASE_WINDOW( self ),
-			G_OBJECT( self ), BASE_SIGNAL_INITIALIZE_GTK, G_CALLBACK( on_base_initialize_gtk_toplevel ));
+	self->private->dispose_has_run = FALSE;
+}
 
-	base_window_signal_connect( BASE_WINDOW( self ),
-			G_OBJECT( self ), BASE_SIGNAL_INITIALIZE_WINDOW, G_CALLBACK( on_base_initialize_base_window ));
+static void
+instance_constructed( GObject *dialog )
+{
+	static const gchar *thisfn = "nact_icon_chooser_instance_constructed";
+	NactIconChooserPrivate *priv;
 
-	base_window_signal_connect( BASE_WINDOW( self ),
-			G_OBJECT( self ), BASE_SIGNAL_SHOW_WIDGETS, G_CALLBACK( on_base_all_widgets_showed));
+	g_return_if_fail( NACT_IS_ICON_CHOOSER( dialog ));
 
-	self->private->dispose_has_run = FALSE;
+	priv = NACT_ICON_CHOOSER( dialog )->private;
+
+	if( !priv->dispose_has_run ){
+
+		/* chain up to the parent class */
+		if( G_OBJECT_CLASS( st_parent_class )->constructed ){
+			G_OBJECT_CLASS( st_parent_class )->constructed( dialog );
+		}
+
+		g_debug( "%s: dialog=%p (%s)", thisfn, ( void * ) dialog, G_OBJECT_TYPE_NAME( dialog ));
+
+		base_window_signal_connect(
+				BASE_WINDOW( dialog ),
+				G_OBJECT( dialog ),
+				BASE_SIGNAL_INITIALIZE_GTK,
+				G_CALLBACK( on_base_initialize_gtk ));
+
+		base_window_signal_connect(
+				BASE_WINDOW( dialog ),
+				G_OBJECT( dialog ),
+				BASE_SIGNAL_INITIALIZE_WINDOW,
+				G_CALLBACK( on_base_initialize_window ));
+
+		base_window_signal_connect(
+				BASE_WINDOW( dialog ),
+				G_OBJECT( dialog ),
+				BASE_SIGNAL_SHOW_WIDGETS,
+				G_CALLBACK( on_base_show_widgets ));
+	}
 }
 
 static void
@@ -309,14 +341,16 @@ nact_icon_chooser_choose_icon( BaseWindow *parent, const gchar *icon_name )
 }
 
 static void
-on_base_initialize_gtk_toplevel( NactIconChooser *editor, GtkDialog *toplevel )
+on_base_initialize_gtk( NactIconChooser *editor, GtkDialog *toplevel, gpointer user_data )
 {
-	static const gchar *thisfn = "nact_icon_chooser_on_base_initialize_gtk_toplevel";
+	static const gchar *thisfn = "nact_icon_chooser_on_base_initialize_gtk";
 
 	g_return_if_fail( NACT_IS_ICON_CHOOSER( editor ));
 
 	if( !editor->private->dispose_has_run ){
-		g_debug( "%s: editor=%p, toplevel=%p", thisfn, ( void * ) editor, ( void * ) toplevel );
+
+		g_debug( "%s: dialog=%p, toplevel=%p, user_data=%p",
+				thisfn, ( void * ) editor, ( void * ) toplevel, ( void * ) user_data );
 
 		/* initialize the notebook
 		 */
@@ -407,16 +441,17 @@ do_initialize_icons_by_path( NactIconChooser *editor )
 }
 
 static void
-on_base_initialize_base_window( NactIconChooser *editor )
+on_base_initialize_window( NactIconChooser *editor, gpointer user_data )
 {
-	static const gchar *thisfn = "nact_icon_chooser_on_base_initialize_base_window";
+	static const gchar *thisfn = "nact_icon_chooser_on_base_initialize_window";
 	guint pos;
 	GtkWidget *paned;
 
 	g_return_if_fail( NACT_IS_ICON_CHOOSER( editor ));
 
 	if( !editor->private->dispose_has_run ){
-		g_debug( "%s: editor=%p", thisfn, ( void * ) editor );
+
+		g_debug( "%s: dialog=%p, user_data=%p", thisfn, ( void * ) editor, ( void * ) user_data );
 
 		pos = na_settings_get_uint( NA_IPREFS_ICON_CHOOSER_PANED, NULL, NULL );
 		if( pos ){
@@ -436,17 +471,25 @@ on_base_initialize_base_window( NactIconChooser *editor )
 
 		/*  intercept Escape key: we do not quit on Esc.
 		 */
-		base_window_signal_connect( BASE_WINDOW( editor ),
+		base_window_signal_connect(
+				BASE_WINDOW( editor ),
 				G_OBJECT( base_window_get_gtk_toplevel( BASE_WINDOW( editor ))),
-				"key-press-event", G_CALLBACK( on_key_pressed_event ));
+				"key-press-event",
+				G_CALLBACK( on_key_pressed_event ));
 
 		/* OK/Cancel buttons
 		 */
 		base_window_signal_connect_by_name(
-				BASE_WINDOW( editor ), "CancelButton", "clicked", G_CALLBACK( on_cancel_clicked ));
+				BASE_WINDOW( editor ),
+				"CancelButton",
+				"clicked",
+				G_CALLBACK( on_cancel_clicked ));
 
 		base_window_signal_connect_by_name(
-				BASE_WINDOW( editor ), "OKButton", "clicked", G_CALLBACK( on_ok_clicked ));
+				BASE_WINDOW( editor ),
+				"OKButton",
+				"clicked",
+				G_CALLBACK( on_ok_clicked ));
 	}
 }
 
@@ -460,22 +503,34 @@ fillup_themed_icons( NactIconChooser *editor )
 
 	icon_view = GTK_ICON_VIEW( base_window_get_widget( BASE_WINDOW( editor ), "ThemedIconView" ));
 	base_window_signal_connect(
-			BASE_WINDOW( editor ), G_OBJECT( icon_view ), "selection-changed", G_CALLBACK( on_themed_icon_changed ));
+			BASE_WINDOW( editor ),
+			G_OBJECT( icon_view ),
+			"selection-changed",
+			G_CALLBACK( on_themed_icon_changed ));
+
 	/* catch double-click */
 	base_window_signal_connect(
-			BASE_WINDOW( editor ), G_OBJECT( icon_view ), "button-press-event", G_CALLBACK( on_icon_view_button_press_event ));
+			BASE_WINDOW( editor ),
+			G_OBJECT( icon_view ),
+			"button-press-event",
+			G_CALLBACK( on_icon_view_button_press_event ));
 
 	context_view = GTK_TREE_VIEW( base_window_get_widget( BASE_WINDOW( editor ), "ThemedTreeView" ));
 	selection = gtk_tree_view_get_selection( context_view );
 	base_window_signal_connect(
-			BASE_WINDOW( editor ), G_OBJECT( selection ), "changed", G_CALLBACK( on_themed_context_changed ));
+			BASE_WINDOW( editor ),
+			G_OBJECT( selection ),
+			"changed",
+			G_CALLBACK( on_themed_context_changed ));
 
 	path = gtk_tree_path_new_first();
 	gtk_tree_selection_select_path( selection, path );
 	gtk_tree_path_free( path );
-
 	base_window_signal_connect_by_name(
-			BASE_WINDOW( editor ), "ThemedApplyButton", "clicked", G_CALLBACK( on_themed_apply_button_clicked ));
+			BASE_WINDOW( editor ),
+			"ThemedApplyButton",
+			"clicked",
+			G_CALLBACK( on_themed_apply_button_clicked ));
 }
 
 static void
@@ -498,26 +553,36 @@ fillup_icons_by_path( NactIconChooser *editor )
 		gtk_file_chooser_set_filename( file_chooser, editor->private->current_icon );
 	}
 
-	base_window_signal_connect( BASE_WINDOW( editor ),
-			G_OBJECT( file_chooser ), "selection-changed", G_CALLBACK( on_path_selection_changed ));
+	base_window_signal_connect(
+			BASE_WINDOW( editor ),
+			G_OBJECT( file_chooser ),
+			"selection-changed",
+			G_CALLBACK( on_path_selection_changed ));
 
-	base_window_signal_connect( BASE_WINDOW( editor ),
-			G_OBJECT( file_chooser ), "update-preview", G_CALLBACK( on_path_update_preview ));
+	base_window_signal_connect(
+			BASE_WINDOW( editor ),
+			G_OBJECT( file_chooser ),
+			"update-preview",
+			G_CALLBACK( on_path_update_preview ));
 
-	base_window_signal_connect_by_name( BASE_WINDOW( editor ),
-			"PathApplyButton", "clicked", G_CALLBACK( on_path_apply_button_clicked ));
+	base_window_signal_connect_by_name(
+			BASE_WINDOW( editor ),
+			"PathApplyButton",
+			"clicked",
+			G_CALLBACK( on_path_apply_button_clicked ));
 }
 
 static void
-on_base_all_widgets_showed( NactIconChooser *editor )
+on_base_show_widgets( NactIconChooser *editor, gpointer user_data )
 {
-	static const gchar *thisfn = "nact_icon_chooser_on_base_all_widgets_showed";
+	static const gchar *thisfn = "nact_icon_chooser_on_base_show_widgets";
 	GtkWidget *about_button;
 
 	g_return_if_fail( NACT_IS_ICON_CHOOSER( editor ));
 
 	if( !editor->private->dispose_has_run ){
-		g_debug( "%s: editor=%p", thisfn, ( void * ) editor );
+
+		g_debug( "%s: dialog=%p, user_data=%p", thisfn, ( void * ) editor, ( void * ) user_data );
 
 		/* hide about button not used here
 		 */
diff --git a/src/nact/nact-preferences-editor.c b/src/nact/nact-preferences-editor.c
index 97aa721..714855b 100644
--- a/src/nact/nact-preferences-editor.c
+++ b/src/nact/nact-preferences-editor.c
@@ -132,11 +132,13 @@ static GList     *ioptions_list_get_options( const NAIOptionsList *instance, Gtk
 static void       ioptions_list_free_options( const NAIOptionsList *instance, GtkWidget *container, GList *options );
 static NAIOption *ioptions_list_get_ask_option( const NAIOptionsList *instance, GtkWidget *container );
 static void       instance_init( GTypeInstance *instance, gpointer klass );
+static void       instance_constructed( GObject *dialog );
 static void       instance_dispose( GObject *dialog );
 static void       instance_finalize( GObject *dialog );
-static void       on_base_initialize_gtk( NactPreferencesEditor *editor, GtkDialog *toplevel );
-static void       on_base_initialize_window( NactPreferencesEditor *editor );
-static void       on_base_all_widgets_showed( NactPreferencesEditor *editor );
+
+static void       on_base_initialize_gtk( NactPreferencesEditor *editor, GtkDialog *toplevel, gpointer user_data );
+static void       on_base_initialize_window( NactPreferencesEditor *editor, gpointer user_data );
+static void       on_base_show_widgets( NactPreferencesEditor *editor, gpointer user_data );
 static void       order_mode_setup( NactPreferencesEditor *editor );
 static void       order_mode_on_alpha_asc_toggled( GtkToggleButton *togglebutton, NactPreferencesEditor *editor );
 static void       order_mode_on_alpha_desc_toggled( GtkToggleButton *togglebutton, NactPreferencesEditor *editor );
@@ -225,6 +227,7 @@ class_init( NactPreferencesEditorClass *klass )
 	st_parent_class = g_type_class_peek_parent( klass );
 
 	object_class = G_OBJECT_CLASS( klass );
+	object_class->constructed = instance_constructed;
 	object_class->dispose = instance_dispose;
 	object_class->finalize = instance_finalize;
 
@@ -355,12 +358,51 @@ instance_init( GTypeInstance *instance, gpointer klass )
 			BASE_WINDOW( instance ),
 			G_OBJECT( instance ),
 			BASE_SIGNAL_SHOW_WIDGETS,
-			G_CALLBACK( on_base_all_widgets_showed));
+			G_CALLBACK( on_base_show_widgets));
 
 	self->private->dispose_has_run = FALSE;
 }
 
 static void
+instance_constructed( GObject *dialog )
+{
+	static const gchar *thisfn = "nact_preferences_editor_instance_constructed";
+	NactPreferencesEditorPrivate *priv;
+
+	g_return_if_fail( NACT_IS_PREFERENCES_EDITOR( dialog ));
+
+	priv = NACT_PREFERENCES_EDITOR( dialog )->private;
+
+	if( !priv->dispose_has_run ){
+
+		/* chain up to the parent class */
+		if( G_OBJECT_CLASS( st_parent_class )->constructed ){
+			G_OBJECT_CLASS( st_parent_class )->constructed( dialog );
+		}
+
+		g_debug( "%s: dialog=%p (%s)", thisfn, ( void * ) dialog, G_OBJECT_TYPE_NAME( dialog ));
+
+		base_window_signal_connect(
+				BASE_WINDOW( dialog ),
+				G_OBJECT( dialog ),
+				BASE_SIGNAL_INITIALIZE_GTK,
+				G_CALLBACK( on_base_initialize_gtk ));
+
+		base_window_signal_connect(
+				BASE_WINDOW( dialog ),
+				G_OBJECT( dialog ),
+				BASE_SIGNAL_INITIALIZE_WINDOW,
+				G_CALLBACK( on_base_initialize_window ));
+
+		base_window_signal_connect(
+				BASE_WINDOW( dialog ),
+				G_OBJECT( dialog ),
+				BASE_SIGNAL_SHOW_WIDGETS,
+				G_CALLBACK( on_base_show_widgets ));
+	}
+}
+
+static void
 instance_dispose( GObject *dialog )
 {
 	static const gchar *thisfn = "nact_preferences_editor_instance_dispose";
@@ -451,7 +493,7 @@ nact_preferences_editor_run( BaseWindow *parent )
 }
 
 static void
-on_base_initialize_gtk( NactPreferencesEditor *editor, GtkDialog *toplevel )
+on_base_initialize_gtk( NactPreferencesEditor *editor, GtkDialog *toplevel, gpointer user_data )
 {
 	static const gchar *thisfn = "nact_preferences_editor_on_base_initialize_gtk";
 	GtkWidget *container;
@@ -460,7 +502,9 @@ on_base_initialize_gtk( NactPreferencesEditor *editor, GtkDialog *toplevel )
 	g_return_if_fail( NACT_IS_PREFERENCES_EDITOR( editor ));
 
 	if( !editor->private->dispose_has_run ){
-		g_debug( "%s: editor=%p, toplevel=%p", thisfn, ( void * ) editor, ( void * ) toplevel );
+
+		g_debug( "%s: dialog=%p, toplevel=%p, user_data=%p",
+				thisfn, ( void * ) editor, ( void * ) toplevel, ( void * ) user_data );
 
 		desktop_create_model( editor );
 
@@ -483,7 +527,7 @@ on_base_initialize_gtk( NactPreferencesEditor *editor, GtkDialog *toplevel )
 }
 
 static void
-on_base_initialize_window( NactPreferencesEditor *editor )
+on_base_initialize_window( NactPreferencesEditor *editor, gpointer user_data )
 {
 	static const gchar *thisfn = "nact_preferences_editor_on_base_initialize_window";
 	GtkWidget *container;
@@ -495,7 +539,8 @@ on_base_initialize_window( NactPreferencesEditor *editor )
 	g_return_if_fail( NACT_IS_PREFERENCES_EDITOR( editor ));
 
 	if( !editor->private->dispose_has_run ){
-		g_debug( "%s: editor=%p", thisfn, ( void * ) editor );
+
+		g_debug( "%s: dialog=%p, user_data=%p", thisfn, ( void * ) editor, ( void * ) user_data );
 
 		/* first tab: runtime preferences
 		 */
@@ -564,15 +609,16 @@ on_base_initialize_window( NactPreferencesEditor *editor )
 }
 
 static void
-on_base_all_widgets_showed( NactPreferencesEditor *editor )
+on_base_show_widgets( NactPreferencesEditor *editor, gpointer user_data )
 {
-	static const gchar *thisfn = "nact_preferences_editor_on_all_widgets_showed";
+	static const gchar *thisfn = "nact_preferences_editor_on_base_show_widgets";
 	GtkNotebook *notebook;
 
 	g_return_if_fail( NACT_IS_PREFERENCES_EDITOR( editor ));
 
 	if( !editor->private->dispose_has_run ){
-		g_debug( "%s: editor=%p", thisfn, ( void * ) editor );
+
+		g_debug( "%s: dialog=%p, user_data=%p", thisfn, ( void * ) editor, ( void * ) user_data );
 
 		notebook = GTK_NOTEBOOK( base_window_get_widget( BASE_WINDOW( editor ), "PreferencesNotebook" ));
 		gtk_notebook_set_current_page( notebook, st_last_tab );



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