Commit dcb478cf authored by Darin Adler's avatar Darin Adler

reviewed by: John Sullivan <sullivan@eazel.com>

	Fix bug 6495 (Emacs-style keybindings not working in location bar
	and other NautilusEntry fields) by adding an expert preference to
	control whether the Emacs shortcuts or the ones in the menu bar
	take precedence. I started with Maciej's patch and did many
	refinements.

	Fix bug 1788 ("Select All" needs to be implemented for text): I
	had to add Select All so it won't do the icon view's Select All
	when you do a select all with the location bar focused.

	Fix bug 5612 (clicking to deselect causes incorrect menu
	sensitivity) by adding another signal handler for button clicks.

	Fix bug 7581 (When trying to restart Nautilus after crash from bug
	7579 I get a Segmentation Fault). I was just lucky enough to run
	into the problem on my machine.

	* libnautilus-extensions/nautilus-global-preferences.h:
	* libnautilus-extensions/nautilus-global-preferences.c:
	(global_preferences_install_descriptions),
	(global_preferences_install_defaults),
	(global_preferences_install_visibility),
	(global_preferences_create_dialog): Added the new Emacs-shortcut
	preference with the wording requested in the bug report.

	* libnautilus-extensions/nautilus-entry.h:
	* libnautilus-extensions/nautilus-entry.c:
	(emacs_shortcuts_preference_changed_callback): Track the
	preference.
	(nautilus_entry_initialize): Set up the callback to track the
	preference.
	(nautilus_entry_destroy): Tear down the callback to track the
	preference.
	(nautilus_entry_key_press): Allow the emacs shortcuts built into
	GtkEntry to work if the preference is set that way. Also, only
	emit the selection_changed signal if the key is actually handled.
	(nautilus_entry_motion_notify): Simplify the logic, since it's
	OK to send the selection_changed signal a little too often.
	(select_all_at_idle): Handle the case where the object is
	destroyed.
	(nautilus_entry_select_all_at_idle): Ref the object to handle the
	case where the object is destroyed before the idle happens.
	(nautilus_entry_button_press): Send a selection_changed message,
	since pressing the button can cause a selection change.
	(nautilus_entry_button_release): Send a selection_changed message,
	since pressing the button can cause a selection change.
	(nautilus_entry_initialize_class): Add new default handlers. Also,
	move to bottom of file so we don't need so many forward
	declarations.

	* libnautilus/nautilus-clipboard-ui.xml: Add a Select All Text
	command.
	* libnautilus/nautilus-clipboard.c: (select_all): New function to
	select all the text in a GtkEditable. Sadly it needs a special
	case for GtkText.
	(select_all_idle_callback): Callback used to select the text from
	idle.
	(select_all_callback): Callback that sets up the idle. Called from
	the bonobo verb.
	(initialize_clipboard_component_with_callback_data): Add the
	callback for Select All.

	* librsvg/rsvg.c: (rsvg_state_init): Initialize more fields,
	including font_size.
	(rsvg_text_handler_characters): Don't try to draw if the font
	size is 0 or negative.
	* librsvg/art_render_mask.c: (art_render_mask_render): Handle
	cases where x1 < x0. The old code would seg. fault. This was the
	reason we got a crash in bug 7581.

	* configure.in: Upped the required version of gnome-vfs.
