[nautilus] Bug 699103 - Enter location bar upon typing ~



commit 039038da3d399029ab8e4d82c8cade1c9a98265d
Author: Garrett Regier <garrettregier gmail com>
Date:   Sun Jun 16 05:19:14 2013 -0700

    Bug 699103 - Enter location bar upon typing ~

 src/nautilus-shell-ui.xml   |    3 ++-
 src/nautilus-window-menus.c |   27 ++++++++++++++++++++++-----
 2 files changed, 24 insertions(+), 6 deletions(-)
---
diff --git a/src/nautilus-shell-ui.xml b/src/nautilus-shell-ui.xml
index 4cb7348..53f8022 100644
--- a/src/nautilus-shell-ui.xml
+++ b/src/nautilus-shell-ui.xml
@@ -13,7 +13,8 @@
 <accelerator action="ZoomInAccel"/>
 <accelerator action="ZoomInAccel2"/>
 <accelerator action="ZoomOutAccel"/>
-<accelerator action="PromptLocationAccel"/>
+<accelerator action="PromptLocationSlashAccel"/>
+<accelerator action="PromptLocationTildeAccel"/>
 <accelerator action="ReloadAccel"/>
 <popup name="ViewMenu" accelerators="true">
   <placeholder name="Zoom Items Placeholder">
diff --git a/src/nautilus-window-menus.c b/src/nautilus-window-menus.c
index 3faf817..330bff2 100644
--- a/src/nautilus-window-menus.c
+++ b/src/nautilus-window-menus.c
@@ -35,6 +35,7 @@
 #include "nautilus-connect-server-dialog.h"
 #include "nautilus-file-management-properties.h"
 #include "nautilus-list-view.h"
+#include "nautilus-location-entry.h"
 #include "nautilus-notebook.h"
 #include "nautilus-window-private.h"
 #include "nautilus-desktop-window.h"
@@ -424,8 +425,8 @@ action_show_hide_search_callback (GtkAction *action,
 }
 
 static void
-action_prompt_for_location_callback (GtkAction *action,
-                                    NautilusWindow *window)
+action_prompt_for_location_slash_callback (GtkAction *action,
+                                          NautilusWindow *window)
 {
        GFile *location;
 
@@ -435,6 +436,18 @@ action_prompt_for_location_callback (GtkAction *action,
 }
 
 static void
+action_prompt_for_location_tilde_callback (GtkAction *action,
+                                          NautilusWindow *window)
+{
+       GtkWidget *entry;
+
+       entry = nautilus_window_ensure_location_entry (window);
+       nautilus_location_entry_set_special_text (NAUTILUS_LOCATION_ENTRY (entry),
+                                                 "~");
+       gtk_editable_set_position (GTK_EDITABLE (entry), -1);
+}
+
+static void
 action_view_radio_changed (GtkRadioAction *action,
                           GtkRadioAction *current,
                           NautilusWindow *window)
@@ -573,10 +586,14 @@ static const GtkActionEntry main_entries[] = {
   /* label, accelerator */       N_("P_roperties"), NULL,
   /* tooltip */                  N_("View or modify the properties of this folder"),
                                 G_CALLBACK (action_location_properties_callback) },
-  /* name, stock id */         { "PromptLocationAccel", NULL,
-  /* label, accelerator */       "PromptLocationAccel", "slash",
+  /* name, stock id */         { "PromptLocationSlashAccel", NULL,
+  /* label, accelerator */       "PromptLocationSlashAccel", "slash",
+  /* tooltip */                  NULL,
+                                G_CALLBACK (action_prompt_for_location_slash_callback) },
+  /* name, stock id */         { "PromptLocationTildeAccel", NULL,
+  /* label, accelerator */       "PromptLocationTildeAccel", "asciitilde",
   /* tooltip */                  NULL,
-                                G_CALLBACK (action_prompt_for_location_callback) },
+                                G_CALLBACK (action_prompt_for_location_tilde_callback) },
 };
 
 static const GtkToggleActionEntry main_toggle_entries[] = {


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