summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndy Hertzfeld <andy@src.gnome.org>2001-02-10 02:51:09 +0000
committerAndy Hertzfeld <andy@src.gnome.org>2001-02-10 02:51:09 +0000
commitf792bd3793549b74230e3a89885bdd0f4be02bc4 (patch)
treed4c2617a31d2f553162229ae50566b01a40deca2 /src
parentc277415005f890aafdc1b58eeb5acf3baad6ebda (diff)
downloadnautilus-f792bd3793549b74230e3a89885bdd0f4be02bc4.tar.gz
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
Diffstat (limited to 'src')
-rw-r--r--src/nautilus-information-panel.c13
-rw-r--r--src/nautilus-sidebar.c13
2 files changed, 22 insertions, 4 deletions
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);
}