summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Neumair <chris@gnome-de.org>2005-07-07 10:16:41 +0000
committerChristian Neumair <cneumair@src.gnome.org>2005-07-07 10:16:41 +0000
commitdc3fe85974d6039351ef40012ff61da2bfceb9d8 (patch)
treed0add33364fa5898b1bbd147c34d08be1225835b
parent72112227983929d9c32c803d53c43dcd2e0658b8 (diff)
downloadnautilus-dc3fe85974d6039351ef40012ff61da2bfceb9d8.tar.gz
Connect accelerators with "View as" menu items. Fixes #139908.
2005-07-06 Christian Neumair <chris@gnome-de.org> * src/nautilus-window.c: (add_view_as_menu_item): Connect accelerators with "View as" menu items. Fixes #139908. * libnautilus-private/nautilus-file-operations.c: (progress_dialog_set_to_from_item_text): When operating on remote locations, also display hostname in copy/move progress dialog.
-rw-r--r--ChangeLog10
-rw-r--r--libnautilus-private/nautilus-file-operations.c30
-rw-r--r--src/nautilus-window.c19
3 files changed, 53 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index f471e1052..307f0bb8b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2005-07-06 Christian Neumair <chris@gnome-de.org>
+
+ * src/nautilus-window.c: (add_view_as_menu_item):
+ Connect accelerators with "View as" menu items. Fixes #139908.
+
+ * libnautilus-private/nautilus-file-operations.c:
+ (progress_dialog_set_to_from_item_text):
+ When operating on remote locations, also display hostname in copy/move
+ progress dialog.
+
2005-07-06 Kjartan Maraas <kmaraas@gnome.org>
* src/file-manager/fm-tree-view.c: (show_iter_for_file):
diff --git a/libnautilus-private/nautilus-file-operations.c b/libnautilus-private/nautilus-file-operations.c
index 1b798c1c7..53fc387b0 100644
--- a/libnautilus-private/nautilus-file-operations.c
+++ b/libnautilus-private/nautilus-file-operations.c
@@ -328,7 +328,9 @@ progress_dialog_set_to_from_item_text (NautilusFileOperationsProgress *dialog,
{
char *item;
char *from_path;
+ char *from_text;
char *to_path;
+ char *to_text;
char *progress_label_text;
const char *from_prefix;
const char *to_prefix;
@@ -336,8 +338,8 @@ progress_dialog_set_to_from_item_text (NautilusFileOperationsProgress *dialog,
int length;
item = NULL;
- from_path = NULL;
- to_path = NULL;
+ from_text = NULL;
+ to_text = NULL;
from_prefix = "";
to_prefix = "";
progress_label_text = NULL;
@@ -352,6 +354,14 @@ progress_dialog_set_to_from_item_text (NautilusFileOperationsProgress *dialog,
if (from_path [length - 1] == '/') {
from_path [length - 1] = '\0';
}
+
+ if (g_str_has_prefix (from_uri, "file://")) {
+ from_text = from_path;
+ } else {
+ from_text = g_strdup_printf (_("%s on %s"),
+ from_path, gnome_vfs_uri_get_host_name (uri));
+ g_free (from_path);
+ }
gnome_vfs_uri_unref (uri);
g_assert (progress_verb);
@@ -370,6 +380,14 @@ progress_dialog_set_to_from_item_text (NautilusFileOperationsProgress *dialog,
to_path [length - 1] = '\0';
}
+ if (g_str_has_prefix (to_uri, "file://")) {
+ to_text = to_path;
+ } else {
+ to_text = g_strdup_printf (_("%s on %s"),
+ to_path, gnome_vfs_uri_get_host_name (uri));
+ g_free (to_path);
+ }
+
gnome_vfs_uri_unref (uri);
/* "To" dialog label, source path gets placed next to it in the dialog */
to_prefix = _("To:");
@@ -379,14 +397,14 @@ progress_dialog_set_to_from_item_text (NautilusFileOperationsProgress *dialog,
(dialog,
progress_label_text != NULL ? progress_label_text : "",
item != NULL ? item : "",
- from_path != NULL ? from_path : "",
- to_path != NULL ? to_path : "",
+ from_text != NULL ? from_text : "",
+ to_text != NULL ? to_text : "",
from_prefix, to_prefix, index, size);
g_free (progress_label_text);
g_free (item);
- g_free (from_path);
- g_free (to_path);
+ g_free (from_text);
+ g_free (to_text);
}
static int
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index b40f61529..21b0eca6a 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -679,6 +679,10 @@ add_view_as_menu_item (NautilusWindow *window,
char *action_name;
ActivateViewData *data;
+ char *accel;
+ char *accel_path;
+ unsigned int accel_keyval;
+
info = nautilus_view_factory_lookup (identifier);
action_name = g_strdup_printf ("view_as_%d", index);
@@ -688,6 +692,21 @@ add_view_as_menu_item (NautilusWindow *window,
NULL,
0);
+ if (index >= 1 && index <= 9) {
+ accel = g_strdup_printf ("%d", index);
+
+ accel_path = g_strdup_printf ("<Nautilus-Window>/%s", action_name);
+
+ accel_keyval = gdk_keyval_from_name (accel);
+ g_assert (accel_keyval != GDK_VoidSymbol);
+
+ gtk_accel_map_add_entry (accel_path, accel_keyval, GDK_CONTROL_MASK);
+ gtk_action_set_accel_path (GTK_ACTION (action), accel_path);
+
+ g_free (accel);
+ g_free (accel_path);
+ }
+
if (window->details->view_as_radio_action != NULL) {
gtk_radio_action_set_group (action,
gtk_radio_action_get_group (window->details->view_as_radio_action));