[nautilus-actions] Set/get current folder when selecting a directory



commit 5c6877836fafe5e73946857b83270cb3df32d73f
Author: Pierre Wieser <pwieser trychlos org>
Date:   Wed Dec 1 23:23:33 2010 +0100

    Set/get current folder when selecting a directory
    
    Fix #616532.

 ChangeLog                        |    7 +++++++
 src/nact/nact-assistant-export.c |    4 ++--
 src/nact/nact-ifolders-tab.c     |    4 ++--
 3 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 7c329fb..63ef273 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2010-12-01 Pierre Wieser <pwieser trychlos org>
 
+	* src/nact/nact-assistant-export.c
+	(assist_runtime_init_target_folder, on_folder_selection_changed):
+	Set/get current folder URI. Fix #616532.
+
+	* src/nact/nact-ifolders-tab.c (on_browse_folder_clicked):
+	Set/get current folder. Fix #616532.
+
 	* src/api/na-object-item.h: Define new ITEM_TARGET_ANY target.
 
 	* src/core/na-icontext.c (is_candidate_for_target):
diff --git a/src/nact/nact-assistant-export.c b/src/nact/nact-assistant-export.c
index 2dbc731..0c383fe 100644
--- a/src/nact/nact-assistant-export.c
+++ b/src/nact/nact-assistant-export.c
@@ -515,7 +515,7 @@ assist_runtime_init_target_folder( NactAssistantExport *window, GtkAssistant *as
 
 	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 );
+		gtk_file_chooser_set_current_folder_uri( GTK_FILE_CHOOSER( chooser ), uri );
 	}
 	g_free( uri );
 
@@ -559,7 +559,7 @@ on_folder_selection_changed( GtkFileChooser *chooser, gpointer user_data )
 	pos = gtk_assistant_get_current_page( assistant );
 	if( pos == ASSIST_PAGE_FOLDER_SELECTION ){
 
-		uri = gtk_file_chooser_get_uri( chooser );
+		uri = gtk_file_chooser_get_current_folder_uri( chooser );
 		g_debug( "%s: uri=%s", thisfn, uri );
 		enabled = ( uri && strlen( uri ) && na_core_utils_dir_is_writable_uri( uri ));
 
diff --git a/src/nact/nact-ifolders-tab.c b/src/nact/nact-ifolders-tab.c
index 1822c1d..4db79ae 100644
--- a/src/nact/nact-ifolders-tab.c
+++ b/src/nact/nact-ifolders-tab.c
@@ -296,12 +296,12 @@ on_browse_folder_clicked( GtkButton *button, BaseWindow *window )
 
 	path = na_iprefs_read_string( NA_IPREFS( updater ), IPREFS_FOLDERS_PATH, "/" );
 	if( path && g_utf8_strlen( path, -1 )){
-		gtk_file_chooser_set_filename( GTK_FILE_CHOOSER( dialog ), path );
+		gtk_file_chooser_set_current_folder( GTK_FILE_CHOOSER( dialog ), path );
 	}
 	g_free( path );
 
 	if( gtk_dialog_run( GTK_DIALOG( dialog )) == GTK_RESPONSE_ACCEPT ){
-		path = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER( dialog ));
+		path = gtk_file_chooser_get_current_folder( GTK_FILE_CHOOSER( dialog ));
 		nact_iprefs_write_string( window, IPREFS_FOLDERS_PATH, path );
 
 		nact_match_list_insert_row( window, ITAB_NAME, path, FALSE, FALSE );



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