[nautilus-actions] Refactoring: update src/nact/
- From: Pierre Wieser <pwieser src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus-actions] Refactoring: update src/nact/
- Date: Fri, 19 Feb 2010 02:27:06 +0000 (UTC)
commit 96e2fa95fbe2ba3fd7631b5062e1011359420195
Author: Pierre Wieser <pwieser trychlos org>
Date: Mon Feb 15 20:29:36 2010 +0100
Refactoring: update src/nact/
src/nact/Makefile.am | 8 ++
src/nact/base-iprefs.c | 164 ++++++++++++++++-----------------
src/nact/base-iprefs.h | 20 ++---
src/nact/base-window-class.h | 8 +-
src/nact/base-window.c | 71 +++++++++------
src/nact/base-window.h | 18 ++--
src/nact/nact-application.c | 77 ++++++++--------
src/nact/nact-application.h | 6 +-
src/nact/nact-assistant-export-ask.c | 63 +++++--------
src/nact/nact-assistant-export-ask.h | 4 +-
src/nact/nact-assistant-export.c | 81 ++++++-----------
src/nact/nact-assistant-import-ask.c | 21 +++--
src/nact/nact-assistant-import-ask.h | 4 +-
src/nact/nact-assistant-import.c | 95 ++++++++------------
src/nact/nact-iaction-tab.c | 8 +-
src/nact/nact-iactions-list.c | 8 +-
src/nact/nact-iactions-list.h | 2 +-
src/nact/nact-iadvanced-tab.c | 6 +-
src/nact/nact-ibackground-tab.c | 8 +-
src/nact/nact-icommand-tab.c | 8 +-
src/nact/nact-iconditions-tab.c | 8 +-
src/nact/nact-main-window.h | 2 +-
src/nact/nact-preferences-editor.c | 4 +-
src/nact/nact-window.h | 20 ++--
24 files changed, 344 insertions(+), 370 deletions(-)
---
diff --git a/src/nact/Makefile.am b/src/nact/Makefile.am
index 1bb8a75..0e59e78 100644
--- a/src/nact/Makefile.am
+++ b/src/nact/Makefile.am
@@ -70,6 +70,12 @@ nautilus_actions_config_tool_SOURCES = \
egg-sm-client-xsmp.c \
egg-tree-multi-dnd.c \
egg-tree-multi-dnd.h \
+ na-exporter.c \
+ na-exporter.h \
+ na-iexporter.c \
+ na-importer.c \
+ na-importer.h \
+ na-iimporter.c \
nact-application.c \
nact-application.h \
nact-assistant-export.c \
@@ -101,6 +107,8 @@ nautilus_actions_config_tool_SOURCES = \
nact-icommand-tab.h \
nact-iconditions-tab.c \
nact-iconditions-tab.h \
+ nact-iprefs.c \
+ nact-iprefs.h \
nact-main.c \
nact-main-menubar.c \
nact-main-menubar.h \
diff --git a/src/nact/base-iprefs.c b/src/nact/base-iprefs.c
index 1ccadff..5e94ff1 100644
--- a/src/nact/base-iprefs.c
+++ b/src/nact/base-iprefs.c
@@ -33,8 +33,9 @@
#include <config.h>
#endif
-#include <runtime/na-gconf-utils.h>
-#include <runtime/na-iprefs.h>
+#include <api/na-gconf-utils.h>
+
+#include <core/na-iprefs.h>
#include "base-iprefs.h"
@@ -47,19 +48,19 @@ struct BaseIPrefsInterfacePrivate {
static gboolean st_initialized = FALSE;
static gboolean st_finalized = FALSE;
-static GType register_type( void );
-static void interface_base_init( BaseIPrefsInterface *klass );
-static void interface_base_finalize( BaseIPrefsInterface *klass );
+static GType register_type( void );
+static void interface_base_init( BaseIPrefsInterface *klass );
+static void interface_base_finalize( BaseIPrefsInterface *klass );
-static gchar *v_iprefs_get_window_id( BaseWindow *window );
+static gchar *v_iprefs_get_window_id( const BaseWindow *window );
-static gint read_int( BaseWindow *window, const gchar *name );
-static GSList *read_int_list( BaseWindow *window, const gchar *key );
-static void write_int( BaseWindow *window, const gchar *name, gint value );
-static void write_int_list( BaseWindow *window, const gchar *key, GSList *list );
-static void int_list_to_position( BaseWindow *window, GSList *list, gint *x, gint *y, gint *width, gint *height );
-static GSList *position_to_int_list( BaseWindow *window, gint x, gint y, gint width, gint height );
-static void free_int_list( GSList *list );
+/*static gint read_int( const BaseWindow *window, const gchar *name );*/
+static GSList *read_int_list( const BaseWindow *window, const gchar *key );
+/*static void write_int( const BaseWindow *window, const gchar *name, gint value )*/
+static void write_int_list( const BaseWindow *window, const gchar *key, GSList *list );
+static void int_list_to_position( const BaseWindow *window, GSList *list, gint *x, gint *y, gint *width, gint *height );
+static GSList *position_to_int_list( const BaseWindow *window, gint x, gint y, gint width, gint height );
+static void free_int_list( GSList *list );
GType
base_iprefs_get_type( void )
@@ -93,7 +94,7 @@ register_type( void )
g_debug( "%s", thisfn );
- type = g_type_register_static( G_TYPE_INTERFACE, "BaseIPrefs", &info, 0 );
+ type = g_type_register_static( NA_IPREFS_TYPE, "BaseIPrefs", &info, 0 );
g_type_interface_add_prerequisite( type, G_TYPE_OBJECT );
@@ -127,9 +128,11 @@ interface_base_finalize( BaseIPrefsInterface *klass )
g_debug( "%s: klass=%p", thisfn, ( void * ) klass );
- g_free( klass->private );
-
st_finalized = TRUE;
+
+ g_object_unref( klass->private->client );
+
+ g_free( klass->private );
}
}
@@ -142,7 +145,7 @@ interface_base_finalize( BaseIPrefsInterface *klass )
* A window position is stored as a list of integers "x,y,width,height".
*/
void
-base_iprefs_position_window( BaseWindow *window )
+base_iprefs_position_window( const BaseWindow *window )
{
GtkWindow *toplevel;
gchar *key;
@@ -173,7 +176,7 @@ base_iprefs_position_window( BaseWindow *window )
* as some of the screen is reserved by deskbars and so...
*/
void
-base_iprefs_position_named_window( BaseWindow *window, GtkWindow *toplevel, const gchar *key )
+base_iprefs_position_named_window( const BaseWindow *window, GtkWindow *toplevel, const gchar *key )
{
static const gchar *thisfn = "base_iprefs_position_named_window";
GSList *list;
@@ -214,7 +217,7 @@ base_iprefs_position_named_window( BaseWindow *window, GtkWindow *toplevel, cons
* Save the size and position of the specified window.
*/
void
-base_iprefs_save_window_position( BaseWindow *window )
+base_iprefs_save_window_position( const BaseWindow *window )
{
GtkWindow *toplevel;
gchar *key;
@@ -242,7 +245,7 @@ base_iprefs_save_window_position( BaseWindow *window )
* Save size and position of the specified window.
*/
void
-base_iprefs_save_named_window_position( BaseWindow *window, GtkWindow *toplevel, const gchar *key )
+base_iprefs_save_named_window_position( const BaseWindow *window, GtkWindow *toplevel, const gchar *key )
{
static const gchar *thisfn = "base_iprefs_save_named_window_position";
gint x, y, width, height;
@@ -265,49 +268,8 @@ base_iprefs_save_named_window_position( BaseWindow *window, GtkWindow *toplevel,
}
}
-/**
- * base_iprefs_get_int:
- * @window: this BaseWindow-derived window.
- * @name: the entry to be readen.
- *
- * Returns: the named integer.
- */
-gint
-base_iprefs_get_int( BaseWindow *window, const gchar *name )
-{
- gint ret = 0;
-
- g_return_val_if_fail( BASE_IS_WINDOW( window ), 0 );
- g_return_val_if_fail( BASE_IS_IPREFS( window ), 0 );
-
- if( st_initialized && !st_finalized ){
- ret = read_int( window, name );
- }
-
- return( ret );
-}
-
-/**
- * base_iprefs_set_int:
- * @window: this BaseWindow-derived window.
- * @name: the entry to be written.
- * @value: the integer to be set.
- *
- * Writes an integer in the GConf system.
- */
-void
-base_iprefs_set_int( BaseWindow *window, const gchar *name, gint value )
-{
- g_return_if_fail( BASE_IS_WINDOW( window ));
- g_return_if_fail( BASE_IS_IPREFS( window ));
-
- if( st_initialized && !st_finalized ){
- write_int( window, name, value );
- }
-}
-
static gchar *
-v_iprefs_get_window_id( BaseWindow *window )
+v_iprefs_get_window_id( const BaseWindow *window )
{
g_return_val_if_fail( BASE_IS_IPREFS( window ), NULL );
@@ -318,39 +280,57 @@ v_iprefs_get_window_id( BaseWindow *window )
return( NULL );
}
+#if 0
+/*
+ * base_iprefs_read_int:
+ * @window: this #BaseWindow-derived window.
+ * @name: the entry to be readen.
+ *
+ * Returns: the named integer.
+ */
static gint
-read_int( BaseWindow *window, const gchar *name )
+read_int( const BaseWindow *window, const gchar *name )
{
- static const gchar *thisfn = "base_iprefs_read_key_int";
+ static const gchar *thisfn = "base_iprefs_read_int";
GError *error = NULL;
gchar *path;
gint value;
- path = gconf_concat_dir_and_key( NA_GCONF_PREFS_PATH, name );
+ g_return_val_if_fail( BASE_IS_WINDOW( window ), 0 );
+ g_return_val_if_fail( BASE_IS_IPREFS( window ), 0 );
- value = gconf_client_get_int( BASE_IPREFS_GET_INTERFACE( window )->private->client, path, &error );
+ value = 0;
- if( error ){
- g_warning( "%s: name=%s, %s", thisfn, name, error->message );
- g_error_free( error );
+ if( st_initialized && !st_finalized ){
+
+ path = gconf_concat_dir_and_key( IPREFS_GCONF_PREFS_PATH, name );
+
+ value = gconf_client_get_int( BASE_IPREFS_GET_INTERFACE( window )->private->client, path, &error );
+
+ if( error ){
+ g_warning( "%s: name=%s, %s", thisfn, name, error->message );
+ g_error_free( error );
+ }
+
+ g_free( path );
}
- g_free( path );
return( value );
}
+#endif
/*
* returns a list of int
*/
static GSList *
-read_int_list( BaseWindow *window, const gchar *key )
+read_int_list( const BaseWindow *window, const gchar *key )
{
static const gchar *thisfn = "base_iprefs_read_int_list";
GError *error = NULL;
gchar *path;
GSList *list;
- path = gconf_concat_dir_and_key( NA_GCONF_PREFS_PATH, key );
+ path = gconf_concat_dir_and_key( IPREFS_GCONF_PREFS_PATH, key );
list = gconf_client_get_list(
BASE_IPREFS_GET_INTERFACE( window )->private->client, path, GCONF_VALUE_INT, &error );
@@ -365,33 +345,49 @@ read_int_list( BaseWindow *window, const gchar *key )
return( list );
}
+#if 0
+/**
+ * base_iprefs_write_int:
+ * @window: this #BaseWindow-derived window.
+ * @name: the entry to be written.
+ * @value: the integer to be set.
+ *
+ * Writes an integer in the GConf system.
+ */
static void
-write_int( BaseWindow *window, const gchar *name, gint value )
+write_int( const BaseWindow *window, const gchar *name, gint value )
{
static const gchar *thisfn = "base_iprefs_write_int";
GError *error = NULL;
gchar *path;
- path = gconf_concat_dir_and_key( NA_GCONF_PREFS_PATH, name );
+ g_return_if_fail( BASE_IS_WINDOW( window ));
+ g_return_if_fail( BASE_IS_IPREFS( window ));
+
+ if( st_initialized && !st_finalized ){
- gconf_client_set_int( BASE_IPREFS_GET_INTERFACE( window )->private->client, path, value, &error );
+ path = gconf_concat_dir_and_key( IPREFS_GCONF_PREFS_PATH, name );
- if( error ){
- g_warning( "%s: name=%s, %s", thisfn, name, error->message );
- g_error_free( error );
- }
+ gconf_client_set_int( BASE_IPREFS_GET_INTERFACE( window )->private->client, path, value, &error );
- g_free( path );
+ if( error ){
+ g_warning( "%s: name=%s, %s", thisfn, name, error->message );
+ g_error_free( error );
+ }
+
+ g_free( path );
+ }
}
+#endif
static void
-write_int_list( BaseWindow *window, const gchar *key, GSList *list )
+write_int_list( const BaseWindow *window, const gchar *key, GSList *list )
{
static const gchar *thisfn = "base_iprefs_write_int_list";
GError *error = NULL;
gchar *path;
- path = g_strdup_printf( "%s/%s", NA_GCONF_PREFS_PATH, key );
+ path = g_strdup_printf( "%s/%s", IPREFS_GCONF_PREFS_PATH, key );
gconf_client_set_list(
BASE_IPREFS_GET_INTERFACE( window )->private->client, path, GCONF_VALUE_INT, list, &error );
@@ -409,7 +405,7 @@ write_int_list( BaseWindow *window, const gchar *key, GSList *list )
* extract the position of the window from the list of GConfValue
*/
static void
-int_list_to_position( BaseWindow *window, GSList *list, gint *x, gint *y, gint *width, gint *height )
+int_list_to_position( const BaseWindow *window, GSList *list, gint *x, gint *y, gint *width, gint *height )
{
GSList *il;
int i;
@@ -438,7 +434,7 @@ int_list_to_position( BaseWindow *window, GSList *list, gint *x, gint *y, gint *
}
static GSList *
-position_to_int_list( BaseWindow *window, gint x, gint y, gint width, gint height )
+position_to_int_list( const BaseWindow *window, gint x, gint y, gint width, gint height )
{
GSList *list = NULL;
diff --git a/src/nact/base-iprefs.h b/src/nact/base-iprefs.h
index a526b31..ea76d92 100644
--- a/src/nact/base-iprefs.h
+++ b/src/nact/base-iprefs.h
@@ -42,6 +42,8 @@
* to this function.
*/
+#include <core/na-iprefs.h>
+
#include "base-window.h"
G_BEGIN_DECLS
@@ -51,30 +53,26 @@ G_BEGIN_DECLS
#define BASE_IS_IPREFS( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, BASE_IPREFS_TYPE ))
#define BASE_IPREFS_GET_INTERFACE( instance ) ( G_TYPE_INSTANCE_GET_INTERFACE(( instance ), BASE_IPREFS_TYPE, BaseIPrefsInterface ))
-typedef struct BaseIPrefs BaseIPrefs;
+typedef struct BaseIPrefs BaseIPrefs;
typedef struct BaseIPrefsInterfacePrivate BaseIPrefsInterfacePrivate;
typedef struct {
- GTypeInterface parent;
+ NAIPrefsInterface parent;
BaseIPrefsInterfacePrivate *private;
/* api */
- gchar * ( *iprefs_get_window_id )( BaseWindow *window );
+ gchar * ( *iprefs_get_window_id )( const BaseWindow *window );
}
BaseIPrefsInterface;
GType base_iprefs_get_type( void );
-void base_iprefs_position_window( BaseWindow *window );
-void base_iprefs_position_named_window( BaseWindow *window, GtkWindow *toplevel, const gchar *name );
-
-void base_iprefs_save_window_position( BaseWindow *window );
-void base_iprefs_save_named_window_position( BaseWindow *window, GtkWindow *toplevel, const gchar *name );
-
-gint base_iprefs_get_int( BaseWindow *window, const gchar *name );
-void base_iprefs_set_int( BaseWindow *window, const gchar *name, gint value );
+void base_iprefs_position_window( const BaseWindow *window );
+void base_iprefs_position_named_window( const BaseWindow *window, GtkWindow *toplevel, const gchar *name );
+void base_iprefs_save_window_position( const BaseWindow *window );
+void base_iprefs_save_named_window_position( const BaseWindow *window, GtkWindow *toplevel, const gchar *name );
G_END_DECLS
diff --git a/src/nact/base-window-class.h b/src/nact/base-window-class.h
index 2f942df..d9cc2e9 100644
--- a/src/nact/base-window-class.h
+++ b/src/nact/base-window-class.h
@@ -137,7 +137,7 @@ typedef struct {
*
* Pure virtual function.
*/
- gchar * ( *get_toplevel_name ) ( BaseWindow *window );
+ gchar * ( *get_toplevel_name ) ( const BaseWindow *window );
/**
* get_iprefs_window_id:
@@ -149,7 +149,7 @@ typedef struct {
* This delegates to #BaseWindow-derived classes the NactIPrefs
* interface virtual function.
*/
- gchar * ( *get_iprefs_window_id ) ( BaseWindow *window );
+ gchar * ( *get_iprefs_window_id ) ( const BaseWindow *window );
/**
* get_ui_filename:
@@ -164,7 +164,7 @@ typedef struct {
* Returns: the filename of the XML definition, to be g_free() by
* the caller.
*/
- gchar * ( *get_ui_filename ) ( BaseWindow *window );
+ gchar * ( *get_ui_filename ) ( const BaseWindow *window );
/**
* is_willing_to_quit:
@@ -179,7 +179,7 @@ typedef struct {
* Returns: the filename of the XML definition, to be g_free() by
* the caller.
*/
- gboolean ( *is_willing_to_quit ) ( BaseWindow *window );
+ gboolean ( *is_willing_to_quit ) ( const BaseWindow *window );
}
BaseWindowClass;
diff --git a/src/nact/base-window.c b/src/nact/base-window.c
index 631c59b..e82ed37 100644
--- a/src/nact/base-window.c
+++ b/src/nact/base-window.c
@@ -39,6 +39,7 @@
#include "base-application.h"
#include "base-iprefs.h"
+#include "nact-iprefs.h"
#include "base-window.h"
/* private class data
@@ -99,7 +100,8 @@ static gboolean st_debug_signal_connect = FALSE;
static GType register_type( void );
static void class_init( BaseWindowClass *klass );
-static void iprefs_iface_init( BaseIPrefsInterface *iface );
+static void iprefs_base_iface_init( BaseIPrefsInterface *iface );
+static void iprefs_nact_iface_init( NactIPrefsInterface *iface );
static void instance_init( GTypeInstance *instance, gpointer klass );
static void instance_get_property( GObject *object, guint property_id, GValue *value, GParamSpec *spec );
static void instance_set_property( GObject *object, guint property_id, const GValue *value, GParamSpec *spec );
@@ -112,9 +114,9 @@ static void v_initial_load_toplevel( BaseWindow *window, gpointer us
static void v_runtime_init_toplevel( BaseWindow *window, gpointer user_data );
static void v_all_widgets_showed( BaseWindow *window, gpointer user_data );
static gboolean v_dialog_response( GtkDialog *dialog, gint code, BaseWindow *window );
-static gchar *v_get_toplevel_name( BaseWindow *window );
-static gchar *v_get_iprefs_window_id( BaseWindow *window );
-static gchar *v_get_ui_filename( BaseWindow *window );
+static gchar *v_get_toplevel_name( const BaseWindow *window );
+static gchar *v_get_iprefs_window_id( const BaseWindow *window );
+static gchar *v_get_ui_filename( const BaseWindow *window );
static void on_runtime_init_toplevel( BaseWindow *window, gpointer user_data );
@@ -123,11 +125,11 @@ static void window_do_runtime_init_toplevel( BaseWindow *window, gpo
static void window_do_all_widgets_showed( BaseWindow *window, gpointer user_data );
static gboolean window_do_dialog_response( GtkDialog *dialog, gint code, BaseWindow *window );
static gboolean window_do_delete_event( BaseWindow *window, GtkWindow *toplevel, GdkEvent *event );
-static gboolean window_do_is_willing_to_quit( BaseWindow *window );
+static gboolean window_do_is_willing_to_quit( const BaseWindow *window );
static gboolean is_main_window( BaseWindow *window );
static gboolean is_toplevel_initialized( BaseWindow *window, GtkWindow *toplevel );
-static GtkWindow *load_named_toplevel( BaseWindow *window, const gchar *name );
+static GtkWindow *load_named_toplevel( const BaseWindow *window, const gchar *name );
static GtkWidget *search_for_widget( GtkWindow *toplevel, const gchar *name );
static GtkWidget *search_for_child_widget( GtkContainer *container, const gchar *name );
static void set_toplevel_initialized( BaseWindow *window, GtkWindow *toplevel, gboolean init );
@@ -165,8 +167,14 @@ register_type( void )
( GInstanceInitFunc ) instance_init
};
- static const GInterfaceInfo prefs_iface_info = {
- ( GInterfaceInitFunc ) iprefs_iface_init,
+ static const GInterfaceInfo iprefs_base_iface_info = {
+ ( GInterfaceInitFunc ) iprefs_base_iface_init,
+ NULL,
+ NULL
+ };
+
+ static const GInterfaceInfo iprefs_nact_iface_info = {
+ ( GInterfaceInitFunc ) iprefs_nact_iface_init,
NULL,
NULL
};
@@ -175,7 +183,9 @@ register_type( void )
type = g_type_register_static( G_TYPE_OBJECT, "BaseWindow", &info, 0 );
- g_type_add_interface_static( type, BASE_IPREFS_TYPE, &prefs_iface_info );
+ g_type_add_interface_static( type, BASE_IPREFS_TYPE, &iprefs_base_iface_info );
+
+ g_type_add_interface_static( type, NACT_IPREFS_TYPE, &iprefs_nact_iface_info );
return( type );
}
@@ -329,9 +339,9 @@ class_init( BaseWindowClass *klass )
}
static void
-iprefs_iface_init( BaseIPrefsInterface *iface )
+iprefs_base_iface_init( BaseIPrefsInterface *iface )
{
- static const gchar *thisfn = "base_window_iprefs_iface_init";
+ static const gchar *thisfn = "base_window_iprefs_base_iface_init";
g_debug( "%s: iface=%p", thisfn, ( void * ) iface );
@@ -339,6 +349,14 @@ iprefs_iface_init( BaseIPrefsInterface *iface )
}
static void
+iprefs_nact_iface_init( NactIPrefsInterface *iface )
+{
+ static const gchar *thisfn = "base_window_iprefs_nact_iface_init";
+
+ g_debug( "%s: iface=%p", thisfn, ( void * ) iface );
+}
+
+static void
instance_init( GTypeInstance *instance, gpointer klass )
{
static const gchar *thisfn = "base_window_instance_init";
@@ -477,6 +495,8 @@ instance_dispose( GObject *window )
if( !self->private->dispose_has_run ){
+ self->private->dispose_has_run = TRUE;
+
if( self->private->save_window_position ){
base_iprefs_save_window_position( self );
}
@@ -514,8 +534,6 @@ instance_dispose( GObject *window )
}
}
- self->private->dispose_has_run = TRUE;
-
/* release the Gtkbuilder, if any
*/
if( self->private->has_own_builder ){
@@ -702,7 +720,7 @@ base_window_run( BaseWindow *window )
* caller.
*/
BaseApplication *
-base_window_get_application( BaseWindow *window )
+base_window_get_application( const BaseWindow *window )
{
BaseApplication *application = NULL;
@@ -729,7 +747,7 @@ base_window_get_application( BaseWindow *window )
* #GtkWindow.
*/
GtkWindow *
-base_window_get_named_toplevel( BaseWindow *window, const gchar *name )
+base_window_get_named_toplevel( const BaseWindow *window, const gchar *name )
{
GtkWindow *toplevel = NULL;
@@ -751,7 +769,7 @@ base_window_get_named_toplevel( BaseWindow *window, const gchar *name )
* The returned object is owned by @window, and should not be freed.
*/
BaseWindow *
-base_window_get_parent( BaseWindow *window )
+base_window_get_parent( const BaseWindow *window )
{
BaseWindow *parent = NULL;
@@ -775,7 +793,7 @@ base_window_get_parent( BaseWindow *window )
* #GtkWindow.
*/
GtkWindow *
-base_window_get_toplevel( BaseWindow *window )
+base_window_get_toplevel( const BaseWindow *window )
{
GtkWindow *toplevel = NULL;
@@ -801,7 +819,7 @@ base_window_get_toplevel( BaseWindow *window )
* g_free() nor g_object_unref() by the caller.
*/
GtkWidget *
-base_window_get_widget( BaseWindow *window, const gchar *name )
+base_window_get_widget( const BaseWindow *window, const gchar *name )
{
GtkWindow *toplevel;
GtkWidget *widget = NULL;
@@ -829,7 +847,7 @@ base_window_get_widget( BaseWindow *window, const gchar *name )
* session and thus asks its client if they are willing to quit.
*/
gboolean
-base_window_is_willing_to_quit( BaseWindow *window )
+base_window_is_willing_to_quit( const BaseWindow *window )
{
gboolean willing_to = TRUE;
@@ -838,6 +856,7 @@ base_window_is_willing_to_quit( BaseWindow *window )
if( !window->private->dispose_has_run ){
if( BASE_WINDOW_GET_CLASS( window )->is_willing_to_quit ){
+
willing_to = BASE_WINDOW_GET_CLASS( window )->is_willing_to_quit( window );
}
}
@@ -961,7 +980,7 @@ v_dialog_response( GtkDialog *dialog, gint code, BaseWindow *window )
}
static gchar *
-v_get_toplevel_name( BaseWindow *window )
+v_get_toplevel_name( const BaseWindow *window )
{
gchar *name = NULL;
@@ -982,7 +1001,7 @@ v_get_toplevel_name( BaseWindow *window )
}
static gchar *
-v_get_iprefs_window_id( BaseWindow *window )
+v_get_iprefs_window_id( const BaseWindow *window )
{
gchar *id = NULL;
@@ -999,7 +1018,7 @@ v_get_iprefs_window_id( BaseWindow *window )
}
static gchar *
-v_get_ui_filename( BaseWindow *window )
+v_get_ui_filename( const BaseWindow *window )
{
gchar *filename = NULL;
BaseApplication *application;
@@ -1119,7 +1138,7 @@ window_do_delete_event( BaseWindow *window, GtkWindow *toplevel, GdkEvent *event
}
static gboolean
-window_do_is_willing_to_quit( BaseWindow *window )
+window_do_is_willing_to_quit( const BaseWindow *window )
{
static const gchar *thisfn = "base_window_do_is_willing_to_quit";
@@ -1157,7 +1176,7 @@ is_toplevel_initialized( BaseWindow *window, GtkWindow *toplevel )
}
static GtkWindow *
-load_named_toplevel( BaseWindow *window, const gchar *name )
+load_named_toplevel( const BaseWindow *window, const gchar *name )
{
GtkWindow *toplevel = NULL;
BaseApplication *application;
@@ -1268,7 +1287,7 @@ setup_builder( BaseWindow *window )
}
void
-base_window_error_dlg( BaseWindow *window, GtkMessageType type, const gchar *primary, const gchar *secondary )
+base_window_error_dlg( const BaseWindow *window, GtkMessageType type, const gchar *primary, const gchar *secondary )
{
g_return_if_fail( BASE_IS_WINDOW( window ));
@@ -1278,7 +1297,7 @@ base_window_error_dlg( BaseWindow *window, GtkMessageType type, const gchar *pri
}
gboolean
-base_window_yesno_dlg( BaseWindow *window, GtkMessageType type, const gchar *first, const gchar *second )
+base_window_yesno_dlg( const BaseWindow *window, GtkMessageType type, const gchar *first, const gchar *second )
{
gboolean yesno = FALSE;
diff --git a/src/nact/base-window.h b/src/nact/base-window.h
index 4387fac..8a8805a 100644
--- a/src/nact/base-window.h
+++ b/src/nact/base-window.h
@@ -77,17 +77,15 @@ G_BEGIN_DECLS
gboolean base_window_init( BaseWindow *window );
gboolean base_window_run( BaseWindow *window );
-BaseApplication *base_window_get_application( BaseWindow *window );
-GtkWindow *base_window_get_named_toplevel( BaseWindow *window, const gchar *name );
-BaseWindow *base_window_get_parent( BaseWindow *window );
-GtkWindow *base_window_get_toplevel( BaseWindow *window );
-GtkWidget *base_window_get_widget( BaseWindow *window, const gchar *name );
-gboolean base_window_is_willing_to_quit( BaseWindow *window );
+BaseApplication *base_window_get_application( const BaseWindow *window );
+GtkWindow *base_window_get_named_toplevel( const BaseWindow *window, const gchar *name );
+BaseWindow *base_window_get_parent( const BaseWindow *window );
+GtkWindow *base_window_get_toplevel( const BaseWindow *window );
+GtkWidget *base_window_get_widget( const BaseWindow *window, const gchar *name );
+gboolean base_window_is_willing_to_quit( const BaseWindow *window );
-void base_window_set_save_window_position( BaseWindow *window, gboolean save );
-
-void base_window_error_dlg( BaseWindow *window, GtkMessageType type, const gchar *primary, const gchar *secondary );
-gboolean base_window_yesno_dlg( BaseWindow *window, GtkMessageType type, const gchar *first, const gchar *second );
+void base_window_error_dlg( const BaseWindow *window, GtkMessageType type, const gchar *primary, const gchar *secondary );
+gboolean base_window_yesno_dlg( const BaseWindow *window, GtkMessageType type, const gchar *first, const gchar *second );
gulong base_window_signal_connect( BaseWindow *window, GObject *instance, const gchar *signal, GCallback fn );
gulong base_window_signal_connect_after( BaseWindow *window, GObject *instance, const gchar *signal, GCallback fn );
diff --git a/src/nact/nact-application.c b/src/nact/nact-application.c
index ce86e00..ad01189 100644
--- a/src/nact/nact-application.c
+++ b/src/nact/nact-application.c
@@ -35,11 +35,10 @@
#include <glib/gi18n.h>
#include <gtk/gtk.h>
-#include <private/na-object-action-fn.h>
+#include <api/na-core-utils.h>
-#include <runtime/na-iabout.h>
-#include <runtime/na-ipivot-consumer.h>
-#include <runtime/na-utils.h>
+#include <core/na-iabout.h>
+#include <core/na-ipivot-consumer.h>
#include "nact-application.h"
#include "nact-main-window.h"
@@ -53,22 +52,22 @@ struct NactApplicationClassPrivate {
/* private instance data
*/
struct NactApplicationPrivate {
- gboolean dispose_has_run;
- NAPivot *pivot;
+ gboolean dispose_has_run;
+ NAUpdater *updater;
};
/* private instance properties
*/
enum {
- NACT_APPLICATION_PROP_PIVOT_ID = 1
+ NACT_APPLICATION_PROP_UPDATER_ID = 1
};
-#define NACT_APPLICATION_PROP_PIVOT "nact-application-pivot"
+#define NACT_APPLICATION_PROP_UPDATER "nact-application-prop-updater"
-static gboolean st_non_unique_opt = FALSE;
-static gboolean st_version_opt = FALSE;
+static gboolean st_non_unique_opt = FALSE;
+static gboolean st_version_opt = FALSE;
-static GOptionEntry st_entries[] = {
+static GOptionEntry st_entries[] = {
{ "non-unique", 'n', 0, G_OPTION_ARG_NONE, &st_non_unique_opt,
N_( "Set it to run multiple instances of the program [unique]" ), NULL },
{ "version" , 'v', 0, G_OPTION_ARG_NONE, &st_version_opt,
@@ -151,11 +150,11 @@ class_init( NactApplicationClass *klass )
object_class->set_property = instance_set_property;
spec = g_param_spec_pointer(
- NACT_APPLICATION_PROP_PIVOT,
- NACT_APPLICATION_PROP_PIVOT,
- "NAPivot object pointer",
+ NACT_APPLICATION_PROP_UPDATER,
+ NACT_APPLICATION_PROP_UPDATER,
+ "NAUpdater object pointer",
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE );
- g_object_class_install_property( object_class, NACT_APPLICATION_PROP_PIVOT_ID, spec );
+ g_object_class_install_property( object_class, NACT_APPLICATION_PROP_UPDATER_ID, spec );
klass->private = g_new0( NactApplicationClassPrivate, 1 );
@@ -197,8 +196,8 @@ instance_get_property( GObject *object, guint property_id, GValue *value, GParam
if( !self->private->dispose_has_run ){
switch( property_id ){
- case NACT_APPLICATION_PROP_PIVOT_ID:
- g_value_set_pointer( value, self->private->pivot );
+ case NACT_APPLICATION_PROP_UPDATER_ID:
+ g_value_set_pointer( value, self->private->updater );
break;
default:
@@ -219,8 +218,8 @@ instance_set_property( GObject *object, guint property_id, const GValue *value,
if( !self->private->dispose_has_run ){
switch( property_id ){
- case NACT_APPLICATION_PROP_PIVOT_ID:
- self->private->pivot = g_value_get_pointer( value );
+ case NACT_APPLICATION_PROP_UPDATER_ID:
+ self->private->updater = g_value_get_pointer( value );
break;
default:
@@ -242,16 +241,16 @@ instance_dispose( GObject *application )
if( !self->private->dispose_has_run ){
- if( self->private->pivot ){
- g_object_unref( self->private->pivot );
+ self->private->dispose_has_run = TRUE;
+
+ if( self->private->updater ){
+ g_object_unref( self->private->updater );
}
/* chain up to the parent class */
if( G_OBJECT_CLASS( st_parent_class )->dispose ){
G_OBJECT_CLASS( st_parent_class )->dispose( application );
}
-
- self->private->dispose_has_run = TRUE;
}
}
@@ -294,25 +293,27 @@ nact_application_new_with_args( int argc, char **argv )
}
/**
- * Returns a pointer on the NAPivot object.
- *
+ * nact_application_get_updater:
* @application: this NactApplication object.
*
- * The returned pointer is owned by the NactApplication object.
- * It should not be freed not unref by the caller.
+ * Returns a pointer on the #NAUpdater object.
+ *
+ * The returned pointer is owned by the #NactApplication object.
+ * It should not be g_free() not g_object_unref() by the caller.
*/
-NAPivot *
-nact_application_get_pivot( NactApplication *application )
+NAUpdater *
+nact_application_get_updater( NactApplication *application )
{
- NAPivot *pivot = NULL;
+ NAUpdater *updater = NULL;
g_return_val_if_fail( NACT_IS_APPLICATION( application ), NULL );
if( !application->private->dispose_has_run ){
- pivot = application->private->pivot;
+
+ updater = application->private->updater;
}
- return( pivot );
+ return( updater );
}
/*
@@ -328,7 +329,7 @@ appli_manage_options( BaseApplication *application )
if( ok ){
if( st_version_opt ){
- na_utils_print_version();
+ na_core_utils_print_version();
ok = FALSE;
}
}
@@ -388,15 +389,11 @@ appli_initialize_application( BaseApplication *application )
{
static const gchar *thisfn = "nact_application_appli_initialize_application";
gboolean ok;
- NAObjectAction *fake;
g_debug( "%s: application=%p", thisfn, ( void * ) application );
- fake = na_object_action_new();
- g_object_unref( fake );
-
- NACT_APPLICATION( application )->private->pivot = na_pivot_new( PIVOT_LOAD_ALL );
- na_pivot_load_items( NACT_APPLICATION( application )->private->pivot );
+ NACT_APPLICATION( application )->private->updater = na_updater_new( PIVOT_LOAD_ALL );
+ na_pivot_load_items( NA_PIVOT( NACT_APPLICATION( application )->private->updater ));
/* call parent class */
ok = BASE_APPLICATION_CLASS( st_parent_class )->initialize_application( application );
@@ -460,7 +457,7 @@ appli_get_main_window( BaseApplication *application )
window = BASE_WINDOW( nact_main_window_new( application ));
na_pivot_register_consumer(
- nact_application_get_pivot( NACT_APPLICATION( application )),
+ NA_PIVOT( nact_application_get_updater( NACT_APPLICATION( application ))),
NA_IPIVOT_CONSUMER( window ));
return( G_OBJECT( window ));
diff --git a/src/nact/nact-application.h b/src/nact/nact-application.h
index 767b0b3..99b6b79 100644
--- a/src/nact/nact-application.h
+++ b/src/nact/nact-application.h
@@ -39,7 +39,7 @@
* This is the main class for nautilus-actions-config-tool program.
*/
-#include <runtime/na-pivot.h>
+#include <core/na-updater.h>
#include "base-application.h"
@@ -52,7 +52,7 @@ G_BEGIN_DECLS
#define NACT_IS_APPLICATION_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NACT_APPLICATION_TYPE ))
#define NACT_APPLICATION_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NACT_APPLICATION_TYPE, NactApplicationClass ))
-typedef struct NactApplicationPrivate NactApplicationPrivate;
+typedef struct NactApplicationPrivate NactApplicationPrivate;
typedef struct {
BaseApplication parent;
@@ -72,7 +72,7 @@ GType nact_application_get_type( void );
NactApplication *nact_application_new_with_args( int argc, char **argv );
-NAPivot *nact_application_get_pivot( NactApplication *application );
+NAUpdater *nact_application_get_updater( NactApplication *application );
G_END_DECLS
diff --git a/src/nact/nact-assistant-export-ask.c b/src/nact/nact-assistant-export-ask.c
index a360076..f67af93 100644
--- a/src/nact/nact-assistant-export-ask.c
+++ b/src/nact/nact-assistant-export-ask.c
@@ -36,10 +36,7 @@
#include <api/na-object-api.h>
-#include <runtime/na-iprefs.h>
-#include <runtime/na-pivot.h>
-
-#include "nact-application.h"
+#include "nact-iprefs.h"
#include "nact-assistant-export-ask.h"
/* private class data
@@ -51,10 +48,10 @@ struct NactAssistantExportAskClassPrivate {
/* private instance data
*/
struct NactAssistantExportAskPrivate {
- gboolean dispose_has_run;
- BaseWindow *parent;
- NAObjectAction *action;
- gint format;
+ gboolean dispose_has_run;
+ BaseWindow *parent;
+ NAObjectItem *item;
+ gint format;
};
static BaseDialogClass *st_parent_class = NULL;
@@ -67,9 +64,9 @@ static void instance_finalize( GObject *dialog );
static NactAssistantExportAsk *assistant_export_ask_new( BaseWindow *parent );
-static gchar *base_get_iprefs_window_id( BaseWindow *window );
-static gchar *base_get_dialog_name( BaseWindow *window );
-static gchar *base_get_ui_filename( BaseWindow *dialog );
+static gchar *base_get_iprefs_window_id( const BaseWindow *window );
+static gchar *base_get_dialog_name( const BaseWindow *window );
+static gchar *base_get_ui_filename( const BaseWindow *dialog );
static void on_base_initial_load_dialog( NactAssistantExportAsk *editor, gpointer user_data );
static void on_base_runtime_init_dialog( NactAssistantExportAsk *editor, gpointer user_data );
static void on_base_all_widgets_showed( NactAssistantExportAsk *editor, gpointer user_data );
@@ -233,55 +230,49 @@ assistant_export_ask_new( BaseWindow *parent )
* becomes his preference export format.
*/
gint
-nact_assistant_export_ask_user( BaseWindow *parent, NAObjectAction *action )
+nact_assistant_export_ask_user( BaseWindow *parent, NAObjectItem *item )
{
static const gchar *thisfn = "nact_assistant_export_ask_run";
- NactApplication *application;
- NAPivot *pivot;
NactAssistantExportAsk *editor;
gint format;
g_debug( "%s: parent=%p", thisfn, ( void * ) parent );
- g_return_val_if_fail( BASE_IS_WINDOW( parent ), IPREFS_EXPORT_NO_EXPORT );
- application = NACT_APPLICATION( base_window_get_application( parent ));
- g_return_val_if_fail( NACT_IS_APPLICATION( application ), IPREFS_EXPORT_NO_EXPORT );
+ format = IPREFS_EXPORT_NO_EXPORT;
- pivot = nact_application_get_pivot( application );
- g_return_val_if_fail( NA_IS_PIVOT( pivot ), IPREFS_EXPORT_NO_EXPORT );
+ g_return_val_if_fail( BASE_IS_WINDOW( parent ), format );
editor = assistant_export_ask_new( parent );
- /*g_object_set( G_OBJECT( editor ), BASE_WINDOW_PROP_HAS_OWN_BUILDER, TRUE, NULL );*/
editor->private->parent = parent;
- editor->private->action = action;
- editor->private->format = na_iprefs_get_export_format( NA_IPREFS( pivot ), IPREFS_EXPORT_ASK_LAST_FORMAT );
+ editor->private->item = item;
+ editor->private->format = nact_iprefs_get_export_format( BASE_WINDOW( parent ), IPREFS_EXPORT_ASK_LAST_FORMAT );
+
+ if( base_window_run( BASE_WINDOW( editor ))){
- if( !base_window_run( BASE_WINDOW( editor ))){
- editor->private->format = IPREFS_EXPORT_NO_EXPORT;
+ format = editor->private->format;
+ nact_iprefs_set_export_format( BASE_WINDOW( parent ), IPREFS_EXPORT_ASK_LAST_FORMAT, format );
}
- na_iprefs_set_export_format( NA_IPREFS( pivot ), IPREFS_EXPORT_ASK_LAST_FORMAT, editor->private->format );
- format = editor->private->format;
g_object_unref( editor );
return( format );
}
static gchar *
-base_get_iprefs_window_id( BaseWindow *window )
+base_get_iprefs_window_id( const BaseWindow *window )
{
return( g_strdup( "export-ask-user" ));
}
static gchar *
-base_get_dialog_name( BaseWindow *window )
+base_get_dialog_name( const BaseWindow *window )
{
return( g_strdup( "AssistantExportAsk" ));
}
static gchar *
-base_get_ui_filename( BaseWindow *dialog )
+base_get_ui_filename( const BaseWindow *dialog )
{
return( g_strdup( PKGDATADIR "/nact-assistant-export.ui" ));
}
@@ -299,7 +290,7 @@ static void
on_base_runtime_init_dialog( NactAssistantExportAsk *editor, gpointer user_data )
{
static const gchar *thisfn = "nact_assistant_export_ask_on_runtime_init_dialog";
- gchar *action_label;
+ gchar *item_label;
gchar *label;
GtkWidget *widget;
GtkWidget *button;
@@ -307,10 +298,10 @@ on_base_runtime_init_dialog( NactAssistantExportAsk *editor, gpointer user_data
g_debug( "%s: editor=%p, user_data=%p", thisfn, ( void * ) editor, ( void * ) user_data );
g_return_if_fail( NACT_IS_ASSISTANT_EXPORT_ASK( editor ));
- action_label = na_object_get_label( editor->private->action );
+ item_label = na_object_get_label( editor->private->item );
- /* i18n: The action <action_label> is about to be exported */
- label = g_strdup_printf( _( "The action \"%s\" is about to be exported." ), action_label );
+ /* i18n: The item <label> is about to be exported */
+ label = g_strdup_printf( _( "The item \"%s\" is about to be exported." ), item_label );
widget = base_window_get_widget( BASE_WINDOW( editor ), "ExportAskLabel1" );
gtk_label_set_text( GTK_LABEL( widget ), label );
@@ -375,8 +366,6 @@ static gint
get_format( NactAssistantExportAsk *editor )
{
gint export_format;
- NactApplication *application;
- NAPivot *pivot;
GtkWidget *button;
gboolean keep;
@@ -394,9 +383,7 @@ get_format( NactAssistantExportAsk *editor )
button = base_window_get_widget( BASE_WINDOW( editor ), "AskKeepChoiceButton" );
keep = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( button ));
if( keep ){
- application = NACT_APPLICATION( base_window_get_application( BASE_WINDOW( editor )));
- pivot = nact_application_get_pivot( application );
- na_iprefs_set_export_format( NA_IPREFS( pivot ), IPREFS_EXPORT_FORMAT, export_format );
+ nact_iprefs_set_export_format( BASE_WINDOW( editor ), IPREFS_EXPORT_FORMAT, export_format );
}
return( export_format );
diff --git a/src/nact/nact-assistant-export-ask.h b/src/nact/nact-assistant-export-ask.h
index 1329382..258914b 100644
--- a/src/nact/nact-assistant-export-ask.h
+++ b/src/nact/nact-assistant-export-ask.h
@@ -41,7 +41,7 @@
* to be ask to choose the export format.
*/
-#include <private/na-object-action-class.h>
+#include <api/na-object-item.h>
#include "base-dialog.h"
@@ -72,7 +72,7 @@ typedef struct {
GType nact_assistant_export_ask_get_type( void );
-gint nact_assistant_export_ask_user( BaseWindow *window, NAObjectAction *action );
+gint nact_assistant_export_ask_user( BaseWindow *window, NAObjectItem *item );
G_END_DECLS
diff --git a/src/nact/nact-assistant-export.c b/src/nact/nact-assistant-export.c
index dc2630c..6cb647b 100644
--- a/src/nact/nact-assistant-export.c
+++ b/src/nact/nact-assistant-export.c
@@ -36,22 +36,19 @@
#include <gtk/gtk.h>
#include <string.h>
+#include <api/na-core-utils.h>
#include <api/na-object-api.h>
-#include <private/na-iduplicable.h>
-
-#include <runtime/na-iprefs.h>
-#include <runtime/na-pivot.h>
-#include <runtime/na-utils.h>
-#include <runtime/na-xml-names.h>
-#include <runtime/na-xml-writer.h>
+#include <core/na-iprefs.h>
#include "base-iprefs.h"
#include "nact-application.h"
+#include "nact-iprefs.h"
#include "nact-main-window.h"
#include "nact-assistant-export.h"
#include "nact-assistant-export-ask.h"
#include "nact-iactions-list.h"
+#include "na-exporter.h"
/* Export Assistant
*
@@ -96,8 +93,6 @@ typedef struct {
}
ExportStruct;
-#define IPREFS_EXPORT_ACTIONS_FOLDER_URI "export-folder-uri"
-
static BaseAssistantClass *st_parent_class = NULL;
static GType register_type( void );
@@ -109,9 +104,9 @@ static void instance_finalize( GObject *application );
static NactAssistantExport *assist_new( BaseWindow *parent );
-static gchar *window_get_iprefs_window_id( BaseWindow *window );
-static gchar *window_get_toplevel_name( BaseWindow *dialog );
-static gchar *window_get_ui_filename( BaseWindow *dialog );
+static gchar *window_get_iprefs_window_id( const BaseWindow *window );
+static gchar *window_get_toplevel_name( const BaseWindow *dialog );
+static gchar *window_get_ui_filename( const BaseWindow *dialog );
static void on_initial_load_dialog( NactAssistantExport *dialog, gpointer user_data );
static void on_runtime_init_dialog( NactAssistantExport *dialog, gpointer user_data );
@@ -327,19 +322,19 @@ nact_assistant_export_run( BaseWindow *main_window )
}
static gchar *
-window_get_iprefs_window_id( BaseWindow *window )
+window_get_iprefs_window_id( const BaseWindow *window )
{
return( g_strdup( "export-assistant" ));
}
static gchar *
-window_get_toplevel_name( BaseWindow *dialog )
+window_get_toplevel_name( const BaseWindow *dialog )
{
return( g_strdup( "ExportAssistant" ));
}
static gchar *
-window_get_ui_filename( BaseWindow *dialog )
+window_get_ui_filename( const BaseWindow *dialog )
{
return( g_strdup( PKGDATADIR "/nact-assistant-export.ui" ));
}
@@ -350,7 +345,7 @@ on_initial_load_dialog( NactAssistantExport *dialog, gpointer user_data )
static const gchar *thisfn = "nact_assistant_export_on_initial_load_dialog";
GtkAssistant *assistant;
NactApplication *application;
- NAPivot *pivot;
+ NAUpdater *updater;
gboolean esc_quit, esc_confirm;
g_debug( "%s: dialog=%p, user_data=%p", thisfn, ( void * ) dialog, ( void * ) user_data );
@@ -366,10 +361,10 @@ on_initial_load_dialog( NactAssistantExport *dialog, gpointer user_data )
assist_initial_load_exportdone( dialog, assistant );
application = NACT_APPLICATION( base_window_get_application( BASE_WINDOW( dialog )));
- pivot = nact_application_get_pivot( application );
- esc_quit = na_iprefs_read_bool( NA_IPREFS( pivot ), IPREFS_ASSIST_ESC_QUIT, TRUE );
+ updater = nact_application_get_updater( application );
+ esc_quit = na_iprefs_read_bool( NA_IPREFS( updater ), IPREFS_ASSIST_ESC_QUIT, TRUE );
base_assistant_set_cancel_on_esc( BASE_ASSISTANT( dialog ), esc_quit );
- esc_confirm = na_iprefs_read_bool( NA_IPREFS( pivot ), IPREFS_ASSIST_ESC_CONFIRM, TRUE );
+ esc_confirm = na_iprefs_read_bool( NA_IPREFS( updater ), IPREFS_ASSIST_ESC_CONFIRM, TRUE );
base_assistant_set_warn_on_esc( BASE_ASSISTANT( dialog ), esc_confirm );
}
@@ -486,7 +481,7 @@ assist_runtime_init_target_folder( NactAssistantExport *window, GtkAssistant *as
{
GtkFileChooser *chooser;
NactApplication *application;
- NAPivot *pivot;
+ NAUpdater *updater;
gchar *uri;
GtkWidget *content;
@@ -494,9 +489,9 @@ assist_runtime_init_target_folder( NactAssistantExport *window, GtkAssistant *as
gtk_file_chooser_unselect_all( chooser );
application = NACT_APPLICATION( base_window_get_application( BASE_WINDOW( window )));
- pivot = nact_application_get_pivot( application );
+ updater = nact_application_get_updater( application );
- uri = na_iprefs_read_string( NA_IPREFS( pivot ), IPREFS_EXPORT_ACTIONS_FOLDER_URI, "file:///tmp" );
+ uri = na_iprefs_read_string( NA_IPREFS( updater ), IPREFS_EXPORT_ITEMS_FOLDER_URI, "file:///tmp" );
if( uri && strlen( uri )){
gtk_file_chooser_set_uri( GTK_FILE_CHOOSER( chooser ), uri );
}
@@ -528,8 +523,6 @@ on_folder_selection_changed( GtkFileChooser *chooser, gpointer user_data )
{
static const gchar *thisfn = "nact_assistant_export_on_folder_selection_changed";
GtkAssistant *assistant;
- NactApplication *application;
- NAPivot *pivot;
gint pos;
gchar *uri;
gboolean enabled;
@@ -546,14 +539,12 @@ on_folder_selection_changed( GtkFileChooser *chooser, gpointer user_data )
uri = gtk_file_chooser_get_uri( chooser );
g_debug( "%s: uri=%s", thisfn, uri );
- enabled = ( uri && strlen( uri ) && na_utils_is_writable_dir( uri ));
+ enabled = ( uri && strlen( uri ) && na_core_utils_dir_is_writable( uri ));
if( enabled ){
g_free( assist->private->uri );
assist->private->uri = g_strdup( uri );
- application = NACT_APPLICATION( base_window_get_application( BASE_WINDOW( assist )));
- pivot = nact_application_get_pivot( application );
- na_iprefs_write_string( NA_IPREFS( pivot ), IPREFS_EXPORT_ACTIONS_FOLDER_URI, uri );
+ nact_iprefs_write_string( BASE_WINDOW( assist ), IPREFS_EXPORT_ITEMS_FOLDER_URI, uri );
}
g_free( uri );
@@ -574,13 +565,9 @@ assist_runtime_init_format( NactAssistantExport *window, GtkAssistant *assistant
{
GtkToggleButton *button;
GtkWidget *content;
- NactApplication *application;
- NAPivot *pivot;
- gint format;
+ guint format;
- application = NACT_APPLICATION( base_window_get_application( BASE_WINDOW( window )));
- pivot = nact_application_get_pivot( application );
- format = na_iprefs_get_export_format( NA_IPREFS( pivot ), IPREFS_EXPORT_FORMAT );
+ format = nact_iprefs_get_export_format( BASE_WINDOW( window ), IPREFS_EXPORT_FORMAT );
switch( format ){
case IPREFS_EXPORT_FORMAT_GCONF_SCHEMA_V1:
@@ -706,13 +693,8 @@ assist_prepare_confirm( NactAssistantExport *window, GtkAssistant *assistant, Gt
gchar *text, *tmp, *text2;
gchar *label1, *label2, *label3;
GList *actions, *ia;
- NactApplication *application;
- NAPivot *pivot;
gint format;
- application = NACT_APPLICATION( base_window_get_application( BASE_WINDOW( window )));
- pivot = nact_application_get_pivot( application );
-
g_debug( "%s: window=%p, assistant=%p, page=%p",
thisfn, ( void * ) window, ( void * ) assistant, ( void * ) page );
@@ -730,7 +712,7 @@ assist_prepare_confirm( NactAssistantExport *window, GtkAssistant *assistant, Gt
text = tmp;
}
- na_object_free_items_list( actions );
+ na_object_unref_items( actions );
g_assert( window->private->uri && strlen( window->private->uri ));
@@ -769,9 +751,9 @@ assist_prepare_confirm( NactAssistantExport *window, GtkAssistant *assistant, Gt
g_return_if_reached();
break;
}
- na_iprefs_set_export_format( NA_IPREFS( pivot ), IPREFS_EXPORT_FORMAT, format );
+ nact_iprefs_set_export_format( BASE_WINDOW( window ), IPREFS_EXPORT_FORMAT, format );
- label3 = na_utils_prefix_strings( "\t", label2 );
+ label3 = na_core_utils_str_add_prefix( "\t", label2 );
tmp = g_strdup_printf( "%s\n\n<b>%s</b>\n\n%s", text, label1, label3 );
g_free( label3 );
g_free( label2 );
@@ -795,8 +777,6 @@ assistant_apply( BaseAssistant *wnd, GtkAssistant *assistant )
{
static const gchar *thisfn = "nact_assistant_export_on_apply";
NactAssistantExport *window;
- NactApplication *application;
- NAPivot *pivot;
GList *actions, *ia;
ExportStruct *str;
@@ -804,9 +784,6 @@ assistant_apply( BaseAssistant *wnd, GtkAssistant *assistant )
g_assert( NACT_IS_ASSISTANT_EXPORT( wnd ));
window = NACT_ASSISTANT_EXPORT( wnd );
- application = NACT_APPLICATION( base_window_get_application( BASE_WINDOW( window )));
- pivot = nact_application_get_pivot( application );
-
actions = nact_iactions_list_bis_get_selected_items( NACT_IACTIONS_LIST( window ));
g_assert( window->private->uri && strlen( window->private->uri ));
@@ -817,20 +794,20 @@ assistant_apply( BaseAssistant *wnd, GtkAssistant *assistant )
str->action = NA_OBJECT_ACTION( na_iduplicable_get_origin( NA_IDUPLICABLE( ia->data )));
- str->format = na_iprefs_get_export_format( NA_IPREFS( pivot ), IPREFS_EXPORT_FORMAT );
+ str->format = nact_iprefs_get_export_format( BASE_WINDOW( wnd ), IPREFS_EXPORT_FORMAT );
if( str->format == IPREFS_EXPORT_FORMAT_ASK ){
- str->format = nact_assistant_export_ask_user( BASE_WINDOW( wnd ), str->action );
+ str->format = nact_assistant_export_ask_user( BASE_WINDOW( wnd ), NA_OBJECT_ITEM( str->action ));
if( str->format == IPREFS_EXPORT_NO_EXPORT ){
str->msg = g_slist_append( NULL, g_strdup( _( "Export canceled due to user action." )));
}
}
if( str->format != IPREFS_EXPORT_NO_EXPORT ){
- str->fname = na_xml_writer_export( str->action, window->private->uri, str->format, &str->msg );
+ str->fname = na_exporter_export( NA_OBJECT_ITEM( str->action ), window->private->uri, str->format, &str->msg );
}
}
- na_object_free_items_list( actions );
+ na_object_unref_items( actions );
}
static void
@@ -911,7 +888,7 @@ free_results( GList *list )
for( ir = list ; ir ; ir = ir->next ){
str = ( ExportStruct * ) ir->data;
g_free( str->fname );
- na_utils_free_string_list( str->msg );
+ na_core_utils_slist_free( str->msg );
}
g_list_free( list );
diff --git a/src/nact/nact-assistant-import-ask.c b/src/nact/nact-assistant-import-ask.c
index c734954..fe53914 100644
--- a/src/nact/nact-assistant-import-ask.c
+++ b/src/nact/nact-assistant-import-ask.c
@@ -36,10 +36,10 @@
#include <api/na-object-api.h>
-#include <runtime/na-iprefs.h>
-#include <runtime/na-pivot.h>
+#include <core/na-iprefs.h>
#include "nact-application.h"
+#include "nact-iprefs.h"
#include "nact-assistant-import-ask.h"
/* private class data
@@ -54,7 +54,7 @@ struct NactAssistantImportAskPrivate {
gboolean dispose_has_run;
NactMainWindow *parent;
const gchar *uri;
- NAObjectAction *action;
+ NAObjectItem *item;
NAObjectItem *exist;
gint mode;
};
@@ -69,8 +69,8 @@ static void instance_finalize( GObject *dialog );
static NactAssistantImportAsk *assistant_import_ask_new( BaseWindow *parent );
-static gchar *base_get_iprefs_window_id( BaseWindow *window );
-static gchar *base_get_dialog_name( BaseWindow *window );
+static gchar *base_get_iprefs_window_id( const BaseWindow *window );
+static gchar *base_get_dialog_name( const BaseWindow *window );
static void on_base_initial_load_dialog( NactAssistantImportAsk *editor, gpointer user_data );
static void on_base_runtime_init_dialog( NactAssistantImportAsk *editor, gpointer user_data );
static void on_base_all_widgets_showed( NactAssistantImportAsk *editor, gpointer user_data );
@@ -224,6 +224,9 @@ assistant_import_ask_new( BaseWindow *parent )
/**
* nact_assistant_import_ask_run:
* @parent: the NactMainWindow parent of this dialog.
+ * @uri:
+ * @item:
+ * @exist:
*
* Initializes and runs the dialog.
*
@@ -233,7 +236,7 @@ assistant_import_ask_new( BaseWindow *parent )
* becomes his preference import mode.
*/
gint
-nact_assistant_import_ask_user( NactMainWindow *parent, const gchar *uri, NAObjectAction *action, NAObjectItem *exist )
+nact_assistant_import_ask_user( NactMainWindow *parent, const gchar *uri, NAObjectItem *item, NAObjectItem *exist )
{
static const gchar *thisfn = "nact_assistant_import_ask_run";
NactApplication *application;
@@ -253,7 +256,7 @@ nact_assistant_import_ask_user( NactMainWindow *parent, const gchar *uri, NAObje
editor = assistant_import_ask_new( BASE_WINDOW( parent ));
editor->private->parent = parent;
editor->private->uri = uri;
- editor->private->action = action;
+ editor->private->item = item;
editor->private->exist = exist;
editor->private->mode = na_iprefs_get_import_mode( NA_IPREFS( pivot ), IPREFS_IMPORT_ASK_LAST_MODE );
@@ -267,13 +270,13 @@ nact_assistant_import_ask_user( NactMainWindow *parent, const gchar *uri, NAObje
}
static gchar *
-base_get_iprefs_window_id( BaseWindow *window )
+base_get_iprefs_window_id( const BaseWindow *window )
{
return( g_strdup( "import-ask-user" ));
}
static gchar *
-base_get_dialog_name( BaseWindow *window )
+base_get_dialog_name( const BaseWindow *window )
{
return( g_strdup( "AssistantImportAsk" ));
}
diff --git a/src/nact/nact-assistant-import-ask.h b/src/nact/nact-assistant-import-ask.h
index 6d8288b..2b1201b 100644
--- a/src/nact/nact-assistant-import-ask.h
+++ b/src/nact/nact-assistant-import-ask.h
@@ -42,7 +42,7 @@
* with it.
*/
-#include <private/na-object-action-class.h>
+#include <api/na-object-item.h>
#include "base-dialog.h"
#include "nact-main-window.h"
@@ -74,7 +74,7 @@ typedef struct {
GType nact_assistant_import_ask_get_type( void );
-gint nact_assistant_import_ask_user( NactMainWindow *window, const gchar *uri, NAObjectAction *new_action, NAObjectItem *current );
+gint nact_assistant_import_ask_user( NactMainWindow *window, const gchar *uri, NAObjectItem *new_item, NAObjectItem *current );
G_END_DECLS
diff --git a/src/nact/nact-assistant-import.c b/src/nact/nact-assistant-import.c
index 99e8dac..99de8ca 100644
--- a/src/nact/nact-assistant-import.c
+++ b/src/nact/nact-assistant-import.c
@@ -32,23 +32,19 @@
#include <config.h>
#endif
-#include <gconf/gconf.h>
#include <glib/gi18n.h>
-#include <gtk/gtk.h>
#include <string.h>
#include <api/na-object-api.h>
-
-#include <runtime/na-iprefs.h>
-#include <runtime/na-pivot.h>
-#include <runtime/na-utils.h>
+#include <api/na-core-utils.h>
#include "nact-application.h"
+#include "nact-iprefs.h"
#include "nact-iactions-list.h"
#include "nact-assistant-import.h"
#include "nact-assistant-import-ask.h"
#include "nact-main-window.h"
-#include "nact-xml-reader.h"
+#include "na-importer.h"
/* Import Assistant
*
@@ -70,9 +66,9 @@ enum {
};
typedef struct {
- gchar *uri;
- NAObjectAction *action;
- GSList *msg;
+ gchar *uri;
+ NAObjectItem *item;
+ GSList *msg;
}
ImportUriStruct;
@@ -87,11 +83,9 @@ struct NactAssistantImportClassPrivate {
struct NactAssistantImportPrivate {
gboolean dispose_has_run;
GSList *results;
- GSList *actions;
+ GList *items;
};
-#define IPREFS_IMPORT_ACTIONS_FOLDER_URI "import-folder-uri"
-
static BaseAssistantClass *st_parent_class = NULL;
static GType register_type( void );
@@ -102,8 +96,8 @@ static void instance_finalize( GObject *application );
static NactAssistantImport *assist_new( BaseWindow *parent );
-static gchar *window_get_iprefs_window_id( BaseWindow *window );
-static gchar *window_get_dialog_name( BaseWindow *dialog );
+static gchar *window_get_iprefs_window_id( const BaseWindow *window );
+static gchar *window_get_dialog_name( const BaseWindow *dialog );
static void on_initial_load_dialog( NactAssistantImport *dialog, gpointer user_data );
static void on_runtime_init_dialog( NactAssistantImport *dialog, gpointer user_data );
@@ -280,13 +274,13 @@ nact_assistant_import_run( BaseWindow *main_window )
}
static gchar *
-window_get_iprefs_window_id( BaseWindow *window )
+window_get_iprefs_window_id( const BaseWindow *window )
{
return( g_strdup( "import-assistant" ));
}
static gchar *
-window_get_dialog_name( BaseWindow *dialog )
+window_get_dialog_name( const BaseWindow *dialog )
{
return( g_strdup( "ImportAssistant" ));
}
@@ -296,17 +290,17 @@ on_initial_load_dialog( NactAssistantImport *dialog, gpointer user_data )
{
static const gchar *thisfn = "nact_assistant_import_on_initial_load_dialog";
NactApplication *application;
- NAPivot *pivot;
+ NAUpdater *updater;
gboolean esc_quit, esc_confirm;
g_debug( "%s: dialog=%p, user_data=%p", thisfn, ( void * ) dialog, ( void * ) user_data );
g_return_if_fail( NACT_IS_ASSISTANT_IMPORT( dialog ));
application = NACT_APPLICATION( base_window_get_application( BASE_WINDOW( dialog )));
- pivot = nact_application_get_pivot( application );
- esc_quit = na_iprefs_read_bool( NA_IPREFS( pivot ), IPREFS_ASSIST_ESC_QUIT, TRUE );
+ updater = nact_application_get_updater( application );
+ esc_quit = na_iprefs_read_bool( NA_IPREFS( updater ), IPREFS_ASSIST_ESC_QUIT, TRUE );
base_assistant_set_cancel_on_esc( BASE_ASSISTANT( dialog ), esc_quit );
- esc_confirm = na_iprefs_read_bool( NA_IPREFS( pivot ), IPREFS_ASSIST_ESC_CONFIRM, TRUE );
+ esc_confirm = na_iprefs_read_bool( NA_IPREFS( updater ), IPREFS_ASSIST_ESC_CONFIRM, TRUE );
base_assistant_set_warn_on_esc( BASE_ASSISTANT( dialog ), esc_confirm );
}
@@ -348,7 +342,7 @@ runtime_init_file_selector( NactAssistantImport *window, GtkAssistant *assistant
{
static const gchar *thisfn = "nact_assistant_import_runtime_init_file_selector";
NactApplication *application;
- NAPivot *pivot;
+ NAUpdater *updater;
GtkWidget *page;
GtkWidget *chooser;
gchar *uri;
@@ -359,10 +353,10 @@ runtime_init_file_selector( NactAssistantImport *window, GtkAssistant *assistant
thisfn, ( void * ) window, ( void * ) assistant, ( void * ) page );
application = NACT_APPLICATION( base_window_get_application( BASE_WINDOW( window )));
- pivot = nact_application_get_pivot( application );
+ updater = nact_application_get_updater( application );
chooser = base_window_get_widget( BASE_WINDOW( window ), "ImportFileChooser" );
- uri = na_iprefs_read_string( NA_IPREFS( pivot ), IPREFS_IMPORT_ACTIONS_FOLDER_URI, "file:///tmp" );
+ uri = na_iprefs_read_string( NA_IPREFS( updater ), IPREFS_IMPORT_ITEMS_FOLDER_URI, "file:///tmp" );
if( uri && strlen( uri )){
gtk_file_chooser_set_current_folder_uri( GTK_FILE_CHOOSER( chooser ), uri );
}
@@ -384,8 +378,6 @@ on_file_selection_changed( GtkFileChooser *chooser, gpointer user_data )
g_debug( "%s: chooser=%p, user_data=%p", thisfn, chooser, user_data );*/
GtkAssistant *assistant;
- NactApplication *application;
- NAPivot *pivot;
gint pos;
GSList *uris;
gboolean enabled;
@@ -402,13 +394,11 @@ on_file_selection_changed( GtkFileChooser *chooser, gpointer user_data )
if( enabled ){
folder = gtk_file_chooser_get_current_folder_uri( GTK_FILE_CHOOSER( chooser ));
- application = NACT_APPLICATION( base_window_get_application( BASE_WINDOW( user_data )));
- pivot = nact_application_get_pivot( application );
- na_iprefs_write_string( NA_IPREFS( pivot ), IPREFS_IMPORT_ACTIONS_FOLDER_URI, folder );
+ nact_iprefs_write_string( BASE_WINDOW( user_data ), IPREFS_IMPORT_ITEMS_FOLDER_URI, folder );
g_free( folder );
}
- na_utils_free_string_list( uris );
+ na_core_utils_slist_free( uris );
content = gtk_assistant_get_nth_page( assistant, pos );
gtk_assistant_set_page_complete( assistant, content, enabled );
@@ -473,16 +463,12 @@ static void
runtime_init_duplicates( NactAssistantImport *window, GtkAssistant *assistant )
{
static const gchar *thisfn = "nact_assistant_import_runtime_init_duplicates";
- NactApplication *application;
- NAPivot *pivot;
GtkWidget *page;
gint mode;
g_debug( "%s: window=%p", thisfn, ( void * ) window );
- application = NACT_APPLICATION( base_window_get_application( BASE_WINDOW( window )));
- pivot = nact_application_get_pivot( application );
- mode = na_iprefs_get_import_mode( NA_IPREFS( pivot ), IPREFS_IMPORT_ACTIONS_IMPORT_MODE );
+ mode = nact_iprefs_get_import_mode( BASE_WINDOW( window ), IPREFS_IMPORT_ITEMS_IMPORT_MODE );
set_import_mode( window, mode );
page = gtk_assistant_get_nth_page( assistant, ASSIST_PAGE_DUPLICATES );
@@ -643,7 +629,7 @@ add_import_mode( NactAssistantImport *window, const gchar *text )
}
if( label1 ){
- label3 = na_utils_prefix_strings( "\t", label2 );
+ label3 = na_core_utils_str_add_prefix( "\t", label2 );
g_free( label2 );
result = g_strdup_printf( "%s\n\n<b>%s</b>\n\n%s", text, label1, label3 );
@@ -664,7 +650,7 @@ assistant_apply( BaseAssistant *wnd, GtkAssistant *assistant )
NactAssistantImport *window;
GtkWidget *chooser;
GSList *uris, *is, *msg;
- NAObjectAction *action;
+ NAObjectItem *item;
ImportUriStruct *str;
GList *items;
BaseWindow *mainwnd;
@@ -688,22 +674,22 @@ assistant_apply( BaseAssistant *wnd, GtkAssistant *assistant )
for( is = uris ; is ; is = is->next ){
msg = NULL;
- action = nact_xml_reader_import( BASE_WINDOW( window ), items, ( const gchar * ) is->data, mode, &msg );
+ item = na_importer_import( BASE_WINDOW( window ), items, ( const gchar * ) is->data, mode, &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 );
- na_utils_free_string_list( msg );
+ str->item = item;
+ str->msg = na_core_utils_slist_duplicate( msg );
+ na_core_utils_slist_free( msg );
- if( str->action ){
- na_object_check_status( str->action );
- items = g_list_prepend( items, str->action );
+ if( str->item ){
+ na_object_check_status( str->item );
+ items = g_list_prepend( items, str->item );
}
window->private->results = g_slist_prepend( window->private->results, str );
}
- na_utils_free_string_list( uris );
+ na_core_utils_slist_free( uris );
window->private->results = g_slist_reverse( window->private->results );
/* then insert the list
@@ -711,15 +697,13 @@ assistant_apply( BaseAssistant *wnd, GtkAssistant *assistant )
*/
items = g_list_reverse( items );
nact_iactions_list_bis_insert_items( NACT_IACTIONS_LIST( mainwnd ), items, NULL );
- na_object_free_items_list( items );
+ na_object_unref_items( items );
}
static void
prepare_importdone( NactAssistantImport *window, GtkAssistant *assistant, GtkWidget *page )
{
static const gchar *thisfn = "nact_assistant_import_prepare_importdone";
- NactApplication *application;
- NAPivot *pivot;
gchar *text, *tmp, *text2;
gchar *bname, *uuid, *label;
GSList *is, *im;
@@ -730,9 +714,6 @@ prepare_importdone( NactAssistantImport *window, GtkAssistant *assistant, GtkWid
g_debug( "%s: window=%p, assistant=%p, page=%p",
thisfn, ( void * ) window, ( void * ) assistant, ( void * ) page );
- application = NACT_APPLICATION( base_window_get_application( BASE_WINDOW( window )));
- pivot = nact_application_get_pivot( application );
-
/* i18n: result of the import assistant */
text = g_strdup( _( "Selected files have been proceeded :" ));
tmp = g_strdup_printf( "<b>%s</b>\n\n", text );
@@ -750,13 +731,13 @@ prepare_importdone( NactAssistantImport *window, GtkAssistant *assistant, GtkWid
text = tmp;
g_free( bname );
- if( str->action ){
+ if( str->item ){
/* i18n: indicate that the file has been successfully imported */
tmp = g_strdup_printf( "%s\t\t%s\n", text, _( "Import OK" ));
g_free( text );
text = tmp;
- uuid = na_object_get_id( str->action );
- label = na_object_get_label( str->action );
+ uuid = na_object_get_id( str->item );
+ label = na_object_get_label( str->item );
/* i18n: this is the globally unique identifier and the label of the newly imported action */
text2 = g_strdup_printf( _( "UUID: %s\t%s" ), uuid, label);
g_free( label );
@@ -765,7 +746,7 @@ prepare_importdone( NactAssistantImport *window, GtkAssistant *assistant, GtkWid
g_free( text );
text = tmp;
- window->private->actions = g_slist_prepend( window->private->actions, str->action );
+ window->private->items = g_list_prepend( window->private->items, str->item );
} else {
/* i18n: indicate that the file was not iported */
@@ -792,7 +773,7 @@ prepare_importdone( NactAssistantImport *window, GtkAssistant *assistant, GtkWid
g_free( text );
mode = get_import_mode( window );
- na_iprefs_set_import_mode( NA_IPREFS( pivot ), IPREFS_IMPORT_ACTIONS_IMPORT_MODE, mode );
+ nact_iprefs_set_import_mode( BASE_WINDOW( window ), IPREFS_IMPORT_ITEMS_IMPORT_MODE, mode );
gtk_assistant_set_page_complete( assistant, page, TRUE );
base_assistant_set_warn_on_cancel( BASE_ASSISTANT( window ), FALSE );
@@ -808,7 +789,7 @@ free_results( GSList *list )
for( is = list ; is ; is = is->next ){
str = ( ImportUriStruct * ) is->data;
g_free( str->uri );
- na_utils_free_string_list( str->msg );
+ na_core_utils_slist_free( str->msg );
}
g_slist_free( list );
diff --git a/src/nact/nact-iaction-tab.c b/src/nact/nact-iaction-tab.c
index a779895..18414f6 100644
--- a/src/nact/nact-iaction-tab.c
+++ b/src/nact/nact-iaction-tab.c
@@ -155,6 +155,7 @@ interface_base_init( NactIActionTabInterface *klass )
static const gchar *thisfn = "nact_iaction_tab_interface_base_init";
if( !st_initialized ){
+
g_debug( "%s: klass=%p", thisfn, ( void * ) klass );
klass->private = g_new0( NactIActionTabInterfacePrivate, 1 );
@@ -168,12 +169,13 @@ interface_base_finalize( NactIActionTabInterface *klass )
{
static const gchar *thisfn = "nact_iaction_tab_interface_base_finalize";
- if( !st_finalized ){
- g_debug( "%s: klass=%p", thisfn, ( void * ) klass );
+ if( st_initialized && !st_finalized ){
- g_free( klass->private );
+ g_debug( "%s: klass=%p", thisfn, ( void * ) klass );
st_finalized = TRUE;
+
+ g_free( klass->private );
}
}
diff --git a/src/nact/nact-iactions-list.c b/src/nact/nact-iactions-list.c
index 5259fd2..66e19c9 100644
--- a/src/nact/nact-iactions-list.c
+++ b/src/nact/nact-iactions-list.c
@@ -149,6 +149,7 @@ interface_base_init( NactIActionsListInterface *klass )
static const gchar *thisfn = "nact_iactions_list_interface_base_init";
if( !st_iactions_list_initialized ){
+
g_debug( "%s: klass=%p", thisfn, ( void * ) klass );
klass->private = g_new0( NactIActionsListInterfacePrivate, 1 );
@@ -311,12 +312,13 @@ interface_base_finalize( NactIActionsListInterface *klass )
{
static const gchar *thisfn = "nact_iactions_list_interface_base_finalize";
- if( !st_iactions_list_finalized ){
- g_debug( "%s: klass=%p", thisfn, ( void * ) klass );
+ if( st_iactions_list_initialized && !st_iactions_list_finalized ){
- g_free( klass->private );
+ g_debug( "%s: klass=%p", thisfn, ( void * ) klass );
st_iactions_list_finalized = TRUE;
+
+ g_free( klass->private );
}
}
diff --git a/src/nact/nact-iactions-list.h b/src/nact/nact-iactions-list.h
index caa179d..4a7bbae 100644
--- a/src/nact/nact-iactions-list.h
+++ b/src/nact/nact-iactions-list.h
@@ -52,7 +52,7 @@
#include <gtk/gtk.h>
-#include <private/na-object-item-class.h>
+#include <api/na-object-item.h>
G_BEGIN_DECLS
diff --git a/src/nact/nact-iadvanced-tab.c b/src/nact/nact-iadvanced-tab.c
index 70f4ba8..97c831e 100644
--- a/src/nact/nact-iadvanced-tab.c
+++ b/src/nact/nact-iadvanced-tab.c
@@ -119,13 +119,13 @@ interface_base_finalize( NactIAdvancedTabInterface *klass )
{
static const gchar *thisfn = "nact_iadvanced_tab_interface_base_finalize";
- if( !st_finalized ){
+ if( st_initialized && !st_finalized ){
g_debug( "%s: klass=%p", thisfn, ( void * ) klass );
- g_free( klass->private );
-
st_finalized = TRUE;
+
+ g_free( klass->private );
}
}
diff --git a/src/nact/nact-ibackground-tab.c b/src/nact/nact-ibackground-tab.c
index 99e6fe2..fd4bafe 100644
--- a/src/nact/nact-ibackground-tab.c
+++ b/src/nact/nact-ibackground-tab.c
@@ -139,6 +139,7 @@ interface_base_init( NactIBackgroundTabInterface *klass )
static const gchar *thisfn = "nact_ibackground_tab_interface_base_init";
if( !st_initialized ){
+
g_debug( "%s: klass=%p", thisfn, ( void * ) klass );
klass->private = g_new0( NactIBackgroundTabInterfacePrivate, 1 );
@@ -152,12 +153,13 @@ interface_base_finalize( NactIBackgroundTabInterface *klass )
{
static const gchar *thisfn = "nact_ibackground_tab_interface_base_finalize";
- if( !st_finalized ){
- g_debug( "%s: klass=%p", thisfn, ( void * ) klass );
+ if( st_initialized && !st_finalized ){
- g_free( klass->private );
+ g_debug( "%s: klass=%p", thisfn, ( void * ) klass );
st_finalized = TRUE;
+
+ g_free( klass->private );
}
}
diff --git a/src/nact/nact-icommand-tab.c b/src/nact/nact-icommand-tab.c
index b6f1fa6..36ff825 100644
--- a/src/nact/nact-icommand-tab.c
+++ b/src/nact/nact-icommand-tab.c
@@ -144,6 +144,7 @@ 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 );
@@ -157,12 +158,13 @@ interface_base_finalize( NactICommandTabInterface *klass )
{
static const gchar *thisfn = "nact_icommand_tab_interface_base_finalize";
- if( !st_finalized ){
- g_debug( "%s: klass=%p", thisfn, ( void * ) klass );
+ if( st_initialized && !st_finalized ){
- g_free( klass->private );
+ g_debug( "%s: klass=%p", thisfn, ( void * ) klass );
st_finalized = TRUE;
+
+ g_free( klass->private );
}
}
diff --git a/src/nact/nact-iconditions-tab.c b/src/nact/nact-iconditions-tab.c
index 73cb30c..7f12d96 100644
--- a/src/nact/nact-iconditions-tab.c
+++ b/src/nact/nact-iconditions-tab.c
@@ -122,6 +122,7 @@ interface_base_init( NactIConditionsTabInterface *klass )
static const gchar *thisfn = "nact_iconditions_tab_interface_base_init";
if( !st_initialized ){
+
g_debug( "%s: klass=%p", thisfn, ( void * ) klass );
klass->private = g_new0( NactIConditionsTabInterfacePrivate, 1 );
@@ -135,12 +136,13 @@ interface_base_finalize( NactIConditionsTabInterface *klass )
{
static const gchar *thisfn = "nact_iconditions_tab_interface_base_finalize";
- if( !st_finalized ){
- g_debug( "%s: klass=%p", thisfn, ( void * ) klass );
+ if( st_initialized && !st_finalized ){
- g_free( klass->private );
+ g_debug( "%s: klass=%p", thisfn, ( void * ) klass );
st_finalized = TRUE;
+
+ g_free( klass->private );
}
}
diff --git a/src/nact/nact-main-window.h b/src/nact/nact-main-window.h
index ae8a473..2a7ee5b 100644
--- a/src/nact/nact-main-window.h
+++ b/src/nact/nact-main-window.h
@@ -39,7 +39,7 @@
* This class is derived from BaseWindow and manages the main window.
*/
-#include <private/na-object-action-class.h>
+#include <api/na-object-item.h>
#include "nact-clipboard.h"
#include "nact-window.h"
diff --git a/src/nact/nact-preferences-editor.c b/src/nact/nact-preferences-editor.c
index bb35b84..8e616c5 100644
--- a/src/nact/nact-preferences-editor.c
+++ b/src/nact/nact-preferences-editor.c
@@ -183,11 +183,11 @@ instance_dispose( GObject *dialog )
if( !self->private->dispose_has_run ){
+ self->private->dispose_has_run = TRUE;
+
nact_schemes_list_dispose( BASE_WINDOW( self ));
nact_providers_list_dispose( BASE_WINDOW( self ));
- self->private->dispose_has_run = TRUE;
-
/* chain up to the parent class */
if( G_OBJECT_CLASS( st_parent_class )->dispose ){
G_OBJECT_CLASS( st_parent_class )->dispose( dialog );
diff --git a/src/nact/nact-window.h b/src/nact/nact-window.h
index 62e8d57..32a6972 100644
--- a/src/nact/nact-window.h
+++ b/src/nact/nact-window.h
@@ -40,9 +40,9 @@
* It is a common base class for all Nautilus Actions window documents.
*/
-#include <private/na-object-item-class.h>
+#include <api/na-object-item.h>
-#include <runtime/na-pivot.h>
+#include <core/na-updater.h>
#include "base-window.h"
@@ -55,7 +55,7 @@ G_BEGIN_DECLS
#define NACT_IS_WINDOW_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NACT_WINDOW_TYPE ))
#define NACT_WINDOW_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NACT_WINDOW_TYPE, NactWindowClass ))
-typedef struct NactWindowPrivate NactWindowPrivate;
+typedef struct NactWindowPrivate NactWindowPrivate;
typedef struct {
BaseWindow parent;
@@ -71,18 +71,18 @@ typedef struct {
}
NactWindowClass;
-GType nact_window_get_type( void );
+GType nact_window_get_type( void );
-NAPivot *nact_window_get_pivot( NactWindow *window );
+NAUpdater *nact_window_get_updater( NactWindow *window );
-gboolean nact_window_has_writable_providers( NactWindow *window );
+gboolean nact_window_has_writable_providers( NactWindow *window );
-gboolean nact_window_save_item( NactWindow *window, NAObjectItem *item );
-gboolean nact_window_delete_item( NactWindow *window, const NAObjectItem *item );
+gboolean nact_window_save_item ( NactWindow *window, NAObjectItem *item );
+gboolean nact_window_delete_item( NactWindow *window, const NAObjectItem *item );
-void nact_window_count_level_zero_items( GList *items, guint *actions, guint *profiles, guint *menus );
+void nact_window_count_level_zero_items( GList *items, guint *actions, guint *profiles, guint *menus );
-gboolean nact_window_warn_modified( NactWindow *window );
+gboolean nact_window_warn_modified( NactWindow *window );
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]