[nautilus-actions] Define NactIMenuItem and NactIActionConditions interfaces



commit 19cf832e8fa04e525983b73f91b1973801a3bbf0
Author: Pierre Wieser <pwieser trychlos org>
Date:   Fri Jun 26 23:11:24 2009 +0200

    Define NactIMenuItem and NactIActionConditions interfaces

 ChangeLog                          |   17 ++++-
 src/common/na-ipivot-container.c   |  140 ++++++++++++++++++++++++++++++++++++
 src/common/na-ipivot-container.h   |   70 ++++++++++++++++++
 src/nact/Makefile.am               |    4 +
 src/nact/nact-action-profile.c     |   38 ++++++++++
 src/nact/nact-iaction-conditions.c |  114 +++++++++++++++++++++++++++++
 src/nact/nact-iaction-conditions.h |   69 ++++++++++++++++++
 src/nact/nact-imenu-item.c         |  114 +++++++++++++++++++++++++++++
 src/nact/nact-imenu-item.h         |   69 ++++++++++++++++++
 src/nact/nact-main-window.c        |    4 +-
 10 files changed, 633 insertions(+), 6 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 49c8946..0599318 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
 
 	Migration to GtkBuilder.
 	IPivotContainer interface definition.
+	IActionConditions and IMenuItem UI interface definitions.
 
 	* configure.ac:
 	Update Gtk+ dependancy to 2.12 to have gtk_builder functions.
@@ -51,19 +52,29 @@
 
 	* src/nact/nact-main-window.c:
 	* src/nact/nact-main-window.h:
+	New files.
+	Implement NAIPivotContainer interface.
+
 	* src/nact/nact-action-profile.c:
-	* src/nact/nact-action-profile.h: New files.
+	* src/nact/nact-action-profile.h:
+	New files.
+	Implement NactIMenuItem and NactIActionConditions interfaces.
 
 	* src/nact/nact-main-window.c:
 	Implements NAIPivotContainer interface.
 
-	* src/nact/Makefile.am: Updated accordingly.
-
 	* src/nact/base-window.c:
 	* src/nact/base-window.h:
 	Remove libglade stuff.
 	Create the structure for derived windows/dialogs.
 
+	* src/nact/iaction-conditions.c:
+	* src/nact/iaction-conditions.h:
+	* src/nact/imenu-item.c:
+	* src/nact/imenu-item.h: New interface files.
+
+	* src/nact/Makefile.am: Updated accordingly.
+
 	* src/plugin/nautilus-actions.c:
 	Implements NAIPivotContainer interface.
 
