Commit daff2271 authored by John Sullivan's avatar John Sullivan

Cleaned up request-new-window situation with Nautilus_NavigationRequestInfo.

parent 212ed01c
2000-03-22 John Sullivan <sullivan@eazel.com>
Fixed bug 308 (Straighten out the new_window situation
in Nautilus_NavigationRequestInfo)
Nautilus_NavigationRequestInfo was passing around a trio
of tri-state values where one boolean would do. Now it
passes around one boolean.
* idl/nautilus.idl: Eliminated enum TruthValue,
replaced NavigationRequestInfo's new_window_default,
new_window_suggested, and new_window_enforced with boolean
new_window_requested.
* components/help/hyperbola-nav-index.c: (hyperbola_navigation_index_select_row),
* components/help/hyperbola-nav-search.c: (hyperbola_navigation_search_select_row),
* components/help/hyperbola-nav-tree.c: (hyperbola_navigation_tree_select_row),
* components/history/ntl-history-view.c:
* components/websearch/ntl-web-search.c:
* src/nautilus-window-toolbars.c:
* src/ntl-window-msgs.c:
* src/ntl-window.c:
* src/file-manager/fm-directory-view.c:
Simplified all users of Nautilus_NavigationRequestInfo to match.
* components/music/main.c: Added a #include to kill
warning about gnome_vfs_init being undefined.
2000-03-21 John Sullivan <sullivan@eazel.com>
Fixed bug 335 (Menus incorrect after keyboard navigation)
......
......@@ -241,7 +241,7 @@ hyperbola_navigation_index_select_row(GtkWidget *clist, gint row, gint column, G
memset(&loc, 0, sizeof(loc));
loc.requested_uri = ii->uri;
loc.new_window_default = loc.new_window_suggested = loc.new_window_enforced = Nautilus_V_UNKNOWN;
loc.new_window_requested = FALSE;
nautilus_view_frame_request_location_change(NAUTILUS_VIEW_FRAME(hni->view_frame), &loc);
}
......
......@@ -138,7 +138,7 @@ hyperbola_navigation_search_select_row(GtkWidget *clist, gint row, gint column,
memset(&loc, 0, sizeof(loc));
loc.requested_uri = uri;
loc.new_window_default = loc.new_window_suggested = loc.new_window_enforced = Nautilus_V_UNKNOWN;
loc.new_window_requested = FALSE;
nautilus_view_frame_request_location_change(NAUTILUS_VIEW_FRAME(hns->view_frame), &loc);
}
......
......@@ -137,7 +137,7 @@ static void hyperbola_navigation_tree_select_row(GtkCTree *ctree, GtkCTreeNode *
memset(&nri, 0, sizeof(nri));
nri.requested_uri = tnode->uri;
nri.new_window_default = nri.new_window_suggested = nri.new_window_enforced = Nautilus_V_UNKNOWN;
nri.new_window_requested = FALSE;
nautilus_view_frame_request_location_change(view->view_frame, &nri);
view->notify_count--;
......
......@@ -173,9 +173,7 @@ hyperbola_navigation_history_select_row(GtkCList *clist, gint row, gint column,
/* FIXME: gotta cast away const because requested_uri isn't defined correctly */
reqi.requested_uri = (char *)get_uri_from_row (clist, row);
reqi.new_window_default = reqi.new_window_suggested = Nautilus_V_FALSE;
reqi.new_window_enforced = Nautilus_V_FALSE;
reqi.new_window_requested = FALSE;
nautilus_view_frame_request_location_change(hview->view, &reqi);
......
......@@ -173,9 +173,7 @@ hyperbola_navigation_history_select_row(GtkCList *clist, gint row, gint column,
/* FIXME: gotta cast away const because requested_uri isn't defined correctly */
reqi.requested_uri = (char *)get_uri_from_row (clist, row);
reqi.new_window_default = reqi.new_window_suggested = Nautilus_V_FALSE;
reqi.new_window_enforced = Nautilus_V_FALSE;
reqi.new_window_requested = FALSE;
nautilus_view_frame_request_location_change(hview->view, &reqi);
......
......@@ -27,6 +27,7 @@
#include "nautilus-music-view.h"
#include <gnome.h>
#include <libgnomevfs/gnome-vfs.h>
#include <libgnorba/gnorba.h>
#include <bonobo.h>
......
......@@ -89,9 +89,7 @@ do_search(GtkWidget *widget, WebSearchView *hview)
real_query[j] = '\0';
g_snprintf(uri, sizeof(uri), "%s%s%s", ei->url_head?ei->url_head:"", real_query, ei->url_tail?ei->url_tail:"");
nri.requested_uri = uri;
nri.new_window_default = Nautilus_V_FALSE;
nri.new_window_suggested = Nautilus_V_FALSE;
nri.new_window_enforced = Nautilus_V_UNKNOWN;
nri.new_window_requested = FALSE;
nautilus_view_frame_request_location_change(hview->view, &nri);
}
......
......@@ -4,10 +4,9 @@
#include <Bonobo.idl>
module Nautilus {
enum TruthValue { V_UNKNOWN, V_FALSE, V_TRUE };
struct NavigationRequestInfo {
string requested_uri;
TruthValue new_window_default, new_window_suggested, new_window_enforced;
boolean new_window_requested;
};
struct NavigationInfo {
......
......@@ -1665,11 +1665,7 @@ fm_directory_view_activate_file_internal (FMDirectoryView *view,
g_return_if_fail (NAUTILUS_IS_FILE (file));
request.requested_uri = nautilus_file_get_uri (file);
request.new_window_default = Nautilus_V_FALSE;
request.new_window_suggested = use_new_window ?
Nautilus_V_TRUE :
Nautilus_V_FALSE;
request.new_window_enforced = Nautilus_V_UNKNOWN;
request.new_window_requested = use_new_window;
nautilus_view_frame_request_location_change
(NAUTILUS_VIEW_FRAME (view->details->view_frame), &request);
......
......@@ -318,8 +318,7 @@ nautilus_window_goto_uri (NautilusWindow *window, const char *uri)
memset(&navinfo, 0, sizeof(navinfo));
navinfo.requested_uri = (char *)uri;
navinfo.new_window_default = navinfo.new_window_suggested = Nautilus_V_FALSE;
navinfo.new_window_enforced = Nautilus_V_UNKNOWN;
navinfo.new_window_requested = FALSE;
nautilus_window_request_location_change (window, &navinfo, NULL);
}
......@@ -701,7 +700,7 @@ nautilus_window_back_or_forward (NautilusWindow *window, gboolean back, guint di
/* FIXME: Have to cast away the const for nri.requested_uri. This field should be
* declared const. */
nri.requested_uri = (char *)nautilus_bookmark_get_uri (g_slist_nth_data (list, distance));
nri.new_window_default = nri.new_window_suggested = nri.new_window_enforced = Nautilus_V_FALSE;
nri.new_window_requested = FALSE;
nautilus_window_begin_location_change (window, &nri, NULL, back ? NAUTILUS_LOCATION_CHANGE_BACK : NAUTILUS_LOCATION_CHANGE_FORWARD, distance);
}
......
......@@ -318,8 +318,7 @@ nautilus_window_goto_uri (NautilusWindow *window, const char *uri)
memset(&navinfo, 0, sizeof(navinfo));
navinfo.requested_uri = (char *)uri;
navinfo.new_window_default = navinfo.new_window_suggested = Nautilus_V_FALSE;
navinfo.new_window_enforced = Nautilus_V_UNKNOWN;
navinfo.new_window_requested = FALSE;
nautilus_window_request_location_change (window, &navinfo, NULL);
}
......@@ -701,7 +700,7 @@ nautilus_window_back_or_forward (NautilusWindow *window, gboolean back, guint di
/* FIXME: Have to cast away the const for nri.requested_uri. This field should be
* declared const. */
nri.requested_uri = (char *)nautilus_bookmark_get_uri (g_slist_nth_data (list, distance));
nri.new_window_default = nri.new_window_suggested = nri.new_window_enforced = Nautilus_V_FALSE;
nri.new_window_requested = FALSE;
nautilus_window_begin_location_change (window, &nri, NULL, back ? NAUTILUS_LOCATION_CHANGE_BACK : NAUTILUS_LOCATION_CHANGE_FORWARD, distance);
}
......
......@@ -318,8 +318,7 @@ nautilus_window_goto_uri (NautilusWindow *window, const char *uri)
memset(&navinfo, 0, sizeof(navinfo));
navinfo.requested_uri = (char *)uri;
navinfo.new_window_default = navinfo.new_window_suggested = Nautilus_V_FALSE;
navinfo.new_window_enforced = Nautilus_V_UNKNOWN;
navinfo.new_window_requested = FALSE;
nautilus_window_request_location_change (window, &navinfo, NULL);
}
......@@ -701,7 +700,7 @@ nautilus_window_back_or_forward (NautilusWindow *window, gboolean back, guint di
/* FIXME: Have to cast away the const for nri.requested_uri. This field should be
* declared const. */
nri.requested_uri = (char *)nautilus_bookmark_get_uri (g_slist_nth_data (list, distance));
nri.new_window_default = nri.new_window_suggested = nri.new_window_enforced = Nautilus_V_FALSE;
nri.new_window_requested = FALSE;
nautilus_window_begin_location_change (window, &nri, NULL, back ? NAUTILUS_LOCATION_CHANGE_BACK : NAUTILUS_LOCATION_CHANGE_FORWARD, distance);
}
......
......@@ -497,17 +497,7 @@ nautilus_window_request_location_change(NautilusWindow *window,
Nautilus_NavigationRequestInfo *loc,
NautilusView *requesting_view)
{
gboolean use_new_window;
/* FIXME: Either remove distinctions between default, suggested, & enforced, or
* deal with them somehow.
*/
use_new_window = (loc->new_window_default == Nautilus_V_TRUE ||
loc->new_window_suggested == Nautilus_V_TRUE ||
loc->new_window_enforced == Nautilus_V_TRUE);
if (use_new_window)
if (loc->new_window_requested)
{
NautilusWindow *new_window;
......
......@@ -196,7 +196,7 @@ nautilus_window_reload_cb (GtkWidget *widget, NautilusWindow *window)
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;
nri.new_window_requested = FALSE;
nautilus_window_begin_location_change (window, &nri, NULL, NAUTILUS_LOCATION_CHANGE_RELOAD, 0);
}
......
......@@ -318,8 +318,7 @@ nautilus_window_goto_uri (NautilusWindow *window, const char *uri)
memset(&navinfo, 0, sizeof(navinfo));
navinfo.requested_uri = (char *)uri;
navinfo.new_window_default = navinfo.new_window_suggested = Nautilus_V_FALSE;
navinfo.new_window_enforced = Nautilus_V_UNKNOWN;
navinfo.new_window_requested = FALSE;
nautilus_window_request_location_change (window, &navinfo, NULL);
}
......@@ -701,7 +700,7 @@ nautilus_window_back_or_forward (NautilusWindow *window, gboolean back, guint di
/* FIXME: Have to cast away the const for nri.requested_uri. This field should be
* declared const. */
nri.requested_uri = (char *)nautilus_bookmark_get_uri (g_slist_nth_data (list, distance));
nri.new_window_default = nri.new_window_suggested = nri.new_window_enforced = Nautilus_V_FALSE;
nri.new_window_requested = FALSE;
nautilus_window_begin_location_change (window, &nri, NULL, back ? NAUTILUS_LOCATION_CHANGE_BACK : NAUTILUS_LOCATION_CHANGE_FORWARD, distance);
}
......
......@@ -497,17 +497,7 @@ nautilus_window_request_location_change(NautilusWindow *window,
Nautilus_NavigationRequestInfo *loc,
NautilusView *requesting_view)
{
gboolean use_new_window;
/* FIXME: Either remove distinctions between default, suggested, & enforced, or
* deal with them somehow.
*/
use_new_window = (loc->new_window_default == Nautilus_V_TRUE ||
loc->new_window_suggested == Nautilus_V_TRUE ||
loc->new_window_enforced == Nautilus_V_TRUE);
if (use_new_window)
if (loc->new_window_requested)
{
NautilusWindow *new_window;
......
......@@ -318,8 +318,7 @@ nautilus_window_goto_uri (NautilusWindow *window, const char *uri)
memset(&navinfo, 0, sizeof(navinfo));
navinfo.requested_uri = (char *)uri;
navinfo.new_window_default = navinfo.new_window_suggested = Nautilus_V_FALSE;
navinfo.new_window_enforced = Nautilus_V_UNKNOWN;
navinfo.new_window_requested = FALSE;
nautilus_window_request_location_change (window, &navinfo, NULL);
}
......@@ -701,7 +700,7 @@ nautilus_window_back_or_forward (NautilusWindow *window, gboolean back, guint di
/* FIXME: Have to cast away the const for nri.requested_uri. This field should be
* declared const. */
nri.requested_uri = (char *)nautilus_bookmark_get_uri (g_slist_nth_data (list, distance));
nri.new_window_default = nri.new_window_suggested = nri.new_window_enforced = Nautilus_V_FALSE;
nri.new_window_requested = FALSE;
nautilus_window_begin_location_change (window, &nri, NULL, back ? NAUTILUS_LOCATION_CHANGE_BACK : NAUTILUS_LOCATION_CHANGE_FORWARD, distance);
}
......
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