Commit c54c5854 authored by Darin Adler's avatar Darin Adler

Fixed bug 1891 (calling set_title before report_load_underway has

	no effect).

	* libnautilus-extensions/nautilus-file.c: (destroy):
	Fix a leak in the symbolic link target hash table.

	* src/nautilus-application.c: (nautilus_application_startup),
	(nautilus_application_create_desktop_window),
	(nautilus_application_open_desktop),
	(nautilus_application_close_desktop),
	(nautilus_application_destroyed_window),
	(nautilus_application_create_window):
	Simplified the logic for creating and destroying the desktop
	window a little bit and made it actually unref the desktop
	window instead of just destroying it.

	* src/nautilus-switchable-navigation-bar.c:
	(nautilus_switchable_navigation_bar_initialize),
	(nautilus_switchable_navigation_bar_set_mode),
	(nautilus_switchable_navigation_bar_set_location):
	Added missing code to send out the mode_changed signal and
	took out a gratuitous FIXME.

	* src/nautilus-view-frame.h:
	* src/nautilus-view-frame.c:
	(nautilus_view_frame_initialize_class),
	(nautilus_view_frame_initialize), (nautilus_view_frame_destroy),
	(set_up_for_new_location), (nautilus_view_frame_load_location),
	(nautilus_view_frame_report_location_change),
	(nautilus_view_frame_set_title), (nautilus_view_frame_get_title):
	Changed it so the view frame keeps around the title as passed by
	the view. It now emits a "title_changed" signal instead of a
	"set_title" signal and you can get the title with a call to
	nautilus_view_frame_get_title.

	* src/nautilus-window.h:
	* src/nautilus-window.c: (nautilus_window_title_changed_callback),
	(nautilus_window_connect_view):
	* src/nautilus-window-manage-views.h:
	* src/nautilus-window-manage-views.c:
	(nautilus_window_get_current_location_title),
	(nautilus_window_update_title),
	(nautilus_window_set_displayed_location),
	(nautilus_window_title_changed), (handle_go_elsewhere),
	(nautilus_window_has_really_changed),
	(nautilus_window_update_state):
	Manage the title in a simpler way now that the view frame keeps
	the title around.

	* src/nautilus-window-toolbars.c: (set_up_button): Fixed error
	that would result in a call to gnome_stock_set_icon with NULL.

	* RPMs-README: Fixed a typo.