diff --git a/src/common/na-ipivot-container.c b/src/common/na-ipivot-container.c
new file mode 100644
index 0000000..8b323ca
--- /dev/null
+++ b/src/common/na-ipivot-container.c
@@ -0,0 +1,140 @@
+/*
+ * Nautilus Actions
+ * A Nautilus extension which offers configurable context menu actions.
+ *
+ * Copyright (C) 2005 The GNOME Foundation
+ * Copyright (C) 2006, 2007, 2008 Frederic Ruaudel and others (see AUTHORS)
+ * Copyright (C) 2009 Pierre Wieser and others (see AUTHORS)
+ *
+ * This Program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this Library; see the file COPYING.  If not,
+ * write to the Free Software Foundation, Inc., 59 Temple Place,
+ * Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Authors:
+ *   Frederic Ruaudel <grumz grumz net>
+ *   Rodrigo Moya <rodrigo gnome-db org>
+ *   Pierre Wieser <pwieser trychlos org>
+ *   ... and many others (see AUTHORS)
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <glib.h>
+
+#include "na-ipivot-container.h"
+
+/* private interface data
+ */
+struct NAIPivotContainerInterfacePrivate {
+};
+
+static GType register_type( void );
+static void  interface_base_init( NAIPivotContainerInterface *klass );
+static void  interface_base_finalize( NAIPivotContainerInterface *klass );
+
+/*static void  do_actions_changed( NAIPivotContainer *instance, gpointer user_data );*/
+
+/**
+ * Registers the GType of this interface.
+ */
+GType
+na_ipivot_container_get_type( void )
+{
+	static GType object_type = 0;
+
+	if( !object_type ){
+		object_type = register_type();
+	}
+
+	return( object_type );
+}
+
+static GType
+register_type( void )
+{
+	static const gchar *thisfn = "na_ipivot_container_register_type";
+	g_debug( "%s", thisfn );
+
+	static const GTypeInfo info = {
+		sizeof( NAIPivotContainerInterface ),
+		( GBaseInitFunc ) interface_base_init,
+		( GBaseFinalizeFunc ) interface_base_finalize,
+		NULL,
+		NULL,
+		NULL,
+		0,
+		0,
+		NULL
+	};
+
+	GType type = g_type_register_static( G_TYPE_INTERFACE, "NAIPivotContainer", &info, 0 );
+
+	g_type_interface_add_prerequisite( type, G_TYPE_OBJECT );
+
+	return( type );
+}
+
+static void
+interface_base_init( NAIPivotContainerInterface *klass )
+{
+	static const gchar *thisfn = "na_ipivot_container_interface_base_init";
+	static gboolean initialized = FALSE;
+
+	if( !initialized ){
+		g_debug( "%s: klass=%p", thisfn, klass );
+
+		klass->private = g_new0( NAIPivotContainerInterfacePrivate, 1 );
+
+		klass->on_actions_changed = NULL /*do_actions_changed*/;
+
+		initialized = TRUE;
+	}
+}
+
+static void
+interface_base_finalize( NAIPivotContainerInterface *klass )
+{
+	static const gchar *thisfn = "na_ipivot_container_interface_base_finalize";
+	static gboolean finalized = FALSE ;
+
+	if( !finalized ){
+		g_debug( "%s: klass=%p", thisfn, klass );
+
+		g_free( klass->private );
+
+		finalized = TRUE;
+	}
+}
+
+/**
+ * Notify the container that the actions have been modified.
+ */
+void na_ipivot_container_notify( NAIPivotContainer *instance )
+{
+	static const gchar *thisfn = "na_ipivot_container_notify";
+	g_debug( "%s: instance=%p", thisfn, instance );
+
+	if( NA_IPIVOT_CONTAINER_GET_INTERFACE( instance )->on_actions_changed ){
+		NA_IPIVOT_CONTAINER_GET_INTERFACE( instance )->on_actions_changed( instance, NULL );
+	}
+}
+
+/*static void
+do_actions_changed( NAIPivotContainer *instance, gpointer user_data )
+{
+	static const gchar *thisfn = "na_ipivot_container_do_actions_changed";
+	g_debug( "%s: instance=%p, user_data=%p", thisfn, instance, user_data );
+}*/
diff --git a/src/common/na-ipivot-container.h b/src/common/na-ipivot-container.h
new file mode 100644
index 0000000..308efe9
--- /dev/null
+++ b/src/common/na-ipivot-container.h
@@ -0,0 +1,70 @@
+/*
+ * Nautilus Actions
+ * A Nautilus extension which offers configurable context menu actions.
+ *
+ * Copyright (C) 2005 The GNOME Foundation
+ * Copyright (C) 2006, 2007, 2008 Frederic Ruaudel and others (see AUTHORS)
+ * Copyright (C) 2009 Pierre Wieser and others (see AUTHORS)
+ *
+ * This Program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this Library; see the file COPYING.  If not,
+ * write to the Free Software Foundation, Inc., 59 Temple Place,
+ * Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Authors:
+ *   Frederic Ruaudel <grumz grumz net>
+ *   Rodrigo Moya <rodrigo gnome-db org>
+ *   Pierre Wieser <pwieser trychlos org>
+ *   ... and many others (see AUTHORS)
+ */
+
+#ifndef __NA_IPIVOT_CONTAINER_H__
+#define __NA_IPIVOT_CONTAINER_H__
+
+/*
+ * NAIPivotContainer interface definition.
+ *
+ * This interface should be implemented by all classes which embed a
+ * NAPivot object, in order to receive modification notification
+ * messages.
+ */
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define NA_IPIVOT_CONTAINER_TYPE						( na_ipivot_container_get_type())
+#define NA_IPIVOT_CONTAINER( object )					( G_TYPE_CHECK_INSTANCE_CAST( object, NA_IPIVOT_CONTAINER_TYPE, NAIPivotContainer ))
+#define NA_IS_IPIVOT_CONTAINER( object )				( G_TYPE_CHECK_INSTANCE_TYPE( object, NA_IPIVOT_CONTAINER_TYPE ))
+#define NA_IPIVOT_CONTAINER_GET_INTERFACE( instance )	( G_TYPE_INSTANCE_GET_INTERFACE(( instance ), NA_IPIVOT_CONTAINER_TYPE, NAIPivotContainerInterface ))
+
+typedef struct NAIPivotContainer NAIPivotContainer;
+
+typedef struct NAIPivotContainerInterfacePrivate NAIPivotContainerInterfacePrivate;
+
+typedef struct {
+	GTypeInterface                     parent;
+	NAIPivotContainerInterfacePrivate *private;
+
+	/* api */
+	void ( *on_actions_changed )( NAIPivotContainer *instance, gpointer user_data );
+}
+	NAIPivotContainerInterface;
+
+GType na_ipivot_container_get_type( void );
+
+void  na_ipivot_container_notify( NAIPivotContainer *instance );
+
+G_END_DECLS
+
+#endif /* __NA_IPIVOT_CONTAINER_H__ */
diff --git a/src/nact/Makefile.am b/src/nact/Makefile.am
index 22e4b02..51815ff 100644
--- a/src/nact/Makefile.am
+++ b/src/nact/Makefile.am
@@ -48,8 +48,12 @@ nautilus_actions_config_SOURCES = \
 	nact-action-profile.h								\
 	nact-application.c									\
 	nact-application.h									\
+	nact-iaction-conditions.c							\
+	nact-iaction-conditions.h							\
 	nact-iactions-list.c								\
 	nact-iactions-list.h								\
+	nact-imenu-item.c									\
+	nact-imenu-item.h									\
 	nact-main.c											\
 	nact-main-window.c									\
 	nact-main-window.h									\
diff --git a/src/nact/nact-action-profile.c b/src/nact/nact-action-profile.c
index f8701fc..adc5720 100644
--- a/src/nact/nact-action-profile.c
+++ b/src/nact/nact-action-profile.c
@@ -36,6 +36,8 @@
 
 #include "nact-application.h"
 #include "nact-action-profile.h"
+#include "nact-iaction-conditions.h"
+#include "nact-imenu-item.h"
 #include "nact-main-window.h"
 
 /* private class data
@@ -54,6 +56,8 @@ static GObjectClass *st_parent_class = NULL;
 
 static GType  register_type( void );
 static void   class_init( NactActionProfileClass *klass );
+static void   imenu_item_iface_init( NactIMenuItemInterface *iface );
+static void   iaction_conditions_iface_init( NactIActionConditionsInterface *iface );
 static void   instance_init( GTypeInstance *instance, gpointer klass );
 static void   instance_dispose( GObject *dialog );
 static void   instance_finalize( GObject *dialog );
@@ -96,6 +100,26 @@ register_type( void )
 
 	GType type = g_type_register_static( NACT_WINDOW_TYPE, "NactActionProfile", &info, 0 );
 
+	/* implement IMenuItem interface
+	 */
+	static const GInterfaceInfo imenu_item_iface_info = {
+		( GInterfaceInitFunc ) imenu_item_iface_init,
+		NULL,
+		NULL
+	};
+
+	g_type_add_interface_static( type, NACT_IMENU_ITEM_TYPE, &imenu_item_iface_info );
+
+	/* implement IActionConditions interface
+	 */
+	static const GInterfaceInfo iaction_conditions_iface_info = {
+		( GInterfaceInitFunc ) iaction_conditions_iface_init,
+		NULL,
+		NULL
+	};
+
+	g_type_add_interface_static( type, NACT_IACTION_CONDITIONS_TYPE, &iaction_conditions_iface_info );
+
 	return( type );
 }
 
@@ -122,6 +146,20 @@ class_init( NactActionProfileClass *klass )
 }
 
 static void
