diff options
author | Holger Berndt <hb@gnome.org> | 2010-03-22 22:16:52 +0100 |
---|---|---|
committer | Holger Berndt <hb@gnome.org> | 2010-04-15 22:31:09 +0200 |
commit | 85c0047c370b06473026b2920dc53428bd3c30ae (patch) | |
tree | 65e8b98ba1f2cc58f8365b703dbe3e561e365fe7 | |
parent | 543d3ddd5131546fbbb2e3e2a504d9800c4f0d62 (diff) | |
download | nautilus-85c0047c370b06473026b2920dc53428bd3c30ae.tar.gz |
Fix sensitivity of "{Copy|Move} to other pane after enable/disable of extra pane"
Add an "update_menus" signal to the NautilusView interface, so that external events
can trigger a menu sensitivity update.
Fixes bug 613257.
-rw-r--r-- | libnautilus-private/nautilus-view.c | 10 | ||||
-rw-r--r-- | libnautilus-private/nautilus-view.h | 2 | ||||
-rw-r--r-- | src/file-manager/fm-directory-view.c | 7 | ||||
-rw-r--r-- | src/nautilus-navigation-window-menus.c | 6 |
4 files changed, 25 insertions, 0 deletions
diff --git a/libnautilus-private/nautilus-view.c b/libnautilus-private/nautilus-view.c index 67d53d591..196881085 100644 --- a/libnautilus-private/nautilus-view.c +++ b/libnautilus-private/nautilus-view.c @@ -268,6 +268,16 @@ nautilus_view_grab_focus (NautilusView *view) } void +nautilus_view_update_menus (NautilusView *view) +{ + g_return_if_fail (NAUTILUS_IS_VIEW (view)); + + if (NAUTILUS_VIEW_GET_IFACE (view)->update_menus != NULL) { + (* NAUTILUS_VIEW_GET_IFACE (view)->update_menus) (view); + } +} + +void nautilus_view_pop_up_location_context_menu (NautilusView *view, GdkEventButton *event, const char *location) diff --git a/libnautilus-private/nautilus-view.h b/libnautilus-private/nautilus-view.h index 4e9b088e6..65715720b 100644 --- a/libnautilus-private/nautilus-view.h +++ b/libnautilus-private/nautilus-view.h @@ -108,6 +108,7 @@ struct _NautilusViewIface gboolean (* can_zoom_out) (NautilusView *view); void (* grab_focus) (NautilusView *view); + void (* update_menus) (NautilusView *view); /* Request popup of context menu referring to the open location. * This is triggered in spatial windows by right-clicking the location button, @@ -171,6 +172,7 @@ void nautilus_view_pop_up_location_context_menu (NautilusView *v GdkEventButton *event, const char *location); void nautilus_view_grab_focus (NautilusView *view); +void nautilus_view_update_menus (NautilusView *view); void nautilus_view_drop_proxy_received_uris (NautilusView *view, GList *uris, const char *target_location, diff --git a/src/file-manager/fm-directory-view.c b/src/file-manager/fm-directory-view.c index 0997a1555..d8b9050b7 100644 --- a/src/file-manager/fm-directory-view.c +++ b/src/file-manager/fm-directory-view.c @@ -1784,6 +1784,12 @@ fm_directory_view_grab_focus (NautilusView *view) } } +static void +view_iface_update_menus (NautilusView *view) +{ + fm_directory_view_update_menus (FM_DIRECTORY_VIEW (view)); +} + static GtkWidget * fm_directory_view_get_widget (NautilusView *view) { @@ -1872,6 +1878,7 @@ void fm_directory_view_init_view_iface (NautilusViewIface *iface) { iface->grab_focus = fm_directory_view_grab_focus; + iface->update_menus = view_iface_update_menus; iface->get_widget = fm_directory_view_get_widget; iface->load_location = fm_directory_view_load_location; diff --git a/src/nautilus-navigation-window-menus.c b/src/nautilus-navigation-window-menus.c index ec4832492..5b473457f 100644 --- a/src/nautilus-navigation-window-menus.c +++ b/src/nautilus-navigation-window-menus.c @@ -261,11 +261,17 @@ action_split_view_callback (GtkAction *action, is_active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)); if (is_active != nautilus_navigation_window_split_view_showing (window)) { + NautilusWindow *nautilus_window; + if (is_active) { nautilus_navigation_window_split_view_on (window); } else { nautilus_navigation_window_split_view_off (window); } + nautilus_window = NAUTILUS_WINDOW (window); + if (nautilus_window->details->active_pane && nautilus_window->details->active_pane->active_slot) { + nautilus_view_update_menus (nautilus_window->details->active_pane->active_slot->content_view); + } } } |