[nautilus-actions] NactExportAsk: rename NACT_EXPORT_ASK_TYPE GType macro to NACT_TYPE_EXPORT_ASK



commit 3eda94788bff920d49231565449bcca8823e640e
Author: Pierre Wieser <pwieser trychlos org>
Date:   Fri Jan 13 08:27:18 2012 +0100

    NactExportAsk: rename NACT_EXPORT_ASK_TYPE GType macro to NACT_TYPE_EXPORT_ASK

 ChangeLog                         |    8 +++++++
 src/nact/nact-assistant-export.ui |    2 +-
 src/nact/nact-export-ask.c        |   40 +++++++++++++++++++-----------------
 src/nact/nact-export-ask.h        |   14 ++++++------
 src/utils/nautilus-actions-new.c  |    2 +-
 5 files changed, 38 insertions(+), 28 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 67da534..8129ea6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2012-01-13 Pierre Wieser <pwieser trychlos org>
 
+	* src/nact/nact-assistant-export.ui: Rename widget to ExportAskLabel.
+
+	* src/nact/nact-export-ask.c:
+	* src/nact/nact-export-ask.h:
+	Rename NACT_EXPORT_ASK_TYPE GType macro to NACT_TYPE_EXPORT_ASK.
+
+	* src/utils/nautilus-actions-new.c (output_to_stdout): Set default value.
+
 	* src/core/na-ioptions-list.h: Fix GType macros.
 
 	* src/core/na-settings.c:
diff --git a/src/nact/nact-assistant-export.ui b/src/nact/nact-assistant-export.ui
index e5ba2dd..5995136 100644
--- a/src/nact/nact-assistant-export.ui
+++ b/src/nact/nact-assistant-export.ui
@@ -379,7 +379,7 @@ You may use Ctrl and Shift keys to extend the selection.</property>
                 <property name="visible">True</property>
                 <property name="spacing">6</property>
                 <child>
-                  <object class="GtkLabel" id="ExportAskLabel1">
+                  <object class="GtkLabel" id="ExportAskLabel">
                     <property name="visible">True</property>
                     <property name="xalign">0</property>
                     <property name="xpad">6</property>
diff --git a/src/nact/nact-export-ask.c b/src/nact/nact-export-ask.c
index c7332fa..3ff00ee 100644
--- a/src/nact/nact-export-ask.c
+++ b/src/nact/nact-export-ask.c
@@ -79,8 +79,8 @@ static void     ioptions_list_free_formats( const NAIOptionsList *instance, GtkW
 static void     instance_init( GTypeInstance *instance, gpointer klass );
 static void     instance_dispose( GObject *dialog );
 static void     instance_finalize( GObject *dialog );
-static void     on_base_initialize_gtk_toplevel( NactExportAsk *editor, GtkDialog *toplevel );
-static void     on_base_initialize_base_window( NactExportAsk *editor );
+static void     on_base_initialize_gtk( NactExportAsk *editor, GtkDialog *toplevel );
+static void     on_base_initialize_window( NactExportAsk *editor );
 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 );
@@ -126,7 +126,7 @@ register_type( void )
 
 	type = g_type_register_static( BASE_TYPE_DIALOG, "NactExportAsk", &info, 0 );
 
-	g_type_add_interface_static( type, NA_IOPTIONS_LIST_TYPE, &ioptions_list_iface_info );
+	g_type_add_interface_static( type, NA_TYPE_IOPTIONS_LIST, &ioptions_list_iface_info );
 
 	return( type );
 }
@@ -202,13 +202,13 @@ instance_init( GTypeInstance *instance, gpointer klass )
 			BASE_WINDOW( instance ),
 			G_OBJECT( instance ),
 			BASE_SIGNAL_INITIALIZE_GTK,
-			G_CALLBACK( on_base_initialize_gtk_toplevel ));
+			G_CALLBACK( on_base_initialize_gtk ));
 
 	base_window_signal_connect(
 			BASE_WINDOW( instance ),
 			G_OBJECT( instance ),
 			BASE_SIGNAL_INITIALIZE_WINDOW,
-			G_CALLBACK( on_base_initialize_base_window ));
+			G_CALLBACK( on_base_initialize_window ));
 
 	self->private->dispose_has_run = FALSE;
 }
