[nautilus-actions] Adjustements on IconChooser preferences



commit 1d072bddf7ef1a1c2a390c0a818c4258ca167305
Author: Pierre Wieser <pwieser trychlos org>
Date:   Wed Jan 12 22:34:42 2011 +0100

    Adjustements on IconChooser preferences

 README-GCONF                 |   30 +++++++++++++++---------------
 src/core/na-settings.c       |    2 +-
 src/core/na-settings.h       |    2 +-
 src/nact/base-iprefs.h       |   28 ++++++++++++++++++++--------
 src/nact/nact-icon-chooser.c |   16 ++++++++++------
 src/utils/na-gconf2key.sh.in |    2 +-
 6 files changed, 48 insertions(+), 32 deletions(-)
---
diff --git a/README-GCONF b/README-GCONF
index 5b6d6ec..982a7f7 100644
--- a/README-GCONF
+++ b/README-GCONF
@@ -64,31 +64,31 @@ Deprecating GConf
 
  GConf                                      Group      Key
  -----------------------------------------  ------     --------------------------------------
- add-capability-dialog = [720,263,384,246]  [nact]     capability-add-capability-dialog-size
- add-scheme-dialog = [720,263,352,271]      [nact]     scheme-add-scheme-dialog-size
+ add-capability-dialog = [720,263,384,246]  [nact]     capability-add-capability-wsp
+ add-scheme-dialog = [720,263,352,271]      [nact]     scheme-add-scheme-wsp
  assistant-esc-confirm = true               [nact]     assistant-esc-confirm
  assistant-esc-quit = true                  [nact]     assistant-esc-quit
  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-dialog-size
+ export-assistant = [377,33,699,675]        [nact]     export-assistant-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-dialog-size
+ icommand-command-chooser                   [nact]     command-command-chooser-wsp
  icommand-folder-uri                        [nact]     command-command-chooser-last-folder-uri
- icommand-legend-dialog = [673,94,474,480]  [nact]     command-legend-dialog-size
- icommand-working-dir-dialog                [nact]     command-working-dir-chooser-dialog-size
+ icommand-legend-dialog = [673,94,474,480]  [nact]     command-legend-wsp
+ icommand-working-dir-dialog                [nact]     command-working-dir-chooser-wsp
  icommand-working-dir-uri = file:///home..  [nact]     command-working-dir-chooser-last-folder-uri
