Commit a3c59407 authored by Gene Z. Ragan's avatar Gene Z. Ragan Committed by Gene Ragan
Browse files

Added code to check for position of current page in list.

2000-07-13  Gene Z. Ragan  <gzr@eazel.com>

	* components/history/nautilus-history-view.c: (install_icon),
	(history_view_update_icons), (history_load_location), (make_obj):
	Added code to check for position of current page in list.

	* src/nautilus-window.c:
	* src/nautilus-window.h:
	(nautilus_window_get_base_page_index):
	New function to return the index of the base page in the
	history list.

	(nautilus_window_get_history_list_callback),
	Set position field of returned list info using new function above.
parent 2d38a2d7
2000-07-13 Gene Z. Ragan <gzr@eazel.com>
* components/history/nautilus-history-view.c: (install_icon),
(history_view_update_icons), (history_load_location), (make_obj):
Added code to check for position of current page in list.
* src/nautilus-window.c:
* src/nautilus-window.h:
(nautilus_window_get_base_page_index):
New function to return the index of the base page in the
history list.
(nautilus_window_get_history_list_callback),
Set position field of returned list info using new function above.
2000-07-13 Darin Adler <darin@eazel.com>
My apologies to all who read the cvs commits list that have
......
......@@ -89,6 +89,7 @@ install_icon (GtkCList *clist, gint row)
NautilusBookmark *bookmark;
bookmark = get_bookmark_from_row (clist, row);
if (!nautilus_bookmark_get_pixmap_and_mask (bookmark,
NAUTILUS_ICON_SIZE_SMALLER,
&pixmap,
......@@ -108,7 +109,7 @@ static void
history_view_update_icons (GtkCList *clist)
{
int row;
for (row = 0; row < clist->rows; ++row) {
install_icon (clist, row);
}
......@@ -151,6 +152,7 @@ history_load_location (NautilusView *view,
/* Populate with data from main history list */
history = get_history_list (hview);
for (i = 0; i < history->list._length; i++) {
item = &history->list._buffer[i];
bookmark = nautilus_bookmark_new (item->location, item->title);
......@@ -235,7 +237,7 @@ do_destroy(GtkObject *obj, HistoryView *hview)
static BonoboObject *
make_obj(BonoboGenericFactory *Factory, const char *goad_id, gpointer closure)
make_obj (BonoboGenericFactory *Factory, const char *goad_id, gpointer closure)
{
GtkWidget *wtmp;
GtkCList *clist;
......
......@@ -1136,7 +1136,9 @@ nautilus_window_get_history_list_callback (NautilusViewFrame *view,
history = Nautilus_History__alloc ();
list = &history->list;
history->position = 0; /* FIXME */
/* Set the the index in the list of the location of the current page */
history->position = nautilus_window_get_base_page_index (window);
list->_length = length;
list->_maximum = length;
......@@ -1532,3 +1534,30 @@ nautilus_window_show_statusbar (NautilusWindow *window)
gtk_widget_show (GTK_WIDGET (app->statusbar)->parent);
}
}
/**
* nautilus_window_get_base_page_index:
* @window: Window to get index from
*
* Returns the index of the base page in the history list.
* Base page is not the currently displayed page, but the page
* that acts as the base from which the back and forward commands
* navigate from.
*/
gint
nautilus_window_get_base_page_index (NautilusWindow *window)
{
gint forward_count;
forward_count = g_slist_length (window->forward_list);
/* If forward is empty, the base it at the top of the list */
if (forward_count == 0) {
return 0;
}
/* The forward count indicate the relative postion of the base page
* in the history list
*/
return forward_count;
}
......@@ -173,14 +173,14 @@ void nautilus_window_allow_stop (NautilusWindow *window
gboolean allow);
void nautilus_bookmarks_exiting (void);
void nautilus_window_reload (NautilusWindow *window);
void nautilus_window_hide_locationbar (NautilusWindow *window);
void nautilus_window_show_locationbar (NautilusWindow *window);
void nautilus_window_hide_toolbar (NautilusWindow *window);
void nautilus_window_show_toolbar (NautilusWindow *window);
void nautilus_window_hide_sidebar (NautilusWindow *window);
void nautilus_window_show_sidebar (NautilusWindow *window);
void nautilus_window_hide_statusbar (NautilusWindow *window);
void nautilus_window_show_statusbar (NautilusWindow *window);
gint nautilus_window_get_base_page_index (NautilusWindow *window);
void nautilus_window_hide_locationbar (NautilusWindow *window);
void nautilus_window_show_locationbar (NautilusWindow *window);
void nautilus_window_hide_toolbar (NautilusWindow *window);
void nautilus_window_show_toolbar (NautilusWindow *window);
void nautilus_window_hide_sidebar (NautilusWindow *window);
void nautilus_window_show_sidebar (NautilusWindow *window);
void nautilus_window_hide_statusbar (NautilusWindow *window);
void nautilus_window_show_statusbar (NautilusWindow *window);
#endif
......@@ -1136,7 +1136,9 @@ nautilus_window_get_history_list_callback (NautilusViewFrame *view,
history = Nautilus_History__alloc ();
list = &history->list;
history->position = 0; /* FIXME */
/* Set the the index in the list of the location of the current page */
history->position = nautilus_window_get_base_page_index (window);
list->_length = length;
list->_maximum = length;
......@@ -1532,3 +1534,30 @@ nautilus_window_show_statusbar (NautilusWindow *window)
gtk_widget_show (GTK_WIDGET (app->statusbar)->parent);
}
}
/**
* nautilus_window_get_base_page_index:
* @window: Window to get index from
*
* Returns the index of the base page in the history list.
* Base page is not the currently displayed page, but the page
* that acts as the base from which the back and forward commands
* navigate from.
*/
gint
nautilus_window_get_base_page_index (NautilusWindow *window)
{
gint forward_count;
forward_count = g_slist_length (window->forward_list);
/* If forward is empty, the base it at the top of the list */
if (forward_count == 0) {
return 0;
}
/* The forward count indicate the relative postion of the base page
* in the history list
*/
return forward_count;
}
......@@ -173,14 +173,14 @@ void nautilus_window_allow_stop (NautilusWindow *window
gboolean allow);
void nautilus_bookmarks_exiting (void);
void nautilus_window_reload (NautilusWindow *window);
void nautilus_window_hide_locationbar (NautilusWindow *window);
void nautilus_window_show_locationbar (NautilusWindow *window);
void nautilus_window_hide_toolbar (NautilusWindow *window);
void nautilus_window_show_toolbar (NautilusWindow *window);
void nautilus_window_hide_sidebar (NautilusWindow *window);
void nautilus_window_show_sidebar (NautilusWindow *window);
void nautilus_window_hide_statusbar (NautilusWindow *window);
void nautilus_window_show_statusbar (NautilusWindow *window);
gint nautilus_window_get_base_page_index (NautilusWindow *window);
void nautilus_window_hide_locationbar (NautilusWindow *window);
void nautilus_window_show_locationbar (NautilusWindow *window);
void nautilus_window_hide_toolbar (NautilusWindow *window);
void nautilus_window_show_toolbar (NautilusWindow *window);
void nautilus_window_hide_sidebar (NautilusWindow *window);
void nautilus_window_show_sidebar (NautilusWindow *window);
void nautilus_window_hide_statusbar (NautilusWindow *window);
void nautilus_window_show_statusbar (NautilusWindow *window);
#endif
......@@ -1136,7 +1136,9 @@ nautilus_window_get_history_list_callback (NautilusViewFrame *view,
history = Nautilus_History__alloc ();
list = &history->list;
history->position = 0; /* FIXME */
/* Set the the index in the list of the location of the current page */
history->position = nautilus_window_get_base_page_index (window);
list->_length = length;
list->_maximum = length;
......@@ -1532,3 +1534,30 @@ nautilus_window_show_statusbar (NautilusWindow *window)
gtk_widget_show (GTK_WIDGET (app->statusbar)->parent);
}
}
/**
* nautilus_window_get_base_page_index:
* @window: Window to get index from
*
* Returns the index of the base page in the history list.
* Base page is not the currently displayed page, but the page
* that acts as the base from which the back and forward commands
* navigate from.
*/
gint
nautilus_window_get_base_page_index (NautilusWindow *window)
{
gint forward_count;
forward_count = g_slist_length (window->forward_list);
/* If forward is empty, the base it at the top of the list */
if (forward_count == 0) {
return 0;
}
/* The forward count indicate the relative postion of the base page
* in the history list
*/
return forward_count;
}
......@@ -173,14 +173,14 @@ void nautilus_window_allow_stop (NautilusWindow *window
gboolean allow);
void nautilus_bookmarks_exiting (void);
void nautilus_window_reload (NautilusWindow *window);
void nautilus_window_hide_locationbar (NautilusWindow *window);
void nautilus_window_show_locationbar (NautilusWindow *window);
void nautilus_window_hide_toolbar (NautilusWindow *window);
void nautilus_window_show_toolbar (NautilusWindow *window);
void nautilus_window_hide_sidebar (NautilusWindow *window);
void nautilus_window_show_sidebar (NautilusWindow *window);
void nautilus_window_hide_statusbar (NautilusWindow *window);
void nautilus_window_show_statusbar (NautilusWindow *window);
gint nautilus_window_get_base_page_index (NautilusWindow *window);
void nautilus_window_hide_locationbar (NautilusWindow *window);
void nautilus_window_show_locationbar (NautilusWindow *window);
void nautilus_window_hide_toolbar (NautilusWindow *window);
void nautilus_window_show_toolbar (NautilusWindow *window);
void nautilus_window_hide_sidebar (NautilusWindow *window);
void nautilus_window_show_sidebar (NautilusWindow *window);
void nautilus_window_hide_statusbar (NautilusWindow *window);
void nautilus_window_show_statusbar (NautilusWindow *window);
#endif
......@@ -1136,7 +1136,9 @@ nautilus_window_get_history_list_callback (NautilusViewFrame *view,
history = Nautilus_History__alloc ();
list = &history->list;
history->position = 0; /* FIXME */
/* Set the the index in the list of the location of the current page */
history->position = nautilus_window_get_base_page_index (window);
list->_length = length;
list->_maximum = length;
......@@ -1532,3 +1534,30 @@ nautilus_window_show_statusbar (NautilusWindow *window)
gtk_widget_show (GTK_WIDGET (app->statusbar)->parent);
}
}
/**
* nautilus_window_get_base_page_index:
* @window: Window to get index from
*
* Returns the index of the base page in the history list.
* Base page is not the currently displayed page, but the page
* that acts as the base from which the back and forward commands
* navigate from.
*/
gint
nautilus_window_get_base_page_index (NautilusWindow *window)
{
gint forward_count;
forward_count = g_slist_length (window->forward_list);
/* If forward is empty, the base it at the top of the list */
if (forward_count == 0) {
return 0;
}
/* The forward count indicate the relative postion of the base page
* in the history list
*/
return forward_count;
}
......@@ -173,14 +173,14 @@ void nautilus_window_allow_stop (NautilusWindow *window
gboolean allow);
void nautilus_bookmarks_exiting (void);
void nautilus_window_reload (NautilusWindow *window);
void nautilus_window_hide_locationbar (NautilusWindow *window);
void nautilus_window_show_locationbar (NautilusWindow *window);
void nautilus_window_hide_toolbar (NautilusWindow *window);
void nautilus_window_show_toolbar (NautilusWindow *window);
void nautilus_window_hide_sidebar (NautilusWindow *window);
void nautilus_window_show_sidebar (NautilusWindow *window);
void nautilus_window_hide_statusbar (NautilusWindow *window);
void nautilus_window_show_statusbar (NautilusWindow *window);
gint nautilus_window_get_base_page_index (NautilusWindow *window);
void nautilus_window_hide_locationbar (NautilusWindow *window);
void nautilus_window_show_locationbar (NautilusWindow *window);
void nautilus_window_hide_toolbar (NautilusWindow *window);
void nautilus_window_show_toolbar (NautilusWindow *window);
void nautilus_window_hide_sidebar (NautilusWindow *window);
void nautilus_window_show_sidebar (NautilusWindow *window);
void nautilus_window_hide_statusbar (NautilusWindow *window);
void nautilus_window_show_statusbar (NautilusWindow *window);
#endif
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