Mercurial > pidgin
diff src/gtkprefs.c @ 8979:e2ad3e04d248
[gaim-migrate @ 9753]
"Adds a feature requested by my brother, a conversation placement option
limited by number of conversations in that window, so as to let one avoid
needing the GtkNotebook scroll arrows." --deryni
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Wed, 19 May 2004 04:44:36 +0000 |
parents | cd1c9bbab491 |
children | d6fea11c62d7 |
line wrap: on
line diff
--- a/src/gtkprefs.c Wed May 19 04:43:16 2004 +0000 +++ b/src/gtkprefs.c Wed May 19 04:44:36 2004 +0000 @@ -84,6 +84,7 @@ static guint proxy_pref_id = 0; static guint sound_pref_id = 0; static guint auto_resp_pref_id = 0; +static guint placement_pref_id = 0; /* * PROTOTYPES @@ -346,6 +347,7 @@ gaim_prefs_disconnect_callback(proxy_pref_id); gaim_prefs_disconnect_callback(sound_pref_id); gaim_prefs_disconnect_callback(auto_resp_pref_id); + gaim_prefs_disconnect_callback(placement_pref_id); for (l = gaim_plugins_get_loaded(); l != NULL; l = l->next) { plug = l->data; @@ -881,6 +883,18 @@ return ret; } +static void +conversation_placement_cb(const char *name, GaimPrefType type, gpointer value, + gpointer data) +{ + const char *placement = value; + + if (strcmp(placement, "number")) + gtk_widget_set_sensitive(GTK_WIDGET(data), FALSE); + else + gtk_widget_set_sensitive(GTK_WIDGET(data), TRUE); +} + GtkWidget *conv_page() { GtkWidget *ret; GtkWidget *vbox; @@ -905,6 +919,15 @@ gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_size_group_add_widget(sg, label); + label = gaim_gtk_prefs_labeled_spin_button(vbox, "Number of conversations per window", + "/gaim/gtk/conversations/placement_number", + 1, 50, sg); + + placement_pref_id = gaim_prefs_connect_callback("/gaim/gtk/conversations/placement", + conversation_placement_cb, + label); + gaim_prefs_trigger_callback("/gaim/gtk/conversations/placement"); + gaim_gtk_prefs_checkbox(_("Show _formatting toolbar"), "/gaim/gtk/conversations/show_formatting_toolbar", vbox);