Commit 653e0c2c authored by Pierre Wieser's avatar Pierre Wieser

NactTreeModel class is renamed to FMATreeModel

parent 7abfef4b
......@@ -134,10 +134,10 @@ fma_config_tool_SOURCES = \
fma-status-bar.h \
fma-tree-ieditable.c \
fma-tree-ieditable.h \
nact-tree-model.c \
nact-tree-model.h \
nact-tree-model-priv.h \
nact-tree-model-dnd.c \
fma-tree-model.c \
fma-tree-model.h \
fma-tree-model-priv.h \
fma-tree-model-dnd.c \
nact-tree-view.c \
nact-tree-view.h \
$(BUILT_SOURCES) \
......
......@@ -42,7 +42,7 @@
#include "fma-application.h"
#include "fma-export-ask.h"
#include "fma-main-window.h"
#include "nact-tree-model.h"
#include "fma-tree-model.h"
#include "fma-clipboard.h"
/* private class data
......
......@@ -1008,7 +1008,7 @@ on_instance_finalized( MatchListData *data, BaseWindow *window )
g_object_set_data( G_OBJECT( window ), data->tab_name, NULL );
/* This function is called when the FMAMainWindow is about to be finalized.
* At this time, the NactTreeModel has already been finalized.
* At this time, the FMATreeModel has already been finalized.
* It is so too late to try to clear it...
*/
#if 0
......
......@@ -41,7 +41,7 @@
#include "fma-application.h"
#include "fma-main-window.h"
#include "fma-tree-ieditable.h"
#include "nact-tree-model.h"
#include "fma-tree-model.h"
#include "nact-tree-view.h"
/* private interface data
......@@ -56,7 +56,7 @@ typedef struct {
FMAUpdater *updater;
FMAMainWindow *main_window;
GtkTreeView *treeview;
NactTreeModel *model;
FMATreeModel *model;
gulong modified_handler_id;
gulong valid_handler_id;
guint count_modified;
......@@ -188,7 +188,7 @@ fma_tree_ieditable_initialize( FMATreeIEditable *instance, GtkTreeView *treeview
ied = get_instance_data( instance );
ied->main_window = main_window;
ied->treeview = treeview;
ied->model = NACT_TREE_MODEL( gtk_tree_view_get_model( treeview ));
ied->model = FMA_TREE_MODEL( gtk_tree_view_get_model( treeview ));
application = gtk_window_get_application( GTK_WINDOW( main_window ));
g_return_if_fail( application && FMA_IS_APPLICATION( application ));
......@@ -286,7 +286,7 @@ on_label_edited( GtkCellRendererText *renderer, const gchar *path_str, const gch
if( nact_tree_view_are_notify_allowed( items_view )){
ied = ( IEditableData * ) g_object_get_data( G_OBJECT( items_view ), VIEW_DATA_IEDITABLE );
path = gtk_tree_path_new_from_string( path_str );
object = nact_tree_model_object_at_path( ied->model, path );
object = fma_tree_model_object_at_path( ied->model, path );
fma_object_set_label( object, text );
g_signal_emit_by_name( ied->main_window, MAIN_SIGNAL_ITEM_UPDATED, object );
......@@ -453,7 +453,7 @@ fma_tree_ieditable_delete( FMATreeIEditable *instance, GList *items, TreeIEditab
* so potentially update the modification status
*/
parent = fma_object_get_parent( it->data );
path = nact_tree_model_delete( ied->model, FMA_OBJECT( it->data ));
path = fma_tree_model_delete( ied->model, FMA_OBJECT( it->data ));
if( parent ){
fma_object_check_status( parent );
} else {
......@@ -666,11 +666,11 @@ fma_tree_ieditable_insert_items( FMATreeIEditable *instance, GList *items, FMAOb
ied = get_instance_data( instance );
if( sibling ){
insert_path = nact_tree_model_object_to_path( ied->model, sibling );
insert_path = fma_tree_model_object_to_path( ied->model, sibling );
} else {
insert_path = get_selection_first_path( ied->treeview );
object = nact_tree_model_object_at_path( ied->model, insert_path );
object = fma_tree_model_object_at_path( ied->model, insert_path );
g_debug( "%s: current object at insertion path is %p", thisfn, ( void * ) object );
/* as a particular case, insert a new profile _into_ current action
......@@ -686,7 +686,7 @@ fma_tree_ieditable_insert_items( FMATreeIEditable *instance, GList *items, FMAOb
if( FMA_IS_OBJECT_PROFILE( object ) && FMA_IS_OBJECT_ITEM( items->data )){
parent = ( FMAObject * ) fma_object_get_parent( object );
gtk_tree_path_free( insert_path );
insert_path = nact_tree_model_object_to_path( ied->model, parent );
insert_path = fma_tree_model_object_to_path( ied->model, parent );
}
}
......@@ -828,7 +828,7 @@ do_insert_before( IEditableData *ied, GList *items, GtkTreePath *asked_path )
} else {
path = gtk_tree_path_copy( asked_path );
}
actual_path = nact_tree_model_insert_before( ied->model, FMA_OBJECT( it->data ), path );
actual_path = fma_tree_model_insert_before( ied->model, FMA_OBJECT( it->data ), path );
gtk_tree_path_free( path );
g_debug( "%s: object=%p (%s, ref_count=%d)", thisfn,
( void * ) it->data, G_OBJECT_TYPE_NAME( it->data ), G_OBJECT( it->data )->ref_count );
......@@ -873,7 +873,7 @@ do_insert_into( IEditableData *ied, GList *items, GtkTreePath *asked_path )
/* insert the last child into the wished path
* and recursively all its children
*/
actual_path = nact_tree_model_insert_into( ied->model, FMA_OBJECT( last->data ), asked_path );
actual_path = fma_tree_model_insert_into( ied->model, FMA_OBJECT( last->data ), asked_path );
gtk_tree_view_expand_to_path( ied->treeview, actual_path );
if( FMA_IS_OBJECT_ITEM( last->data )){
......@@ -973,8 +973,8 @@ fma_tree_ieditable_set_items( FMATreeIEditable *instance, GList *items )
* only children of the old item are its own profiles, which are to be
* replaced with the profiles provided by the new item
*/
path = nact_tree_model_delete( ied->model, FMA_OBJECT( old_item ));
insert_path = nact_tree_model_insert_before( ied->model, FMA_OBJECT( new_item ), path );
path = fma_tree_model_delete( ied->model, FMA_OBJECT( old_item ));
insert_path = fma_tree_model_insert_before( ied->model, FMA_OBJECT( new_item ), path );
gtk_tree_path_free( path );
gtk_tree_path_free( insert_path );
......
......@@ -28,13 +28,13 @@
*/
/**
* SECTION: nact_tree_model
* @short_description: #NactTreeModel private data definition.
* @include: ui/nact-tree-model-priv.h
* SECTION: fma_tree_model
* @short_description: #FMATreeModel private data definition.
* @include: ui/fma-tree-model-priv.h
*/
#ifndef __UI_NACT_TREE_MODEL_PRIV_H__
#define __UI_NACT_TREE_MODEL_PRIV_H__
#ifndef __UI_FMA_TREE_MODEL_PRIV_H__
#define __UI_FMA_TREE_MODEL_PRIV_H__
#include "egg-tree-multi-dnd.h"
#include "fma-clipboard.h"
......@@ -43,7 +43,7 @@ G_BEGIN_DECLS
/* private instance data
*/
struct _NactTreeModelPrivate {
struct _FMATreeModelPrivate {
gboolean dispose_has_run;
/* data set at instanciation time
......@@ -54,8 +54,8 @@ struct _NactTreeModelPrivate {
/* must be initialized right after the instanciation
*/
FMAMainWindow *window;
FMAClipboard *clipboard;
FMAMainWindow *window;
FMAClipboard *clipboard;
guint mode;
/* runtime data
......@@ -65,22 +65,22 @@ struct _NactTreeModelPrivate {
gboolean drag_drop; /* defined for on_drag_motion handler */
};
#define TREE_MODEL_STATUSBAR_CONTEXT "nact-tree-model-statusbar-context"
#define TREE_MODEL_STATUSBAR_CONTEXT "fma-tree-model-statusbar-context"
gboolean nact_tree_model_dnd_idrag_dest_drag_data_received( GtkTreeDragDest *drag_dest, GtkTreePath *dest, GtkSelectionData *selection_data );
gboolean nact_tree_model_dnd_idrag_dest_row_drop_possible( GtkTreeDragDest *drag_dest, GtkTreePath *dest_path, GtkSelectionData *selection_data );
gboolean fma_tree_model_dnd_idrag_dest_drag_data_received( GtkTreeDragDest *drag_dest, GtkTreePath *dest, GtkSelectionData *selection_data );
gboolean fma_tree_model_dnd_idrag_dest_row_drop_possible( GtkTreeDragDest *drag_dest, GtkTreePath *dest_path, GtkSelectionData *selection_data );
gboolean nact_tree_model_dnd_imulti_drag_source_drag_data_get( EggTreeMultiDragSource *drag_source, GdkDragContext *context, GtkSelectionData *selection_data, GList *path_list, guint info );
gboolean nact_tree_model_dnd_imulti_drag_source_drag_data_delete( EggTreeMultiDragSource *drag_source, GList *path_list );
GdkDragAction nact_tree_model_dnd_imulti_drag_source_get_drag_actions( EggTreeMultiDragSource *drag_source );
GtkTargetList *nact_tree_model_dnd_imulti_drag_source_get_format_list( EggTreeMultiDragSource *drag_source );
gboolean nact_tree_model_dnd_imulti_drag_source_row_draggable( EggTreeMultiDragSource *drag_source, GList *path_list );
gboolean fma_tree_model_dnd_imulti_drag_source_drag_data_get( EggTreeMultiDragSource *drag_source, GdkDragContext *context, GtkSelectionData *selection_data, GList *path_list, guint info );
gboolean fma_tree_model_dnd_imulti_drag_source_drag_data_delete( EggTreeMultiDragSource *drag_source, GList *path_list );
GdkDragAction fma_tree_model_dnd_imulti_drag_source_get_drag_actions( EggTreeMultiDragSource *drag_source );
GtkTargetList *fma_tree_model_dnd_imulti_drag_source_get_format_list( EggTreeMultiDragSource *drag_source );
gboolean fma_tree_model_dnd_imulti_drag_source_row_draggable( EggTreeMultiDragSource *drag_source, GList *path_list );
void nact_tree_model_dnd_on_drag_begin( GtkWidget *widget, GdkDragContext *context, BaseWindow *window );
void fma_tree_model_dnd_on_drag_begin( GtkWidget *widget, GdkDragContext *context, BaseWindow *window );
/*gboolean on_drag_motion( GtkWidget *widget, GdkDragContext *context, gint x, gint y, guint time, BaseWindow *window );*/
/*gboolean on_drag_drop( GtkWidget *widget, GdkDragContext *context, gint x, gint y, guint time, BaseWindow *window );*/
void nact_tree_model_dnd_on_drag_end( GtkWidget *widget, GdkDragContext *context, BaseWindow *window );
void fma_tree_model_dnd_on_drag_end( GtkWidget *widget, GdkDragContext *context, BaseWindow *window );
G_END_DECLS
#endif /* __UI_NACT_TREE_MODEL_PRIV_H__ */
#endif /* __UI_FMA_TREE_MODEL_PRIV_H__ */
......@@ -28,21 +28,21 @@
*/
/**
* SECTION: nact_tree_model
* @short_description: #NactTreeModel class definition.
* @include: ui/nact-tree-model.h
* SECTION: fma_tree_model
* @short_description: #FMATreeModel class definition.
* @include: ui/fma-tree-model.h
*
* NactTreeModel is derived from GtkTreeModelFilter in order to be able
* FMATreeModel is derived from GtkTreeModelFilter in order to be able
* to selectively display profiles, whether an action has one or more
* profiles.
*
* NactTreeModel implements EggTreeMultiDragSource and GtkTreeDragDest
* FMATreeModel implements EggTreeMultiDragSource and GtkTreeDragDest
* interfaces.
*
* The GtkTreeModelFilter base class embeds a GtkTreeStore.
*/
#ifndef __UI_NACT_TREE_MODEL_H__
#define __UI_NACT_TREE_MODEL_H__
#ifndef __UI_FMA_TREE_MODEL_H__
#define __UI_FMA_TREE_MODEL_H__
#include "api/fma-object.h"
......@@ -50,27 +50,27 @@
G_BEGIN_DECLS
#define NACT_TYPE_TREE_MODEL ( nact_tree_model_get_type())
#define NACT_TREE_MODEL( object ) ( G_TYPE_CHECK_INSTANCE_CAST(( object ), NACT_TYPE_TREE_MODEL, NactTreeModel ))
#define NACT_TREE_MODEL_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST(( klass ), NACT_TYPE_TREE_MODEL, NactTreeModelClass ))
#define NACT_IS_TREE_MODEL( object ) ( G_TYPE_CHECK_INSTANCE_TYPE(( object ), NACT_TYPE_TREE_MODEL ))
#define NACT_IS_TREE_MODEL_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NACT_TYPE_TREE_MODEL ))
#define NACT_TREE_MODEL_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NACT_TYPE_TREE_MODEL, NactTreeModelClass ))
#define FMA_TYPE_TREE_MODEL ( fma_tree_model_get_type())
#define FMA_TREE_MODEL( object ) ( G_TYPE_CHECK_INSTANCE_CAST(( object ), FMA_TYPE_TREE_MODEL, FMATreeModel ))
#define FMA_TREE_MODEL_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST(( klass ), FMA_TYPE_TREE_MODEL, FMATreeModelClass ))
#define FMA_IS_TREE_MODEL( object ) ( G_TYPE_CHECK_INSTANCE_TYPE(( object ), FMA_TYPE_TREE_MODEL ))
#define FMA_IS_TREE_MODEL_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), FMA_TYPE_TREE_MODEL ))
#define FMA_TREE_MODEL_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), FMA_TYPE_TREE_MODEL, FMATreeModelClass ))
typedef struct _NactTreeModelPrivate NactTreeModelPrivate;
typedef struct _FMATreeModelPrivate FMATreeModelPrivate;
typedef struct {
/*< private >*/
GtkTreeModelFilter parent;
NactTreeModelPrivate *private;
FMATreeModelPrivate *private;
}
NactTreeModel;
FMATreeModel;
typedef struct {
/*< private >*/
GtkTreeModelFilterClass parent;
}
NactTreeModelClass;
FMATreeModelClass;
/**
* Column ordering in the tree view
......@@ -82,42 +82,42 @@ enum {
TREE_N_COLUMN
};
GType nact_tree_model_get_type ( void );
GType fma_tree_model_get_type ( void );
NactTreeModel *nact_tree_model_new ( GtkTreeView *treeview );
FMATreeModel *fma_tree_model_new ( GtkTreeView *treeview );
void nact_tree_model_set_main_window ( NactTreeModel *tmodel,
void fma_tree_model_set_main_window ( FMATreeModel *tmodel,
FMAMainWindow *main_window );
void nact_tree_model_set_edition_mode( NactTreeModel *tmodel,
void fma_tree_model_set_edition_mode( FMATreeModel *tmodel,
guint mode );
GtkTreePath *nact_tree_model_delete ( NactTreeModel *model,
GtkTreePath *fma_tree_model_delete ( FMATreeModel *model,
FMAObject *object );
void nact_tree_model_fill ( NactTreeModel *model,
void fma_tree_model_fill ( FMATreeModel *model,
GList *items );
GtkTreePath *nact_tree_model_insert_before ( NactTreeModel *model,
GtkTreePath *fma_tree_model_insert_before ( FMATreeModel *model,
const FMAObject *object,
GtkTreePath *path );
GtkTreePath *nact_tree_model_insert_into ( NactTreeModel *model,
GtkTreePath *fma_tree_model_insert_into ( FMATreeModel *model,
const FMAObject *object,
GtkTreePath *path );
FMAObjectItem *nact_tree_model_get_item_by_id ( const NactTreeModel *model,
FMAObjectItem *fma_tree_model_get_item_by_id ( const FMATreeModel *model,
const gchar *id );
GList *nact_tree_model_get_items ( const NactTreeModel *model,
GList *fma_tree_model_get_items ( const FMATreeModel *model,
guint mode );
FMAObject *nact_tree_model_object_at_path ( const NactTreeModel *model,
FMAObject *fma_tree_model_object_at_path ( const FMATreeModel *model,
GtkTreePath *path );
GtkTreePath *nact_tree_model_object_to_path ( const NactTreeModel *model,
GtkTreePath *fma_tree_model_object_to_path ( const FMATreeModel *model,
const FMAObject *object );
G_END_DECLS
#endif /* __UI_NACT_TREE_MODEL_H__ */
#endif /* __UI_FMA_TREE_MODEL_H__ */
......@@ -41,7 +41,7 @@
#include "fma-application.h"
#include "fma-main-window.h"
#include "nact-tree-view.h"
#include "nact-tree-model.h"
#include "fma-tree-model.h"
#include "fma-tree-ieditable.h"
/* private instance data
......@@ -475,7 +475,7 @@ initialize_gtk( NactTreeView *view )
static const gchar *thisfn = "nact_tree_view_initialize_gtk";
NactTreeViewPrivate *priv;
GtkWidget *scrolled, *tview;
NactTreeModel *model;
FMATreeModel *model;
GtkTreeViewColumn *column;
GtkCellRenderer *renderer;
GtkTreeSelection *selection;
......@@ -495,8 +495,8 @@ initialize_gtk( NactTreeView *view )
priv->tree_view = GTK_TREE_VIEW( tview );
gtk_tree_view_set_headers_visible( priv->tree_view, FALSE );
model = nact_tree_model_new( GTK_TREE_VIEW( tview ));
nact_tree_model_set_main_window( model, priv->window );
model = fma_tree_model_new( GTK_TREE_VIEW( tview ));
fma_tree_model_set_main_window( model, priv->window );
gtk_tree_view_set_model( GTK_TREE_VIEW( tview ), GTK_TREE_MODEL( model ));
g_object_unref( model );
......@@ -593,8 +593,8 @@ nact_tree_view_set_edition_mode( NactTreeView *view, guint mode )
}
tmodel = gtk_tree_view_get_model( priv->tree_view );
g_return_if_fail( tmodel && NACT_IS_TREE_MODEL( tmodel ));
nact_tree_model_set_edition_mode( NACT_TREE_MODEL( tmodel ), mode );
g_return_if_fail( tmodel && FMA_IS_TREE_MODEL( tmodel ));
fma_tree_model_set_edition_mode( FMA_TREE_MODEL( tmodel ), mode );
}
}
......@@ -734,7 +734,7 @@ void
nact_tree_view_fill( NactTreeView *view, GList *items )
{
static const gchar *thisfn = "nact_tree_view_fill";
NactTreeModel *model;
FMATreeModel *model;
gint nb_menus, nb_actions, nb_profiles;
g_return_if_fail( NACT_IS_TREE_VIEW( view ));
......@@ -745,9 +745,9 @@ nact_tree_view_fill( NactTreeView *view, GList *items )
clear_selection( view );
view->private->notify_allowed = FALSE;
model = NACT_TREE_MODEL( gtk_tree_view_get_model( view->private->tree_view ));
nact_tree_model_fill( model, items );
g_debug( "%s: nact_tree_model_ref_count=%d", thisfn, G_OBJECT( model )->ref_count );
model = FMA_TREE_MODEL( gtk_tree_view_get_model( view->private->tree_view ));
fma_tree_model_fill( model, items );
g_debug( "%s: fma_tree_model_ref_count=%d", thisfn, G_OBJECT( model )->ref_count );
view->private->notify_allowed = TRUE;
fma_object_count_items( items, &nb_menus, &nb_actions, &nb_profiles );
......@@ -845,7 +845,7 @@ FMAObjectItem *
nact_tree_view_get_item_by_id( const NactTreeView *view, const gchar *id )
{
FMAObjectItem *item;
NactTreeModel *model;
FMATreeModel *model;
g_return_val_if_fail( NACT_IS_TREE_VIEW( view ), NULL );
......@@ -853,8 +853,8 @@ nact_tree_view_get_item_by_id( const NactTreeView *view, const gchar *id )
if( !view->private->dispose_has_run ){
model = NACT_TREE_MODEL( gtk_tree_view_get_model( view->private->tree_view ));
item = nact_tree_model_get_item_by_id( model, id );
model = FMA_TREE_MODEL( gtk_tree_view_get_model( view->private->tree_view ));
item = fma_tree_model_get_item_by_id( model, id );
}
return( item );
......@@ -885,7 +885,7 @@ GList *
nact_tree_view_get_items_ex( const NactTreeView *view, guint mode )
{
GList *items;
NactTreeModel *model;
FMATreeModel *model;
GList *deleted;
g_return_val_if_fail( NACT_IS_TREE_VIEW( view ), NULL );
......@@ -902,8 +902,8 @@ nact_tree_view_get_items_ex( const NactTreeView *view, guint mode )
}
}
model = NACT_TREE_MODEL( gtk_tree_view_get_model( view->private->tree_view ));
items = nact_tree_model_get_items( model, mode );
model = FMA_TREE_MODEL( gtk_tree_view_get_model( view->private->tree_view ));
items = fma_tree_model_get_items( model, mode );
items = g_list_concat( items, deleted );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment