[nautilus-actions] Refactor NactIBackgroundTab as NactIFoldersTab class



commit 9d2536d6fc43959144efff9b0bec96b8927defde
Author: Pierre Wieser <pwieser trychlos org>
Date:   Sat Mar 6 19:00:06 2010 +0100

    Refactor NactIBackgroundTab as NactIFoldersTab class

 ChangeLog                                          |    9 +
 src/nact/Makefile.am                               |    4 +-
 ...{nact-ibackground-tab.c => nact-ifolders-tab.c} |  180 ++++++++++----------
 ...{nact-ibackground-tab.h => nact-ifolders-tab.h} |   38 ++--
 src/nact/nact-main-tab.h                           |    2 +-
 src/nact/nact-main-window.c                        |   24 ++--
 6 files changed, 133 insertions(+), 124 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 0822d61..2179e2c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2009-03-05 Pierre Wieser <pwieser trychlos org>
 
+	Refactor NactIBackgroundTab class as NactIFoldersTab.
+
+	* src/nact/nact-ibackground-tab.c:
+	* src/nact/nact-ibackground-tab.h: Renamed as nact-ifolders-tab.{c,h}.
+
+	* src/nact/Makefile.am:
+	* src/nact/nact-main-tab.h:
+	* src/nact/nact-main-window.c: Updated accordingly.
+
 	Remove the 'target background' indicator which was introduced in 2.29.1.
 
 	* src/core/na-object-action-factory.c:
diff --git a/src/nact/Makefile.am b/src/nact/Makefile.am
index 01c2ab4..b4cd1e9 100644
--- a/src/nact/Makefile.am
+++ b/src/nact/Makefile.am
@@ -95,8 +95,8 @@ nautilus_actions_config_tool_SOURCES = \
 	nact-iaction-tab.h									\
 	nact-iadvanced-tab.c								\
 	nact-iadvanced-tab.h								\
-	nact-ibackground-tab.c								\
-	nact-ibackground-tab.h								\
+	nact-ifolders-tab.c									\
+	nact-ifolders-tab.h									\
 	nact-icommand-tab.c									\
 	nact-icommand-tab.h									\
 	nact-iconditions-tab.c								\
diff --git a/src/nact/nact-ibackground-tab.c b/src/nact/nact-ifolders-tab.c
similarity index 72%
rename from src/nact/nact-ibackground-tab.c
rename to src/nact/nact-ifolders-tab.c
index 55cbd0e..fd54888 100644
--- a/src/nact/nact-ibackground-tab.c
+++ b/src/nact/nact-ifolders-tab.c
@@ -47,55 +47,55 @@
 #include "nact-iprefs.h"
 #include "nact-application.h"
 #include "nact-main-tab.h"
-#include "nact-ibackground-tab.h"
+#include "nact-ifolders-tab.h"
 
 /* private interface data
  */
