From f792bd3793549b74230e3a89885bdd0f4be02bc4 Mon Sep 17 00:00:00 2001 From: Andy Hertzfeld Date: Sat, 10 Feb 2001 02:51:09 +0000 Subject: fixed bug 6005, help tab still left on sidebar after view is hidden, by * src/nautilus-sidebar.c: (nautilus_sidebar_active_panel_matches_id), (nautilus_sidebar_remove_panel): fixed bug 6005, help tab still left on sidebar after view is hidden, by decrementing the active tab index when an earlier one is deleted, and checking for NULL in active_panel_matches_id. * components/rpmview/nautilus-rpm-view.c: (nautilus_rpm_view_initialize), (nautilus_rpm_view_update_from_uri): made it us nautilus_image so the package image is anti-aliased --- src/nautilus-information-panel.c | 13 +++++++++++-- src/nautilus-sidebar.c | 13 +++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/nautilus-information-panel.c b/src/nautilus-information-panel.c index 7c02ced86..1a0635f3a 100644 --- a/src/nautilus-information-panel.c +++ b/src/nautilus-information-panel.c @@ -357,7 +357,14 @@ nautilus_sidebar_active_panel_matches_id (NautilusSidebar *sidebar, const char * return FALSE; } current_view = gtk_notebook_get_nth_page (GTK_NOTEBOOK (sidebar->details->notebook), - sidebar->details->selected_index); + sidebar->details->selected_index); + /* if we can't get the active one, say yes to removing it, to make sure to + * remove the tab + */ + if (current_view == NULL) { + return TRUE; + } + current_iid = nautilus_view_frame_get_view_iid (NAUTILUS_VIEW_FRAME (current_view)); return nautilus_strcmp (current_iid, id) == 0; } @@ -863,7 +870,9 @@ nautilus_sidebar_remove_panel (NautilusSidebar *sidebar, /* Remove the tab associated with this panel */ nautilus_sidebar_tabs_remove_view (sidebar->details->sidebar_tabs, description); - + if (page_num <= sidebar->details->selected_index) { + sidebar->details->selected_index -= 1; + } g_free (description); } diff --git a/src/nautilus-sidebar.c b/src/nautilus-sidebar.c index 7c02ced86..1a0635f3a 100644 --- a/src/nautilus-sidebar.c +++ b/src/nautilus-sidebar.c @@ -357,7 +357,14 @@ nautilus_sidebar_active_panel_matches_id (NautilusSidebar *sidebar, const char * return FALSE; } current_view = gtk_notebook_get_nth_page (GTK_NOTEBOOK (sidebar->details->notebook), - sidebar->details->selected_index); + sidebar->details->selected_index); + /* if we can't get the active one, say yes to removing it, to make sure to + * remove the tab + */ + if (current_view == NULL) { + return TRUE; + } + current_iid = nautilus_view_frame_get_view_iid (NAUTILUS_VIEW_FRAME (current_view)); return nautilus_strcmp (current_iid, id) == 0; } @@ -863,7 +870,9 @@ nautilus_sidebar_remove_panel (NautilusSidebar *sidebar, /* Remove the tab associated with this panel */ nautilus_sidebar_tabs_remove_view (sidebar->details->sidebar_tabs, description); - + if (page_num <= sidebar->details->selected_index) { + sidebar->details->selected_index -= 1; + } g_free (description); } -- cgit v1.2.1