Commit 3d953577 authored by John Sullivan's avatar John Sullivan

Added some of the framework for supporting multiple content views for the same

uri.
parent c912e1ef
2000-01-10 John Sullivan <sullivan@eazel.com>
Added some of the framework for supporting multiple
content views for the same uri. More to come later.
* src/ntl-types.h: added NautilusViewIdentifier struct
to keep track of iid and human-readable name. Renamed
NautilusNavigationInfo.content_iid to default_content_iid,
and added content_identifiers GSList.
* src/ntl-uri-map.c:
(nautilus_view_identifier_new): New function.
(nautilus_view_identifier_free): New function.
(nautilus_navinfo_new): Create a human-readable-name
for each content iid, and store them together in
content_identifiers list. I included a currently
unworking "List" choice for the directory case, to
test the framework.
(nautilus_navinfo_free): Free the content_identifiers list.
* src/ntl-window-msgs.c:
(nautilus_window_load_content_view_menu): New function,
iterates through the content_identifiers list to fill in
the menu of content view choices. The menu items don't do
anything yet.
(nautilus_window_change_location_internal): Added call to
nautilus_window_load_content_view_menu.
(nautilus_window_change_location_2): Fixed spelling and
grammar in a couple of error messages.
* src/ntl-window.c: (nautilus_window_constructed): Removed
"View as (placeholder)" text in menu; now it has no text
until the actual choices appear. Removed some option-menu-sizing
trickery that didn't work correctly when items were added later.
Now the entire menu is replaced when its contents change.
* src/ntl-window.h: Removed menu_cvtype field; code all uses
just option_cvtype now.
2000-01-10 Darin Adler <darin@eazel.com>
* libnautilus/Makefile.am, libnautilus/nautilus-background.h,
......
......@@ -59,6 +59,32 @@ nautilus_navinfo_add_mapping(const char *scheme, int type, const char *data, con
g_hash_table_insert(scheme_mappings, g_strdup(scheme), ent);
}
static NautilusViewIdentifier *
nautilus_view_identifier_new (const char *iid, const char *name)
{
NautilusViewIdentifier *new_identifier;
g_return_val_if_fail (iid != NULL, NULL);
g_return_val_if_fail (name != NULL, NULL);
new_identifier = g_new0 (NautilusViewIdentifier, 1);
new_identifier->iid = g_strdup (iid);
new_identifier->name = g_strdup (name);
return new_identifier;
}
static void
nautilus_view_identifier_free (NautilusViewIdentifier *identifier)
{
if (identifier != NULL)
{
g_free (identifier->iid);
g_free (identifier->name);
g_free (identifier);
}
}
static void
navinfo_read_map_file(const char *fn)
{
......@@ -258,12 +284,12 @@ nautilus_navinfo_new(Nautilus_NavigationRequestInfo *nri,
Check if the URI is in an abnormal scheme (e.g. one not supported by gnome-vfs)
If so
Lookup a content view by scheme name, go.
Lookup content views by scheme name, go.
Lookup meta views by scheme name, go.
If not
Figure out content type.
Lookup a content view by content type, go.
Lookup content views by content type, go.
Lookup meta views by content type, go.
The lookup-and-go process works like:
......@@ -280,16 +306,29 @@ nautilus_navinfo_new(Nautilus_NavigationRequestInfo *nri,
{
if(!strcmp(navinfo->navinfo.content_type, "text/html"))
{
navinfo->content_iid = "ntl_web_browser";
navinfo->default_content_iid = "ntl_web_browser";
navinfo->content_identifiers = g_slist_append (
navinfo->content_identifiers,
nautilus_view_identifier_new (navinfo->default_content_iid, "Web Page"));
}
else if(!strcmp(navinfo->navinfo.content_type, "text/plain"))
{
navinfo->content_iid = "embeddable:text-plain";
navinfo->default_content_iid = "embeddable:text-plain";
navinfo->content_identifiers = g_slist_append (
navinfo->content_identifiers,
nautilus_view_identifier_new (navinfo->default_content_iid, "Text"));
}
else if(!strcmp(navinfo->navinfo.content_type, "special/directory")
|| !strcmp(navinfo->navinfo.content_type, "application/x-nautilus-vdir"))
{
navinfo->content_iid = "ntl_file_manager";
navinfo->default_content_iid = "ntl_file_manager";
navinfo->content_identifiers = g_slist_append (
navinfo->content_identifiers,
nautilus_view_identifier_new (navinfo->default_content_iid, "Icons"));
/* FIXME: Test of multiple items, replace with working case */
navinfo->content_identifiers = g_slist_append (
navinfo->content_identifiers,
nautilus_view_identifier_new ("bogus_test_iid", "List"));
}
else
{
......@@ -320,6 +359,8 @@ nautilus_navinfo_free(NautilusNavigationInfo *navinfo)
/* XXX remove_notification */
}
g_slist_foreach(navinfo->content_identifiers, (GFunc)nautilus_view_identifier_free, NULL);
g_slist_free(navinfo->content_identifiers);
g_slist_foreach(navinfo->meta_iids, (GFunc)g_free, NULL);
g_slist_free(navinfo->meta_iids);
g_free(navinfo->navinfo.requested_uri);
......
......@@ -427,15 +427,6 @@ nautilus_window_constructed(NautilusWindow *window)
/* set up location bar */
window->option_cvtype = gtk_option_menu_new();
window->menu_cvtype = gtk_menu_new();
/* FIXME: Add in placeholder item for now; rework this when we get the right views showing up.
* Since menu doesn't yet work, make it insensitive.
*/
gtk_container_add(GTK_CONTAINER(window->menu_cvtype),
gtk_menu_item_new_with_label(_("View as (placeholder)")));
gtk_widget_set_sensitive(window->option_cvtype, FALSE);
location_bar_box = gtk_hbox_new(FALSE, GNOME_PAD);
gtk_container_set_border_width(GTK_CONTAINER(location_bar_box), GNOME_PAD_SMALL);
......@@ -447,23 +438,12 @@ nautilus_window_constructed(NautilusWindow *window)
GNOME_DOCK_ITEM_BEH_EXCLUSIVE|GNOME_DOCK_ITEM_BEH_NEVER_VERTICAL,
GNOME_DOCK_TOP, 2, 0, 0);
gtk_widget_show_all(window->menu_cvtype);
gtk_option_menu_set_menu(GTK_OPTION_MENU(window->option_cvtype), window->menu_cvtype);
gtk_option_menu_set_history(GTK_OPTION_MENU(window->option_cvtype), 0);
/* Option menu for content view types; it's empty here, filled in when a uri is set. */
window->option_cvtype = gtk_option_menu_new();
gtk_box_pack_end(GTK_BOX(location_bar_box), window->option_cvtype, FALSE, FALSE, GNOME_PAD_BIG);
gtk_widget_show(window->option_cvtype);
gtk_widget_show_all(location_bar_box);
/* For mysterious reasons, connecting these signals before laying out the menu
* and option menu ends up making the option menu not know how to size itself (i.e,
* it is zero-width unless you turn on expand and fill). So we do it here afterwards.
*/
gtk_signal_connect_while_alive(GTK_OBJECT(window->menu_cvtype), "add",
GTK_SIGNAL_FUNC(gtk_option_menu_do_resize), window->option_cvtype,
GTK_OBJECT(window->option_cvtype));
gtk_signal_connect_while_alive(GTK_OBJECT(window->menu_cvtype), "remove",
GTK_SIGNAL_FUNC(gtk_option_menu_do_resize), window->option_cvtype,
GTK_OBJECT(window->option_cvtype));
gtk_widget_show_all(location_bar_box);
/* set up status bar */
......
......@@ -60,7 +60,7 @@ struct _NautilusWindow {
/* UI stuff */
NautilusIndexPanel *index_panel;
GtkWidget *content_hbox, *btn_back, *btn_fwd;
GtkWidget *option_cvtype, *menu_cvtype, *ent_uri;
GtkWidget *option_cvtype, *ent_uri;
guint statusbar_ctx, statusbar_clear_id;
......
......@@ -427,15 +427,6 @@ nautilus_window_constructed(NautilusWindow *window)
/* set up location bar */
window->option_cvtype = gtk_option_menu_new();
window->menu_cvtype = gtk_menu_new();
/* FIXME: Add in placeholder item for now; rework this when we get the right views showing up.
* Since menu doesn't yet work, make it insensitive.
*/
gtk_container_add(GTK_CONTAINER(window->menu_cvtype),
gtk_menu_item_new_with_label(_("View as (placeholder)")));
gtk_widget_set_sensitive(window->option_cvtype, FALSE);
location_bar_box = gtk_hbox_new(FALSE, GNOME_PAD);
gtk_container_set_border_width(GTK_CONTAINER(location_bar_box), GNOME_PAD_SMALL);
......@@ -447,23 +438,12 @@ nautilus_window_constructed(NautilusWindow *window)
GNOME_DOCK_ITEM_BEH_EXCLUSIVE|GNOME_DOCK_ITEM_BEH_NEVER_VERTICAL,
GNOME_DOCK_TOP, 2, 0, 0);
gtk_widget_show_all(window->menu_cvtype);
gtk_option_menu_set_menu(GTK_OPTION_MENU(window->option_cvtype), window->menu_cvtype);
gtk_option_menu_set_history(GTK_OPTION_MENU(window->option_cvtype), 0);
/* Option menu for content view types; it's empty here, filled in when a uri is set. */
window->option_cvtype = gtk_option_menu_new();
gtk_box_pack_end(GTK_BOX(location_bar_box), window->option_cvtype, FALSE, FALSE, GNOME_PAD_BIG);
gtk_widget_show(window->option_cvtype);
gtk_widget_show_all(location_bar_box);
/* For mysterious reasons, connecting these signals before laying out the menu
* and option menu ends up making the option menu not know how to size itself (i.e,
* it is zero-width unless you turn on expand and fill). So we do it here afterwards.
*/
gtk_signal_connect_while_alive(GTK_OBJECT(window->menu_cvtype), "add",
GTK_SIGNAL_FUNC(gtk_option_menu_do_resize), window->option_cvtype,
GTK_OBJECT(window->option_cvtype));
gtk_signal_connect_while_alive(GTK_OBJECT(window->menu_cvtype), "remove",
GTK_SIGNAL_FUNC(gtk_option_menu_do_resize), window->option_cvtype,
GTK_OBJECT(window->option_cvtype));
gtk_widget_show_all(location_bar_box);
/* set up status bar */
......
......@@ -60,7 +60,7 @@ struct _NautilusWindow {
/* UI stuff */
NautilusIndexPanel *index_panel;
GtkWidget *content_hbox, *btn_back, *btn_fwd;
GtkWidget *option_cvtype, *menu_cvtype, *ent_uri;
GtkWidget *option_cvtype, *ent_uri;
guint statusbar_ctx, statusbar_clear_id;
......
......@@ -427,15 +427,6 @@ nautilus_window_constructed(NautilusWindow *window)
/* set up location bar */
window->option_cvtype = gtk_option_menu_new();
window->menu_cvtype = gtk_menu_new();
/* FIXME: Add in placeholder item for now; rework this when we get the right views showing up.
* Since menu doesn't yet work, make it insensitive.
*/
gtk_container_add(GTK_CONTAINER(window->menu_cvtype),
gtk_menu_item_new_with_label(_("View as (placeholder)")));
gtk_widget_set_sensitive(window->option_cvtype, FALSE);
location_bar_box = gtk_hbox_new(FALSE, GNOME_PAD);
gtk_container_set_border_width(GTK_CONTAINER(location_bar_box), GNOME_PAD_SMALL);
......@@ -447,23 +438,12 @@ nautilus_window_constructed(NautilusWindow *window)
GNOME_DOCK_ITEM_BEH_EXCLUSIVE|GNOME_DOCK_ITEM_BEH_NEVER_VERTICAL,
GNOME_DOCK_TOP, 2, 0, 0);
gtk_widget_show_all(window->menu_cvtype);
gtk_option_menu_set_menu(GTK_OPTION_MENU(window->option_cvtype), window->menu_cvtype);
gtk_option_menu_set_history(GTK_OPTION_MENU(window->option_cvtype), 0);
/* Option menu for content view types; it's empty here, filled in when a uri is set. */
window->option_cvtype = gtk_option_menu_new();
gtk_box_pack_end(GTK_BOX(location_bar_box), window->option_cvtype, FALSE, FALSE, GNOME_PAD_BIG);
gtk_widget_show(window->option_cvtype);
gtk_widget_show_all(location_bar_box);
/* For mysterious reasons, connecting these signals before laying out the menu
* and option menu ends up making the option menu not know how to size itself (i.e,
* it is zero-width unless you turn on expand and fill). So we do it here afterwards.
*/
gtk_signal_connect_while_alive(GTK_OBJECT(window->menu_cvtype), "add",
GTK_SIGNAL_FUNC(gtk_option_menu_do_resize), window->option_cvtype,
GTK_OBJECT(window->option_cvtype));
gtk_signal_connect_while_alive(GTK_OBJECT(window->menu_cvtype), "remove",
GTK_SIGNAL_FUNC(gtk_option_menu_do_resize), window->option_cvtype,
GTK_OBJECT(window->option_cvtype));
gtk_widget_show_all(location_bar_box);
/* set up status bar */
......
......@@ -60,7 +60,7 @@ struct _NautilusWindow {
/* UI stuff */
NautilusIndexPanel *index_panel;
GtkWidget *content_hbox, *btn_back, *btn_fwd;
GtkWidget *option_cvtype, *menu_cvtype, *ent_uri;
GtkWidget *option_cvtype, *ent_uri;
guint statusbar_ctx, statusbar_clear_id;
......
......@@ -134,6 +134,54 @@ Nautilus_NavigationInfo__copy(Nautilus_NavigationInfo *dest_ni, Nautilus_Navigat
dest_ni->self_originated = CORBA_FALSE;
}
static void
nautilus_window_load_content_view_menu (NautilusWindow *window)
{
GList *children;
GList *iter_old;
GSList *iter_new;
GtkWidget *new_menu;
gint index, default_view_index;
g_return_if_fail (NAUTILUS_IS_WINDOW (window));
g_return_if_fail (GTK_IS_OPTION_MENU (window->option_cvtype));
g_return_if_fail (window->load_info != NULL);
g_return_if_fail (window->load_info->ni != NULL);
new_menu = gtk_menu_new ();
/* Add a menu item for each available content view type */
iter_new = window->load_info->ni->content_identifiers;
index = 0;
default_view_index = -1;
while (iter_new != NULL)
{
GtkWidget *menu_item;
NautilusViewIdentifier *identifier;
identifier = (NautilusViewIdentifier *)iter_new->data;
menu_item = gtk_menu_item_new_with_label (identifier->name);
if (strcmp (identifier->iid, window->load_info->ni->default_content_iid) == 0)
{
default_view_index = index;
}
/* FIXME: Need to connect menu item to signal here */
gtk_menu_append (GTK_MENU (new_menu), menu_item);
gtk_widget_show (menu_item);
iter_new = g_slist_next (iter_new);
++index;
}
/* We create and attach a new menu here because adding/removing items from
* existing menu screws up the size of the option menu.
*/
gtk_option_menu_set_menu (GTK_OPTION_MENU (window->option_cvtype), new_menu);
g_assert (default_view_index >= 0);
gtk_option_menu_set_history (GTK_OPTION_MENU (window->option_cvtype),
default_view_index);
}
/* Handle the changes for the NautilusWindow itself. */
static void
nautilus_window_change_location_internal(NautilusWindow *window, Nautilus_NavigationInfo *loci, gboolean is_back)
......@@ -196,6 +244,8 @@ nautilus_window_change_location_internal(NautilusWindow *window, Nautilus_Naviga
window->si = NULL;
}
nautilus_window_load_content_view_menu (window);
explorer_location_bar_set_uri_string(EXPLORER_LOCATION_BAR(window->ent_uri),
loci->requested_uri);
}
......@@ -440,25 +490,25 @@ nautilus_window_change_location_2(NautilusNavigationInfo *ni, gpointer data)
{
nautilus_window_display_error
(window,
_("The chosen hyperlink is invalid, or points to an inaccessable page."));
_("The chosen hyperlink is invalid, or points to an inaccessible page."));
nautilus_window_end_location_change(window);
return;
}
if(!ni->content_iid)
if(!ni->default_content_iid)
{
nautilus_window_display_error
(window,
_("There is not any known method of displaying the selected page."));
_("There is no known method of displaying the selected page."));
nautilus_window_end_location_change(window);
return;
}
nautilus_window_load_content_view(window, ni->content_iid, ni, (NautilusView **)&ni->requesting_view);
nautilus_window_load_content_view(window, ni->default_content_iid, ni, (NautilusView **)&ni->requesting_view);
if(!window->load_info->new_content_view)
{
nautilus_window_display_error
......
......@@ -427,15 +427,6 @@ nautilus_window_constructed(NautilusWindow *window)
/* set up location bar */
window->option_cvtype = gtk_option_menu_new();
window->menu_cvtype = gtk_menu_new();
/* FIXME: Add in placeholder item for now; rework this when we get the right views showing up.
* Since menu doesn't yet work, make it insensitive.
*/
gtk_container_add(GTK_CONTAINER(window->menu_cvtype),
gtk_menu_item_new_with_label(_("View as (placeholder)")));
gtk_widget_set_sensitive(window->option_cvtype, FALSE);
location_bar_box = gtk_hbox_new(FALSE, GNOME_PAD);
gtk_container_set_border_width(GTK_CONTAINER(location_bar_box), GNOME_PAD_SMALL);
......@@ -447,23 +438,12 @@ nautilus_window_constructed(NautilusWindow *window)
GNOME_DOCK_ITEM_BEH_EXCLUSIVE|GNOME_DOCK_ITEM_BEH_NEVER_VERTICAL,
GNOME_DOCK_TOP, 2, 0, 0);
gtk_widget_show_all(window->menu_cvtype);
gtk_option_menu_set_menu(GTK_OPTION_MENU(window->option_cvtype), window->menu_cvtype);
gtk_option_menu_set_history(GTK_OPTION_MENU(window->option_cvtype), 0);
/* Option menu for content view types; it's empty here, filled in when a uri is set. */
window->option_cvtype = gtk_option_menu_new();
gtk_box_pack_end(GTK_BOX(location_bar_box), window->option_cvtype, FALSE, FALSE, GNOME_PAD_BIG);
gtk_widget_show(window->option_cvtype);
gtk_widget_show_all(location_bar_box);
/* For mysterious reasons, connecting these signals before laying out the menu
* and option menu ends up making the option menu not know how to size itself (i.e,
* it is zero-width unless you turn on expand and fill). So we do it here afterwards.
*/
gtk_signal_connect_while_alive(GTK_OBJECT(window->menu_cvtype), "add",
GTK_SIGNAL_FUNC(gtk_option_menu_do_resize), window->option_cvtype,
GTK_OBJECT(window->option_cvtype));
gtk_signal_connect_while_alive(GTK_OBJECT(window->menu_cvtype), "remove",
GTK_SIGNAL_FUNC(gtk_option_menu_do_resize), window->option_cvtype,
GTK_OBJECT(window->option_cvtype));
gtk_widget_show_all(location_bar_box);
/* set up status bar */
......
......@@ -60,7 +60,7 @@ struct _NautilusWindow {
/* UI stuff */
NautilusIndexPanel *index_panel;
GtkWidget *content_hbox, *btn_back, *btn_fwd;
GtkWidget *option_cvtype, *menu_cvtype, *ent_uri;
GtkWidget *option_cvtype, *ent_uri;
guint statusbar_ctx, statusbar_clear_id;
......
......@@ -34,16 +34,23 @@
typedef char *NautilusLocationReference;
typedef struct _NautilusNavigationInfo NautilusNavigationInfo;
typedef struct _NautilusViewIdentifier NautilusViewIdentifier;
typedef void (*NautilusNavigationInfoFunc)(NautilusNavigationInfo *navinfo, gpointer data);
struct _NautilusViewIdentifier {
char *iid; /* magic key */
char *name; /* human-readable name */
};
struct _NautilusNavigationInfo {
Nautilus_NavigationInfo navinfo;
gpointer requesting_view;
const char *content_iid;
GSList *meta_iids;
const char *default_content_iid;
GSList *content_identifiers; /* list of NautilusViewIdentifiers */
GSList *meta_iids; /* list of iid strings */
guint notify_tag;
NautilusNavigationInfoFunc notify_ready;
......
......@@ -59,6 +59,32 @@ nautilus_navinfo_add_mapping(const char *scheme, int type, const char *data, con
g_hash_table_insert(scheme_mappings, g_strdup(scheme), ent);
}
static NautilusViewIdentifier *
nautilus_view_identifier_new (const char *iid, const char *name)
{
NautilusViewIdentifier *new_identifier;
g_return_val_if_fail (iid != NULL, NULL);
g_return_val_if_fail (name != NULL, NULL);
new_identifier = g_new0 (NautilusViewIdentifier, 1);
new_identifier->iid = g_strdup (iid);
new_identifier->name = g_strdup (name);
return new_identifier;
}
static void
nautilus_view_identifier_free (NautilusViewIdentifier *identifier)
{
if (identifier != NULL)
{
g_free (identifier->iid);
g_free (identifier->name);
g_free (identifier);
}
}
static void
navinfo_read_map_file(const char *fn)
{
......@@ -258,12 +284,12 @@ nautilus_navinfo_new(Nautilus_NavigationRequestInfo *nri,
Check if the URI is in an abnormal scheme (e.g. one not supported by gnome-vfs)
If so
Lookup a content view by scheme name, go.
Lookup content views by scheme name, go.
Lookup meta views by scheme name, go.
If not
Figure out content type.
Lookup a content view by content type, go.
Lookup content views by content type, go.
Lookup meta views by content type, go.
The lookup-and-go process works like:
......@@ -280,16 +306,29 @@ nautilus_navinfo_new(Nautilus_NavigationRequestInfo *nri,
{
if(!strcmp(navinfo->navinfo.content_type, "text/html"))
{
navinfo->content_iid = "ntl_web_browser";
navinfo->default_content_iid = "ntl_web_browser";
navinfo->content_identifiers = g_slist_append (
navinfo->content_identifiers,
nautilus_view_identifier_new (navinfo->default_content_iid, "Web Page"));
}
else if(!strcmp(navinfo->navinfo.content_type, "text/plain"))
{
navinfo->content_iid = "embeddable:text-plain";
navinfo->default_content_iid = "embeddable:text-plain";
navinfo->content_identifiers = g_slist_append (
navinfo->content_identifiers,
nautilus_view_identifier_new (navinfo->default_content_iid, "Text"));
}
else if(!strcmp(navinfo->navinfo.content_type, "special/directory")
|| !strcmp(navinfo->navinfo.content_type, "application/x-nautilus-vdir"))
{
navinfo->content_iid = "ntl_file_manager";
navinfo->default_content_iid = "ntl_file_manager";
navinfo->content_identifiers = g_slist_append (
navinfo->content_identifiers,
nautilus_view_identifier_new (navinfo->default_content_iid, "Icons"));
/* FIXME: Test of multiple items, replace with working case */
navinfo->content_identifiers = g_slist_append (
navinfo->content_identifiers,
nautilus_view_identifier_new ("bogus_test_iid", "List"));
}
else
{
......@@ -320,6 +359,8 @@ nautilus_navinfo_free(NautilusNavigationInfo *navinfo)
/* XXX remove_notification */
}
g_slist_foreach(navinfo->content_identifiers, (GFunc)nautilus_view_identifier_free, NULL);
g_slist_free(navinfo->content_identifiers);
g_slist_foreach(navinfo->meta_iids, (GFunc)g_free, NULL);
g_slist_free(navinfo->meta_iids);
g_free(navinfo->navinfo.requested_uri);
......
......@@ -134,6 +134,54 @@ Nautilus_NavigationInfo__copy(Nautilus_NavigationInfo *dest_ni, Nautilus_Navigat
dest_ni->self_originated = CORBA_FALSE;
}
static void
nautilus_window_load_content_view_menu (NautilusWindow *window)
{
GList *children;
GList *iter_old;
GSList *iter_new;
GtkWidget *new_menu;
gint index, default_view_index;
g_return_if_fail (NAUTILUS_IS_WINDOW (window));
g_return_if_fail (GTK_IS_OPTION_MENU (window->option_cvtype));
g_return_if_fail (window->load_info != NULL);
g_return_if_fail (window->load_info->ni != NULL);
new_menu = gtk_menu_new ();
/* Add a menu item for each available content view type */
iter_new = window->load_info->ni->content_identifiers;
index = 0;
default_view_index = -1;
while (iter_new != NULL)
{
GtkWidget *menu_item;
NautilusViewIdentifier *identifier;
identifier = (NautilusViewIdentifier *)iter_new->data;
menu_item = gtk_menu_item_new_with_label (identifier->name);
if (strcmp (identifier->iid, window->load_info->ni->default_content_iid) == 0)
{
default_view_index = index;
}
/* FIXME: Need to connect menu item to signal here */
gtk_menu_append (GTK_MENU (new_menu), menu_item);
gtk_widget_show (menu_item);
iter_new = g_slist_next (iter_new);
++index;
}
/* We create and attach a new menu here because adding/removing items from
* existing menu screws up the size of the option menu.
*/
gtk_option_menu_set_menu (GTK_OPTION_MENU (window->option_cvtype), new_menu);
g_assert (default_view_index >= 0);
gtk_option_menu_set_history (GTK_OPTION_MENU (window->option_cvtype),
default_view_index);
}
/* Handle the changes for the NautilusWindow itself. */
static void
nautilus_window_change_location_internal(NautilusWindow *window, Nautilus_NavigationInfo *loci, gboolean is_back)
......@@ -196,6 +244,8 @@ nautilus_window_change_location_internal(NautilusWindow *window, Nautilus_Naviga
window->si = NULL;
}
nautilus_window_load_content_view_menu (window);
explorer_location_bar_set_uri_string(EXPLORER_LOCATION_BAR(window->ent_uri),
loci->requested_uri);
}
......@@ -440,25 +490,25 @@ nautilus_window_change_location_2(NautilusNavigationInfo *ni, gpointer data)
{
nautilus_window_display_error
(window,
_("The chosen hyperlink is invalid, or points to an inaccessable page."));
_("The chosen hyperlink is invalid, or points to an inaccessible page."));