Commit f4cbb90c authored by John Sullivan's avatar John Sullivan

Fixed bug where choosing viewer from "View as Other..."

	dialog from "View as" menu wouldn't update the menu
	title.

	* src/nautilus-window.c: (nautilus_window_synch_content_view_menu),
	(view_menu_choose_view_callback),
	(nautilus_window_load_content_view_menu): Renamed
	"synch_view_as_menu" to "nautilus_window_synch_content_view_menu".
	* src/nautilus-window-private.h: Put this function here so it
	can be used in -manage-views.c.
	* src/nautilus-window-manage-views.c:
	(nautilus_window_has_really_changed): Call this function to
	fix "View as" menu title when the view but not the location changes.
parent 24bbecbb
2000-06-01 John Sullivan <sullivan@eazel.com>
Fixed bug where choosing viewer from "View as Other..."
dialog from "View as" menu wouldn't update the menu
title.
* src/nautilus-window.c: (nautilus_window_synch_content_view_menu),
(view_menu_choose_view_callback),
(nautilus_window_load_content_view_menu): Renamed
"synch_view_as_menu" to "nautilus_window_synch_content_view_menu".
* src/nautilus-window-private.h: Put this function here so it
can be used in -manage-views.c.
* src/nautilus-window-manage-views.c:
(nautilus_window_has_really_changed): Call this function to
fix "View as" menu title when the view but not the location changes.
2000-06-01 Andy Hertzfeld <andy@eazel.com>
* icons/eazel/Makefile.am:
......
......@@ -690,15 +690,15 @@ nautilus_window_switch_views (NautilusWindow *window, const char *iid)
}
/**
* synch_view_as_menu:
* nautilus_window_synch_content_view_menu:
*
* Set the visible item of the "View as" option menu to
* match the current content view.
*
* @window: The NautilusWindow whose "View as" option menu should be synched.
*/
static void
synch_view_as_menu (NautilusWindow *window)
void
nautilus_window_synch_content_view_menu (NautilusWindow *window)
{
GList *children, *child;
GtkWidget *menu;
......@@ -726,7 +726,7 @@ synch_view_as_menu (NautilusWindow *window)
gtk_option_menu_set_history (GTK_OPTION_MENU (window->view_as_option_menu),
matching_index);
} else {
g_warning ("In synch_view_as_menu, couldn't find matching menu item.");
g_warning ("In nautilus_window_synch_content_view_menu, couldn't find matching menu item.");
}
g_list_free (children);
......@@ -761,7 +761,7 @@ view_menu_choose_view_callback (GtkWidget *widget, gpointer data)
* in nautilus_window_load_content_view_menu. Do this right away so
* the user never sees the option menu set to "View as Other...".
*/
synch_view_as_menu (window);
nautilus_window_synch_content_view_menu (window);
file = nautilus_file_get (window->ni->requested_uri);
g_return_if_fail (NAUTILUS_IS_FILE (file));
......@@ -856,7 +856,7 @@ nautilus_window_load_content_view_menu (NautilusWindow *window,
gtk_option_menu_set_menu (GTK_OPTION_MENU (window->view_as_option_menu),
new_menu);
synch_view_as_menu (window);
nautilus_window_synch_content_view_menu (window);
}
void
......
......@@ -690,15 +690,15 @@ nautilus_window_switch_views (NautilusWindow *window, const char *iid)
}
/**
* synch_view_as_menu:
* nautilus_window_synch_content_view_menu:
*
* Set the visible item of the "View as" option menu to
* match the current content view.
*
* @window: The NautilusWindow whose "View as" option menu should be synched.
*/
static void
synch_view_as_menu (NautilusWindow *window)
void
nautilus_window_synch_content_view_menu (NautilusWindow *window)
{
GList *children, *child;
GtkWidget *menu;
......@@ -726,7 +726,7 @@ synch_view_as_menu (NautilusWindow *window)
gtk_option_menu_set_history (GTK_OPTION_MENU (window->view_as_option_menu),
matching_index);
} else {
g_warning ("In synch_view_as_menu, couldn't find matching menu item.");
g_warning ("In nautilus_window_synch_content_view_menu, couldn't find matching menu item.");
}
g_list_free (children);
......@@ -761,7 +761,7 @@ view_menu_choose_view_callback (GtkWidget *widget, gpointer data)
* in nautilus_window_load_content_view_menu. Do this right away so
* the user never sees the option menu set to "View as Other...".
*/
synch_view_as_menu (window);
nautilus_window_synch_content_view_menu (window);
file = nautilus_file_get (window->ni->requested_uri);
g_return_if_fail (NAUTILUS_IS_FILE (file));
......@@ -856,7 +856,7 @@ nautilus_window_load_content_view_menu (NautilusWindow *window,
gtk_option_menu_set_menu (GTK_OPTION_MENU (window->view_as_option_menu),
new_menu);
synch_view_as_menu (window);
nautilus_window_synch_content_view_menu (window);
}
void
......
......@@ -690,15 +690,15 @@ nautilus_window_switch_views (NautilusWindow *window, const char *iid)
}
/**
* synch_view_as_menu:
* nautilus_window_synch_content_view_menu:
*
* Set the visible item of the "View as" option menu to
* match the current content view.
*
* @window: The NautilusWindow whose "View as" option menu should be synched.
*/
static void
synch_view_as_menu (NautilusWindow *window)
void
nautilus_window_synch_content_view_menu (NautilusWindow *window)
{
GList *children, *child;
GtkWidget *menu;
......@@ -726,7 +726,7 @@ synch_view_as_menu (NautilusWindow *window)
gtk_option_menu_set_history (GTK_OPTION_MENU (window->view_as_option_menu),
matching_index);
} else {
g_warning ("In synch_view_as_menu, couldn't find matching menu item.");
g_warning ("In nautilus_window_synch_content_view_menu, couldn't find matching menu item.");
}
g_list_free (children);
......@@ -761,7 +761,7 @@ view_menu_choose_view_callback (GtkWidget *widget, gpointer data)
* in nautilus_window_load_content_view_menu. Do this right away so
* the user never sees the option menu set to "View as Other...".
*/
synch_view_as_menu (window);
nautilus_window_synch_content_view_menu (window);
file = nautilus_file_get (window->ni->requested_uri);
g_return_if_fail (NAUTILUS_IS_FILE (file));
......@@ -856,7 +856,7 @@ nautilus_window_load_content_view_menu (NautilusWindow *window,
gtk_option_menu_set_menu (GTK_OPTION_MENU (window->view_as_option_menu),
new_menu);
synch_view_as_menu (window);
nautilus_window_synch_content_view_menu (window);
}
void
......
......@@ -511,6 +511,15 @@ nautilus_window_has_really_changed(NautilusWindow *window)
}
gtk_object_unref(GTK_OBJECT(window->new_content_view));
window->new_content_view = NULL;
/* Update displayed view in menu. Only do this if we're not switching
* locations though, because if we are switching locations we'll
* install a whole new set of views in the menu later (the current
* views in the menu are for some other location).
*/
if (window->pending_ni == NULL) {
nautilus_window_synch_content_view_menu (window);
}
}
if (new_sidebar_panels) {
......
......@@ -43,6 +43,7 @@ void nautilus_window_begin_location_change(NautilusWindow *window,
NautilusLocationChangeType type,
guint distance);
void nautilus_window_load_content_view_menu (NautilusWindow *window, NautilusNavigationInfo *ni);
void nautilus_window_synch_content_view_menu (NautilusWindow *window);
NautilusViewFrame *nautilus_window_load_content_view(NautilusWindow *window,
const char *iid,
Nautilus_NavigationInfo *navinfo,
......
......@@ -690,15 +690,15 @@ nautilus_window_switch_views (NautilusWindow *window, const char *iid)
}
/**
* synch_view_as_menu:
* nautilus_window_synch_content_view_menu:
*
* Set the visible item of the "View as" option menu to
* match the current content view.
*
* @window: The NautilusWindow whose "View as" option menu should be synched.
*/
static void
synch_view_as_menu (NautilusWindow *window)
void
nautilus_window_synch_content_view_menu (NautilusWindow *window)
{
GList *children, *child;
GtkWidget *menu;
......@@ -726,7 +726,7 @@ synch_view_as_menu (NautilusWindow *window)
gtk_option_menu_set_history (GTK_OPTION_MENU (window->view_as_option_menu),
matching_index);
} else {
g_warning ("In synch_view_as_menu, couldn't find matching menu item.");
g_warning ("In nautilus_window_synch_content_view_menu, couldn't find matching menu item.");
}
g_list_free (children);
......@@ -761,7 +761,7 @@ view_menu_choose_view_callback (GtkWidget *widget, gpointer data)
* in nautilus_window_load_content_view_menu. Do this right away so
* the user never sees the option menu set to "View as Other...".
*/
synch_view_as_menu (window);
nautilus_window_synch_content_view_menu (window);
file = nautilus_file_get (window->ni->requested_uri);
g_return_if_fail (NAUTILUS_IS_FILE (file));
......@@ -856,7 +856,7 @@ nautilus_window_load_content_view_menu (NautilusWindow *window,
gtk_option_menu_set_menu (GTK_OPTION_MENU (window->view_as_option_menu),
new_menu);
synch_view_as_menu (window);
nautilus_window_synch_content_view_menu (window);
}
void
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment