Commit 57a1da0b authored by Michael Meeks's avatar Michael Meeks Committed by Michael Meeks

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.
parent c8fd8946
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.
2002-02-27 Michael Meeks <michael@ximian.com>
* libnautilus-private/nautilus-file-operations.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,
......
......@@ -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),
......
......@@ -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"
......
......@@ -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));
......
......@@ -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);
}
/**
......
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment