Commit f7492a63 authored by Elliot Lee's avatar Elliot Lee

Add a specific flag to indicate reload, and make use of it.



* src/ntl-window.[ch], src/ntl-window-msgs.c,
src/ntl-window-private.h: Add a specific flag to indicate reload, and make use of it.
parent dfc585b3
2000-01-21 Elliot Lee <sopwith@redhat.com>
* src/ntl-window.[ch], src/ntl-window-msgs.c,
src/ntl-window-private.h: Add a specific flag to indicate reload, and make use of it.
* libnautilus/nautilus-directory.c: Allocate an extra byte in the
buffer, for safety's sake.
* src/ntl-window-msgs.c: Fix back/fwd buttons.
......
......@@ -424,6 +424,8 @@ nautilus_window_constructed(NautilusWindow *window)
window->btn_back = toolbar_info[0].widget;
window->btn_fwd = toolbar_info[1].widget;
nautilus_window_allow_stop(window, FALSE);
gtk_widget_set_sensitive(window->btn_back, FALSE);
gtk_widget_set_sensitive(window->btn_fwd, FALSE);
/* set up location bar */
......@@ -741,7 +743,7 @@ nautilus_window_back (GtkWidget *btn, NautilusWindow *window)
nri.requested_uri = window->uris_prev->data;
nri.new_window_default = nri.new_window_suggested = nri.new_window_enforced = Nautilus_V_FALSE;
nautilus_window_change_location(window, &nri, NULL, TRUE);
nautilus_window_change_location(window, &nri, NULL, TRUE, FALSE);
}
static void
......@@ -754,7 +756,7 @@ nautilus_window_fwd (GtkWidget *btn, NautilusWindow *window)
memset(&nri, 0, sizeof(nri));
nri.requested_uri = window->uris_next->data;
nri.new_window_default = nri.new_window_suggested = nri.new_window_enforced = Nautilus_V_FALSE;
nautilus_window_change_location(window, &nri, NULL, FALSE);
nautilus_window_change_location(window, &nri, NULL, FALSE, FALSE);
}
const char *
......@@ -790,9 +792,12 @@ nautilus_window_up (GtkWidget *btn, NautilusWindow *window)
static void
nautilus_window_reload (GtkWidget *btn, NautilusWindow *window)
{
/* Should enforce same window! */
nautilus_window_goto_uri (window,
nautilus_window_get_requested_uri(window));
Nautilus_NavigationRequestInfo nri;
memset(&nri, 0, sizeof(nri));
nri.requested_uri = (char *)nautilus_window_get_requested_uri(window);
nri.new_window_default = nri.new_window_suggested = nri.new_window_enforced = Nautilus_V_FALSE;
nautilus_window_change_location(window, &nri, NULL, FALSE, TRUE);
}
static void
......
......@@ -90,6 +90,7 @@ struct _NautilusWindow {
gboolean changes_pending : 1;
gboolean is_back : 1;
gboolean is_reload : 1;
gboolean views_shown : 1;
gboolean view_bombed_out : 1;
gboolean view_activation_complete : 1;
......
......@@ -424,6 +424,8 @@ nautilus_window_constructed(NautilusWindow *window)
window->btn_back = toolbar_info[0].widget;
window->btn_fwd = toolbar_info[1].widget;
nautilus_window_allow_stop(window, FALSE);
gtk_widget_set_sensitive(window->btn_back, FALSE);
gtk_widget_set_sensitive(window->btn_fwd, FALSE);
/* set up location bar */
......@@ -741,7 +743,7 @@ nautilus_window_back (GtkWidget *btn, NautilusWindow *window)
nri.requested_uri = window->uris_prev->data;
nri.new_window_default = nri.new_window_suggested = nri.new_window_enforced = Nautilus_V_FALSE;
nautilus_window_change_location(window, &nri, NULL, TRUE);
nautilus_window_change_location(window, &nri, NULL, TRUE, FALSE);
}
static void
......@@ -754,7 +756,7 @@ nautilus_window_fwd (GtkWidget *btn, NautilusWindow *window)
memset(&nri, 0, sizeof(nri));
nri.requested_uri = window->uris_next->data;
nri.new_window_default = nri.new_window_suggested = nri.new_window_enforced = Nautilus_V_FALSE;
nautilus_window_change_location(window, &nri, NULL, FALSE);
nautilus_window_change_location(window, &nri, NULL, FALSE, FALSE);
}
const char *
......@@ -790,9 +792,12 @@ nautilus_window_up (GtkWidget *btn, NautilusWindow *window)
static void
nautilus_window_reload (GtkWidget *btn, NautilusWindow *window)
{
/* Should enforce same window! */
nautilus_window_goto_uri (window,
nautilus_window_get_requested_uri(window));
Nautilus_NavigationRequestInfo nri;
memset(&nri, 0, sizeof(nri));
nri.requested_uri = (char *)nautilus_window_get_requested_uri(window);
nri.new_window_default = nri.new_window_suggested = nri.new_window_enforced = Nautilus_V_FALSE;
nautilus_window_change_location(window, &nri, NULL, FALSE, TRUE);
}
static void
......
......@@ -90,6 +90,7 @@ struct _NautilusWindow {
gboolean changes_pending : 1;
gboolean is_back : 1;
gboolean is_reload : 1;
gboolean views_shown : 1;
gboolean view_bombed_out : 1;
gboolean view_activation_complete : 1;
......
......@@ -424,6 +424,8 @@ nautilus_window_constructed(NautilusWindow *window)
window->btn_back = toolbar_info[0].widget;
window->btn_fwd = toolbar_info[1].widget;
nautilus_window_allow_stop(window, FALSE);
gtk_widget_set_sensitive(window->btn_back, FALSE);
gtk_widget_set_sensitive(window->btn_fwd, FALSE);
/* set up location bar */
......@@ -741,7 +743,7 @@ nautilus_window_back (GtkWidget *btn, NautilusWindow *window)
nri.requested_uri = window->uris_prev->data;
nri.new_window_default = nri.new_window_suggested = nri.new_window_enforced = Nautilus_V_FALSE;
nautilus_window_change_location(window, &nri, NULL, TRUE);
nautilus_window_change_location(window, &nri, NULL, TRUE, FALSE);
}
static void
......@@ -754,7 +756,7 @@ nautilus_window_fwd (GtkWidget *btn, NautilusWindow *window)
memset(&nri, 0, sizeof(nri));
nri.requested_uri = window->uris_next->data;
nri.new_window_default = nri.new_window_suggested = nri.new_window_enforced = Nautilus_V_FALSE;
nautilus_window_change_location(window, &nri, NULL, FALSE);
nautilus_window_change_location(window, &nri, NULL, FALSE, FALSE);
}
const char *
......@@ -790,9 +792,12 @@ nautilus_window_up (GtkWidget *btn, NautilusWindow *window)
static void
nautilus_window_reload (GtkWidget *btn, NautilusWindow *window)
{
/* Should enforce same window! */
nautilus_window_goto_uri (window,
nautilus_window_get_requested_uri(window));
Nautilus_NavigationRequestInfo nri;
memset(&nri, 0, sizeof(nri));
nri.requested_uri = (char *)nautilus_window_get_requested_uri(window);
nri.new_window_default = nri.new_window_suggested = nri.new_window_enforced = Nautilus_V_FALSE;
nautilus_window_change_location(window, &nri, NULL, FALSE, TRUE);
}
static void
......
......@@ -90,6 +90,7 @@ struct _NautilusWindow {
gboolean changes_pending : 1;
gboolean is_back : 1;
gboolean is_reload : 1;
gboolean views_shown : 1;
gboolean view_bombed_out : 1;
gboolean view_activation_complete : 1;
......
......@@ -180,6 +180,8 @@ nautilus_window_update_internals(NautilusWindow *window, NautilusNavigationInfo
Nautilus_NavigationInfo *newni;
/* Maintain history lists. */
if(!window->is_reload)
{
if (window->is_back)
{
/* Going back. Remove one item from the prev list and add the current item to the next list. */
......@@ -211,6 +213,7 @@ nautilus_window_update_internals(NautilusWindow *window, NautilusNavigationInfo
if (window->ni)
window->uris_prev = g_slist_prepend(window->uris_prev, g_strdup(window->ni->requested_uri));
}
}
new_uri = gnome_vfs_uri_new (loci->navinfo.requested_uri);
nautilus_window_allow_up(window,
......@@ -421,7 +424,7 @@ nautilus_window_request_location_change(NautilusWindow *window,
Nautilus_NavigationRequestInfo *loc,
NautilusView *requesting_view)
{
nautilus_window_change_location(window, loc, requesting_view, FALSE);
nautilus_window_change_location(window, loc, requesting_view, FALSE, FALSE);
}
static NautilusView *
......@@ -828,7 +831,8 @@ void
nautilus_window_change_location(NautilusWindow *window,
Nautilus_NavigationRequestInfo *loc,
NautilusView *requesting_view,
gboolean is_back)
gboolean is_back,
gboolean is_reload)
{
nautilus_window_set_state_info(window, (NautilusWindowStateItem)RESET_TO_IDLE, (NautilusWindowStateItem)0);
......@@ -839,6 +843,7 @@ nautilus_window_change_location(NautilusWindow *window,
nautilus_window_progress_indicate(window, PROGRESS_INITIAL, 0, _("Gathering information"));
window->is_back = is_back;
window->is_reload = is_reload;
window->new_requesting_view = requesting_view;
window->cancel_tag =
......@@ -866,6 +871,8 @@ view_menu_switch_views_cb (GtkWidget *widget, gpointer data)
view = nautilus_window_load_content_view (window, iid, window->ni, NULL);
nautilus_window_set_state_info(window, (NautilusWindowStateItem)NEW_CONTENT_VIEW_ACTIVATED, view, (NautilusWindowStateItem)0);
window->is_back = FALSE;
window->is_reload = TRUE;
}
/*
......
......@@ -35,7 +35,8 @@ void nautilus_window_set_status(NautilusWindow *window, const char *txt);
void nautilus_window_change_location(NautilusWindow *window,
Nautilus_NavigationRequestInfo *loc,
NautilusView *requesting_view,
gboolean is_back);
gboolean is_back,
gboolean is_reload);
void nautilus_window_remove_meta_view_real(NautilusWindow *window, NautilusView *meta_view);
void nautilus_window_end_location_change(NautilusWindow *window);
void nautilus_window_connect_view (NautilusWindow *window,
......
......@@ -424,6 +424,8 @@ nautilus_window_constructed(NautilusWindow *window)
window->btn_back = toolbar_info[0].widget;
window->btn_fwd = toolbar_info[1].widget;
nautilus_window_allow_stop(window, FALSE);
gtk_widget_set_sensitive(window->btn_back, FALSE);
gtk_widget_set_sensitive(window->btn_fwd, FALSE);
/* set up location bar */
......@@ -741,7 +743,7 @@ nautilus_window_back (GtkWidget *btn, NautilusWindow *window)
nri.requested_uri = window->uris_prev->data;
nri.new_window_default = nri.new_window_suggested = nri.new_window_enforced = Nautilus_V_FALSE;
nautilus_window_change_location(window, &nri, NULL, TRUE);
nautilus_window_change_location(window, &nri, NULL, TRUE, FALSE);
}
static void
......@@ -754,7 +756,7 @@ nautilus_window_fwd (GtkWidget *btn, NautilusWindow *window)
memset(&nri, 0, sizeof(nri));
nri.requested_uri = window->uris_next->data;
nri.new_window_default = nri.new_window_suggested = nri.new_window_enforced = Nautilus_V_FALSE;
nautilus_window_change_location(window, &nri, NULL, FALSE);
nautilus_window_change_location(window, &nri, NULL, FALSE, FALSE);
}
const char *
......@@ -790,9 +792,12 @@ nautilus_window_up (GtkWidget *btn, NautilusWindow *window)
static void
nautilus_window_reload (GtkWidget *btn, NautilusWindow *window)
{
/* Should enforce same window! */
nautilus_window_goto_uri (window,
nautilus_window_get_requested_uri(window));
Nautilus_NavigationRequestInfo nri;
memset(&nri, 0, sizeof(nri));
nri.requested_uri = (char *)nautilus_window_get_requested_uri(window);
nri.new_window_default = nri.new_window_suggested = nri.new_window_enforced = Nautilus_V_FALSE;
nautilus_window_change_location(window, &nri, NULL, FALSE, TRUE);
}
static void
......
......@@ -90,6 +90,7 @@ struct _NautilusWindow {
gboolean changes_pending : 1;
gboolean is_back : 1;
gboolean is_reload : 1;
gboolean views_shown : 1;
gboolean view_bombed_out : 1;
gboolean view_activation_complete : 1;
......
......@@ -180,6 +180,8 @@ nautilus_window_update_internals(NautilusWindow *window, NautilusNavigationInfo
Nautilus_NavigationInfo *newni;
/* Maintain history lists. */
if(!window->is_reload)
{
if (window->is_back)
{
/* Going back. Remove one item from the prev list and add the current item to the next list. */
......@@ -211,6 +213,7 @@ nautilus_window_update_internals(NautilusWindow *window, NautilusNavigationInfo
if (window->ni)
window->uris_prev = g_slist_prepend(window->uris_prev, g_strdup(window->ni->requested_uri));
}
}
new_uri = gnome_vfs_uri_new (loci->navinfo.requested_uri);
nautilus_window_allow_up(window,
......@@ -421,7 +424,7 @@ nautilus_window_request_location_change(NautilusWindow *window,
Nautilus_NavigationRequestInfo *loc,
NautilusView *requesting_view)
{
nautilus_window_change_location(window, loc, requesting_view, FALSE);
nautilus_window_change_location(window, loc, requesting_view, FALSE, FALSE);
}
static NautilusView *
......@@ -828,7 +831,8 @@ void
nautilus_window_change_location(NautilusWindow *window,
Nautilus_NavigationRequestInfo *loc,
NautilusView *requesting_view,
gboolean is_back)
gboolean is_back,
gboolean is_reload)
{
nautilus_window_set_state_info(window, (NautilusWindowStateItem)RESET_TO_IDLE, (NautilusWindowStateItem)0);
......@@ -839,6 +843,7 @@ nautilus_window_change_location(NautilusWindow *window,
nautilus_window_progress_indicate(window, PROGRESS_INITIAL, 0, _("Gathering information"));
window->is_back = is_back;
window->is_reload = is_reload;
window->new_requesting_view = requesting_view;
window->cancel_tag =
......@@ -866,6 +871,8 @@ view_menu_switch_views_cb (GtkWidget *widget, gpointer data)
view = nautilus_window_load_content_view (window, iid, window->ni, NULL);
nautilus_window_set_state_info(window, (NautilusWindowStateItem)NEW_CONTENT_VIEW_ACTIVATED, view, (NautilusWindowStateItem)0);
window->is_back = FALSE;
window->is_reload = TRUE;
}
/*
......
......@@ -35,7 +35,8 @@ void nautilus_window_set_status(NautilusWindow *window, const char *txt);
void nautilus_window_change_location(NautilusWindow *window,
Nautilus_NavigationRequestInfo *loc,
NautilusView *requesting_view,
gboolean is_back);
gboolean is_back,
gboolean is_reload);
void nautilus_window_remove_meta_view_real(NautilusWindow *window, NautilusView *meta_view);
void nautilus_window_end_location_change(NautilusWindow *window);
void nautilus_window_connect_view (NautilusWindow *window,
......
......@@ -424,6 +424,8 @@ nautilus_window_constructed(NautilusWindow *window)
window->btn_back = toolbar_info[0].widget;
window->btn_fwd = toolbar_info[1].widget;
nautilus_window_allow_stop(window, FALSE);
gtk_widget_set_sensitive(window->btn_back, FALSE);
gtk_widget_set_sensitive(window->btn_fwd, FALSE);
/* set up location bar */
......@@ -741,7 +743,7 @@ nautilus_window_back (GtkWidget *btn, NautilusWindow *window)
nri.requested_uri = window->uris_prev->data;
nri.new_window_default = nri.new_window_suggested = nri.new_window_enforced = Nautilus_V_FALSE;
nautilus_window_change_location(window, &nri, NULL, TRUE);
nautilus_window_change_location(window, &nri, NULL, TRUE, FALSE);
}
static void
......@@ -754,7 +756,7 @@ nautilus_window_fwd (GtkWidget *btn, NautilusWindow *window)
memset(&nri, 0, sizeof(nri));
nri.requested_uri = window->uris_next->data;
nri.new_window_default = nri.new_window_suggested = nri.new_window_enforced = Nautilus_V_FALSE;
nautilus_window_change_location(window, &nri, NULL, FALSE);
nautilus_window_change_location(window, &nri, NULL, FALSE, FALSE);
}
const char *
......@@ -790,9 +792,12 @@ nautilus_window_up (GtkWidget *btn, NautilusWindow *window)
static void
nautilus_window_reload (GtkWidget *btn, NautilusWindow *window)
{
/* Should enforce same window! */
nautilus_window_goto_uri (window,
nautilus_window_get_requested_uri(window));
Nautilus_NavigationRequestInfo nri;
memset(&nri, 0, sizeof(nri));
nri.requested_uri = (char *)nautilus_window_get_requested_uri(window);
nri.new_window_default = nri.new_window_suggested = nri.new_window_enforced = Nautilus_V_FALSE;
nautilus_window_change_location(window, &nri, NULL, FALSE, TRUE);
}
static void
......
......@@ -90,6 +90,7 @@ struct _NautilusWindow {
gboolean changes_pending : 1;
gboolean is_back : 1;
gboolean is_reload : 1;
gboolean views_shown : 1;
gboolean view_bombed_out : 1;
gboolean view_activation_complete : 1;
......
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