[nautilus-actions] Update all preference names when saving/restoring window size and position



commit 8d25de1fef566ff1b4538efa6c3396ed73a6f977
Author: Pierre Wieser <pwieser trychlos org>
Date:   Wed Jan 12 22:52:11 2011 +0100

    Update all preference names when saving/restoring window size and position

 ChangeLog                             |   14 ++++++++++++++
 README-GCONF                          |    1 +
 src/core/na-settings.c                |    1 +
 src/nact/nact-add-capability-dialog.c |    2 +-
 src/nact/nact-add-scheme-dialog.c     |    2 +-
 src/nact/nact-assistant-export.c      |    2 +-
 src/nact/nact-assistant-import.c      |    2 +-
 src/nact/nact-export-ask.c            |    2 +-
 src/nact/nact-main-window.c           |    9 ++++++---
 src/nact/nact-preferences-editor.c    |    2 +-
 src/utils/na-gconf2key.sh.in          |    3 +++
 11 files changed, 31 insertions(+), 9 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 07cd370..b564d91 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -31,6 +31,20 @@
 
 2011-01-12 Pierre Wieser <pwieser trychlos org>
 
+	* README-GCONF:
+	* src/core/na-settings.c:
+	* src/utils/na-gconf2key.sh.in: Add 'export-ask-user-wsp' preference.
+
+	* src/nact/nact-add-capability-dialog.c (base_get_iprefs_window_id):
+	* src/nact/nact-add-scheme-dialog.c (base_get_iprefs_window_id):
+	* src/nact/nact-assistant-export.c (window_get_iprefs_window_id):
+	* src/nact/nact-assistant-import.c (window_get_iprefs_window_id):
+	* src/nact/nact-export-ask.c (base_get_iprefs_window_id):
+	* src/nact/nact-main-window.c
+	(instance_dispose, base_get_iprefs_window_id):
+	* src/nact/nact-preferences-editor.c (base_get_iprefs_window_id):
+	Update all preference names when saving/restoring window size and position.
+
 	* src/core/na-settings.c:
 	* src/core/na-settings.h: All getters/setters are implemented.
 
diff --git a/README-GCONF b/README-GCONF
index 982a7f7..567b6af 100644
--- a/README-GCONF
+++ b/README-GCONF
@@ -71,6 +71,7 @@ Deprecating GConf
  auto-save-on = false                       [nact]     main-save-auto
  auto-save-period = 5                       [nact]     main-save-period
  export-assistant = [377,33,699,675]        [nact]     export-assistant-wsp
+ export-ask-user = [377,33,699,675]         [nact]     export-ask-user-wsp
  export-folder-uri = file:///home/pierre..  [nact]     export-last-folder-uri
  export-format = Ask                        [nact]     export-preferred-format
  icommand-command-chooser                   [nact]     command-command-chooser-wsp