parent a85afd0f
2001-03-16 Darin Adler <darin@eazel.com>
reviewed by: John Sullivan <sullivan@eazel.com>
Fix bug 6495 (Emacs-style keybindings not working in location bar
and other NautilusEntry fields) by adding an expert preference to
control whether the Emacs shortcuts or the ones in the menu bar
take precedence. I started with Maciej's patch and did many
refinements.
Fix bug 1788 ("Select All" needs to be implemented for text): I
had to add Select All so it won't do the icon view's Select All
when you do a select all with the location bar focused.
Fix bug 5612 (clicking to deselect causes incorrect menu
sensitivity) by adding another signal handler for button clicks.
Fix bug 7581 (When trying to restart Nautilus after crash from bug
7579 I get a Segmentation Fault). I was just lucky enough to run
into the problem on my machine.
* libnautilus-extensions/nautilus-global-preferences.h:
* libnautilus-extensions/nautilus-global-preferences.c:
(global_preferences_install_descriptions),
(global_preferences_install_defaults),
(global_preferences_install_visibility),
(global_preferences_create_dialog): Added the new Emacs-shortcut
preference with the wording requested in the bug report.
* libnautilus-extensions/nautilus-entry.h:
* libnautilus-extensions/nautilus-entry.c:
(emacs_shortcuts_preference_changed_callback): Track the
preference.
(nautilus_entry_initialize): Set up the callback to track the
preference.
(nautilus_entry_destroy): Tear down the callback to track the
preference.
(nautilus_entry_key_press): Allow the emacs shortcuts built into
GtkEntry to work if the preference is set that way. Also, only
emit the selection_changed signal if the key is actually handled.
(nautilus_entry_motion_notify): Simplify the logic, since it's
OK to send the selection_changed signal a little too often.
(select_all_at_idle): Handle the case where the object is
destroyed.
(nautilus_entry_select_all_at_idle): Ref the object to handle the
case where the object is destroyed before the idle happens.
(nautilus_entry_button_press): Send a selection_changed message,
since pressing the button can cause a selection change.
(nautilus_entry_button_release): Send a selection_changed message,
since pressing the button can cause a selection change.
(nautilus_entry_initialize_class): Add new default handlers. Also,
move to bottom of file so we don't need so many forward
declarations.
* libnautilus/nautilus-clipboard-ui.xml: Add a Select All Text
command.
* libnautilus/nautilus-clipboard.c: (select_all): New function to
select all the text in a GtkEditable. Sadly it needs a special
case for GtkText.
(select_all_idle_callback): Callback used to select the text from
idle.
(select_all_callback): Callback that sets up the idle. Called from
the bonobo verb.
(initialize_clipboard_component_with_callback_data): Add the
callback for Select All.
* librsvg/rsvg.c: (rsvg_state_init): Initialize more fields,
including font_size.
(rsvg_text_handler_characters): Don't try to draw if the font
size is 0 or negative.
* librsvg/art_render_mask.c: (art_render_mask_render): Handle
cases where x1 < x0. The old code would seg. fault. This was the
reason we got a crash in bug 7581.
* configure.in: Upped the required version of gnome-vfs.
2001-03-16 Robey Pointer <robey@eazel.com>
* nautilus-installer/src/main.c: (main):
......
......@@ -19,7 +19,7 @@ CONTROL_CENTER_REQUIRED=1.2.3
IMLIB_REQUIRED=1.9.8
LIBXML_REQUIRED=1.8.10
ORBIT_REQUIRED=0.5.6
GNOME_VFS_REQUIRED=0.4.2
GNOME_VFS_REQUIRED=1.0
POPT_REQUIRED=1.5
FREETYPE_REQUIRED=2.0
MEDUSA_REQUIRED=0.2.2
......
......@@ -28,20 +28,18 @@
#include "nautilus-entry.h"
#include "nautilus-gtk-macros.h"
#include <gdk/gdkkeysyms.h>
#include <gtk/gtksignal.h>
#include <gtk/gtkmain.h>
#include <gtk/gtkwidget.h>
#include <libgnome/gnome-defs.h>
#include <gtk/gtksignal.h>
#include <libgnome/gnome-i18n.h>
#include <libnautilus-extensions/nautilus-gdk-extensions.h>
#include <libnautilus-extensions/nautilus-global-preferences.h>
#include <libnautilus-extensions/nautilus-undo-signal-handlers.h>
#include <orb/orbit.h>
struct NautilusEntryDetails {
gboolean use_emacs_shortcuts;
};
enum {
USER_CHANGED,
......@@ -50,68 +48,22 @@ enum {
};
static guint signals[LAST_SIGNAL];
static void nautilus_entry_initialize (NautilusEntry *entry);
static void nautilus_entry_initialize (NautilusEntry *entry);
static void nautilus_entry_initialize_class (NautilusEntryClass *class);
static void nautilus_entry_destroy (GtkObject *object);
static gint nautilus_entry_key_press (GtkWidget *widget,
GdkEventKey *event);
static gint nautilus_entry_motion_notify (GtkWidget *widget,
GdkEventMotion *event);
static void nautilus_entry_insert_text (GtkEditable *editable,
const gchar *text,
gint length,
gint *position);
static gboolean nautilus_entry_selection_clear (GtkWidget *widget,
GdkEventSelection *event);
static void nautilus_entry_delete_text (GtkEditable *editable,
gint start_pos,
gint end_pos);
static void nautilus_entry_set_selection (GtkEditable *editable,
gint start_pos,
gint end_pos);
NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusEntry, nautilus_entry, GTK_TYPE_ENTRY)
NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusEntry,
nautilus_entry,
GTK_TYPE_ENTRY)
static void
nautilus_entry_initialize_class (NautilusEntryClass *class)
emacs_shortcuts_preference_changed_callback (gpointer callback_data)
{
GtkWidgetClass *widget_class;
GtkObjectClass *object_class;
GtkEditableClass *editable_class;
widget_class = GTK_WIDGET_CLASS (class);
object_class = GTK_OBJECT_CLASS (class);
editable_class = GTK_EDITABLE_CLASS (class);
widget_class->key_press_event = nautilus_entry_key_press;
widget_class->motion_notify_event = nautilus_entry_motion_notify;
widget_class->selection_clear_event = nautilus_entry_selection_clear;
object_class->destroy = nautilus_entry_destroy;
editable_class->insert_text = nautilus_entry_insert_text;
editable_class->delete_text = nautilus_entry_delete_text;
editable_class->set_selection = nautilus_entry_set_selection;
NautilusEntry *entry;
entry = NAUTILUS_ENTRY (callback_data);
/* Set up signals */
signals[USER_CHANGED] = gtk_signal_new
("user_changed",
GTK_RUN_LAST,
object_class->type,
GTK_SIGNAL_OFFSET (NautilusEntryClass,
user_changed),
gtk_marshal_NONE__NONE,
GTK_TYPE_NONE, 0);
signals[SELECTION_CHANGED] = gtk_signal_new
("selection_changed",
GTK_RUN_LAST,
object_class->type,
GTK_SIGNAL_OFFSET (NautilusEntryClass,
selection_changed),
gtk_marshal_NONE__NONE,
GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
entry->details->use_emacs_shortcuts =
nautilus_preferences_get_boolean (NAUTILUS_PREFERENCES_USE_EMACS_SHORTCUTS);
}
static void
......@@ -120,15 +72,19 @@ nautilus_entry_initialize (NautilusEntry *entry)
GtkWidget *widget;
widget = GTK_WIDGET (entry);
entry->details = g_new0 (NautilusEntryDetails, 1);
entry->user_edit = TRUE;
entry->special_tab_handling = FALSE;
entry->cursor_obscured = FALSE;
/* Allow pointer motion events so we can expose an obscured cursor if necessary */
gtk_widget_set_events (widget, gtk_widget_get_events (widget) | GDK_POINTER_MOTION_MASK);
nautilus_undo_set_up_nautilus_entry_for_undo (entry);
nautilus_preferences_add_callback (NAUTILUS_PREFERENCES_USE_EMACS_SHORTCUTS,
emacs_shortcuts_preference_changed_callback,
entry);
emacs_shortcuts_preference_changed_callback (entry);
}
GtkWidget *
......@@ -148,7 +104,6 @@ nautilus_entry_new_with_max_length (guint16 max)
return widget;
}
static void
nautilus_entry_destroy (GtkObject *object)
{
......@@ -156,6 +111,12 @@ nautilus_entry_destroy (GtkObject *object)
entry = NAUTILUS_ENTRY (object);
nautilus_preferences_remove_callback (NAUTILUS_PREFERENCES_USE_EMACS_SHORTCUTS,
emacs_shortcuts_preference_changed_callback,
entry);
g_free (entry->details);
NAUTILUS_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
}
......@@ -170,14 +131,13 @@ obscure_cursor (NautilusEntry *entry)
nautilus_gdk_window_set_invisible_cursor (GTK_ENTRY (entry)->text_area);
}
static gint
static gboolean
nautilus_entry_key_press (GtkWidget *widget, GdkEventKey *event)
{
NautilusEntry *entry;
GtkEditable *editable;
int position;
gint return_code;
gboolean result;
entry = NAUTILUS_ENTRY (widget);
editable = GTK_EDITABLE (widget);
......@@ -194,8 +154,7 @@ nautilus_entry_key_press (GtkWidget *widget, GdkEventKey *event)
* should position the insertion point at the end of
* the selection.
*/
if (entry->special_tab_handling
&& editable->has_selection) {
if (entry->special_tab_handling && editable->has_selection) {
position = strlen (gtk_entry_get_text (GTK_ENTRY (editable)));
gtk_entry_select_region (GTK_ENTRY (editable), position, position);
return TRUE;
......@@ -203,9 +162,9 @@ nautilus_entry_key_press (GtkWidget *widget, GdkEventKey *event)
break;
case GDK_KP_Enter:
/* Fix bug in GtkEntry where keypad Enter key inserts
* a character rather than activating like the other
* Enter key.
/* Work around bug in GtkEntry where keypad Enter key
* inserts a character rather than activating like the
* other Enter key.
*/
gtk_widget_activate (widget);
return TRUE;
......@@ -214,27 +173,33 @@ nautilus_entry_key_press (GtkWidget *widget, GdkEventKey *event)
break;
}
/* Filter out default GTKEntry alt and control key bindings. They have numerous conflicts
* with Nautilus menu keyboard accelerators.
*/
if (event->state & GDK_CONTROL_MASK || event->state & GDK_MOD1_MASK) {
return FALSE;
if (!entry->details->use_emacs_shortcuts) {
/* Filter out the emacs-style keyboard shortcuts in
* GtkEntry for alt and control keys. They have
* numerous conflicts with menu keyboard shortcuts.
*/
if (event->state & GDK_CONTROL_MASK || event->state & GDK_MOD1_MASK) {
return FALSE;
}
}
obscure_cursor (entry);
return_code = NAUTILUS_CALL_PARENT_WITH_RETURN_VALUE
result = NAUTILUS_CALL_PARENT_WITH_RETURN_VALUE
(GTK_WIDGET_CLASS, key_press_event, (widget, event));
gtk_signal_emit (GTK_OBJECT (widget), signals[SELECTION_CHANGED]);
return return_code;
if (result) {
gtk_signal_emit (GTK_OBJECT (widget), signals[SELECTION_CHANGED]);
}
return result;
}
static gint
static gboolean
nautilus_entry_motion_notify (GtkWidget *widget, GdkEventMotion *event)
{
gint return_code;
int result;
guint old_start_pos, old_end_pos;
GdkCursor *cursor;
NautilusEntry *entry;
......@@ -248,21 +213,17 @@ nautilus_entry_motion_notify (GtkWidget *widget, GdkEventMotion *event)
entry->cursor_obscured = FALSE;
}
if (GTK_ENTRY (widget)->button == 0) {
return FALSE;
}
old_start_pos = GTK_EDITABLE (widget)->selection_start_pos;
old_end_pos = GTK_EDITABLE (widget)->selection_end_pos;
return_code = NAUTILUS_CALL_PARENT_WITH_RETURN_VALUE
result = NAUTILUS_CALL_PARENT_WITH_RETURN_VALUE
(GTK_WIDGET_CLASS, motion_notify_event, (widget, event));
if (GTK_EDITABLE (widget)->selection_start_pos != old_start_pos ||
GTK_EDITABLE (widget)->selection_end_pos != old_end_pos) {
if (result) {
gtk_signal_emit (GTK_OBJECT (widget), signals[SELECTION_CHANGED]);
}
return return_code;
return result;
}
/**
......@@ -282,9 +243,15 @@ nautilus_entry_select_all (NautilusEntry *entry)
}
static gboolean
select_all_at_idle (NautilusEntry *entry)
select_all_at_idle (gpointer callback_data)
{
nautilus_entry_select_all (entry);
NautilusEntry *entry;
entry = NAUTILUS_ENTRY (callback_data);
if (!GTK_OBJECT_DESTROYED (entry)) {
nautilus_entry_select_all (entry);
}
gtk_object_unref (GTK_OBJECT (entry));
return FALSE;
}
......@@ -307,7 +274,8 @@ nautilus_entry_select_all_at_idle (NautilusEntry *entry)
* then gtk_entry_key_press will unselect (and we want
* to move the text cursor position to the end).
*/
gtk_idle_add ((GtkFunction)select_all_at_idle, entry);
gtk_object_ref (GTK_OBJECT (entry));
gtk_idle_add (select_all_at_idle, entry);
}
/**
......@@ -334,20 +302,52 @@ nautilus_entry_set_text (NautilusEntry *entry, const gchar *text)
gtk_signal_emit (GTK_OBJECT (entry), signals[SELECTION_CHANGED]);
}
void
static void
nautilus_entry_set_selection (GtkEditable *editable,
gint start_pos,
gint end_pos)
int start_pos,
int end_pos)
{
NAUTILUS_CALL_PARENT (GTK_EDITABLE_CLASS, set_selection,
(editable, start_pos, end_pos));
gtk_signal_emit (GTK_OBJECT (editable), signals[SELECTION_CHANGED]);
}
static gboolean
nautilus_entry_button_press (GtkWidget *widget,
GdkEventButton *event)
{
gboolean result;
result = NAUTILUS_CALL_PARENT_WITH_RETURN_VALUE
(GTK_WIDGET_CLASS, button_press_event, (widget, event));
if (result) {
gtk_signal_emit (GTK_OBJECT (widget), signals[SELECTION_CHANGED]);
}
return result;
}
static gboolean
nautilus_entry_button_release (GtkWidget *widget,
GdkEventButton *event)
{
gboolean result;
result = NAUTILUS_CALL_PARENT_WITH_RETURN_VALUE
(GTK_WIDGET_CLASS, button_release_event, (widget, event));
if (result) {
gtk_signal_emit (GTK_OBJECT (widget), signals[SELECTION_CHANGED]);
}
return result;
}
static void
nautilus_entry_insert_text (GtkEditable *editable, const gchar *text,
gint length, gint *position)
int length, int *position)
{
NautilusEntry *entry;
......@@ -360,18 +360,16 @@ nautilus_entry_insert_text (GtkEditable *editable, const gchar *text,
NAUTILUS_CALL_PARENT (GTK_EDITABLE_CLASS, insert_text,
(editable, text, length, position));
gtk_signal_emit (GTK_OBJECT (editable), signals[SELECTION_CHANGED]);
gtk_signal_emit (GTK_OBJECT (editable), signals[SELECTION_CHANGED]);
}
static void
nautilus_entry_delete_text (GtkEditable *editable, gint start_pos, gint end_pos)
nautilus_entry_delete_text (GtkEditable *editable, int start_pos, int end_pos)
{
NautilusEntry *entry;
entry = NAUTILUS_ENTRY(editable);
entry = NAUTILUS_ENTRY (editable);
/* Fire off user changed signals */
if (entry->user_edit) {
......@@ -405,3 +403,46 @@ nautilus_entry_selection_clear (GtkWidget *widget,
return NAUTILUS_CALL_PARENT_WITH_RETURN_VALUE
(GTK_WIDGET_CLASS, selection_clear_event, (widget, event));
}
static void
nautilus_entry_initialize_class (NautilusEntryClass *class)
{
GtkWidgetClass *widget_class;
GtkObjectClass *object_class;
GtkEditableClass *editable_class;
widget_class = GTK_WIDGET_CLASS (class);
object_class = GTK_OBJECT_CLASS (class);
editable_class = GTK_EDITABLE_CLASS (class);
widget_class->button_press_event = nautilus_entry_button_press;
widget_class->button_release_event = nautilus_entry_button_release;
widget_class->key_press_event = nautilus_entry_key_press;
widget_class->motion_notify_event = nautilus_entry_motion_notify;
widget_class->selection_clear_event = nautilus_entry_selection_clear;
object_class->destroy = nautilus_entry_destroy;
editable_class->insert_text = nautilus_entry_insert_text;
editable_class->delete_text = nautilus_entry_delete_text;
editable_class->set_selection = nautilus_entry_set_selection;
/* Set up signals */
signals[USER_CHANGED] = gtk_signal_new
("user_changed",
GTK_RUN_LAST,
object_class->type,
GTK_SIGNAL_OFFSET (NautilusEntryClass,
user_changed),
gtk_marshal_NONE__NONE,
GTK_TYPE_NONE, 0);
signals[SELECTION_CHANGED] = gtk_signal_new
("selection_changed",
GTK_RUN_LAST,
object_class->type,
GTK_SIGNAL_OFFSET (NautilusEntryClass,
selection_changed),
gtk_marshal_NONE__NONE,
GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
}
......@@ -43,33 +43,32 @@ BEGIN_GNOME_DECLS
#define NAUTILUS_IS_ENTRY_CLASS(klass) \
(GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_ENTRY))
typedef struct NautilusEntry NautilusEntry;
typedef struct NautilusEntryClass NautilusEntryClass;
typedef struct NautilusEntryDetails NautilusEntryDetails;
struct NautilusEntry {
typedef struct {
GtkEntry parent;
NautilusEntryDetails *details;
/* FIXME: should be in details struct */
gboolean user_edit;
gboolean special_tab_handling;
gboolean cursor_obscured;
};
} NautilusEntry;
struct NautilusEntryClass {
typedef struct {
GtkEntryClass parent_class;
void (*user_changed) (NautilusEntry *entry);
void (*user_changed) (NautilusEntry *entry);
void (*selection_changed) (NautilusEntry *entry);
} NautilusEntryClass;
};
GtkType nautilus_entry_get_type (void);
GtkWidget *nautilus_entry_new (void);
GtkWidget *nautilus_entry_new_with_max_length (guint16 max);
void nautilus_entry_set_text (NautilusEntry *entry,
const gchar *text);
void nautilus_entry_select_all (NautilusEntry *entry);
void nautilus_entry_select_all_at_idle (NautilusEntry *entry);
GtkType nautilus_entry_get_type (void);
GtkWidget *nautilus_entry_new (void);
GtkWidget *nautilus_entry_new_with_max_length (guint16 max);
void nautilus_entry_set_text (NautilusEntry *entry,
const char *text);
void nautilus_entry_select_all (NautilusEntry *entry);
void nautilus_entry_select_all_at_idle (NautilusEntry *entry);
END_GNOME_DECLS
......
......@@ -217,6 +217,8 @@ global_preferences_install_descriptions (void)
nautilus_preferences_set_description (NAUTILUS_PREFERENCES_HIDE_BUILT_IN_BOOKMARKS,
_("Don't include the built-in bookmarks in the Bookmarks menu"));
nautilus_preferences_set_description (NAUTILUS_PREFERENCES_USE_EMACS_SHORTCUTS,
_("Use Emacs-style keyboard shortcuts in text fields"));
nautilus_preferences_set_description (NAUTILUS_PREFERENCES_HOME_URI,
_("Location:"));
......@@ -335,6 +337,10 @@ global_preferences_install_defaults (void)
nautilus_preferences_default_set_boolean (NAUTILUS_PREFERENCES_HIDE_BUILT_IN_BOOKMARKS,
NAUTILUS_USER_LEVEL_NOVICE,
FALSE);
nautilus_preferences_default_set_boolean (NAUTILUS_PREFERENCES_USE_EMACS_SHORTCUTS,
NAUTILUS_USER_LEVEL_NOVICE,
FALSE);
/* FIXME bugzilla.eazel.com 1245: Saved in pixels instead of in %? */
nautilus_preferences_default_set_integer (NAUTILUS_PREFERENCES_SIDEBAR_WIDTH,
......@@ -475,6 +481,9 @@ global_preferences_install_visibility (void)
nautilus_preferences_set_visible_user_level (NAUTILUS_PREFERENCES_HIDE_BUILT_IN_BOOKMARKS,
NAUTILUS_USER_LEVEL_INTERMEDIATE);
nautilus_preferences_set_visible_user_level (NAUTILUS_PREFERENCES_USE_EMACS_SHORTCUTS,
NAUTILUS_USER_LEVEL_ADVANCED);
}
/*
......@@ -532,7 +541,8 @@ global_preferences_create_dialog (void)
appearance_pane = nautilus_preferences_box_add_pane (preference_box,
_("Appearance"));
nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (appearance_pane), _("Smoother Graphics"));
nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (appearance_pane),
_("Smoother Graphics"));
nautilus_preferences_pane_add_item_to_nth_group (NAUTILUS_PREFERENCES_PANE (appearance_pane),
0,
......@@ -551,13 +561,17 @@ global_preferences_create_dialog (void)
windows_and_desktop_pane = nautilus_preferences_box_add_pane (preference_box,
_("Windows & Desktop"));
nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (windows_and_desktop_pane), _("Desktop"));
nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (windows_and_desktop_pane),
_("Desktop"));
nautilus_preferences_pane_add_item_to_nth_group (NAUTILUS_PREFERENCES_PANE (windows_and_desktop_pane),
0,
NAUTILUS_PREFERENCES_SHOW_DESKTOP,
NAUTILUS_PREFERENCE_ITEM_BOOLEAN);
nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (windows_and_desktop_pane), _("Opening New Windows"));
nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (windows_and_desktop_pane),
_("Opening New Windows"));
nautilus_preferences_pane_add_item_to_nth_group (NAUTILUS_PREFERENCES_PANE (windows_and_desktop_pane),
1,
NAUTILUS_PREFERENCES_WINDOW_ALWAYS_NEW,
......@@ -580,35 +594,50 @@ global_preferences_create_dialog (void)
NAUTILUS_PREFERENCES_START_WITH_SIDEBAR,
NAUTILUS_PREFERENCE_ITEM_BOOLEAN);
nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (windows_and_desktop_pane), _("Trash Behavior"));
nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (windows_and_desktop_pane),
_("Trash Behavior"));
nautilus_preferences_pane_add_item_to_nth_group (NAUTILUS_PREFERENCES_PANE (windows_and_desktop_pane),
2,
NAUTILUS_PREFERENCES_CONFIRM_TRASH,
NAUTILUS_PREFERENCE_ITEM_BOOLEAN);
/* FIXME: This group clearly doesn't belong in Windows &
* Desktop, but there's no obviously-better place for it and
* it probably doesn't deserve a pane of its own.
*/
nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (windows_and_desktop_pane),
_("Keyboard Shortcuts"));
nautilus_preferences_pane_add_item_to_nth_group (NAUTILUS_PREFERENCES_PANE (windows_and_desktop_pane),
3,
NAUTILUS_PREFERENCES_USE_EMACS_SHORTCUTS,
NAUTILUS_PREFERENCE_ITEM_BOOLEAN);
/*
* Folder Views pane
*/
directory_views_pane = nautilus_preferences_box_add_pane (preference_box,
_("Icon & List Views"));
nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (directory_views_pane), _("Click Behavior"));
nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (directory_views_pane),
_("Click Behavior"));
nautilus_preferences_pane_add_item_to_nth_group (NAUTILUS_PREFERENCES_PANE (directory_views_pane),
0,
NAUTILUS_PREFERENCES_CLICK_POLICY,
NAUTILUS_PREFERENCE_ITEM_ENUM);
nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (directory_views_pane), _("Executable Text Files"));
nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (directory_views_pane),
_("Executable Text Files"));
nautilus_preferences_pane_add_item_to_nth_group (NAUTILUS_PREFERENCES_PANE (directory_views_pane),
1,
NAUTILUS_PREFERENCES_EXECUTABLE_TEXT_ACTIVATION,
NAUTILUS_PREFERENCE_ITEM_ENUM);
nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (directory_views_pane), _("Show/Hide Options"));
nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (directory_views_pane),
_("Show/Hide Options"));
nautilus_preferences_pane_add_item_to_nth_group (NAUTILUS_PREFERENCES_PANE (directory_views_pane),
2,
......@@ -683,14 +712,16 @@ global_preferences_create_dialog (void)
navigation_pane = nautilus_preferences_box_add_pane (preference_box,
_("Navigation"));
nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (navigation_pane), _("Home"));
nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (navigation_pane),
_("Home"));
nautilus_preferences_pane_add_item_to_nth_group (NAUTILUS_PREFERENCES_PANE (navigation_pane),
0,
NAUTILUS_PREFERENCES_HOME_URI,
NAUTILUS_PREFERENCE_ITEM_EDITABLE_STRING);
nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (navigation_pane), _("HTTP Proxy Settings"));
nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (navigation_pane),
_("HTTP Proxy Settings"));
nautilus_preferences_pane_add_item_to_nth_group (NAUTILUS_PREFERENCES_PANE (navigation_pane),
1,
......@@ -715,44 +746,47 @@ global_preferences_create_dialog (void)
NAUTILUS_PREFERENCES_HIDE_BUILT_IN_BOOKMARKS,
NAUTILUS_PREFERENCE_ITEM_BOOLEAN);
/*
* Tradeoffs
*/
tradeoffs_pane = nautilus_preferences_box_add_pane (preference_box,
_("Speed Tradeoffs"));
nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (tradeoffs_pane), _("Show Text in Icons"));
nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (tradeoffs_pane),
_("Show Text in Icons"));
nautilus_preferences_pane_add_item_to_nth_group (NAUTILUS_PREFERENCES_PANE (tradeoffs_pane),
0,
NAUTILUS_PREFERENCES_SHOW_TEXT_IN_ICONS,
NAUTILUS_PREFERENCE_ITEM_SHORT_ENUM);
nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (tradeoffs_pane), _("Show Count of Items in Folders"));
nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (tradeoffs_pane),
_("Show Count of Items in Folders"));
nautilus_preferences_pane_add_item_to_nth_group (NAUTILUS_PREFERENCES_PANE (tradeoffs_pane),
1,
NAUTILUS_PREFERENCES_SHOW_DIRECTORY_ITEM_COUNTS,
NAUTILUS_PREFERENCE_ITEM_SHORT_ENUM);
nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (tradeoffs_pane), _("Show Thumbnails for Image Files"));
nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (tradeoffs_pane),
_("Show Thumbnails for Image Files"));
nautilus_preferences_pane_add_item_to_nth_group (NAUTILUS_PREFERENCES_PANE (tradeoffs_pane),
2,