diff options
author | Michael Meeks <michael@ximian.com> | 2002-02-27 10:56:08 +0000 |
---|---|---|
committer | Michael Meeks <michael@src.gnome.org> | 2002-02-27 10:56:08 +0000 |
commit | 57a1da0b53449fa54aae6863a0d6334de16d3877 (patch) | |
tree | 1685225c3ed3d3a1132f22464c5f69639ab69654 /libnautilus-private | |
parent | c8fd894632bbb8b903428a4fd60d40070b043c10 (diff) | |
download | nautilus-57a1da0b53449fa54aae6863a0d6334de16d3877.tar.gz |
impl. (get_xalf_prefix): use gconf.
2002-02-27 Michael Meeks <michael@ximian.com>
* libnautilus-private/nautilus-program-choosing.c
(concat_option_cb): impl.
(get_xalf_prefix): use gconf.
* libnautilus-private/nautilus.schemas: add Xalf bits.
* libnautilus-private/nautilus-global-preferences.c: ditto.
* libnautilus-private/nautilus-icon-container.c
(nautilus_icon_container_start_renaming_selected_item):
don't pass a font name, it isn't used anyway.
* libnautilus-private/nautilus-directory-async.c
(should_display_file_name): protect with
GNOME2_HAS_MEDUSA instead.
Diffstat (limited to 'libnautilus-private')
-rw-r--r-- | libnautilus-private/nautilus-directory-async.c | 2 | ||||
-rw-r--r-- | libnautilus-private/nautilus-global-preferences.c | 10 | ||||
-rw-r--r-- | libnautilus-private/nautilus-global-preferences.h | 4 | ||||
-rw-r--r-- | libnautilus-private/nautilus-icon-container.c | 12 | ||||
-rw-r--r-- | libnautilus-private/nautilus-program-choosing.c | 43 | ||||
-rw-r--r-- | libnautilus-private/nautilus.schemas | 29 |
6 files changed, 73 insertions, 27 deletions
diff --git a/libnautilus-private/nautilus-directory-async.c b/libnautilus-private/nautilus-directory-async.c index 619f4fd73..8d347c9f8 100644 --- a/libnautilus-private/nautilus-directory-async.c +++ b/libnautilus-private/nautilus-directory-async.c @@ -1808,7 +1808,7 @@ mark_all_files_unconfirmed (NautilusDirectory *directory) } } -#if GNOME2_CONVERSION_COMPLETE +#if GNOME2_HAS_MEDUSA static gboolean should_display_file_name (const char *name, diff --git a/libnautilus-private/nautilus-global-preferences.c b/libnautilus-private/nautilus-global-preferences.c index 535ce437d..ccb72ae94 100644 --- a/libnautilus-private/nautilus-global-preferences.c +++ b/libnautilus-private/nautilus-global-preferences.c @@ -342,6 +342,16 @@ static const PreferenceDefault preference_defaults[] = { NULL, NULL, "click_policy" }, + { NAUTILUS_PREFERENCES_XALF_ENABLED, + PREFERENCE_BOOLEAN, + GINT_TO_POINTER (TRUE), + NULL, NULL, NULL + }, + { NAUTILUS_PREFERENCES_XALF_OPTIONS, + PREFERENCE_STRING_LIST, + "", + NULL, NULL, NULL + }, { NAUTILUS_PREFERENCES_EXECUTABLE_TEXT_ACTIVATION, PREFERENCE_INTEGER, GINT_TO_POINTER (NAUTILUS_EXECUTABLE_TEXT_ASK), diff --git a/libnautilus-private/nautilus-global-preferences.h b/libnautilus-private/nautilus-global-preferences.h index 9168aca07..00326c749 100644 --- a/libnautilus-private/nautilus-global-preferences.h +++ b/libnautilus-private/nautilus-global-preferences.h @@ -82,6 +82,10 @@ G_BEGIN_DECLS /* Single/Double click preference */ #define NAUTILUS_PREFERENCES_CLICK_POLICY "preferences/click_policy" +/* Xalf settings */ +#define NAUTILUS_PREFERENCES_XALF_ENABLED "preferences/xalf/enabled" +#define NAUTILUS_PREFERENCES_XALF_OPTIONS "preferences/xalf/options" + /* Activating executable text files */ #define NAUTILUS_PREFERENCES_EXECUTABLE_TEXT_ACTIVATION "preferences/executable_text_activation" diff --git a/libnautilus-private/nautilus-icon-container.c b/libnautilus-private/nautilus-icon-container.c index 0028a0459..e8faa44c3 100644 --- a/libnautilus-private/nautilus-icon-container.c +++ b/libnautilus-private/nautilus-icon-container.c @@ -4811,15 +4811,11 @@ nautilus_icon_container_start_renaming_selected_item (NautilusIconContainer *con gnome_icon_text_item_configure (details->rename_widget, x, - eel_round (icon_rect.y1), /* y_top */ + eel_round (icon_rect.y1), /* y_top */ width, -#ifdef GNOME2_CONVERSION_COMPLETE - details->label_font[details->zoom_level], /* font */ -#else - "Helvetica", -#endif - editable_text, /* text */ - TRUE, FALSE); /* allocate local copy */ + NULL, + editable_text, /* text */ + TRUE, FALSE); /* allocate local copy */ if (GNOME_CANVAS_ITEM (details->rename_widget)->canvas->focused_item != GNOME_CANVAS_ITEM (details->rename_widget)) { gnome_canvas_item_grab_focus (GNOME_CANVAS_ITEM (details->rename_widget)); diff --git a/libnautilus-private/nautilus-program-choosing.c b/libnautilus-private/nautilus-program-choosing.c index 3d6042e4d..3580d86e5 100644 --- a/libnautilus-private/nautilus-program-choosing.c +++ b/libnautilus-private/nautilus-program-choosing.c @@ -28,9 +28,11 @@ #include "nautilus-mime-actions.h" #include "nautilus-program-chooser.h" +#include "nautilus-global-preferences.h" #include <eel/eel-glib-extensions.h> #include <eel/eel-gnome-extensions.h> #include <eel/eel-stock-dialogs.h> +#include <eel/eel-preferences.h> #include <eel/eel-string.h> #include <gtk/gtk.h> #include <libgnome/gnome-config.h> @@ -590,15 +592,29 @@ nautilus_launch_application (GnomeVFSMimeApplication *application, g_free (parameter); } +static void +concat_option_cb (const char *string, + gpointer callback_data) +{ + char *quoted; + GString *s; + + s = callback_data; + quoted = g_shell_quote (string); + + g_string_append (s, quoted); + g_string_append_c (s, ' '); + + g_free (quoted); +} + static char * get_xalf_prefix (const char *name) { char *xalf_executable; GString *s; - int argc, i; - char **argv; char *quoted; - char *prefix; + EelStringList *str_list; /* FIXME bugzilla.gnome.org 48206: At time I am writing this, * xalf is still pretty buggy, and Nautilus uses it a lot more @@ -611,7 +627,7 @@ get_xalf_prefix (const char *name) if (g_getenv ("NAUTILUS_USE_XALF") == NULL) { return g_strdup (""); } - if (!gnome_config_get_bool ("/xalf/settings/enabled=true")) { + if (!eel_preferences_get_boolean (NAUTILUS_PREFERENCES_XALF_ENABLED)) { return g_strdup (""); } xalf_executable = g_find_program_in_path ("xalf"); @@ -626,22 +642,13 @@ get_xalf_prefix (const char *name) g_free (quoted); g_string_append_c (s, ' '); - gnome_config_get_vector ("/xalf/settings/options", - &argc, &argv); - for (i = 0; i < argc; i++) { - quoted = g_shell_quote (argv[i]); - g_free (argv[i]); - - g_string_append (s, quoted); - g_string_append_c (s, ' '); - - g_free (quoted); + str_list = eel_preferences_get_string_list (NAUTILUS_PREFERENCES_XALF_OPTIONS); + if (str_list) { + eel_string_list_for_each (str_list, concat_option_cb, s); + eel_string_list_free (str_list); } - g_free (argv); - prefix = s->str; - g_string_free (s, FALSE); - return prefix; + return g_string_free (s, FALSE); } /** diff --git a/libnautilus-private/nautilus.schemas b/libnautilus-private/nautilus.schemas index 4b898286f..12d55a3d0 100644 --- a/libnautilus-private/nautilus.schemas +++ b/libnautilus-private/nautilus.schemas @@ -21,6 +21,35 @@ </locale> </schema> + <schema> + <key>/schemas/apps/nautilus/preferences/xalf/enabled</key> + <applyto>/apps/nautilus/preferences/xalf/enabled</applyto> + <owner>nautilus</owner> + <type>bool</type> + <default>true</default> + <locale name="C"> + <short>Whether to use xalf</short> + <long> + If set to true, then Xalf will be used to provide + application launch feedback. + </long> + </locale> + </schema> + + <schema> + <key>/schemas/apps/nautilus/preferences/xalf/options</key> + <applyto>/apps/nautilus/preferences/xalf/options</applyto> + <owner>nautilus</owner> + <type>list</type> + <locale name="C"> + <short>xalf options</short> + <long> + a set of strings which are passed as options to Xalf if + it is used. + </long> + </locale> + </schema> + <schema> <key>/schemas/apps/nautilus/preferences/show_backup_files</key> <applyto>/apps/nautilus/preferences/show_backup_files</applyto> |