@@ -295,8 +295,7 @@ nact_export_ask_user( BaseWindow *parent, NAObjectItem *item, gboolean first )
 	keep = na_settings_get_boolean( NA_IPREFS_EXPORT_ASK_USER_KEEP_LAST_CHOICE, NULL, &keep_mandatory );
 
 	if( first || !keep ){
-
-		editor = g_object_new( NACT_EXPORT_ASK_TYPE,
+		editor = g_object_new( NACT_TYPE_EXPORT_ASK,
 				BASE_PROP_PARENT,         parent,
 				BASE_PROP_XMLUI_FILENAME, st_xmlui_filename,
 				BASE_PROP_TOPLEVEL_NAME,  st_toplevel_name,
@@ -333,9 +332,9 @@ nact_export_ask_user( BaseWindow *parent, NAObjectItem *item, gboolean first )
 }
 
 static void
-on_base_initialize_gtk_toplevel( NactExportAsk *editor, GtkDialog *toplevel )
+on_base_initialize_gtk( NactExportAsk *editor, GtkDialog *toplevel )
 {
-	static const gchar *thisfn = "nact_export_ask_on_base_initialize_gtk_toplevel";
+	static const gchar *thisfn = "nact_export_ask_on_base_initialize_gtk";
 	GtkWidget *container;
 
 	g_return_if_fail( NACT_IS_EXPORT_ASK( editor ));
@@ -353,20 +352,23 @@ on_base_initialize_gtk_toplevel( NactExportAsk *editor, GtkDialog *toplevel )
 }
 
 static void
-on_base_initialize_base_window( NactExportAsk *editor )
+on_base_initialize_window( NactExportAsk *editor )
 {
-	static const gchar *thisfn = "nact_export_ask_on_base_initialize_base_window";
+	static const gchar *thisfn = "nact_export_ask_on_base_initialize_window";
 	gchar *item_label, *label;
 	GtkWidget *widget;
+	NactExportAskPrivate *priv;
 
 	g_return_if_fail( NACT_IS_EXPORT_ASK( editor ));
 
-	if( !editor->private->dispose_has_run ){
+	priv = editor->private;
+
+	if( !priv->dispose_has_run ){
 		g_debug( "%s: editor=%p", thisfn, ( void * ) editor );
 
-		item_label = na_object_get_label( editor->private->item );
+		item_label = na_object_get_label( priv->item );
 
-		if( NA_IS_OBJECT_ACTION( editor->private->item )){
+		if( NA_IS_OBJECT_ACTION( priv->item )){
 			/* i18n: The action <label> is about to be exported */
 			label = g_strdup_printf( _( "The action \"%s\" is about to be exported." ), item_label );
 		} else {
@@ -374,7 +376,7 @@ on_base_initialize_base_window( NactExportAsk *editor )
 			label = g_strdup_printf( _( "The menu \"%s\" is about to be exported." ), item_label );
 		}
 
-		widget = base_window_get_widget( BASE_WINDOW( editor ), "ExportAskLabel1" );
+		widget = base_window_get_widget( BASE_WINDOW( editor ), "ExportAskLabel" );
 		gtk_label_set_text( GTK_LABEL( widget ), label );
 		g_free( label );
 		g_free( item_label );
@@ -382,15 +384,15 @@ on_base_initialize_base_window( NactExportAsk *editor )
 		widget = base_window_get_widget( BASE_WINDOW( editor ), "ExportFormatAskVBox" );
 		na_ioptions_list_set_editable(
 				NA_IOPTIONS_LIST( editor ), widget,
-				!editor->private->format_mandatory && !editor->private->preferences_locked );
+				!priv->format_mandatory && !priv->preferences_locked );
 		na_ioptions_list_set_default(
 				NA_IOPTIONS_LIST( editor ), widget,
-				g_quark_to_string( editor->private->format ));
+				g_quark_to_string( priv->format ));
 
 		base_gtk_utils_toggle_set_initial_state( BASE_WINDOW( editor ),
 				"AskKeepChoiceButton", G_CALLBACK( keep_choice_on_toggled ),
-				editor->private->keep_last_choice,
-				!editor->private->keep_last_choice_mandatory, !editor->private->preferences_locked );
+				priv->keep_last_choice,
+				!priv->keep_last_choice_mandatory, !priv->preferences_locked );
 
 		base_window_signal_connect_by_name(
 				BASE_WINDOW( editor ),
diff --git a/src/nact/nact-export-ask.h b/src/nact/nact-export-ask.h
index f209c82..ae14770 100644
--- a/src/nact/nact-export-ask.h
+++ b/src/nact/nact-export-ask.h
@@ -52,12 +52,12 @@
 
 G_BEGIN_DECLS
 
-#define NACT_EXPORT_ASK_TYPE                ( nact_export_ask_get_type())
-#define NACT_EXPORT_ASK( object )           ( G_TYPE_CHECK_INSTANCE_CAST( object, NACT_EXPORT_ASK_TYPE, NactExportAsk ))
-#define NACT_EXPORT_ASK_CLASS( klass )      ( G_TYPE_CHECK_CLASS_CAST( klass, NACT_EXPORT_ASK_TYPE, NactExportAskClass ))
-#define NACT_IS_EXPORT_ASK( object )        ( G_TYPE_CHECK_INSTANCE_TYPE( object, NACT_EXPORT_ASK_TYPE ))
-#define NACT_IS_EXPORT_ASK_CLASS( klass )   ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NACT_EXPORT_ASK_TYPE ))
-#define NACT_EXPORT_ASK_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NACT_EXPORT_ASK_TYPE, NactExportAskClass ))
+#define NACT_TYPE_EXPORT_ASK                ( nact_export_ask_get_type())
+#define NACT_EXPORT_ASK( object )           ( G_TYPE_CHECK_INSTANCE_CAST( object, NACT_TYPE_EXPORT_ASK, NactExportAsk ))
+#define NACT_EXPORT_ASK_CLASS( klass )      ( G_TYPE_CHECK_CLASS_CAST( klass, NACT_TYPE_EXPORT_ASK, NactExportAskClass ))
+#define NACT_IS_EXPORT_ASK( object )        ( G_TYPE_CHECK_INSTANCE_TYPE( object, NACT_TYPE_EXPORT_ASK ))
+#define NACT_IS_EXPORT_ASK_CLASS( klass )   ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NACT_TYPE_EXPORT_ASK ))
+#define NACT_EXPORT_ASK_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NACT_TYPE_EXPORT_ASK, NactExportAskClass ))
 
 typedef struct _NactExportAskPrivate        NactExportAskPrivate;
 
@@ -79,7 +79,7 @@ typedef struct {
 
 GType  nact_export_ask_get_type( void );
 
-GQuark nact_export_ask_user( BaseWindow *window, NAObjectItem *item, gboolean first );
+GQuark nact_export_ask_user    ( BaseWindow *window, NAObjectItem *item, gboolean first );
 
 G_END_DECLS
 
diff --git a/src/utils/nautilus-actions-new.c b/src/utils/nautilus-actions-new.c
index 28ecb47..590e6ba 100644
--- a/src/utils/nautilus-actions-new.c
+++ b/src/utils/nautilus-actions-new.c
@@ -604,7 +604,7 @@ output_to_stdout( const NAObjectAction *action, GSList **msgs )
 	gchar *buffer;
 
 	updater = na_updater_new();
-	format = g_quark_from_string( NA_IPREFS_DEFAULT_EXPORT_FORMAT );
+	format = g_quark_from_string( "Desktop1" );
 	buffer = na_exporter_to_buffer( NA_PIVOT( updater ), NA_OBJECT_ITEM( action ), format, msgs );
 	ret = ( buffer != NULL );
 



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