summaryrefslogtreecommitdiff
path: root/libnautilus-extensions/nautilus-global-preferences.c
diff options
context:
space:
mode:
authorDarin Adler <darin@src.gnome.org>2001-03-16 22:26:53 +0000
committerDarin Adler <darin@src.gnome.org>2001-03-16 22:26:53 +0000
commitdcb478cf7e1500504a8273ad6ef0422f7fbc3e29 (patch)
treec1400dd09095b724e50805eec0f6c71122f20ca1 /libnautilus-extensions/nautilus-global-preferences.c
parenta85afd0f2524ca254099a41cf8585c435c19f0b8 (diff)
downloadnautilus-dcb478cf7e1500504a8273ad6ef0422f7fbc3e29.tar.gz
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.
Diffstat (limited to 'libnautilus-extensions/nautilus-global-preferences.c')
-rw-r--r--libnautilus-extensions/nautilus-global-preferences.c68
1 files changed, 51 insertions, 17 deletions
diff --git a/libnautilus-extensions/nautilus-global-preferences.c b/libnautilus-extensions/nautilus-global-preferences.c
index 88763d1a2..b802fdfac 100644
--- a/libnautilus-extensions/nautilus-global-preferences.c
+++ b/libnautilus-extensions/nautilus-global-preferences.c
@@ -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,
NAUTILUS_PREFERENCES_SHOW_IMAGE_FILE_THUMBNAILS,
NAUTILUS_PREFERENCE_ITEM_SHORT_ENUM);
- nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (tradeoffs_pane), _("Preview Sound Files"));
+ nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (tradeoffs_pane),
+ _("Preview Sound Files"));
nautilus_preferences_pane_add_item_to_nth_group (NAUTILUS_PREFERENCES_PANE (tradeoffs_pane),
3,
NAUTILUS_PREFERENCES_PREVIEW_SOUND,
NAUTILUS_PREFERENCE_ITEM_SHORT_ENUM);
-
/* FIXME bugzilla.eazel.com 2560: This title phrase needs improvement. */
- nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (tradeoffs_pane), _("Make Folder Appearance Details Public"));
+ nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (tradeoffs_pane),
+ _("Make Folder Appearance Details Public"));
nautilus_preferences_pane_add_item_to_nth_group (NAUTILUS_PREFERENCES_PANE (tradeoffs_pane),
4,