parent 0280cc18
2000-08-11 Darin Adler <darin@eazel.com>
Fixed bug 1891 (calling set_title before report_load_underway has
no effect).
* libnautilus-extensions/nautilus-file.c: (destroy):
Fix a leak in the symbolic link target hash table.
* src/nautilus-application.c: (nautilus_application_startup),
(nautilus_application_create_desktop_window),
(nautilus_application_open_desktop),
(nautilus_application_close_desktop),
(nautilus_application_destroyed_window),
(nautilus_application_create_window):
Simplified the logic for creating and destroying the desktop
window a little bit and made it actually unref the desktop
window instead of just destroying it.
* src/nautilus-switchable-navigation-bar.c:
(nautilus_switchable_navigation_bar_initialize),
(nautilus_switchable_navigation_bar_set_mode),
(nautilus_switchable_navigation_bar_set_location):
Added missing code to send out the mode_changed signal and
took out a gratuitous FIXME.
* src/nautilus-view-frame.h:
* src/nautilus-view-frame.c:
(nautilus_view_frame_initialize_class),
(nautilus_view_frame_initialize), (nautilus_view_frame_destroy),
(set_up_for_new_location), (nautilus_view_frame_load_location),
(nautilus_view_frame_report_location_change),
(nautilus_view_frame_set_title), (nautilus_view_frame_get_title):
Changed it so the view frame keeps around the title as passed by
the view. It now emits a "title_changed" signal instead of a
"set_title" signal and you can get the title with a call to
nautilus_view_frame_get_title.
* src/nautilus-window.h:
* src/nautilus-window.c: (nautilus_window_title_changed_callback),
(nautilus_window_connect_view):
* src/nautilus-window-manage-views.h:
* src/nautilus-window-manage-views.c:
(nautilus_window_get_current_location_title),
(nautilus_window_update_title),
(nautilus_window_set_displayed_location),
(nautilus_window_title_changed), (handle_go_elsewhere),
(nautilus_window_has_really_changed),
(nautilus_window_update_state):
Manage the title in a simpler way now that the view frame keeps
the title around.
* src/nautilus-window-toolbars.c: (set_up_button): Fixed error
that would result in a call to gnome_stock_set_icon with NULL.
* RPMs-README: Fixed a typo.
2000-08-11 John Sullivan <sullivan@eazel.com>
Fixed bug 1743 (Deleting a file in search results should cause
......@@ -1730,7 +1786,7 @@ Mon Aug 07 14:47:28 2000 George Lebl <jirka@5z.com>
Mon Aug 07 05:00:55 2000 George Lebl <jirka@5z.com>
* libnautilus-extentions/nautilus-list.c (nautilus_list_draw):
* libnautilus-extensions/nautilus-list.c (nautilus_list_draw):
Call gtk_widget_draw on the title widget. This fixes the problem
where the widget is not drawn when the list view is first selected.
......
......@@ -13,5 +13,5 @@ people can use it without going through the pain of setting up a build
system, but we'd be happier if there weren't RPMs out there for other
non-released versions.
If despite this, you decide to distribute your own RPMs, please contact
If, despite this, you decide to distribute your own RPMs, please contact
the Nautilus maintainer, Darin Adler <darin@eazel.com>, and let him know.
......@@ -343,6 +343,8 @@ destroy (GtkObject *object)
nautilus_async_destroying_file (file);
remove_from_link_hash_table (file);
directory = file->details->directory;
if (directory->details->as_file == file) {
......
......@@ -343,6 +343,8 @@ destroy (GtkObject *object)
nautilus_async_destroying_file (file);
remove_from_link_hash_table (file);
directory = file->details->directory;
if (directory->details->as_file == file) {
......
......@@ -141,7 +141,7 @@ create_factory (PortableServer_POA poa,
}
/* Keeps track of the one and only desktop window. */
static NautilusDesktopWindow *nautilus_application_desktop;
static NautilusDesktopWindow *nautilus_application_desktop_window;
/* Keeps track of all the nautilus windows. */
static GSList *nautilus_application_window_list;
......@@ -435,7 +435,7 @@ nautilus_application_startup (NautilusApplication *application,
CORBA_Object_release (shell, &ev);
need_main_loop = nautilus_application_window_list != NULL
|| nautilus_application_desktop != NULL;
|| nautilus_application_desktop_window != NULL;
out:
CORBA_exception_free (&ev);
......@@ -443,45 +443,29 @@ nautilus_application_startup (NautilusApplication *application,
}
static void
nautilus_application_destroy_desktop_window (GtkObject *obj, NautilusApplication *application)
{
nautilus_application_desktop = NULL;
}
static NautilusDesktopWindow *
nautilus_application_create_desktop_window (NautilusApplication *application)
{
NautilusDesktopWindow *window;
g_return_val_if_fail (NAUTILUS_IS_APPLICATION (application), NULL);
window = nautilus_desktop_window_new (application);
g_return_if_fail (nautilus_application_desktop_window == NULL);
g_return_if_fail (NAUTILUS_IS_APPLICATION (application));
gtk_signal_connect (GTK_OBJECT (window),
"destroy", nautilus_application_destroy_desktop_window,
application);
nautilus_application_desktop = window;
return window;
nautilus_application_desktop_window = nautilus_desktop_window_new (application);
gtk_widget_show (GTK_WIDGET (nautilus_application_desktop_window));
}
void
nautilus_application_open_desktop (NautilusApplication *application)
{
NautilusDesktopWindow *desktop_window;
if (nautilus_application_desktop == NULL) {
desktop_window = nautilus_application_create_desktop_window (application);
if (nautilus_application_desktop_window == NULL) {
nautilus_application_create_desktop_window (application);
}
gtk_widget_show (GTK_WIDGET (desktop_window));
}
void
nautilus_application_close_desktop (void)
{
if (nautilus_application_desktop != NULL) {
gtk_widget_destroy (GTK_WIDGET (nautilus_application_desktop));
if (nautilus_application_desktop_window != NULL) {
gtk_widget_unref (GTK_WIDGET (nautilus_application_desktop_window));
nautilus_application_desktop_window = NULL;
}
if (nautilus_application_window_list == NULL && gtk_main_level () > 0) {
......@@ -497,12 +481,11 @@ nautilus_application_close_all_windows (void)
}
}
static void
nautilus_application_destroy_window (GtkObject *obj, NautilusApplication *application)
nautilus_application_destroyed_window (GtkObject *object, NautilusApplication *application)
{
nautilus_application_window_list = g_slist_remove (nautilus_application_window_list, obj);
if (nautilus_application_window_list == NULL && nautilus_application_desktop == NULL) {
nautilus_application_window_list = g_slist_remove (nautilus_application_window_list, object);
if (nautilus_application_window_list == NULL && nautilus_application_desktop_window == NULL) {
gtk_main_quit ();
}
}
......@@ -518,7 +501,7 @@ nautilus_application_create_window (NautilusApplication *application)
"app", GTK_OBJECT (application),
"app_id", "nautilus", NULL));
gtk_signal_connect (GTK_OBJECT (window),
"destroy", nautilus_application_destroy_window,
"destroy", nautilus_application_destroyed_window,
application);
nautilus_application_window_list = g_slist_prepend (nautilus_application_window_list, window);
......
......@@ -206,8 +206,8 @@ goto_uri_callback (GtkWidget *widget,
static void
navigation_bar_mode_changed_callback (GtkWidget *widget,
NautilusSwitchableNavigationBarMode mode,
GtkWidget *window)
NautilusSwitchableNavigationBarMode mode,
GtkWidget *window)
{
switch (mode) {
case NAUTILUS_SWITCHABLE_NAVIGATION_BAR_MODE_LOCATION:
......@@ -217,6 +217,7 @@ navigation_bar_mode_changed_callback (GtkWidget *widget,
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (NAUTILUS_WINDOW (window)->search_local_button), TRUE);
break;
default:
g_assert_not_reached ();
}
}
......@@ -410,7 +411,7 @@ nautilus_window_set_arg (GtkObject *object,
window->application = NAUTILUS_APPLICATION (GTK_VALUE_OBJECT (*arg));
break;
case ARG_CONTENT_VIEW:
nautilus_window_real_set_content_view (window, (NautilusViewFrame *)GTK_VALUE_OBJECT(*arg));
nautilus_window_real_set_content_view (window, (NautilusViewFrame *) GTK_VALUE_OBJECT(*arg));
break;
}
}
......@@ -424,13 +425,13 @@ nautilus_window_get_arg (GtkObject *object,
switch(arg_id) {
case ARG_APP_ID:
GTK_VALUE_STRING(*arg) = app->name;
GTK_VALUE_STRING (*arg) = app->name;
break;
case ARG_APP:
GTK_VALUE_OBJECT(*arg) = GTK_OBJECT(NAUTILUS_WINDOW(object)->application);
GTK_VALUE_OBJECT (*arg) = GTK_OBJECT (NAUTILUS_WINDOW (object)->application);
break;
case ARG_CONTENT_VIEW:
GTK_VALUE_OBJECT(*arg) = GTK_OBJECT(((NautilusWindow *)object)->content_view);
GTK_VALUE_OBJECT (*arg) = GTK_OBJECT (NAUTILUS_WINDOW (object)->content_view);
break;
}
}
......@@ -992,15 +993,13 @@ nautilus_window_go_up (NautilusWindow *window)
void
nautilus_window_set_search_mode (NautilusWindow *window,
gboolean search_mode)
gboolean search_mode)
{
if (search_mode) {
nautilus_switchable_navigation_bar_set_mode (NAUTILUS_SWITCHABLE_NAVIGATION_BAR (window->navigation_bar),
NAUTILUS_SWITCHABLE_NAVIGATION_BAR_MODE_SEARCH);
} else {
nautilus_switchable_navigation_bar_set_mode (NAUTILUS_SWITCHABLE_NAVIGATION_BAR (window->navigation_bar),
NAUTILUS_SWITCHABLE_NAVIGATION_BAR_MODE_LOCATION);
}
nautilus_switchable_navigation_bar_set_mode
(NAUTILUS_SWITCHABLE_NAVIGATION_BAR (window->navigation_bar),
search_mode
? NAUTILUS_SWITCHABLE_NAVIGATION_BAR_MODE_SEARCH
: NAUTILUS_SWITCHABLE_NAVIGATION_BAR_MODE_LOCATION);
}
void
......@@ -1192,11 +1191,10 @@ nautilus_window_report_load_failed_callback (NautilusViewFrame *view,
}
static void
nautilus_window_set_title_callback (NautilusViewFrame *view,
const char *title,
NautilusWindow *window)
nautilus_window_title_changed_callback (NautilusViewFrame *view,
NautilusWindow *window)
{
nautilus_window_set_title (window, title, view);
nautilus_window_title_changed (window, view);
}
static void
......@@ -1209,10 +1207,16 @@ nautilus_window_zoom_level_changed_callback (NautilusViewFrame *view,
/* We rely on the initial zoom_level_change signal to inform us that the
* view-frame is showing a new zoomable.
*/
if (!GTK_WIDGET_VISIBLE(window->zoom_control)) {
nautilus_zoom_control_set_min_zoom_level (NAUTILUS_ZOOM_CONTROL (window->zoom_control), nautilus_view_frame_get_min_zoom_level (view));
nautilus_zoom_control_set_max_zoom_level (NAUTILUS_ZOOM_CONTROL (window->zoom_control), nautilus_view_frame_get_max_zoom_level (view));
nautilus_zoom_control_set_preferred_zoom_levels (NAUTILUS_ZOOM_CONTROL (window->zoom_control), nautilus_view_frame_get_preferred_zoom_levels (view));
if (!GTK_WIDGET_VISIBLE (window->zoom_control)) {
nautilus_zoom_control_set_min_zoom_level
(NAUTILUS_ZOOM_CONTROL (window->zoom_control),
nautilus_view_frame_get_min_zoom_level (view));
nautilus_zoom_control_set_max_zoom_level
(NAUTILUS_ZOOM_CONTROL (window->zoom_control),
nautilus_view_frame_get_max_zoom_level (view));
nautilus_zoom_control_set_preferred_zoom_levels
(NAUTILUS_ZOOM_CONTROL (window->zoom_control),
nautilus_view_frame_get_preferred_zoom_levels (view));
gtk_widget_show (window->zoom_control);
}
}
......@@ -1277,7 +1281,7 @@ nautilus_window_connect_view (NautilusWindow *window, NautilusViewFrame *view)
CONNECT (report_load_progress);
CONNECT (report_load_complete);
CONNECT (report_load_failed);
CONNECT (set_title);
CONNECT (title_changed);
CONNECT (zoom_level_changed);
CONNECT (get_history_list);
......
......@@ -89,8 +89,6 @@ struct NautilusWindow {
/* Information about current location/selection */
char *location;
GList *selection;
char *requested_title;
char *default_title;
/* Back/Forward chain, and history list.
* The data in these lists are NautilusBookmark pointers.
......
......@@ -206,8 +206,8 @@ goto_uri_callback (GtkWidget *widget,
static void
navigation_bar_mode_changed_callback (GtkWidget *widget,
NautilusSwitchableNavigationBarMode mode,
GtkWidget *window)
NautilusSwitchableNavigationBarMode mode,
GtkWidget *window)
{
switch (mode) {
case NAUTILUS_SWITCHABLE_NAVIGATION_BAR_MODE_LOCATION:
......@@ -217,6 +217,7 @@ navigation_bar_mode_changed_callback (GtkWidget *widget,
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (NAUTILUS_WINDOW (window)->search_local_button), TRUE);
break;
default:
g_assert_not_reached ();
}
}
......@@ -410,7 +411,7 @@ nautilus_window_set_arg (GtkObject *object,
window->application = NAUTILUS_APPLICATION (GTK_VALUE_OBJECT (*arg));
break;
case ARG_CONTENT_VIEW:
nautilus_window_real_set_content_view (window, (NautilusViewFrame *)GTK_VALUE_OBJECT(*arg));
nautilus_window_real_set_content_view (window, (NautilusViewFrame *) GTK_VALUE_OBJECT(*arg));
break;
}
}
......@@ -424,13 +425,13 @@ nautilus_window_get_arg (GtkObject *object,
switch(arg_id) {
case ARG_APP_ID:
GTK_VALUE_STRING(*arg) = app->name;
GTK_VALUE_STRING (*arg) = app->name;
break;
case ARG_APP:
GTK_VALUE_OBJECT(*arg) = GTK_OBJECT(NAUTILUS_WINDOW(object)->application);
GTK_VALUE_OBJECT (*arg) = GTK_OBJECT (NAUTILUS_WINDOW (object)->application);
break;
case ARG_CONTENT_VIEW:
GTK_VALUE_OBJECT(*arg) = GTK_OBJECT(((NautilusWindow *)object)->content_view);
GTK_VALUE_OBJECT (*arg) = GTK_OBJECT (NAUTILUS_WINDOW (object)->content_view);
break;
}
}
......@@ -992,15 +993,13 @@ nautilus_window_go_up (NautilusWindow *window)
void
nautilus_window_set_search_mode (NautilusWindow *window,
gboolean search_mode)
gboolean search_mode)
{
if (search_mode) {
nautilus_switchable_navigation_bar_set_mode (NAUTILUS_SWITCHABLE_NAVIGATION_BAR (window->navigation_bar),
NAUTILUS_SWITCHABLE_NAVIGATION_BAR_MODE_SEARCH);
} else {
nautilus_switchable_navigation_bar_set_mode (NAUTILUS_SWITCHABLE_NAVIGATION_BAR (window->navigation_bar),
NAUTILUS_SWITCHABLE_NAVIGATION_BAR_MODE_LOCATION);
}
nautilus_switchable_navigation_bar_set_mode
(NAUTILUS_SWITCHABLE_NAVIGATION_BAR (window->navigation_bar),
search_mode
? NAUTILUS_SWITCHABLE_NAVIGATION_BAR_MODE_SEARCH
: NAUTILUS_SWITCHABLE_NAVIGATION_BAR_MODE_LOCATION);
}
void
......@@ -1192,11 +1191,10 @@ nautilus_window_report_load_failed_callback (NautilusViewFrame *view,
}
static void
nautilus_window_set_title_callback (NautilusViewFrame *view,
const char *title,
NautilusWindow *window)
nautilus_window_title_changed_callback (NautilusViewFrame *view,
NautilusWindow *window)
{
nautilus_window_set_title (window, title, view);
nautilus_window_title_changed (window, view);
}
static void
......@@ -1209,10 +1207,16 @@ nautilus_window_zoom_level_changed_callback (NautilusViewFrame *view,
/* We rely on the initial zoom_level_change signal to inform us that the
* view-frame is showing a new zoomable.
*/
if (!GTK_WIDGET_VISIBLE(window->zoom_control)) {
nautilus_zoom_control_set_min_zoom_level (NAUTILUS_ZOOM_CONTROL (window->zoom_control), nautilus_view_frame_get_min_zoom_level (view));
nautilus_zoom_control_set_max_zoom_level (NAUTILUS_ZOOM_CONTROL (window->zoom_control), nautilus_view_frame_get_max_zoom_level (view));
nautilus_zoom_control_set_preferred_zoom_levels (NAUTILUS_ZOOM_CONTROL (window->zoom_control), nautilus_view_frame_get_preferred_zoom_levels (view));
if (!GTK_WIDGET_VISIBLE (window->zoom_control)) {
nautilus_zoom_control_set_min_zoom_level
(NAUTILUS_ZOOM_CONTROL (window->zoom_control),
nautilus_view_frame_get_min_zoom_level (view));
nautilus_zoom_control_set_max_zoom_level
(NAUTILUS_ZOOM_CONTROL (window->zoom_control),
nautilus_view_frame_get_max_zoom_level (view));
nautilus_zoom_control_set_preferred_zoom_levels
(NAUTILUS_ZOOM_CONTROL (window->zoom_control),
nautilus_view_frame_get_preferred_zoom_levels (view));
gtk_widget_show (window->zoom_control);
}
}
......@@ -1277,7 +1281,7 @@ nautilus_window_connect_view (NautilusWindow *window, NautilusViewFrame *view)
CONNECT (report_load_progress);
CONNECT (report_load_complete);
CONNECT (report_load_failed);
CONNECT (set_title);
CONNECT (title_changed);
CONNECT (zoom_level_changed);
CONNECT (get_history_list);
......
......@@ -89,8 +89,6 @@ struct NautilusWindow {
/* Information about current location/selection */
char *location;
GList *selection;
char *requested_title;
char *default_title;
/* Back/Forward chain, and history list.
* The data in these lists are NautilusBookmark pointers.
......
......@@ -206,8 +206,8 @@ goto_uri_callback (GtkWidget *widget,
static void
navigation_bar_mode_changed_callback (GtkWidget *widget,
NautilusSwitchableNavigationBarMode mode,
GtkWidget *window)
NautilusSwitchableNavigationBarMode mode,
GtkWidget *window)
{
switch (mode) {
case NAUTILUS_SWITCHABLE_NAVIGATION_BAR_MODE_LOCATION:
......@@ -217,6 +217,7 @@ navigation_bar_mode_changed_callback (GtkWidget *widget,
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (NAUTILUS_WINDOW (window)->search_local_button), TRUE);
break;
default:
g_assert_not_reached ();
}
}
......@@ -410,7 +411,7 @@ nautilus_window_set_arg (GtkObject *object,
window->application = NAUTILUS_APPLICATION (GTK_VALUE_OBJECT (*arg));
break;
case ARG_CONTENT_VIEW:
nautilus_window_real_set_content_view (window, (NautilusViewFrame *)GTK_VALUE_OBJECT(*arg));
nautilus_window_real_set_content_view (window, (NautilusViewFrame *) GTK_VALUE_OBJECT(*arg));
break;
}
}
......@@ -424,13 +425,13 @@ nautilus_window_get_arg (GtkObject *object,
switch(arg_id) {
case ARG_APP_ID:
GTK_VALUE_STRING(*arg) = app->name;
GTK_VALUE_STRING (*arg) = app->name;
break;
case ARG_APP:
GTK_VALUE_OBJECT(*arg) = GTK_OBJECT(NAUTILUS_WINDOW(object)->application);
GTK_VALUE_OBJECT (*arg) = GTK_OBJECT (NAUTILUS_WINDOW (object)->application);
break;
case ARG_CONTENT_VIEW:
GTK_VALUE_OBJECT(*arg) = GTK_OBJECT(((NautilusWindow *)object)->content_view);
GTK_VALUE_OBJECT (*arg) = GTK_OBJECT (NAUTILUS_WINDOW (object)->content_view);
break;
}
}
......@@ -992,15 +993,13 @@ nautilus_window_go_up (NautilusWindow *window)
void
nautilus_window_set_search_mode (NautilusWindow *window,
gboolean search_mode)
gboolean search_mode)
{
if (search_mode) {
nautilus_switchable_navigation_bar_set_mode (NAUTILUS_SWITCHABLE_NAVIGATION_BAR (window->navigation_bar),
NAUTILUS_SWITCHABLE_NAVIGATION_BAR_MODE_SEARCH);
} else {
nautilus_switchable_navigation_bar_set_mode (NAUTILUS_SWITCHABLE_NAVIGATION_BAR (window->navigation_bar),
NAUTILUS_SWITCHABLE_NAVIGATION_BAR_MODE_LOCATION);
}
nautilus_switchable_navigation_bar_set_mode
(NAUTILUS_SWITCHABLE_NAVIGATION_BAR (window->navigation_bar),
search_mode
? NAUTILUS_SWITCHABLE_NAVIGATION_BAR_MODE_SEARCH
: NAUTILUS_SWITCHABLE_NAVIGATION_BAR_MODE_LOCATION);
}
void
......@@ -1192,11 +1191,10 @@ nautilus_window_report_load_failed_callback (NautilusViewFrame *view,
}
static void
nautilus_window_set_title_callback (NautilusViewFrame *view,
const char *title,
NautilusWindow *window)
nautilus_window_title_changed_callback (NautilusViewFrame *view,
NautilusWindow *window)
{
nautilus_window_set_title (window, title, view);
nautilus_window_title_changed (window, view);
}
static void
......@@ -1209,10 +1207,16 @@ nautilus_window_zoom_level_changed_callback (NautilusViewFrame *view,
/* We rely on the initial zoom_level_change signal to inform us that the
* view-frame is showing a new zoomable.
*/
if (!GTK_WIDGET_VISIBLE(window->zoom_control)) {
nautilus_zoom_control_set_min_zoom_level (NAUTILUS_ZOOM_CONTROL (window->zoom_control), nautilus_view_frame_get_min_zoom_level (view));
nautilus_zoom_control_set_max_zoom_level (NAUTILUS_ZOOM_CONTROL (window->zoom_control), nautilus_view_frame_get_max_zoom_level (view));
nautilus_zoom_control_set_preferred_zoom_levels (NAUTILUS_ZOOM_CONTROL (window->zoom_control), nautilus_view_frame_get_preferred_zoom_levels (view));
if (!GTK_WIDGET_VISIBLE (window->zoom_control)) {
nautilus_zoom_control_set_min_zoom_level
(NAUTILUS_ZOOM_CONTROL (window->zoom_control),
nautilus_view_frame_get_min_zoom_level (view));
nautilus_zoom_control_set_max_zoom_level
(NAUTILUS_ZOOM_CONTROL (window->zoom_control),
nautilus_view_frame_get_max_zoom_level (view));
nautilus_zoom_control_set_preferred_zoom_levels
(NAUTILUS_ZOOM_CONTROL (window->zoom_control),
nautilus_view_frame_get_preferred_zoom_levels (view));
gtk_widget_show (window->zoom_control);
}
}
......@@ -1277,7 +1281,7 @@ nautilus_window_connect_view (NautilusWindow *window, NautilusViewFrame *view)
CONNECT (report_load_progress);
CONNECT (report_load_complete);
CONNECT (report_load_failed);
CONNECT (set_title);
CONNECT (title_changed);
CONNECT (zoom_level_changed);
CONNECT (get_history_list);
......
......@@ -89,8 +89,6 @@ struct NautilusWindow {
/* Information about current location/selection */
char *location;
GList *selection;
char *requested_title;
char *default_title;
/* Back/Forward chain, and history list.
* The data in these lists are NautilusBookmark pointers.
......
......@@ -109,11 +109,9 @@ nautilus_switchable_navigation_bar_initialize (NautilusSwitchableNavigationBar *
gtk_box_pack_start (GTK_BOX (hbox), bar->search_bar, TRUE, TRUE,
0);
nautilus_switchable_navigation_bar_set_mode (bar, NAUTILUS_SWITCHABLE_NAVIGATION_BAR_MODE_LOCATION);
gtk_widget_show (GTK_WIDGET (bar->location_bar));
gtk_widget_show (GTK_WIDGET (hbox));
gtk_container_add (GTK_CONTAINER (bar), hbox);
gtk_container_add (GTK_CONTAINER (bar), hbox);
}
GtkWidget *
......@@ -122,25 +120,29 @@ nautilus_switchable_navigation_bar_new (void)
return gtk_widget_new (NAUTILUS_TYPE_SWITCHABLE_NAVIGATION_BAR, NULL);
}
void
nautilus_switchable_navigation_bar_set_mode (NautilusSwitchableNavigationBar *bar,
NautilusSwitchableNavigationBarMode mode)
{
if (bar->mode == mode) {
return;
}
switch (mode) {
case NAUTILUS_SWITCHABLE_NAVIGATION_BAR_MODE_LOCATION:
gtk_widget_show (bar->location_bar);
gtk_widget_hide (bar->search_bar);
bar->mode = mode;
break;
case NAUTILUS_SWITCHABLE_NAVIGATION_BAR_MODE_SEARCH:
gtk_widget_show (bar->search_bar);
gtk_widget_hide (bar->location_bar);
bar->mode = mode;
break;
default:
g_return_if_fail (mode && 0);
}
bar->mode = mode;
gtk_signal_emit (GTK_OBJECT (bar), signals[MODE_CHANGED], mode);
}
static char *
......@@ -179,16 +181,14 @@ nautilus_switchable_navigation_bar_set_location (NautilusNavigationBar *navigati
location);
/* Toggle the search button on and off appropriately */
/* FIXME: doing this may be a bit much */
directory = nautilus_directory_get (location);
if (nautilus_directory_is_search_directory (directory)) {
nautilus_switchable_navigation_bar_set_mode (bar,
NAUTILUS_SWITCHABLE_NAVIGATION_BAR_MODE_SEARCH);
nautilus_switchable_navigation_bar_set_mode
(bar, NAUTILUS_SWITCHABLE_NAVIGATION_BAR_MODE_SEARCH);
}
else {
nautilus_switchable_navigation_bar_set_mode (bar,
NAUTILUS_SWITCHABLE_NAVIGATION_BAR_MODE_LOCATION);
nautilus_switchable_navigation_bar_set_mode
(bar, NAUTILUS_SWITCHABLE_NAVIGATION_BAR_MODE_LOCATION);
}
nautilus_directory_unref (directory);
......
......@@ -51,13 +51,17 @@ enum {
REPORT_LOAD_PROGRESS,
REPORT_LOAD_COMPLETE,