- icons-chooser = [425,124,839,539]          [nact]     item-icon-chooser-dialog-size
- icons-path = file:///usr/share/icons/hi..  [nact]     item-icon-browse-last-path
- ienvironment-show-if-running-dialog = [..  [nact]     environment-show-if-running-dialog-size
+ icons-chooser = [425,124,839,539]          [nact]     item-icon-chooser-wsp
+ icons-path = file:///usr/share/icons/hi..  [nact]     item-icon-chooser-last-file-uri
+ ienvironment-show-if-running-dialog = [..  [nact]     environment-show-if-running-wsp
  ienvironment-show-if-running-uri = file..  [nact]     environment-show-if-running-last-folder-uri
- ienvironment-try-exec-dialog = [327,70,..  [nact]     environment-try-exec-dialog-size
+ ienvironment-try-exec-dialog = [327,70,..  [nact]     environment-try-exec-wsp
  ienvironment-try-exec-uri = file:///bin    [nact]     environment-try-exec-last-folder-uri
- ifolders-chooser = [418,86,632,573]        [nact]     folder-chooser-dialog-size
+ ifolders-chooser = [418,86,632,573]        [nact]     folder-chooser-wsp
  ifolders-path = /home/pierre/data/Pictures [nact]     folder-last-path
- import-ask-user                            [nact]     import-ask-user-dialog-size
+ import-ask-user                            [nact]     import-ask-user-wsp
  import-ask-user-last-mode                  [nact]     import-ask-user-last-mode
- import-assistant                           [nact]     import-assistant-dialog-size
+ import-assistant                           [nact]     import-assistant-wsp
  import-folder-uri                          [nact]     import-last-folder-uri
  import-keep-choice                         [nact]     import-mode-keep-last-choice
  import-mode = NoImport                     [nact]     import-preferred-mode
@@ -105,9 +105,9 @@ Deprecating GConf
  main-edit-toolbar = true                   [nact]     main-toolbar-edit-display
  main-file-toolbar = true                   [nact]     main-toolbar-file-display
  main-help-toolbar = true                   [nact]     main-toolbar-help-display
- main-paned = 211                           [nact]     main-pane-width
+ main-paned = 211                           [nact]     main-paned-width
  main-window = [319,95,901,533]             [nact]     main-window-size
- preferences-editor = [548,218,497,392]     [nact]     preferences-dialog-size
+ preferences-editor = [548,218,497,392]     [nact]     preferences-wsp
  schemes = [dav|WebDAV files,file|Local files,ftp|FTP files,sftp|SSH files,smb|Windows files]
                                             [nact]     scheme-default-list
 
diff --git a/src/core/na-settings.c b/src/core/na-settings.c
index ad27528..b957251 100644
--- a/src/core/na-settings.c
+++ b/src/core/na-settings.c
@@ -143,7 +143,7 @@ static const KeyDef st_def_keys[] = {
 	{ "import-mode-keep-last-choice",                GROUP_NACT,        NA_BOXED_TYPE_BOOLEAN,     "false" },
 	{ "import-preferred-mode",                       GROUP_NACT,        NA_BOXED_TYPE_STRING,      "" },
 	{ "io-providers-write-order",                    GROUP_NACT,        NA_BOXED_TYPE_STRING_LIST, "" },
-	{ "item-icon-chooser-last-uri",                  GROUP_NACT,        NA_BOXED_TYPE_STRING,      "" },
+	{ "item-icon-chooser-last-file-uri",             GROUP_NACT,        NA_BOXED_TYPE_STRING,      "" },
 	{ "item-icon-chooser-paned-width",               GROUP_NACT,        NA_BOXED_TYPE_UINT,        "200" },
 	{ "item-icon-chooser-wsp",                       GROUP_NACT,        NA_BOXED_TYPE_UINT_LIST,   "" },
 	{ "main-paned-width",                            GROUP_NACT,        NA_BOXED_TYPE_UINT,        "200" },
diff --git a/src/core/na-settings.h b/src/core/na-settings.h
index bae8c41..29f556b 100644
--- a/src/core/na-settings.h
+++ b/src/core/na-settings.h
@@ -81,7 +81,7 @@ typedef struct {
 
 GType na_settings_get_type( void );
 
-/* monitorable keys
+/* these keys should be monitored, at least by the Nautilus menu plugin
  */
 #define NA_SETTINGS_RUNTIME_IO_PROVIDER_READ_STATUS		"io-provider-read-status-composite-key"
 #define NA_SETTINGS_RUNTIME_IO_PROVIDERS_READ_ORDER		"io-providers-read-order"
diff --git a/src/nact/base-iprefs.h b/src/nact/base-iprefs.h
index 08d5e9f..eae19c9 100644
--- a/src/nact/base-iprefs.h
+++ b/src/nact/base-iprefs.h
@@ -32,14 +32,17 @@
 #define __BASE_IPREFS_H__
 
 /**
- * SECTION: base_iprefs
- * @short_description: #BaseIPrefs interface definition.
- * @include: nact/base-iprefs.h
+ * SECTION: base-iprefs
+ * @title: BaseIPrefs
+ * @short_description: The BaseIPrefs Interface Definition
+ * @include: base-iprefs.h
  *
- * This interface cooperates with #BaseWindow to automatically
- * save, then restore, size and position of window on the display.
- * This is made possible by identifying each window by an id specific
- * to this function.
+ * This interface cooperates with #BaseWindow to automatically save and
+ * restore size and position of windows on the display.
+ *
+ * Each #BaseWindow -derived window which want take advantage of this
+ * feature may want implement this BaseIPrefs interface (but see also the
+ * BaseWindow::base-wsp property which provides this same feature).
  */
 
 #include "base-window.h"
@@ -59,8 +62,17 @@ typedef struct {
 	GTypeInterface              parent;
 	BaseIPrefsInterfacePrivate *private;
 
-	/* api */
+	/* api
+	 * deprecated: 3.1.0
+	 */
 	gchar * ( *iprefs_get_window_id )( const BaseWindow *window );
+
+	/* new api
+	 * since: 3.1.0
+	 */
+	const gchar * ( *get_wsp_id )   ( const BaseWindow *window );
+	GList       * ( *get_uint_list )( const BaseWindow *window );
+	void          ( *set_uint_list )( const BaseWindow *window, GList *list );
 }
 	BaseIPrefsInterface;
 
diff --git a/src/nact/nact-icon-chooser.c b/src/nact/nact-icon-chooser.c
index 75ed09c..2315e08 100644
--- a/src/nact/nact-icon-chooser.c
+++ b/src/nact/nact-icon-chooser.c
@@ -55,10 +55,14 @@ struct _NactIconChooserPrivate {
 	GtkWidget    *path_preview;
 };
 
+#define IPREFS_PANED_WIDTH				"item-icon-chooser-paned-width"
+#define IPREFS_LAST_URI					"item-icon-chooser-last-file-uri"
+#define IPREFS_WSP						"item-icon-chooser-wsp"
+
 #define VIEW_ICON_SIZE					GTK_ICON_SIZE_DND
 #define VIEW_ICON_DEFAULT_WIDTH			32	/* width of the GTK_ICON_SIZE_DND icon size */
 #define PREVIEW_ICON_SIZE				GTK_ICON_SIZE_DIALOG
-#define PREVIEW_ICON_WIDTH				48
+#define PREVIEW_ICON_WIDTH				64
 #define CURRENT_ICON_SIZE				GTK_ICON_SIZE_DIALOG
 
 /* column ordering in the Stock model
@@ -243,7 +247,7 @@ instance_dispose( GObject *dialog )
 
 		paned = base_window_get_widget( BASE_WINDOW( self ), "IconPaned" );
 		pos = gtk_paned_get_position( GTK_PANED( paned ));
-		base_iprefs_set_int( BASE_WINDOW( self ), "item-icon-chooser-paned-width", pos );
+		base_iprefs_set_int( BASE_WINDOW( self ), IPREFS_PANED_WIDTH, pos );
 
 		/* chain up to the parent class */
 		if( G_OBJECT_CLASS( st_parent_class )->dispose ){
@@ -326,7 +330,7 @@ nact_icon_chooser_choose_icon( BaseWindow *parent, const gchar *icon_name )
 static gchar *
 base_get_iprefs_window_id( const BaseWindow *window )
 {
-	return( g_strdup( "item-icon-chooser-wsp" ));
+	return( g_strdup( IPREFS_WSP ));
 }
 
 static gchar *
@@ -444,7 +448,7 @@ on_base_runtime_init_dialog( NactIconChooser *editor, gpointer user_data )
 
 	g_debug( "%s: editor=%p, user_data=%p", thisfn, ( void * ) editor, ( void * ) user_data );
 
-	pos = base_iprefs_get_int( BASE_WINDOW( editor ), "item-icon-chooser-paned-width" );
+	pos = base_iprefs_get_int( BASE_WINDOW( editor ), IPREFS_PANED_WIDTH );
 	if( pos ){
 		paned = base_window_get_widget( BASE_WINDOW( editor ), "IconPaned" );
 		gtk_paned_set_position( GTK_PANED( paned ), pos );
@@ -524,7 +528,7 @@ fillup_icons_by_path( NactIconChooser *editor )
 
 	gtk_file_chooser_unselect_all( file_chooser );
 
-	uri = na_settings_get_string( settings, "item-icon-chooser-last-uri", NULL, NULL );
+	uri = na_settings_get_string( settings, IPREFS_LAST_URI, NULL, NULL );
 	if( uri ){
 		gtk_file_chooser_set_uri( file_chooser, uri );
 		g_free( uri );
@@ -832,7 +836,7 @@ on_path_selection_changed( GtkFileChooser *file_chooser, NactIconChooser *editor
 		application = NACT_APPLICATION( base_window_get_application( BASE_WINDOW( editor )));
 		updater = nact_application_get_updater( application );
 		settings = na_pivot_get_settings( NA_PIVOT( updater ));
-		na_settings_set_string( settings, "item-icon-chooser-last-uri", uri );
+		na_settings_set_string( settings, IPREFS_LAST_URI, uri );
 		g_free( uri );
 	}
 }
diff --git a/src/utils/na-gconf2key.sh.in b/src/utils/na-gconf2key.sh.in
index e2209ba..77ce5b0 100644
--- a/src/utils/na-gconf2key.sh.in
+++ b/src/utils/na-gconf2key.sh.in
@@ -485,7 +485,7 @@ gconftool-2 --all-entries ${na_preferences} | while read key x value; do
 			add_pref "nact" "item-icon-chooser-wsp" list "${value}"
 			;;
 		icons-path)
-			add_pref "nact" "item-icon-chooser-last-uri" str "${value}"
+			add_pref "nact" "item-icon-chooser-last-file-uri" str "${value}"
 			;;
 		ienvironment-show-if-running-dialog)
 			add_pref "nact" "environment-show-if-running-wsp" list "${value}"



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