+imenu_item_iface_init( NactIMenuItemInterface *iface )
+{
+	static const gchar *thisfn = "nact_action_profile_imenu_item_iface_init";
+	g_debug( "%s: iface=%p", thisfn, iface );
+}
+
+static void
+iaction_conditions_iface_init( NactIActionConditionsInterface *iface )
+{
+	static const gchar *thisfn = "nact_action_profile_iaction_conditions_iface_init";
+	g_debug( "%s: iface=%p", thisfn, iface );
+}
+
+static void
 instance_init( GTypeInstance *instance, gpointer klass )
 {
 	static const gchar *thisfn = "nact_action_profile_instance_init";
diff --git a/src/nact/nact-iaction-conditions.c b/src/nact/nact-iaction-conditions.c
new file mode 100644
index 0000000..245c1a6
--- /dev/null
+++ b/src/nact/nact-iaction-conditions.c
@@ -0,0 +1,114 @@
+/*
+ * Nautilus Actions
+ * A Nautilus extension which offers configurable context menu actions.
+ *
+ * Copyright (C) 2005 The GNOME Foundation
+ * Copyright (C) 2006, 2007, 2008 Frederic Ruaudel and others (see AUTHORS)
+ * Copyright (C) 2009 Pierre Wieser and others (see AUTHORS)
+ *
+ * This Program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this Library; see the file COPYING.  If not,
+ * write to the Free Software Foundation, Inc., 59 Temple Place,
+ * Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Authors:
+ *   Frederic Ruaudel <grumz grumz net>
+ *   Rodrigo Moya <rodrigo gnome-db org>
+ *   Pierre Wieser <pwieser trychlos org>
+ *   ... and many others (see AUTHORS)
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <common/na-action.h>
+#include <common/na-action-profile.h>
+
+#include "nact-iaction-conditions.h"
+
+/* private interface data
+ */
+struct NactIActionConditionsInterfacePrivate {
+};
+
+static GType      register_type( void );
+static void       interface_base_init( NactIActionConditionsInterface *klass );
+static void       interface_base_finalize( NactIActionConditionsInterface *klass );
+
+GType
+nact_iaction_conditions_get_type( void )
+{
+	static GType iface_type = 0;
+
+	if( !iface_type ){
+		iface_type = register_type();
+	}
+
+	return( iface_type );
+}
+
+static GType
+register_type( void )
+{
+	static const gchar *thisfn = "nact_iaction_conditions_register_type";
+	g_debug( "%s", thisfn );
+
+	static const GTypeInfo info = {
+		sizeof( NactIActionConditionsInterface ),
+		( GBaseInitFunc ) interface_base_init,
+		( GBaseFinalizeFunc ) interface_base_finalize,
+		NULL,
+		NULL,
+		NULL,
+		0,
+		0,
+		NULL
+	};
+
+	GType type = g_type_register_static( G_TYPE_INTERFACE, "NactIActionConditions", &info, 0 );
+
+	g_type_interface_add_prerequisite( type, G_TYPE_OBJECT );
+
+	return( type );
+}
+
+static void
+interface_base_init( NactIActionConditionsInterface *klass )
+{
+	static const gchar *thisfn = "nact_iaction_conditions_interface_base_init";
+	static gboolean initialized = FALSE;
+
+	if( !initialized ){
+		g_debug( "%s: klass=%p", thisfn, klass );
+
+		klass->private = g_new0( NactIActionConditionsInterfacePrivate, 1 );
+
+		initialized = TRUE;
+	}
+}
+
+static void
+interface_base_finalize( NactIActionConditionsInterface *klass )
+{
+	static const gchar *thisfn = "nact_iaction_conditions_interface_base_finalize";
+	static gboolean finalized = FALSE ;
+
+	if( !finalized ){
+		g_debug( "%s: klass=%p", thisfn, klass );
+
+		g_free( klass->private );
+
+		finalized = TRUE;
+	}
+}
diff --git a/src/nact/nact-iaction-conditions.h b/src/nact/nact-iaction-conditions.h
new file mode 100644
index 0000000..224bc9b
--- /dev/null
+++ b/src/nact/nact-iaction-conditions.h
@@ -0,0 +1,69 @@
+/*
+ * Nautilus Actions
+ * A Nautilus extension which offers configurable context menu actions.
+ *
+ * Copyright (C) 2005 The GNOME Foundation
+ * Copyright (C) 2006, 2007, 2008 Frederic Ruaudel and others (see AUTHORS)
+ * Copyright (C) 2009 Pierre Wieser and others (see AUTHORS)
+ *
+ * This Program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this Library; see the file COPYING.  If not,
+ * write to the Free Software Foundation, Inc., 59 Temple Place,
+ * Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Authors:
+ *   Frederic Ruaudel <grumz grumz net>
+ *   Rodrigo Moya <rodrigo gnome-db org>
+ *   Pierre Wieser <pwieser trychlos org>
+ *   ... and many others (see AUTHORS)
+ */
+
+#ifndef __NACT_IACTION_CONDITIONS_H__
+#define __NACT_IACTION_CONDITIONS_H__
+
+/*
+ * NactIActionConditions interface definition.
+ *
+ * This interface defines some API against the ActionsList listbox.
+ * Our NactWindow may implement it in order to personalize the
+ * behaviour of the listbox.
+ */
+
+#include <gtk/gtk.h>
+
+#include "nact-window.h"
+
+G_BEGIN_DECLS
+
+#define NACT_IACTION_CONDITIONS_TYPE						( nact_iaction_conditions_get_type())
+#define NACT_IACTION_CONDITIONS( object )					( G_TYPE_CHECK_INSTANCE_CAST( object, NACT_IACTION_CONDITIONS_TYPE, NactIActionConditions ))
+#define NACT_IS_IACTION_CONDITIONS( object )				( G_TYPE_CHECK_INSTANCE_TYPE( object, NACT_IACTION_CONDITIONS_TYPE ))
+#define NACT_IACTION_CONDITIONS_GET_INTERFACE( instance )	( G_TYPE_INSTANCE_GET_INTERFACE(( instance ), NACT_IACTION_CONDITIONS_TYPE, NactIActionConditionsInterface ))
+
+typedef struct NactIActionConditions NactIActionConditions;
+
+typedef struct NactIActionConditionsInterfacePrivate NactIActionConditionsInterfacePrivate;
+
+typedef struct {
+	GTypeInterface                         parent;
+	NactIActionConditionsInterfacePrivate *private;
+
+	/* api */
+}
+	NactIActionConditionsInterface;
+
+GType nact_iaction_conditions_get_type( void );
+
+G_END_DECLS
+
+#endif /* __NACT_IACTION_CONDITIONS_H__ */
diff --git a/src/nact/nact-imenu-item.c b/src/nact/nact-imenu-item.c
new file mode 100644
index 0000000..533a8ef
--- /dev/null
+++ b/src/nact/nact-imenu-item.c
@@ -0,0 +1,114 @@
+/*
+ * Nautilus Actions
+ * A Nautilus extension which offers configurable context menu actions.
+ *
+ * Copyright (C) 2005 The GNOME Foundation
+ * Copyright (C) 2006, 2007, 2008 Frederic Ruaudel and others (see AUTHORS)
+ * Copyright (C) 2009 Pierre Wieser and others (see AUTHORS)
+ *
+ * This Program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this Library; see the file COPYING.  If not,
+ * write to the Free Software Foundation, Inc., 59 Temple Place,
+ * Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Authors:
+ *   Frederic Ruaudel <grumz grumz net>
+ *   Rodrigo Moya <rodrigo gnome-db org>
+ *   Pierre Wieser <pwieser trychlos org>
+ *   ... and many others (see AUTHORS)
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <common/na-action.h>
+#include <common/na-action-profile.h>
+
+#include "nact-imenu-item.h"
+
+/* private interface data
+ */
+struct NactIMenuItemInterfacePrivate {
+};
+
+static GType      register_type( void );
+static void       interface_base_init( NactIMenuItemInterface *klass );
+static void       interface_base_finalize( NactIMenuItemInterface *klass );
+
+GType
+nact_imenu_item_get_type( void )
+{
+	static GType iface_type = 0;
+
+	if( !iface_type ){
+		iface_type = register_type();
+	}
+
+	return( iface_type );
+}
+
+static GType
+register_type( void )
+{
+	static const gchar *thisfn = "nact_imenu_item_register_type";
+	g_debug( "%s", thisfn );
+
+	static const GTypeInfo info = {
+		sizeof( NactIMenuItemInterface ),
+		( GBaseInitFunc ) interface_base_init,
+		( GBaseFinalizeFunc ) interface_base_finalize,
+		NULL,
+		NULL,
+		NULL,
+		0,
+		0,
+		NULL
+	};
+
+	GType type = g_type_register_static( G_TYPE_INTERFACE, "NactIMenuItem", &info, 0 );
+
+	g_type_interface_add_prerequisite( type, G_TYPE_OBJECT );
+
+	return( type );
+}
+
+static void
+interface_base_init( NactIMenuItemInterface *klass )
+{
+	static const gchar *thisfn = "nact_imenu_item_interface_base_init";
+	static gboolean initialized = FALSE;
+
+	if( !initialized ){
+		g_debug( "%s: klass=%p", thisfn, klass );
+
+		klass->private = g_new0( NactIMenuItemInterfacePrivate, 1 );
+
+		initialized = TRUE;
+	}
+}
+
+static void
+interface_base_finalize( NactIMenuItemInterface *klass )
+{
+	static const gchar *thisfn = "nact_imenu_item_interface_base_finalize";
+	static gboolean finalized = FALSE ;
+
+	if( !finalized ){
+		g_debug( "%s: klass=%p", thisfn, klass );
+
+		g_free( klass->private );
+
+		finalized = TRUE;
+	}
+}
diff --git a/src/nact/nact-imenu-item.h b/src/nact/nact-imenu-item.h
new file mode 100644
index 0000000..89955dd
--- /dev/null
+++ b/src/nact/nact-imenu-item.h
@@ -0,0 +1,69 @@
+/*
+ * Nautilus Actions
+ * A Nautilus extension which offers configurable context menu actions.
+ *
+ * Copyright (C) 2005 The GNOME Foundation
+ * Copyright (C) 2006, 2007, 2008 Frederic Ruaudel and others (see AUTHORS)
+ * Copyright (C) 2009 Pierre Wieser and others (see AUTHORS)
+ *
+ * This Program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this Library; see the file COPYING.  If not,
+ * write to the Free Software Foundation, Inc., 59 Temple Place,
+ * Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Authors:
+ *   Frederic Ruaudel <grumz grumz net>
+ *   Rodrigo Moya <rodrigo gnome-db org>
+ *   Pierre Wieser <pwieser trychlos org>
+ *   ... and many others (see AUTHORS)
+ */
+
+#ifndef __NACT_IMENU_ITEM_H__
+#define __NACT_IMENU_ITEM_H__
+
+/*
+ * NactIMenuItem interface definition.
+ *
+ * This interface defines some API against the ActionsList listbox.
+ * Our NactWindow may implement it in order to personalize the
+ * behaviour of the listbox.
+ */
+
+#include <gtk/gtk.h>
+
+#include "nact-window.h"
+
+G_BEGIN_DECLS
+
+#define NACT_IMENU_ITEM_TYPE						( nact_imenu_item_get_type())
+#define NACT_IMENU_ITEM( object )					( G_TYPE_CHECK_INSTANCE_CAST( object, NACT_IMENU_ITEM_TYPE, NactIMenuItem ))
+#define NACT_IS_IMENU_ITEM( object )				( G_TYPE_CHECK_INSTANCE_TYPE( object, NACT_IMENU_ITEM_TYPE ))
+#define NACT_IMENU_ITEM_GET_INTERFACE( instance )	( G_TYPE_INSTANCE_GET_INTERFACE(( instance ), NACT_IMENU_ITEM_TYPE, NactIMenuItemInterface ))
+
+typedef struct NactIMenuItem NactIMenuItem;
+
+typedef struct NactIMenuItemInterfacePrivate NactIMenuItemInterfacePrivate;
+
+typedef struct {
+	GTypeInterface                 parent;
+	NactIMenuItemInterfacePrivate *private;
+
+	/* api */
+}
+	NactIMenuItemInterface;
+
+GType nact_imenu_item_get_type( void );
+
+G_END_DECLS
+
+#endif /* __NACT_IMENU_ITEM_H__ */
diff --git a/src/nact/nact-main-window.c b/src/nact/nact-main-window.c
index f3e1b49..67c3aa6 100644
--- a/src/nact/nact-main-window.c
+++ b/src/nact/nact-main-window.c
@@ -382,9 +382,7 @@ on_add_button_clicked( GtkButton *button, gpointer user_data )
 	/* TODO: set the selection to the newly created action
 	 * or restore the previous selection
 	 */
-	if( nact_action_profile_run_editor( wndmain, NULL )){
-		nact_iactions_list_fill( wndmain );
-	}
+	nact_action_profile_run_editor( wndmain, NULL );
 }
 
 /*



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