summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRamiro Estrugo <ramiro@src.gnome.org>2001-04-01 01:01:00 +0000
committerRamiro Estrugo <ramiro@src.gnome.org>2001-04-01 01:01:00 +0000
commit9a61eb330ae70c247171629a7b402ce3ab4d3c00 (patch)
tree4c8330df8f00a1fcb8f89f54bd7631aaaffe74d1
parent1b9302961066a9c5845b220e274ebadceca5d705 (diff)
downloadnautilus-9a61eb330ae70c247171629a7b402ce3ab4d3c00.tar.gz
Restore the "dance." It was needed after all to deal with situations when
* src/nautilus-sidebar.c: (toggle_sidebar_panel): Restore the "dance." It was needed after all to deal with situations when the display become out of whack with the number of running sidebar panels, for example when a panel crashes. Added a comment to this effect as well.
-rw-r--r--ChangeLog8
-rw-r--r--src/nautilus-information-panel.c15
-rw-r--r--src/nautilus-sidebar.c15
3 files changed, 34 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index af8a7efa7..ebc578ed1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2001-03-31 Ramiro Estrugo <ramiro@eazel.com>
+ * src/nautilus-sidebar.c: (toggle_sidebar_panel):
+ Restore the "dance." It was needed after all to deal with
+ situations when the display become out of whack with the number of
+ running sidebar panels, for example when a panel crashes.
+ Added a comment to this effect as well.
+
+2001-03-31 Ramiro Estrugo <ramiro@eazel.com>
+
* libnautilus-extensions/nautilus-preferences-item.c:
(nautilus_preferences_item_set_constrained_integer_values): When
the constrained interger values are change, we need to update the
diff --git a/src/nautilus-information-panel.c b/src/nautilus-information-panel.c
index f5f61d5d7..159301b46 100644
--- a/src/nautilus-information-panel.c
+++ b/src/nautilus-information-panel.c
@@ -392,6 +392,7 @@ toggle_sidebar_panel (GtkWidget *widget,
{
NautilusSidebar *sidebar;
const char *preference_key;
+ gboolean already_on;
g_return_if_fail (GTK_IS_CHECK_MENU_ITEM (widget));
g_return_if_fail (NAUTILUS_IS_SIDEBAR (gtk_object_get_user_data (GTK_OBJECT (widget))));
@@ -402,8 +403,18 @@ toggle_sidebar_panel (GtkWidget *widget,
sidebar = NAUTILUS_SIDEBAR (gtk_object_get_user_data (GTK_OBJECT (widget)));
nautilus_sidebar_hide_active_panel_if_matches (sidebar, sidebar_iid);
-
- nautilus_preferences_set_boolean (preference_key, GTK_CHECK_MENU_ITEM (widget)->active);
+
+ already_on = any_panel_matches_iid (sidebar, sidebar_iid);
+
+ /* This little dance gets the preferences code to send a
+ * notification even though it thinks there's "no change".
+ *
+ * This is needed to deal with situations when the display
+ * become out of whack with the number of running sidebar
+ * panels, for example when a panel crashes.
+ */
+ nautilus_preferences_set_boolean (preference_key, already_on);
+ nautilus_preferences_set_boolean (preference_key, !already_on);
}
typedef struct
diff --git a/src/nautilus-sidebar.c b/src/nautilus-sidebar.c
index f5f61d5d7..159301b46 100644
--- a/src/nautilus-sidebar.c
+++ b/src/nautilus-sidebar.c
@@ -392,6 +392,7 @@ toggle_sidebar_panel (GtkWidget *widget,
{
NautilusSidebar *sidebar;
const char *preference_key;
+ gboolean already_on;
g_return_if_fail (GTK_IS_CHECK_MENU_ITEM (widget));
g_return_if_fail (NAUTILUS_IS_SIDEBAR (gtk_object_get_user_data (GTK_OBJECT (widget))));
@@ -402,8 +403,18 @@ toggle_sidebar_panel (GtkWidget *widget,
sidebar = NAUTILUS_SIDEBAR (gtk_object_get_user_data (GTK_OBJECT (widget)));
nautilus_sidebar_hide_active_panel_if_matches (sidebar, sidebar_iid);
-
- nautilus_preferences_set_boolean (preference_key, GTK_CHECK_MENU_ITEM (widget)->active);
+
+ already_on = any_panel_matches_iid (sidebar, sidebar_iid);
+
+ /* This little dance gets the preferences code to send a
+ * notification even though it thinks there's "no change".
+ *
+ * This is needed to deal with situations when the display
+ * become out of whack with the number of running sidebar
+ * panels, for example when a panel crashes.
+ */
+ nautilus_preferences_set_boolean (preference_key, already_on);
+ nautilus_preferences_set_boolean (preference_key, !already_on);
}
typedef struct