-struct NactIBackgroundTabInterfacePrivate {
+struct NactIFoldersTabInterfacePrivate {
 	void *empty;						/* so that gcc -pedantic is happy */
 };
 
 /* column ordering
  */
 enum {
-	BACKGROUND_URI_COLUMN = 0,
-	BACKGROUND_N_COLUMN
+	FOLDERS_URI_COLUMN = 0,
+	FOLDERS_N_COLUMN
 };
 
-#define IPREFS_BACKGROUND_DIALOG		"ibackground-chooser"
-#define IPREFS_BACKGROUND_URI			"ibackground-uri"
+#define IPREFS_FOLDERS_DIALOG		"ifolders-chooser"
+#define IPREFS_FOLDERS_URI			"ifolders-uri"
 
 static gboolean st_initialized = FALSE;
 static gboolean st_finalized = FALSE;
 static gboolean st_on_selection_change = FALSE;
 
 static GType        register_type( void );
-static void         interface_base_init( NactIBackgroundTabInterface *klass );
-static void         interface_base_finalize( NactIBackgroundTabInterface *klass );
-
-static void         on_tab_updatable_selection_changed( NactIBackgroundTab *instance, gint count_selected );
-static void         on_tab_updatable_enable_tab( NactIBackgroundTab *instance, NAObjectItem *item );
-static gboolean     tab_set_sensitive( NactIBackgroundTab *instance );
-
-static gboolean     on_key_pressed_event( GtkWidget *widget, GdkEventKey *event, NactIBackgroundTab *instance );
-static void         inline_edition( NactIBackgroundTab *instance );
-static void         insert_new_row( NactIBackgroundTab *instance );
-static void         delete_row( NactIBackgroundTab *instance );
-
-static void         add_row( NactIBackgroundTab *instance, GtkTreeView *listview, const gchar *uri );
-static void         add_uri_to_folders( NactIBackgroundTab *instance, const gchar *uri );
-static GtkTreeView *get_folders_treeview( NactIBackgroundTab *instance );
-static void         on_folder_uri_edited( GtkCellRendererText *renderer, const gchar *path, const gchar *text, NactIBackgroundTab *instance );
-static void         on_folders_selection_changed( GtkTreeSelection *selection, NactIBackgroundTab *instance );
-static void         on_add_folder_clicked( GtkButton *button, NactIBackgroundTab *instance );
-static void         on_remove_folder_clicked( GtkButton *button, NactIBackgroundTab *instance );
-static void         remove_uri_from_folders( NactIBackgroundTab *instance, const gchar *uri );
-static void         reset_folders( NactIBackgroundTab *instance );
-static void         setup_folders( NactIBackgroundTab *instance );
-static void         treeview_cell_edited( NactIBackgroundTab *instance, const gchar *path_string, const gchar *text, gint column, gchar **old_text );
+static void         interface_base_init( NactIFoldersTabInterface *klass );
+static void         interface_base_finalize( NactIFoldersTabInterface *klass );
+
+static void         on_tab_updatable_selection_changed( NactIFoldersTab *instance, gint count_selected );
+static void         on_tab_updatable_enable_tab( NactIFoldersTab *instance, NAObjectItem *item );
+static gboolean     tab_set_sensitive( NactIFoldersTab *instance );
+
+static gboolean     on_key_pressed_event( GtkWidget *widget, GdkEventKey *event, NactIFoldersTab *instance );
+static void         inline_edition( NactIFoldersTab *instance );
+static void         insert_new_row( NactIFoldersTab *instance );
+static void         delete_row( NactIFoldersTab *instance );
+
+static void         add_row( NactIFoldersTab *instance, GtkTreeView *listview, const gchar *uri );
+static void         add_uri_to_folders( NactIFoldersTab *instance, const gchar *uri );
+static GtkTreeView *get_folders_treeview( NactIFoldersTab *instance );
+static void         on_folder_uri_edited( GtkCellRendererText *renderer, const gchar *path, const gchar *text, NactIFoldersTab *instance );
+static void         on_folders_selection_changed( GtkTreeSelection *selection, NactIFoldersTab *instance );
+static void         on_add_folder_clicked( GtkButton *button, NactIFoldersTab *instance );
+static void         on_remove_folder_clicked( GtkButton *button, NactIFoldersTab *instance );
+static void         remove_uri_from_folders( NactIFoldersTab *instance, const gchar *uri );
+static void         reset_folders( NactIFoldersTab *instance );
+static void         setup_folders( NactIFoldersTab *instance );
+static void         treeview_cell_edited( NactIFoldersTab *instance, const gchar *path_string, const gchar *text, gint column, gchar **old_text );
 
 GType
-nact_ibackground_tab_get_type( void )
+nact_ifolders_tab_get_type( void )
 {
 	static GType iface_type = 0;
 
@@ -109,11 +109,11 @@ nact_ibackground_tab_get_type( void )
 static GType
 register_type( void )
 {
-	static const gchar *thisfn = "nact_ibackground_tab_register_type";
+	static const gchar *thisfn = "nact_ifolders_tab_register_type";
 	GType type;
 
 	static const GTypeInfo info = {
-		sizeof( NactIBackgroundTabInterface ),
+		sizeof( NactIFoldersTabInterface ),
 		( GBaseInitFunc ) interface_base_init,
 		( GBaseFinalizeFunc ) interface_base_finalize,
 		NULL,
@@ -126,7 +126,7 @@ register_type( void )
 
 	g_debug( "%s", thisfn );
 
-	type = g_type_register_static( G_TYPE_INTERFACE, "NactIBackgroundTab", &info, 0 );
+	type = g_type_register_static( G_TYPE_INTERFACE, "NactIFoldersTab", &info, 0 );
 
 	g_type_interface_add_prerequisite( type, BASE_WINDOW_TYPE );
 
@@ -134,24 +134,24 @@ register_type( void )
 }
 
 static void
-interface_base_init( NactIBackgroundTabInterface *klass )
+interface_base_init( NactIFoldersTabInterface *klass )
 {
-	static const gchar *thisfn = "nact_ibackground_tab_interface_base_init";
+	static const gchar *thisfn = "nact_ifolders_tab_interface_base_init";
 
 	if( !st_initialized ){
 
 		g_debug( "%s: klass=%p", thisfn, ( void * ) klass );
 
-		klass->private = g_new0( NactIBackgroundTabInterfacePrivate, 1 );
+		klass->private = g_new0( NactIFoldersTabInterfacePrivate, 1 );
 
 		st_initialized = TRUE;
 	}
 }
 
 static void
-interface_base_finalize( NactIBackgroundTabInterface *klass )
+interface_base_finalize( NactIFoldersTabInterface *klass )
 {
-	static const gchar *thisfn = "nact_ibackground_tab_interface_base_finalize";
+	static const gchar *thisfn = "nact_ifolders_tab_interface_base_finalize";
 
 	if( st_initialized && !st_finalized ){
 
@@ -164,9 +164,9 @@ interface_base_finalize( NactIBackgroundTabInterface *klass )
 }
 
 void
-nact_ibackground_tab_initial_load_toplevel( NactIBackgroundTab *instance )
+nact_ifolders_tab_initial_load_toplevel( NactIFoldersTab *instance )
 {
-	static const gchar *thisfn = "nact_ibackground_tab_initial_load_toplevel";
+	static const gchar *thisfn = "nact_ifolders_tab_initial_load_toplevel";
 	GtkTreeView *listview;
 	GtkListStore *model;
 	GtkTreeViewColumn *column;
@@ -174,12 +174,12 @@ nact_ibackground_tab_initial_load_toplevel( NactIBackgroundTab *instance )
 	GtkTreeSelection *selection;
 
 	g_debug( "%s: instance=%p", thisfn, ( void * ) instance );
-	g_return_if_fail( NACT_IS_IBACKGROUND_TAB( instance ));
+	g_return_if_fail( NACT_IS_IFOLDERS_TAB( instance ));
 
 	if( st_initialized && !st_finalized ){
 
-		model = gtk_list_store_new( BACKGROUND_N_COLUMN, G_TYPE_STRING );
-		gtk_tree_sortable_set_sort_column_id( GTK_TREE_SORTABLE( model ), BACKGROUND_URI_COLUMN, GTK_SORT_ASCENDING );
+		model = gtk_list_store_new( FOLDERS_N_COLUMN, G_TYPE_STRING );
+		gtk_tree_sortable_set_sort_column_id( GTK_TREE_SORTABLE( model ), FOLDERS_URI_COLUMN, GTK_SORT_ASCENDING );
 		listview = get_folders_treeview( instance );
 		gtk_tree_view_set_model( listview, GTK_TREE_MODEL( model ));
 		g_object_unref( model );
@@ -188,7 +188,7 @@ nact_ibackground_tab_initial_load_toplevel( NactIBackgroundTab *instance )
 		column = gtk_tree_view_column_new_with_attributes(
 				"folder-uri",
 				text_cell,
-				"text", BACKGROUND_URI_COLUMN,
+				"text", FOLDERS_URI_COLUMN,
 				NULL );
 		gtk_tree_view_append_column( listview, column );
 
@@ -200,16 +200,16 @@ nact_ibackground_tab_initial_load_toplevel( NactIBackgroundTab *instance )
 }
 
 void
-nact_ibackground_tab_runtime_init_toplevel( NactIBackgroundTab *instance )
+nact_ifolders_tab_runtime_init_toplevel( NactIFoldersTab *instance )
 {
-	static const gchar *thisfn = "nact_ibackground_tab_runtime_init_toplevel";
+	static const gchar *thisfn = "nact_ifolders_tab_runtime_init_toplevel";
 	GtkTreeView *listview;
 	GtkTreeViewColumn *column;
 	GList *renderers;
 	GtkWidget *add_button, *remove_button;
 
 	g_debug( "%s: instance=%p", thisfn, ( void * ) instance );
-	g_return_if_fail( NACT_IS_IBACKGROUND_TAB( instance ));
+	g_return_if_fail( NACT_IS_IFOLDERS_TAB( instance ));
 
 	if( st_initialized && !st_finalized ){
 
@@ -226,7 +226,7 @@ nact_ibackground_tab_runtime_init_toplevel( NactIBackgroundTab *instance )
 				G_CALLBACK( on_tab_updatable_enable_tab ));
 
 		listview = get_folders_treeview( instance );
-		column = gtk_tree_view_get_column( listview, BACKGROUND_URI_COLUMN );
+		column = gtk_tree_view_get_column( listview, FOLDERS_URI_COLUMN );
 		renderers = gtk_cell_layout_get_cells( GTK_CELL_LAYOUT( column ));
 		base_window_signal_connect(
 				BASE_WINDOW( instance ),
@@ -263,24 +263,24 @@ nact_ibackground_tab_runtime_init_toplevel( NactIBackgroundTab *instance )
 }
 
 void
-nact_ibackground_tab_all_widgets_showed( NactIBackgroundTab *instance )
+nact_ifolders_tab_all_widgets_showed( NactIFoldersTab *instance )
 {
-	static const gchar *thisfn = "nact_ibackground_tab_all_widgets_showed";
+	static const gchar *thisfn = "nact_ifolders_tab_all_widgets_showed";
 
 	g_debug( "%s: instance=%p", thisfn, ( void * ) instance );
-	g_return_if_fail( NACT_IS_IBACKGROUND_TAB( instance ));
+	g_return_if_fail( NACT_IS_IFOLDERS_TAB( instance ));
 
 	if( st_initialized && !st_finalized ){
 	}
 }
 
 void
-nact_ibackground_tab_dispose( NactIBackgroundTab *instance )
+nact_ifolders_tab_dispose( NactIFoldersTab *instance )
 {
-	static const gchar *thisfn = "nact_ibackground_tab_dispose";
+	static const gchar *thisfn = "nact_ifolders_tab_dispose";
 
 	g_debug( "%s: instance=%p", thisfn, ( void * ) instance );
-	g_return_if_fail( NACT_IS_IBACKGROUND_TAB( instance ));
+	g_return_if_fail( NACT_IS_IFOLDERS_TAB( instance ));
 
 	if( st_initialized && !st_finalized ){
 
@@ -289,9 +289,9 @@ nact_ibackground_tab_dispose( NactIBackgroundTab *instance )
 }
 
 static void
-on_tab_updatable_selection_changed( NactIBackgroundTab *instance, gint count_selected )
+on_tab_updatable_selection_changed( NactIFoldersTab *instance, gint count_selected )
 {
-	static const gchar *thisfn = "nact_ibackground_tab_on_tab_updatable_selection_changed";
+	static const gchar *thisfn = "nact_ifolders_tab_on_tab_updatable_selection_changed";
 	NAObjectItem *item;
 	NAObjectProfile *profile;
 	gboolean enable_tab;
@@ -301,7 +301,7 @@ on_tab_updatable_selection_changed( NactIBackgroundTab *instance, gint count_sel
 	GtkWidget *widget;
 
 	g_debug( "%s: instance=%p, count_selected=%d", thisfn, ( void * ) instance, count_selected );
-	g_return_if_fail( NACT_IS_IBACKGROUND_TAB( instance ));
+	g_return_if_fail( NACT_IS_IFOLDERS_TAB( instance ));
 
 	if( st_initialized && !st_finalized ){
 
@@ -326,7 +326,7 @@ on_tab_updatable_selection_changed( NactIBackgroundTab *instance, gint count_sel
 
 		treeview = GTK_TREE_VIEW( base_window_get_widget( BASE_WINDOW( instance ), "FoldersTreeView" ));
 		gtk_widget_set_sensitive( GTK_WIDGET( treeview ), profile != NULL );
-		column = gtk_tree_view_get_column( treeview, BACKGROUND_URI_COLUMN );
+		column = gtk_tree_view_get_column( treeview, FOLDERS_URI_COLUMN );
 		nact_gtk_utils_set_editable( GTK_OBJECT( column ), editable );
 
 		widget = base_window_get_widget( BASE_WINDOW( instance ), "AddFolderButton" );
@@ -342,21 +342,21 @@ on_tab_updatable_selection_changed( NactIBackgroundTab *instance, gint count_sel
 }
 
 static void
-on_tab_updatable_enable_tab( NactIBackgroundTab *instance, NAObjectItem *item )
+on_tab_updatable_enable_tab( NactIFoldersTab *instance, NAObjectItem *item )
 {
-	static const gchar *thisfn = "nact_ibackground_tab_on_tab_updatable_enable_tab";
+	static const gchar *thisfn = "nact_ifolders_tab_on_tab_updatable_enable_tab";
 
 	if( st_initialized && !st_finalized ){
 
 		g_debug( "%s: instance=%p, item=%p", thisfn, ( void * ) instance, ( void * ) item );
-		g_return_if_fail( NACT_IS_IBACKGROUND_TAB( instance ));
+		g_return_if_fail( NACT_IS_IFOLDERS_TAB( instance ));
 
 		tab_set_sensitive( instance );
 	}
 }
 
 static gboolean
-tab_set_sensitive( NactIBackgroundTab *instance )
+tab_set_sensitive( NactIFoldersTab *instance )
 {
 	NAObjectAction *action;
 	NAObjectProfile *profile;
@@ -370,13 +370,13 @@ tab_set_sensitive( NactIBackgroundTab *instance )
 
 	enable_tab = ( profile != NULL );
 
-	nact_main_tab_enable_page( NACT_MAIN_WINDOW( instance ), TAB_BACKGROUND, enable_tab );
+	nact_main_tab_enable_page( NACT_MAIN_WINDOW( instance ), TAB_FOLDERS, enable_tab );
 
 	return( enable_tab );
 }
 
 static gboolean
-on_key_pressed_event( GtkWidget *widget, GdkEventKey *event, NactIBackgroundTab *instance )
+on_key_pressed_event( GtkWidget *widget, GdkEventKey *event, NactIFoldersTab *instance )
 {
 	gboolean stop;
 	gboolean editable;
@@ -410,7 +410,7 @@ on_key_pressed_event( GtkWidget *widget, GdkEventKey *event, NactIBackgroundTab
 }
 
 static void
-inline_edition( NactIBackgroundTab *instance )
+inline_edition( NactIFoldersTab *instance )
 {
 	GtkTreeView *listview;
 	GtkTreeSelection *selection;
@@ -424,7 +424,7 @@ inline_edition( NactIBackgroundTab *instance )
 
 	if( g_list_length( listrows ) == 1 ){
 		path = ( GtkTreePath * ) listrows->data;
-		column = gtk_tree_view_get_column( listview, BACKGROUND_URI_COLUMN );
+		column = gtk_tree_view_get_column( listview, FOLDERS_URI_COLUMN );
 		gtk_tree_view_set_cursor( listview, path, column, TRUE );
 	}
 
@@ -437,7 +437,7 @@ inline_edition( NactIBackgroundTab *instance )
  * before currently selected item...
  */
 static void
-insert_new_row( NactIBackgroundTab *instance )
+insert_new_row( NactIFoldersTab *instance )
 {
 	GtkTreeView *listview;
 	GtkTreeModel *model;
@@ -450,17 +450,17 @@ insert_new_row( NactIBackgroundTab *instance )
 	model = gtk_tree_view_get_model( listview );
 
 	gtk_list_store_append( GTK_LIST_STORE( model ), &iter );
-	gtk_list_store_set( GTK_LIST_STORE( model ), &iter, BACKGROUND_URI_COLUMN, uri, -1 );
+	gtk_list_store_set( GTK_LIST_STORE( model ), &iter, FOLDERS_URI_COLUMN, uri, -1 );
 	add_uri_to_folders( instance, uri );
 
 	path = gtk_tree_model_get_path( model, &iter );
-	column = gtk_tree_view_get_column( listview, BACKGROUND_URI_COLUMN );
+	column = gtk_tree_view_get_column( listview, FOLDERS_URI_COLUMN );
 	gtk_tree_view_set_cursor( listview, path, column, TRUE );
 	gtk_tree_path_free( path );
 }
 
 static void
-delete_row( NactIBackgroundTab *instance )
+delete_row( NactIFoldersTab *instance )
 {
 	GtkTreeView *listview;
 	GtkTreeModel *model;
@@ -478,7 +478,7 @@ delete_row( NactIBackgroundTab *instance )
 	if( g_list_length( rows ) == 1 ){
 		path = ( GtkTreePath * ) rows->data;
 		gtk_tree_model_get_iter( model, &iter, path );
-		gtk_tree_model_get( model, &iter, BACKGROUND_URI_COLUMN, &uri, -1 );
+		gtk_tree_model_get( model, &iter, FOLDERS_URI_COLUMN, &uri, -1 );
 
 		gtk_list_store_remove( GTK_LIST_STORE( model ), &iter );
 		remove_uri_from_folders( instance, uri );
@@ -496,7 +496,7 @@ delete_row( NactIBackgroundTab *instance )
 }
 
 static void
-add_row( NactIBackgroundTab *instance, GtkTreeView *listview, const gchar *uri )
+add_row( NactIFoldersTab *instance, GtkTreeView *listview, const gchar *uri )
 {
 	GtkTreeModel *model;
 	GtkTreeIter row;
@@ -510,12 +510,12 @@ add_row( NactIBackgroundTab *instance, GtkTreeView *listview, const gchar *uri )
 	gtk_list_store_set(
 			GTK_LIST_STORE( model ),
 			&row,
-			BACKGROUND_URI_COLUMN, uri,
+			FOLDERS_URI_COLUMN, uri,
 			-1 );
 }
 
 static void
-add_uri_to_folders( NactIBackgroundTab *instance, const gchar *uri )
+add_uri_to_folders( NactIFoldersTab *instance, const gchar *uri )
 {
 	NAObjectAction *action;
 	NAObjectProfile *edited;
@@ -536,7 +536,7 @@ add_uri_to_folders( NactIBackgroundTab *instance, const gchar *uri )
 }
 
 static GtkTreeView *
-get_folders_treeview( NactIBackgroundTab *instance )
+get_folders_treeview( NactIFoldersTab *instance )
 {
 	GtkWidget *treeview;
 
@@ -547,7 +547,7 @@ get_folders_treeview( NactIBackgroundTab *instance )
 }
 
 static void
-on_add_folder_clicked( GtkButton *button, NactIBackgroundTab *instance )
+on_add_folder_clicked( GtkButton *button, NactIFoldersTab *instance )
 {
 	GtkWidget *dialog;
 	GtkWindow *toplevel;
@@ -573,9 +573,9 @@ on_add_folder_clicked( GtkButton *button, NactIBackgroundTab *instance )
 	application = NACT_APPLICATION( base_window_get_application( BASE_WINDOW( instance )));
 	updater = nact_application_get_updater( application );
 
-	base_iprefs_position_named_window( BASE_WINDOW( instance ), GTK_WINDOW( dialog ), IPREFS_BACKGROUND_DIALOG );
+	base_iprefs_position_named_window( BASE_WINDOW( instance ), GTK_WINDOW( dialog ), IPREFS_FOLDERS_DIALOG );
 
-	uri = na_iprefs_read_string( NA_IPREFS( updater ), IPREFS_BACKGROUND_URI, "x-nautilus-desktop:///" );
+	uri = na_iprefs_read_string( NA_IPREFS( updater ), IPREFS_FOLDERS_URI, "x-nautilus-desktop:///" );
 	if( uri && strlen( uri )){
 		gtk_file_chooser_set_uri( GTK_FILE_CHOOSER( dialog ), uri );
 	}
@@ -583,25 +583,25 @@ on_add_folder_clicked( GtkButton *button, NactIBackgroundTab *instance )
 
 	if( gtk_dialog_run( GTK_DIALOG( dialog )) == GTK_RESPONSE_ACCEPT ){
 		uri = gtk_file_chooser_get_uri( GTK_FILE_CHOOSER( dialog ));
-		nact_iprefs_write_string( BASE_WINDOW( instance ), IPREFS_BACKGROUND_URI, uri );
+		nact_iprefs_write_string( BASE_WINDOW( instance ), IPREFS_FOLDERS_URI, uri );
 		add_row( instance, listview, uri );
 		add_uri_to_folders( instance, uri );
 		g_free( uri );
 	}
 
-	base_iprefs_save_named_window_position( BASE_WINDOW( instance ), GTK_WINDOW( dialog ), IPREFS_BACKGROUND_DIALOG );
+	base_iprefs_save_named_window_position( BASE_WINDOW( instance ), GTK_WINDOW( dialog ), IPREFS_FOLDERS_DIALOG );
 
 	gtk_widget_destroy( dialog );
 }
 
 static void
-on_folder_uri_edited( GtkCellRendererText *renderer, const gchar *path, const gchar *text, NactIBackgroundTab *instance )
+on_folder_uri_edited( GtkCellRendererText *renderer, const gchar *path, const gchar *text, NactIFoldersTab *instance )
 {
-	treeview_cell_edited( instance, path, text, BACKGROUND_URI_COLUMN, NULL );
+	treeview_cell_edited( instance, path, text, FOLDERS_URI_COLUMN, NULL );
 }
 
 static void
-on_folders_selection_changed( GtkTreeSelection *selection, NactIBackgroundTab *instance )
+on_folders_selection_changed( GtkTreeSelection *selection, NactIFoldersTab *instance )
 {
 	gboolean editable;
 	GtkWidget *button;
@@ -619,13 +619,13 @@ on_folders_selection_changed( GtkTreeSelection *selection, NactIBackgroundTab *i
 }
 
 static void
-on_remove_folder_clicked( GtkButton *button, NactIBackgroundTab *instance )
+on_remove_folder_clicked( GtkButton *button, NactIFoldersTab *instance )
 {
 	delete_row( instance );
 }
 
 static void
-remove_uri_from_folders( NactIBackgroundTab *instance, const gchar *uri )
+remove_uri_from_folders( NactIFoldersTab *instance, const gchar *uri )
 {
 	NAObjectProfile *edited;
 	GSList *folders;
@@ -645,7 +645,7 @@ remove_uri_from_folders( NactIBackgroundTab *instance, const gchar *uri )
 }
 
 static void
-reset_folders( NactIBackgroundTab *instance )
+reset_folders( NactIFoldersTab *instance )
 {
 	GtkTreeView *listview;
 	GtkTreeModel *model;
@@ -656,7 +656,7 @@ reset_folders( NactIBackgroundTab *instance )
 }
 
 static void
-setup_folders( NactIBackgroundTab *instance )
+setup_folders( NactIFoldersTab *instance )
 {
 	NAObjectProfile *edited;
 	GSList *folders, *is;
@@ -679,9 +679,9 @@ setup_folders( NactIBackgroundTab *instance )
 }
 
 static void
-treeview_cell_edited( NactIBackgroundTab *instance, const gchar *path_string, const gchar *text, gint column, gchar **old_text )
+treeview_cell_edited( NactIFoldersTab *instance, const gchar *path_string, const gchar *text, gint column, gchar **old_text )
 {
-	static const gchar *thisfn = "nact_ibackground_tab_treeview_cell_edited";
+	static const gchar *thisfn = "nact_ifolders_tab_treeview_cell_edited";
 	GtkTreeView *listview;
 	GtkTreeModel *model;
 	GtkTreeIter iter;
@@ -699,7 +699,7 @@ treeview_cell_edited( NactIBackgroundTab *instance, const gchar *path_string, co
 	gtk_tree_model_get_iter( model, &iter, path );
 	gtk_tree_path_free( path );
 
-	gtk_tree_model_get( model, &iter, BACKGROUND_URI_COLUMN, &previous_text, -1 );
+	gtk_tree_model_get( model, &iter, FOLDERS_URI_COLUMN, &previous_text, -1 );
 
 	gtk_list_store_set( GTK_LIST_STORE( model ), &iter, column, text, -1 );
 
diff --git a/src/nact/nact-ibackground-tab.h b/src/nact/nact-ifolders-tab.h
similarity index 52%
rename from src/nact/nact-ibackground-tab.h
rename to src/nact/nact-ifolders-tab.h
index 33fea4c..3248a0b 100644
--- a/src/nact/nact-ibackground-tab.h
+++ b/src/nact/nact-ifolders-tab.h
@@ -28,13 +28,13 @@
  *   ... and many others (see AUTHORS)
  */
 
-#ifndef __NACT_IBACKGROUND_TAB_H__
-#define __NACT_IBACKGROUND_TAB_H__
+#ifndef __NACT_IFOLDERS_TAB_H__
+#define __NACT_IFOLDERS_TAB_H__
 
 /**
- * SECTION: nact_ibackground_tab
- * @short_description: #NactIBackgroundTab interface declaration.
- * @include: nact/nact-ibackground-tab.h
+ * SECTION: nact_ifolders_tab
+ * @short_description: #NactIFoldersTab interface declaration.
+ * @include: nact/nact-ifolders-tab.h
  *
  * This interface implements all the widgets which are relevant for
  * items which are applied to backgrounds.
@@ -44,28 +44,28 @@
 
 G_BEGIN_DECLS
 
-#define NACT_IBACKGROUND_TAB_TYPE						( nact_ibackground_tab_get_type())
-#define NACT_IBACKGROUND_TAB( object )					( G_TYPE_CHECK_INSTANCE_CAST( object, NACT_IBACKGROUND_TAB_TYPE, NactIBackgroundTab ))
-#define NACT_IS_IBACKGROUND_TAB( object )				( G_TYPE_CHECK_INSTANCE_TYPE( object, NACT_IBACKGROUND_TAB_TYPE ))
-#define NACT_IBACKGROUND_TAB_GET_INTERFACE( instance )	( G_TYPE_INSTANCE_GET_INTERFACE(( instance ), NACT_IBACKGROUND_TAB_TYPE, NactIBackgroundTabInterface ))
+#define NACT_IFOLDERS_TAB_TYPE						( nact_ifolders_tab_get_type())
+#define NACT_IFOLDERS_TAB( object )					( G_TYPE_CHECK_INSTANCE_CAST( object, NACT_IFOLDERS_TAB_TYPE, NactIFoldersTab ))
+#define NACT_IS_IFOLDERS_TAB( object )				( G_TYPE_CHECK_INSTANCE_TYPE( object, NACT_IFOLDERS_TAB_TYPE ))
+#define NACT_IFOLDERS_TAB_GET_INTERFACE( instance )	( G_TYPE_INSTANCE_GET_INTERFACE(( instance ), NACT_IFOLDERS_TAB_TYPE, NactIFoldersTabInterface ))
 
-typedef struct NactIBackgroundTab NactIBackgroundTab;
+typedef struct NactIFoldersTab NactIFoldersTab;
 
-typedef struct NactIBackgroundTabInterfacePrivate NactIBackgroundTabInterfacePrivate;
+typedef struct NactIFoldersTabInterfacePrivate NactIFoldersTabInterfacePrivate;
 
 typedef struct {
 	GTypeInterface                      parent;
-	NactIBackgroundTabInterfacePrivate *private;
+	NactIFoldersTabInterfacePrivate *private;
 }
-	NactIBackgroundTabInterface;
+	NactIFoldersTabInterface;
 
-GType    nact_ibackground_tab_get_type( void );
+GType    nact_ifolders_tab_get_type( void );
 
-void     nact_ibackground_tab_initial_load_toplevel( NactIBackgroundTab *instance );
-void     nact_ibackground_tab_runtime_init_toplevel( NactIBackgroundTab *instance );
-void     nact_ibackground_tab_all_widgets_showed( NactIBackgroundTab *instance );
-void     nact_ibackground_tab_dispose( NactIBackgroundTab *instance );
+void     nact_ifolders_tab_initial_load_toplevel( NactIFoldersTab *instance );
+void     nact_ifolders_tab_runtime_init_toplevel( NactIFoldersTab *instance );
+void     nact_ifolders_tab_all_widgets_showed( NactIFoldersTab *instance );
+void     nact_ifolders_tab_dispose( NactIFoldersTab *instance );
 
 G_END_DECLS
 
-#endif /* __NACT_IBACKGROUND_TAB_H__ */
+#endif /* __NACT_IFOLDERS_TAB_H__ */
diff --git a/src/nact/nact-main-tab.h b/src/nact/nact-main-tab.h
index 7955c4e..69f8415 100644
--- a/src/nact/nact-main-tab.h
+++ b/src/nact/nact-main-tab.h
@@ -62,7 +62,7 @@
 enum {
 	TAB_ACTION = 0,
 	TAB_COMMAND,
-	TAB_BACKGROUND,
+	TAB_FOLDERS,
 	TAB_CONDITIONS,
 	TAB_ADVANCED
 };
diff --git a/src/nact/nact-main-window.c b/src/nact/nact-main-window.c
index 2433a92..d7ad25c 100644
--- a/src/nact/nact-main-window.c
+++ b/src/nact/nact-main-window.c
@@ -49,7 +49,7 @@
 #include "nact-iactions-list.h"
 #include "nact-iaction-tab.h"
 #include "nact-icommand-tab.h"
-#include "nact-ibackground-tab.h"
+#include "nact-ifolders-tab.h"
 #include "nact-iconditions-tab.h"
 #include "nact-iadvanced-tab.h"
 #include "nact-main-tab.h"
@@ -144,7 +144,7 @@ static void     class_init( NactMainWindowClass *klass );
 static void     iactions_list_iface_init( NactIActionsListInterface *iface );
 static void     iaction_tab_iface_init( NactIActionTabInterface *iface );
 static void     icommand_tab_iface_init( NactICommandTabInterface *iface );
-static void     ibackground_tab_iface_init( NactIBackgroundTabInterface *iface );
+static void     ifolders_tab_iface_init( NactIFoldersTabInterface *iface );
 static void     iconditions_tab_iface_init( NactIConditionsTabInterface *iface );
 static void     iadvanced_tab_iface_init( NactIAdvancedTabInterface *iface );
 static void     iabout_iface_init( NAIAboutInterface *iface );
@@ -230,8 +230,8 @@ register_type( void )
 		NULL
 	};
 
-	static const GInterfaceInfo ibackground_tab_iface_info = {
-		( GInterfaceInitFunc ) ibackground_tab_iface_init,
+	static const GInterfaceInfo ifolders_tab_iface_info = {
+		( GInterfaceInitFunc ) ifolders_tab_iface_init,
 		NULL,
 		NULL
 	};
@@ -276,7 +276,7 @@ register_type( void )
 
 	g_type_add_interface_static( type, NACT_ICOMMAND_TAB_TYPE, &icommand_tab_iface_info );
 
-	g_type_add_interface_static( type, NACT_IBACKGROUND_TAB_TYPE, &ibackground_tab_iface_info );
+	g_type_add_interface_static( type, NACT_IFOLDERS_TAB_TYPE, &ifolders_tab_iface_info );
 
 	g_type_add_interface_static( type, NACT_ICONDITIONS_TAB_TYPE, &iconditions_tab_iface_info );
 
@@ -504,9 +504,9 @@ icommand_tab_iface_init( NactICommandTabInterface *iface )
 }
 
 static void
-ibackground_tab_iface_init( NactIBackgroundTabInterface *iface )
+ifolders_tab_iface_init( NactIFoldersTabInterface *iface )
 {
-	static const gchar *thisfn = "nact_main_window_ibackground_tab_iface_init";
+	static const gchar *thisfn = "nact_main_window_ifolders_tab_iface_init";
 
 	g_debug( "%s: iface=%p", thisfn, ( void * ) iface );
 }
@@ -705,7 +705,7 @@ instance_dispose( GObject *window )
 		nact_iactions_list_dispose( NACT_IACTIONS_LIST( window ));
 		nact_iaction_tab_dispose( NACT_IACTION_TAB( window ));
 		nact_icommand_tab_dispose( NACT_ICOMMAND_TAB( window ));
-		nact_ibackground_tab_dispose( NACT_IBACKGROUND_TAB( window ));
+		nact_ifolders_tab_dispose( NACT_IFOLDERS_TAB( window ));
 		nact_iconditions_tab_dispose( NACT_ICONDITIONS_TAB( window ));
 		nact_iadvanced_tab_dispose( NACT_IADVANCED_TAB( window ));
 		nact_main_menubar_dispose( self );
@@ -1027,7 +1027,7 @@ on_base_initial_load_toplevel( NactMainWindow *window, gpointer user_data )
 
 		nact_iaction_tab_initial_load_toplevel( NACT_IACTION_TAB( window ));
 		nact_icommand_tab_initial_load_toplevel( NACT_ICOMMAND_TAB( window ));
-		nact_ibackground_tab_initial_load_toplevel( NACT_IBACKGROUND_TAB( window ));
+		nact_ifolders_tab_initial_load_toplevel( NACT_IFOLDERS_TAB( window ));
 		nact_iconditions_tab_initial_load_toplevel( NACT_ICONDITIONS_TAB( window ));
 		nact_iadvanced_tab_initial_load_toplevel( NACT_IADVANCED_TAB( window ));
 
@@ -1064,7 +1064,7 @@ on_base_runtime_init_toplevel( NactMainWindow *window, gpointer user_data )
 
 		nact_iaction_tab_runtime_init_toplevel( NACT_IACTION_TAB( window ));
 		nact_icommand_tab_runtime_init_toplevel( NACT_ICOMMAND_TAB( window ));
-		nact_ibackground_tab_runtime_init_toplevel( NACT_IBACKGROUND_TAB( window ));
+		nact_ifolders_tab_runtime_init_toplevel( NACT_IFOLDERS_TAB( window ));
 		nact_iconditions_tab_runtime_init_toplevel( NACT_ICONDITIONS_TAB( window ));
 		nact_iadvanced_tab_runtime_init_toplevel( NACT_IADVANCED_TAB( window ));
 		nact_main_menubar_runtime_init( window );
@@ -1096,7 +1096,7 @@ on_base_all_widgets_showed( NactMainWindow *window, gpointer user_data )
 	g_return_if_fail( NACT_IS_IACTIONS_LIST( window ));
 	g_return_if_fail( NACT_IS_IACTION_TAB( window ));
 	g_return_if_fail( NACT_IS_ICOMMAND_TAB( window ));
-	g_return_if_fail( NACT_IS_IBACKGROUND_TAB( window ));
+	g_return_if_fail( NACT_IS_IFOLDERS_TAB( window ));
 	g_return_if_fail( NACT_IS_ICONDITIONS_TAB( window ));
 	g_return_if_fail( NACT_IS_IADVANCED_TAB( window ));
 
@@ -1104,7 +1104,7 @@ on_base_all_widgets_showed( NactMainWindow *window, gpointer user_data )
 
 		nact_iaction_tab_all_widgets_showed( NACT_IACTION_TAB( window ));
 		nact_icommand_tab_all_widgets_showed( NACT_ICOMMAND_TAB( window ));
-		nact_ibackground_tab_all_widgets_showed( NACT_IBACKGROUND_TAB( window ));
+		nact_ifolders_tab_all_widgets_showed( NACT_IFOLDERS_TAB( window ));
 		nact_iconditions_tab_all_widgets_showed( NACT_ICONDITIONS_TAB( window ));
 		nact_iadvanced_tab_all_widgets_showed( NACT_IADVANCED_TAB( window ));
 



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