diff --git a/src/core/na-settings.c b/src/core/na-settings.c
index b957251..86711ab 100644
--- a/src/core/na-settings.c
+++ b/src/core/na-settings.c
@@ -131,6 +131,7 @@ static const KeyDef st_def_keys[] = {
 	{ "environment-show-if-running-last-folder-uri", GROUP_NACT,        NA_BOXED_TYPE_STRING,      "" },
 	{ "environment-try-exec-wsp",                    GROUP_NACT,        NA_BOXED_TYPE_UINT_LIST,   "" },
 	{ "environment-try-exec-last-folder-uri",        GROUP_NACT,        NA_BOXED_TYPE_STRING,      "" },
+	{ "export-ask-user-wsp",                         GROUP_NACT,        NA_BOXED_TYPE_UINT_LIST,   "" },
 	{ "export-assistant-wsp",                        GROUP_NACT,        NA_BOXED_TYPE_UINT_LIST,   "" },
 	{ "export-last-folder-uri",                      GROUP_NACT,        NA_BOXED_TYPE_STRING,      "" },
 	{ "export-preferred-format",                     GROUP_NACT,        NA_BOXED_TYPE_STRING,      "Desktop1" },
diff --git a/src/nact/nact-add-capability-dialog.c b/src/nact/nact-add-capability-dialog.c
index e4c3d03..e85a49e 100644
--- a/src/nact/nact-add-capability-dialog.c
+++ b/src/nact/nact-add-capability-dialog.c
@@ -302,7 +302,7 @@ nact_add_capability_dialog_run( BaseWindow *parent, GSList *capabilities )
 static gchar *
 base_get_iprefs_window_id( const BaseWindow *window )
 {
-	return( g_strdup( "add-capability-dialog" ));
+	return( g_strdup( "capability-add-capability-wsp" ));
 }
 
 static gchar *
diff --git a/src/nact/nact-add-scheme-dialog.c b/src/nact/nact-add-scheme-dialog.c
index 66ca96f..f0a6f6b 100644
--- a/src/nact/nact-add-scheme-dialog.c
+++ b/src/nact/nact-add-scheme-dialog.c
@@ -273,7 +273,7 @@ nact_add_scheme_dialog_run( BaseWindow *parent, GSList *schemes )
 static gchar *
 base_get_iprefs_window_id( const BaseWindow *window )
 {
-	return( g_strdup( "add-scheme-dialog" ));
+	return( g_strdup( "scheme-add-scheme-wsp" ));
 }
 
 static gchar *
diff --git a/src/nact/nact-assistant-export.c b/src/nact/nact-assistant-export.c
index 78d3b7c..124155e 100644
--- a/src/nact/nact-assistant-export.c
+++ b/src/nact/nact-assistant-export.c
@@ -327,7 +327,7 @@ nact_assistant_export_run( BaseWindow *main_window )
 static gchar *
 window_get_iprefs_window_id( const BaseWindow *window )
 {
-	return( g_strdup( "export-assistant" ));
+	return( g_strdup( "export-assistant-wsp" ));
 }
 
 static gchar *
diff --git a/src/nact/nact-assistant-import.c b/src/nact/nact-assistant-import.c
index c7e2b23..9b6428d 100644
--- a/src/nact/nact-assistant-import.c
+++ b/src/nact/nact-assistant-import.c
@@ -276,7 +276,7 @@ nact_assistant_import_run( BaseWindow *main_window )
 static gchar *
 window_get_iprefs_window_id( const BaseWindow *window )
 {
-	return( g_strdup( "import-assistant" ));
+	return( g_strdup( "import-assistant-wsp" ));
 }
 
 static gchar *
diff --git a/src/nact/nact-export-ask.c b/src/nact/nact-export-ask.c
index 71b4bb6..7dddb7b 100644
--- a/src/nact/nact-export-ask.c
+++ b/src/nact/nact-export-ask.c
@@ -275,7 +275,7 @@ nact_export_ask_user( BaseWindow *parent, NAObjectItem *item )
 static gchar *
 base_get_iprefs_window_id( const BaseWindow *window )
 {
-	return( g_strdup( "export-ask-user" ));
+	return( g_strdup( "export-ask-user-wsp" ));
 }
 
 static gchar *
diff --git a/src/nact/nact-main-window.c b/src/nact/nact-main-window.c
index d535548..9a79e43 100644
--- a/src/nact/nact-main-window.c
+++ b/src/nact/nact-main-window.c
@@ -136,6 +136,9 @@ enum {
 	LAST_SIGNAL
 };
 
+#define IPREFS_MAIN_WSP					"main-window-wsp"
+#define IPREFS_MAIN_PANED				"main-paned-width"
+
 static NactWindowClass *st_parent_class = NULL;
 static gint             st_signals[ LAST_SIGNAL ] = { 0 };
 
@@ -760,7 +763,7 @@ instance_dispose( GObject *window )
 
 		pane = base_window_get_widget( BASE_WINDOW( window ), "MainPaned" );
 		pos = gtk_paned_get_position( GTK_PANED( pane ));
-		base_iprefs_set_int( BASE_WINDOW( window ), "main-paned", pos );
+		base_iprefs_set_int( BASE_WINDOW( window ), IPREFS_MAIN_PANED, pos );
 
 		for( it = self->private->deleted ; it ; it = it->next ){
 			g_debug( "nact_main_window_instance_dispose: deleted=%p (%s)", ( void * ) it->data, G_OBJECT_TYPE_NAME( it->data ));
@@ -1086,7 +1089,7 @@ base_get_toplevel_name( const BaseWindow *window )
 static gchar *
 base_get_iprefs_window_id( const BaseWindow *window )
 {
-	return( g_strdup( "main-window" ));
+	return( g_strdup( IPREFS_MAIN_WSP ));
 }
 
 static gboolean
@@ -1123,7 +1126,7 @@ on_base_initial_load_toplevel( NactMainWindow *window, gpointer user_data )
 
 	if( !window->private->dispose_has_run ){
 
-		pos = base_iprefs_get_int( BASE_WINDOW( window ), "main-paned" );
+		pos = base_iprefs_get_int( BASE_WINDOW( window ), IPREFS_MAIN_PANED );
 		if( pos ){
 			pane = base_window_get_widget( BASE_WINDOW( window ), "MainPaned" );
 			gtk_paned_set_position( GTK_PANED( pane ), pos );
diff --git a/src/nact/nact-preferences-editor.c b/src/nact/nact-preferences-editor.c
index c6c2159..8db3539 100644
--- a/src/nact/nact-preferences-editor.c
+++ b/src/nact/nact-preferences-editor.c
@@ -259,7 +259,7 @@ nact_preferences_editor_run( BaseWindow *parent )
 static gchar *
 base_get_iprefs_window_id( const BaseWindow *window )
 {
-	return( g_strdup( "preferences-editor" ));
+	return( g_strdup( "preferences-wsp" ));
 }
 
 static gchar *
diff --git a/src/utils/na-gconf2key.sh.in b/src/utils/na-gconf2key.sh.in
index 77ce5b0..d66e845 100644
--- a/src/utils/na-gconf2key.sh.in
+++ b/src/utils/na-gconf2key.sh.in
@@ -460,6 +460,9 @@ gconftool-2 --all-entries ${na_preferences} | while read key x value; do
 		export-assistant)
 			add_pref "nact" "export-assistant-wsp" list "${value}"
 			;;
+		export-ask-user)
+			add_pref "nact" "export-ask-user-wsp" list "${value}"
+			;;
 		export-folder-uri)
 			add_pref "nact" "export-last-folder-uri" str "${value}"
 			;;



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