summaryrefslogtreecommitdiff
path: root/libnautilus-private
diff options
context:
space:
mode:
authorRamiro Estrugo <ramiro@eazel.com>2001-03-07 06:28:13 +0000
committerRamiro Estrugo <ramiro@src.gnome.org>2001-03-07 06:28:13 +0000
commitbd4268abb158952ff84ae1a0394e56beae5499fb (patch)
tree8d5648208102c16d8c87652139a6fb7164d1c9cf /libnautilus-private
parent80a831b9418e24959c9762bacbc37f5fd51f22e3 (diff)
downloadnautilus-bd4268abb158952ff84ae1a0394e56beae5499fb.tar.gz
Merge from HEAD:
2001-03-06 Ramiro Estrugo <ramiro@eazel.com> reviewed by: John Sullivan <sullivan@eazel.com> Fix bug 7400 - Assertions in NON smooth font picker, and font doesn't change. * libnautilus-extensions/nautilus-preferences-item.c: (preferences_item_create_font_family), (font_family_item_changed_callback): Replace text_item_changed_callback with font_family_item_changed_callback and have the new callback deal with the string picker properly. Im not sure where text_item_changed_callback came from, but it was assuming that the target was a NautilusCaption and not a NautilusStringPicker.
Diffstat (limited to 'libnautilus-private')
-rw-r--r--libnautilus-private/nautilus-preferences-item.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/libnautilus-private/nautilus-preferences-item.c b/libnautilus-private/nautilus-preferences-item.c
index 20cdd7607..3253bac04 100644
--- a/libnautilus-private/nautilus-preferences-item.c
+++ b/libnautilus-private/nautilus-preferences-item.c
@@ -90,12 +90,12 @@ static void enum_radio_group_changed_callback (GtkWidget
gpointer user_data);
static void boolean_button_toggled_callback (GtkWidget *button_group,
gpointer user_data);
-static void text_item_changed_callback (GtkWidget *string_picker,
- gpointer user_data);
static void editable_string_changed_callback (GtkWidget *caption,
gpointer user_data);
static void integer_changed_callback (GtkWidget *caption,
gpointer user_data);
+static void font_family_item_changed_callback (GtkWidget *caption,
+ gpointer user_data);
NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusPreferencesItem, nautilus_preferences_item, GTK_TYPE_VBOX)
@@ -489,8 +489,8 @@ preferences_item_create_font_family (NautilusPreferencesItem *item,
item->details->change_signal_ID = gtk_signal_connect (GTK_OBJECT (item->details->child),
"changed",
- GTK_SIGNAL_FUNC (text_item_changed_callback),
- (gpointer) item);
+ GTK_SIGNAL_FUNC (font_family_item_changed_callback),
+ item);
}
@@ -606,19 +606,24 @@ boolean_button_toggled_callback (GtkWidget *button, gpointer user_data)
}
static void
-text_item_changed_callback (GtkWidget *button, gpointer user_data)
+font_family_item_changed_callback (GtkWidget *string_picker, gpointer user_data)
{
NautilusPreferencesItem *item;
+ char *selected_string;
- g_assert (user_data != NULL);
- g_assert (NAUTILUS_IS_PREFERENCES_ITEM (user_data));
+ g_return_if_fail (NAUTILUS_IS_STRING_PICKER (string_picker));
+ g_return_if_fail (NAUTILUS_IS_PREFERENCES_ITEM (user_data));
item = NAUTILUS_PREFERENCES_ITEM (user_data);
- g_assert (item->details->child != NULL);
- g_assert (NAUTILUS_IS_STRING_PICKER (item->details->child));
+ g_return_if_fail (item->details->preference_name != NULL);
- preferences_item_update_text_settings_at_idle (item);
+ selected_string = nautilus_string_picker_get_selected_string (NAUTILUS_STRING_PICKER (string_picker));
+ g_return_if_fail (selected_string != NULL);
+
+ nautilus_preferences_set (item->details->preference_name, selected_string);
+
+ g_free (selected_string);
}
static void