summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarin Adler <darin@src.gnome.org>2000-08-11 21:33:11 +0000
committerDarin Adler <darin@src.gnome.org>2000-08-11 21:33:11 +0000
commitc54c58543a786c1a19fba2325db2dd83ad7bdd5a (patch)
tree1f5fe3eb319db0dc77f72c515d5b34c236989830
parent0280cc1897ed38875916ebb7679908e6bfaa9b3c (diff)
downloadnautilus-c54c58543a786c1a19fba2325db2dd83ad7bdd5a.tar.gz
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.
-rw-r--r--ChangeLog58
-rw-r--r--RPMs-README2
-rw-r--r--libnautilus-extensions/nautilus-file.c2
-rw-r--r--libnautilus-private/nautilus-file.c2
-rw-r--r--src/nautilus-application.c47
-rw-r--r--src/nautilus-navigation-window.c50
-rw-r--r--src/nautilus-navigation-window.h2
-rw-r--r--src/nautilus-object-window.c50
-rw-r--r--src/nautilus-object-window.h2
-rw-r--r--src/nautilus-spatial-window.c50
-rw-r--r--src/nautilus-spatial-window.h2
-rw-r--r--src/nautilus-switchable-navigation-bar.c26
-rw-r--r--src/nautilus-view-frame.c54
-rw-r--r--src/nautilus-view-frame.h23
-rw-r--r--src/nautilus-window-manage-views.c106
-rw-r--r--src/nautilus-window-manage-views.h3
-rw-r--r--src/nautilus-window-toolbars.c116
-rw-r--r--src/nautilus-window.c50
-rw-r--r--src/nautilus-window.h2
19 files changed, 370 insertions, 277 deletions
diff --git a/ChangeLog b/ChangeLog
index 46e987590..caf6d7b67 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,59 @@
+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.
diff --git a/RPMs-README b/RPMs-README
index a5b05badc..f256247bb 100644
--- a/RPMs-README
+++ b/RPMs-README
@@ -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.
diff --git a/libnautilus-extensions/nautilus-file.c b/libnautilus-extensions/nautilus-file.c
index 03339f264..c7fe54c78 100644
--- a/libnautilus-extensions/nautilus-file.c
+++ b/libnautilus-extensions/nautilus-file.c
@@ -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) {
diff --git a/libnautilus-private/nautilus-file.c b/libnautilus-private/nautilus-file.c
index 03339f264..c7fe54c78 100644
--- a/libnautilus-private/nautilus-file.c
+++ b/libnautilus-private/nautilus-file.c
@@ -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) {
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index 677383ad0..fe34407f1 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -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);
diff --git a/src/nautilus-navigation-window.c b/src/nautilus-navigation-window.c
index 48f547334..55b0ec6a1 100644
--- a/src/nautilus-navigation-window.c
+++ b/src/nautilus-navigation-window.c
@@ -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);
diff --git a/src/nautilus-navigation-window.h b/src/nautilus-navigation-window.h
index c14ceced8..4c48e6627 100644
--- a/src/nautilus-navigation-window.h
+++ b/src/nautilus-navigation-window.h
@@ -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.
diff --git a/src/nautilus-object-window.c b/src/nautilus-object-window.c
index 48f547334..55b0ec6a1 100644
--- a/src/nautilus-object-window.c
+++ b/src/nautilus-object-window.c
@@ -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);
diff --git a/src/nautilus-object-window.h b/src/nautilus-object-window.h
index c14ceced8..4c48e6627 100644
--- a/src/nautilus-object-window.h
+++ b/src/nautilus-object-window.h
@@ -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.
diff --git a/src/nautilus-spatial-window.c b/src/nautilus-spatial-window.c
index 48f547334..55b0ec6a1 100644
--- a/src/nautilus-spatial-window.c
+++ b/src/nautilus-spatial-window.c
@@ -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);
diff --git a/src/nautilus-spatial-window.h b/src/nautilus-spatial-window.h
index c14ceced8..4c48e6627 100644
--- a/src/nautilus-spatial-window.h
+++ b/src/nautilus-spatial-window.h
@@ -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.
diff --git a/src/nautilus-switchable-navigation-bar.c b/src/nautilus-switchable-navigation-bar.c
index be1f24d37..f37946255 100644
--- a/src/nautilus-switchable-navigation-bar.c
+++ b/src/nautilus-switchable-navigation-bar.c
@@ -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);
diff --git a/src/nautilus-view-frame.c b/src/nautilus-view-frame.c
index ccb56ce70..402223a29 100644
--- a/src/nautilus-view-frame.c
+++ b/src/nautilus-view-frame.c
@@ -51,13 +51,17 @@ enum {
REPORT_LOAD_PROGRESS,
REPORT_LOAD_COMPLETE,
REPORT_LOAD_FAILED,
- SET_TITLE,
+ TITLE_CHANGED,
ZOOM_LEVEL_CHANGED,
CLIENT_GONE,
GET_HISTORY_LIST,
LAST_SIGNAL
};
+struct NautilusViewFrameDetails {
+ char *title;
+};
+
static void nautilus_view_frame_initialize (NautilusViewFrame *view);
static void nautilus_view_frame_destroy (GtkObject *view);
static void nautilus_view_frame_initialize_class (NautilusViewFrameClass *klass);
@@ -146,14 +150,14 @@ nautilus_view_frame_initialize_class (NautilusViewFrameClass *klass)
report_load_failed),
gtk_marshal_NONE__NONE,
GTK_TYPE_NONE, 0);
- signals[SET_TITLE] =
- gtk_signal_new ("set_title",
+ signals[TITLE_CHANGED] =
+ gtk_signal_new ("title_changed",
GTK_RUN_LAST,
object_class->type,
GTK_SIGNAL_OFFSET (NautilusViewFrameClass,
- set_title),
- gtk_marshal_NONE__STRING,
- GTK_TYPE_NONE, 1, GTK_TYPE_STRING);
+ title_changed),
+ gtk_marshal_NONE__NONE,
+ GTK_TYPE_NONE, 0);
signals[ZOOM_LEVEL_CHANGED] =
gtk_signal_new ("zoom_level_changed",
@@ -189,6 +193,8 @@ static void
nautilus_view_frame_initialize (NautilusViewFrame *view)
{
GTK_WIDGET_SET_FLAGS (view, GTK_NO_WINDOW);
+
+ view->details = g_new0 (NautilusViewFrameDetails, 1);
}
static void
@@ -243,6 +249,9 @@ nautilus_view_frame_destroy (GtkObject *object)
}
nautilus_view_frame_destroy_client (frame);
+
+ g_free (frame->details->title);
+ g_free (frame->details);
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (object));
}
@@ -381,6 +390,13 @@ nautilus_view_frame_load_client (NautilusViewFrame *view, const char *iid)
return TRUE;
}
+static void
+set_up_for_new_location (NautilusViewFrame *view)
+{
+ g_free (view->details->title);
+ view->details->title = NULL;
+}
+
void
nautilus_view_frame_load_location (NautilusViewFrame *view,
const char *location)
@@ -389,6 +405,8 @@ nautilus_view_frame_load_location (NautilusViewFrame *view,
g_return_if_fail (NAUTILUS_IS_VIEW_FRAME (view));
g_return_if_fail (view->component_class != NULL);
+
+ set_up_for_new_location (view);
if (view->component_class->load_location == NULL) {
return;
@@ -659,7 +677,11 @@ nautilus_view_frame_report_location_change (NautilusViewFrame *view,
const char *location)
{
g_return_if_fail (NAUTILUS_IS_VIEW_FRAME (view));
- gtk_signal_emit (GTK_OBJECT (view), signals[REPORT_LOCATION_CHANGE], location);
+
+ set_up_for_new_location (view);
+
+ gtk_signal_emit (GTK_OBJECT (view),
+ signals[REPORT_LOCATION_CHANGE], location);
}
void
@@ -712,7 +734,23 @@ nautilus_view_frame_set_title (NautilusViewFrame *view,
const char *title)
{
g_return_if_fail (NAUTILUS_IS_VIEW_FRAME (view));
- gtk_signal_emit (GTK_OBJECT (view), signals[SET_TITLE], title);
+ g_return_if_fail (title != NULL);
+
+ /* Only do work if the title actually changed. */
+ if (view->details->title != NULL
+ && strcmp (view->details->title, title) == 0) {
+ return;
+ }
+
+ g_free (view->details->title);
+ view->details->title = g_strdup (title);
+ gtk_signal_emit (GTK_OBJECT (view), signals[TITLE_CHANGED]);
+}
+
+char *
+nautilus_view_frame_get_title (NautilusViewFrame *view)
+{
+ return g_strdup (view->details->title);
}
void
diff --git a/src/nautilus-view-frame.h b/src/nautilus-view-frame.h
index 54df8c4e7..8c3313f52 100644
--- a/src/nautilus-view-frame.h
+++ b/src/nautilus-view-frame.h
@@ -36,20 +36,18 @@
#include <libnautilus/nautilus-view-component.h>
#include <libnautilus-extensions/nautilus-undo-manager.h>
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
#define NAUTILUS_TYPE_VIEW_FRAME (nautilus_view_frame_get_type ())
#define NAUTILUS_VIEW_FRAME(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_VIEW_FRAME, NautilusViewFrame))
#define NAUTILUS_VIEW_FRAME_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_VIEW_FRAME, NautilusViewFrameClass))
#define NAUTILUS_IS_VIEW_FRAME(obj) (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_VIEW_FRAME))
#define NAUTILUS_IS_VIEW_FRAME_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_VIEW_FRAME))
+typedef struct NautilusViewFrameDetails NautilusViewFrameDetails;
typedef struct NautilusViewComponentType NautilusViewComponentType;
typedef struct {
NautilusGenerousBin parent;
+ NautilusViewFrameDetails *details;
BonoboUIHandler *ui_handler;
NautilusUndoManager *undo_manager;
@@ -96,8 +94,12 @@ typedef struct {
double fraction_done);
void (* report_load_complete) (NautilusViewFrame *view);
void (* report_load_failed) (NautilusViewFrame *view);
- void (* set_title) (NautilusViewFrame *view,
- const char *title);
+
+ /* These are higher-level signals. We are moving more work into
+ * this class, so we no longer have one signal for each CORBA
+ * signal.
+ */
+ void (* title_changed) (NautilusViewFrame *view);
/* Part of Nautilus::ZoomableFrame CORBA interface. */
void (* zoom_level_changed) (NautilusViewFrame *view,
@@ -121,6 +123,7 @@ const char * nautilus_view_frame_get_iid (NautilusViewFrame *
CORBA_Object nautilus_view_frame_get_client_objref (NautilusViewFrame *view);
BonoboObject * nautilus_view_frame_get_control_frame (NautilusViewFrame *view);
CORBA_Object nautilus_view_frame_get_objref (NautilusViewFrame *view);
+char * nautilus_view_frame_get_title (NautilusViewFrame *view);
/* These functions correspond to methods of the Nautilus:View CORBAinterface. */
void nautilus_view_frame_load_location (NautilusViewFrame *view,
@@ -137,8 +140,8 @@ void nautilus_view_frame_set_zoom_level (NautilusViewFrame *
gdouble nautilus_view_frame_get_min_zoom_level (NautilusViewFrame *view);
gdouble nautilus_view_frame_get_max_zoom_level (NautilusViewFrame *view);
gboolean nautilus_view_frame_get_is_continuous (NautilusViewFrame *view);
-GList * nautilus_view_frame_get_preferred_zoom_levels
-(NautilusViewFrame *view);
+GList * nautilus_view_frame_get_preferred_zoom_levels
+ (NautilusViewFrame *view);
void nautilus_view_frame_zoom_in (NautilusViewFrame *view);
void nautilus_view_frame_zoom_out (NautilusViewFrame *view);
void nautilus_view_frame_zoom_to_fit (NautilusViewFrame *view);
@@ -152,8 +155,4 @@ void nautilus_view_frame_set_label (NautilusViewFrame *
void nautilus_view_frame_activate (NautilusViewFrame *view);
Nautilus_History * nautilus_view_frame_get_history_list (NautilusViewFrame *view);
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
#endif /* NAUTILUS_VIEW_FRAME_H */
diff --git a/src/nautilus-window-manage-views.c b/src/nautilus-window-manage-views.c
index 04695a141..c42c4dd90 100644
--- a/src/nautilus-window-manage-views.c
+++ b/src/nautilus-window-manage-views.c
@@ -211,12 +211,20 @@ compute_default_title (const char *text_uri)
static char *
nautilus_window_get_current_location_title (NautilusWindow *window)
{
- return window->requested_title != NULL
- ? g_strdup (window->requested_title)
- : g_strdup (window->default_title);
+ char *title;
+
+ if (window->new_content_view != NULL) {
+ title = nautilus_view_frame_get_title (window->new_content_view);
+ } else if (window->content_view != NULL) {
+ title = nautilus_view_frame_get_title (window->content_view);
+ }
+ if (title == NULL) {
+ title = compute_default_title (window->location);
+ }
+ return title;
}
-/* nautilus_window_update_title_internal:
+/* nautilus_window_update_title:
*
* Update the non-NautilusViewFrame objects that use the location's user-displayable
* title in some way. Called when the location or title has changed.
@@ -225,11 +233,14 @@ nautilus_window_get_current_location_title (NautilusWindow *window)
*
*/
static void
-nautilus_window_update_title_internal (NautilusWindow *window, const char *title)
+nautilus_window_update_title (NautilusWindow *window)
{
+ char *title;
char *window_title;
char *truncated_title;
-
+
+ title = nautilus_window_get_current_location_title (window);
+
if (strcmp (title, _("Nautilus")) == 0) {
gtk_window_set_title (GTK_WINDOW (window), _("Nautilus"));
} else {
@@ -249,7 +260,7 @@ nautilus_window_update_title_internal (NautilusWindow *window, const char *title
nautilus_send_history_list_changed ();
}
-/* nautilus_window_reset_title_internal:
+/* nautilus_window_set_displayed_location:
*
* Update the non-NautilusViewFrame objects that use the location's user-displayable
* title in some way. Called when the location or title has changed.
@@ -257,16 +268,11 @@ nautilus_window_update_title_internal (NautilusWindow *window, const char *title
* @title: The new user-displayable title.
*/
static void
-nautilus_window_reset_title_internal (NautilusWindow *window, const char *uri)
+nautilus_window_set_displayed_location (NautilusWindow *window, const char *uri)
{
char *bookmark_uri;
gboolean recreate;
- g_free (window->requested_title);
- window->requested_title = NULL;
- g_free (window->default_title);
- window->default_title = compute_default_title (uri);
-
if (window->current_location_bookmark == NULL) {
recreate = TRUE;
} else {
@@ -284,27 +290,20 @@ nautilus_window_reset_title_internal (NautilusWindow *window, const char *uri)
window->current_location_bookmark = nautilus_bookmark_new (uri, uri);
}
- nautilus_window_update_title_internal (window, window->default_title);
+ nautilus_window_update_title (window);
}
void
-nautilus_window_set_title (NautilusWindow *window,
- const char *new_title,
- NautilusViewFrame *view)
+nautilus_window_title_changed (NautilusWindow *window,
+ NautilusViewFrame *view)
{
g_return_if_fail (NAUTILUS_IS_WINDOW (window));
- g_return_if_fail (new_title != NULL);
g_return_if_fail (NAUTILUS_IS_VIEW_FRAME (view));
/* Only the content view can change the window title. */
- if (view != window->content_view) {
- return;
+ if (view == window->content_view || view == window->new_content_view) {
+ nautilus_window_update_title (window);
}
-
- g_free (window->requested_title);
- window->requested_title = g_strdup (new_title);
-
- nautilus_window_update_title_internal (window, new_title);
}
/* The bulk of this file - location changing */
@@ -390,7 +389,7 @@ handle_go_elsewhere (NautilusWindow *window, const char *location)
if (window->location != NULL) {
/* If we're returning to the same uri somehow, don't put this uri on back list.
- * This also avoids a problem where nautilus_window_reset_title_internal
+ * This also avoids a problem where nautilus_window_set_displayed_location
* didn't update last_location_bookmark since the uri didn't change.
*/
if (strcmp (window->location, location) != 0) {
@@ -510,7 +509,7 @@ nautilus_window_view_failed (NautilusWindow *window, NautilusViewFrame *view)
/* This is called when we have decided we can actually change to the new view/location situation. */
static void
-nautilus_window_has_really_changed(NautilusWindow *window)
+nautilus_window_has_really_changed (NautilusWindow *window)
{
GList *discard_views;
GList *p;
@@ -519,12 +518,12 @@ nautilus_window_has_really_changed(NautilusWindow *window)
new_sidebar_panels = window->new_sidebar_panels;
window->new_sidebar_panels = NULL;
- if (window->new_content_view) {
- if (!GTK_WIDGET (window->new_content_view)->parent) {
+ if (window->new_content_view != NULL) {
+ if (GTK_WIDGET (window->new_content_view)->parent == NULL) {
nautilus_window_disconnect_view (window, window->content_view);
- nautilus_window_set_content_view(window, window->new_content_view);
+ nautilus_window_set_content_view (window, window->new_content_view);
}
- gtk_object_unref(GTK_OBJECT(window->new_content_view));
+ gtk_object_unref (GTK_OBJECT (window->new_content_view));
window->new_content_view = NULL;
/* Update displayed view in menu. Only do this if we're not switching
@@ -537,27 +536,25 @@ nautilus_window_has_really_changed(NautilusWindow *window)
}
}
- if (new_sidebar_panels) {
- /* Do lots of shuffling to make sure we don't remove views that were already there, but add new views */
- for (p = new_sidebar_panels; p != NULL; p = p->next) {
- if (!GTK_OBJECT_DESTROYED (p->data) && !GTK_WIDGET (p->data)->parent)
- nautilus_window_add_sidebar_panel (window, p->data);
- gtk_object_unref (p->data);
- }
-
- discard_views = NULL;
- for (p = window->sidebar_panels; p != NULL; p = p->next) {
- if (!g_list_find (new_sidebar_panels, p->data)) {
- discard_views = g_list_prepend(discard_views, p->data);
- }
- }
- g_list_free (new_sidebar_panels);
-
- for (p = discard_views; p != NULL; p = p->next) {
- nautilus_window_remove_sidebar_panel (window, p->data);
+ /* Do lots of shuffling to make sure we don't remove views that were already there, but add new views */
+ for (p = new_sidebar_panels; p != NULL; p = p->next) {
+ if (!GTK_OBJECT_DESTROYED (p->data) && !GTK_WIDGET (p->data)->parent)
+ nautilus_window_add_sidebar_panel (window, p->data);
+ gtk_object_unref (p->data);
+ }
+
+ discard_views = NULL;
+ for (p = window->sidebar_panels; p != NULL; p = p->next) {
+ if (!g_list_find (new_sidebar_panels, p->data)) {
+ discard_views = g_list_prepend(discard_views, p->data);
}
- g_list_free (discard_views);
}
+ g_list_free (new_sidebar_panels);
+
+ for (p = discard_views; p != NULL; p = p->next) {
+ nautilus_window_remove_sidebar_panel (window, p->data);
+ }
+ g_list_free (discard_views);
if (window->pending_ni != NULL) {
nautilus_window_update_internals (window);
@@ -567,6 +564,8 @@ nautilus_window_has_really_changed(NautilusWindow *window)
}
window->pending_ni = NULL;
}
+
+ nautilus_window_update_title (window);
}
/* This is called when we are done loading to get rid of the load_info structure. */
@@ -941,7 +940,7 @@ nautilus_window_update_state (gpointer data)
}
if (window->pending_ni != NULL) {
- nautilus_window_reset_title_internal
+ nautilus_window_set_displayed_location
(window, window->location == NULL ? "" : window->location);
/* Tell previously-notified views to go back to the old page */
@@ -961,10 +960,9 @@ nautilus_window_update_state (gpointer data)
}
}
- if (window->new_content_view) {
+ if (window->new_content_view != NULL) {
gtk_widget_unref (GTK_WIDGET (window->new_content_view));
}
-
for (p = window->new_sidebar_panels; p != NULL; p = p->next) {
gtk_widget_unref (GTK_WIDGET (p->data));
}
@@ -1026,7 +1024,7 @@ nautilus_window_update_state (gpointer data)
selection = window->selection;
}
- nautilus_window_reset_title_internal (window, location);
+ nautilus_window_set_displayed_location (window, location);
x_message (("!!! Sending update_view"));
diff --git a/src/nautilus-window-manage-views.h b/src/nautilus-window-manage-views.h
index 723c3c4ec..837a770d5 100644
--- a/src/nautilus-window-manage-views.h
+++ b/src/nautilus-window-manage-views.h
@@ -53,8 +53,7 @@ void nautilus_window_report_load_complete (NautilusWindow
NautilusViewFrame *view);
void nautilus_window_report_load_failed (NautilusWindow *window,
NautilusViewFrame *view);
-void nautilus_window_set_title (NautilusWindow *window,
- const char *new_title,
+void nautilus_window_title_changed (NautilusWindow *window,
NautilusViewFrame *view);
NautilusViewFrame *nautilus_window_load_content_view (NautilusWindow *window,
NautilusViewIdentifier *id,
diff --git a/src/nautilus-window-toolbars.c b/src/nautilus-window-toolbars.c
index 4911ca881..988d3c90a 100644
--- a/src/nautilus-window-toolbars.c
+++ b/src/nautilus-window-toolbars.c
@@ -27,11 +27,11 @@
*/
#include <config.h>
+
+#include "nautilus-application.h"
#include "nautilus-toolbar.h"
-#include "nautilus-window.h"
#include "nautilus-window-private.h"
-#include "nautilus-application.h"
-
+#include "nautilus-window.h"
#include <gnome.h>
#include <libnautilus-extensions/nautilus-bookmark.h>
#include <libnautilus-extensions/nautilus-global-preferences.h>
@@ -41,7 +41,7 @@
/* forward declarations */
static void toolbar_reload_callback (GtkWidget *widget, NautilusWindow *window);
static void toolbar_stop_callback (GtkWidget *widget, NautilusWindow *window);
-#if defined(EAZEL_SERVICES)
+#ifdef EAZEL_SERVICES
static void toolbar_services_callback (GtkWidget *widget, NautilusWindow *window);
#endif
@@ -60,43 +60,36 @@ static void toolbar_services_callback (GtkWidget *widget, NautilusWindow *window
#define TOOLBAR_SERVICES_INDEX 10
static void
-toolbar_clear_search_mode(NautilusWindow *window)
+toolbar_clear_search_mode (NautilusWindow *window)
{
- GtkToggleButton *button;
-
- button = GTK_TOGGLE_BUTTON(window->search_local_button);
- if (button->active) {
- nautilus_window_set_search_mode (window, FALSE);
- gtk_toggle_button_set_active(button, FALSE);
- }
+ nautilus_window_set_search_mode (window, FALSE);
}
static void
toolbar_back_callback (GtkWidget *widget, NautilusWindow *window)
{
- nautilus_window_go_back (window);
+ nautilus_window_go_back (window);
}
static void
toolbar_forward_callback (GtkWidget *widget, NautilusWindow *window)
{
- nautilus_window_go_forward (window);
+ nautilus_window_go_forward (window);
}
static void
toolbar_up_callback (GtkWidget *widget, NautilusWindow *window)
{
- nautilus_window_go_up (window);
+ nautilus_window_go_up (window);
}
static void
toolbar_home_callback (GtkWidget *widget, NautilusWindow *window)
{
- toolbar_clear_search_mode (window);
- nautilus_window_go_home (window);
+ toolbar_clear_search_mode (window);
+ nautilus_window_go_home (window);
}
-
static void
toolbar_search_local_callback (GtkWidget *widget, NautilusWindow *window)
{
@@ -114,7 +107,6 @@ toolbar_search_web_callback (GtkWidget *widget, NautilusWindow *window)
{ GNOME_APP_UI_TOGGLEITEM, label, tooltip, (gpointer)callback, NULL, NULL, \
GNOME_APP_PIXMAP_STOCK, stock_id, 0, (GdkModifierType) 0, NULL }
-
static GnomeUIInfo toolbar_info[] = {
GNOMEUIINFO_ITEM_STOCK
(N_("Back"), N_("Go to the previously visited directory"),
@@ -159,12 +151,14 @@ static GnomeUIInfo toolbar_info[] = {
(N_("Stop"), N_("Interrupt loading"),
toolbar_stop_callback,
NAUTILUS_PIXMAPDIR "/eazel/Stop.png"),
-#if defined(EAZEL_SERVICES)
+
+#ifdef EAZEL_SERVICES
GNOMEUIINFO_ITEM_STOCK
(N_("Services"), N_("Eazel Services"),
toolbar_services_callback,
NAUTILUS_PIXMAPDIR "/eazel/Services.png"),
#endif
+
GNOMEUIINFO_END
};
@@ -213,10 +207,11 @@ create_back_or_forward_menu (NautilusWindow *window, gboolean back)
menu_item = nautilus_bookmark_menu_item_new (NAUTILUS_BOOKMARK (list_link->data));
gtk_object_set_user_data (GTK_OBJECT (menu_item), GINT_TO_POINTER (index));
gtk_widget_show (GTK_WIDGET (menu_item));
- gtk_signal_connect(GTK_OBJECT(menu_item),
- "activate",
- back ? activate_back_menu_item_callback : activate_forward_menu_item_callback,
- window);
+ gtk_signal_connect
+ (GTK_OBJECT(menu_item),
+ "activate",
+ back ? activate_back_menu_item_callback : activate_forward_menu_item_callback,
+ window);
gtk_menu_append (menu, menu_item);
list_link = g_slist_next (list_link);
@@ -290,49 +285,63 @@ set_up_button (GtkWidget* button,
const char *theme_name,
const char *icon_name)
{
+ /* FIXME: This GnomeStock trickery belongs in the
+ * libnautilus-extensions library. That's where we put
+ * workarounds like this.
+ */
GnomeStock *stock_widget;
char *full_name;
GtkToolbarChild *toolbar_child;
+ GnomeStockPixmapEntryPath *new_entry;
- if ((theme_name == NULL) || (strcmp(theme_name, "default") == 0)) {
+ if (theme_name == NULL || strcmp (theme_name, "default") == 0) {
full_name = g_strdup (icon_name);
} else {
full_name = g_strdup_printf (NAUTILUS_PIXMAPDIR "/%s/%s.png", theme_name, icon_name);
}
toolbar_child = find_toolbar_child (GTK_TOOLBAR (button->parent), button);
- if (toolbar_child != NULL &&
- toolbar_child->icon != NULL &&
- GNOME_IS_STOCK (toolbar_child->icon))
+ if (toolbar_child != NULL
+ && toolbar_child->icon != NULL
+ && GNOME_IS_STOCK (toolbar_child->icon)) {
stock_widget = GNOME_STOCK (toolbar_child->icon);
- else
+ } else {
stock_widget = NULL;
+ }
- if (stock_widget != NULL &&
- ! gnome_stock_set_icon (stock_widget, full_name) &&
- g_file_exists(full_name)) {
- /* if full_name exists but gnome_stock_set_icon fails, that means
- * this file has NOT been registered with gnome stock. Unfortunately
- * gnome_stock is a worthless pile of dung and doesn't do this for us.
- * Do note however that it DOES register this stuff when it first
- * creates the toolbars from GnomeUIInfo. */
- GnomeStockPixmapEntryPath *new_entry;
- new_entry = g_malloc(sizeof(GnomeStockPixmapEntryPath));
+ if (stock_widget != NULL
+ && ! gnome_stock_set_icon (stock_widget, full_name)
+ && g_file_exists (full_name)) {
+ /* If full_name exists but gnome_stock_set_icon fails,
+ * that means this file has NOT been registered with
+ * gnome stock. Unfortunately gnome_stock is a
+ * worthless pile of dung and doesn't do this for us.
+ * Do note however that it DOES register this stuff
+ * when it first creates the toolbars from
+ * GnomeUIInfo.
+ */
+ new_entry = g_malloc (sizeof (GnomeStockPixmapEntryPath));
new_entry->type = GNOME_STOCK_PIXMAP_TYPE_PATH;
new_entry->label = NULL;
new_entry->pathname = full_name;
new_entry->width = 0;
new_entry->height = 0;
- /* register this under the "full_name" as that's what we'll look it
- * up under later */
- gnome_stock_pixmap_register(full_name, GNOME_STOCK_PIXMAP_REGULAR,
- (GnomeStockPixmapEntry *)new_entry);
- full_name = NULL; /* we used it in new_entry, so we just transfer
- ownership */
+
+ /* Register this under the "full_name" as that's what
+ * we'll look it up under later.
+ */
+ gnome_stock_pixmap_register (full_name, GNOME_STOCK_PIXMAP_REGULAR,
+ (GnomeStockPixmapEntry *) new_entry);
gnome_stock_set_icon (stock_widget, full_name);
+
+ /* We used full_name in new_entry, so we just transfer
+ * ownership.
+ */
+ full_name = NULL;
}
g_free (full_name);
+
gtk_widget_queue_resize (button);
}
@@ -385,15 +394,15 @@ nautilus_window_initialize_toolbars (NautilusWindow *window)
bonobo_ui_handler_set_toolbar (window->ui_handler, "Main", toolbar);
gtk_signal_connect (GTK_OBJECT (window->back_button),
- "button_press_event",
- GTK_SIGNAL_FUNC (back_or_forward_button_clicked_callback),
- window);
+ "button_press_event",
+ GTK_SIGNAL_FUNC (back_or_forward_button_clicked_callback),
+ window);
gtk_signal_connect (GTK_OBJECT (window->forward_button),
- "button_press_event",
- GTK_SIGNAL_FUNC (back_or_forward_button_clicked_callback),
- window);
-
+ "button_press_event",
+ GTK_SIGNAL_FUNC (back_or_forward_button_clicked_callback),
+ window);
+
/* add callback for preference changes */
nautilus_preferences_add_callback
(NAUTILUS_PREFERENCES_THEME,
@@ -423,11 +432,10 @@ toolbar_stop_callback (GtkWidget *widget, NautilusWindow *window)
nautilus_window_set_state_info (window, RESET_TO_IDLE, 0);
}
-#if defined(EAZEL_SERVICES)
+#ifdef EAZEL_SERVICES
static void
toolbar_services_callback (GtkWidget *widget, NautilusWindow *window)
{
nautilus_window_goto_uri (window, "eazel:");
}
#endif
-
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index 48f547334..55b0ec6a1 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -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);
diff --git a/src/nautilus-window.h b/src/nautilus-window.h
index c14ceced8..4c48e6627 100644
--- a/src/nautilus-window.h
+++ b/src/nautilus-window.h
@@ -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.