Mercurial > pidgin
changeset 8238:32625c0dbba6
[gaim-migrate @ 8961]
Make some spin boxes gray when the preference for them is not active...
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Thu, 12 Feb 2004 17:02:35 +0000 |
parents | 9200bee593e8 |
children | 5220e0898252 |
files | src/gtkprefs.c src/gtkprefs.h |
diffstat | 2 files changed, 15 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/src/gtkprefs.c Thu Feb 12 07:16:33 2004 +0000 +++ b/src/gtkprefs.c Thu Feb 12 17:02:35 2004 +0000 @@ -143,7 +143,7 @@ gaim_set_accessible_label (spin, label); - return label; + return hbox; } static void @@ -1100,8 +1100,6 @@ g_signal_connect(G_OBJECT(auto_ip_checkbox), "clicked", G_CALLBACK(gaim_gtk_toggle_sensitive), table); - - vbox = gaim_gtk_make_frame (ret, _("Ports")); sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); @@ -1590,35 +1588,39 @@ vbox = gaim_gtk_make_frame (ret, _("Auto-away")); button = gaim_gtk_prefs_checkbox(_("Set away _when idle"), "/core/away/away_when_idle", vbox); + select = gaim_gtk_prefs_labeled_spin_button(vbox, _("_Minutes before setting away:"), "/core/away/mins_before_away", 1, 24 * 60, sg); - g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(gaim_gtk_toggle_sensitive), select); + hbox = gtk_hbox_new(FALSE, 0); + gtk_container_add(GTK_CONTAINER(vbox), hbox); + label = gtk_label_new_with_mnemonic(_("Away m_essage:")); gtk_size_group_add_widget(sg, label); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); - hbox = gtk_hbox_new(FALSE, 0); - gtk_container_add(GTK_CONTAINER(vbox), hbox); + g_signal_connect(G_OBJECT(button), "clicked", + G_CALLBACK(gaim_gtk_toggle_sensitive), label); gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); + prefs_away_menu = gtk_option_menu_new(); gtk_label_set_mnemonic_widget(GTK_LABEL(label), prefs_away_menu); - g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(gaim_gtk_toggle_sensitive), prefs_away_menu); default_away_menu_init(prefs_away_menu); gtk_widget_show(prefs_away_menu); gtk_box_pack_start(GTK_BOX(hbox), prefs_away_menu, FALSE, FALSE, 0); + gaim_set_accessible_label (prefs_away_menu, label); + if (!gaim_prefs_get_bool("/core/away/away_when_idle")) { gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(label), FALSE); gtk_widget_set_sensitive(GTK_WIDGET(prefs_away_menu), FALSE); } - gaim_set_accessible_label (prefs_away_menu, label); - gtk_widget_show_all(ret); return ret; @@ -2449,7 +2451,7 @@ prefs_notebook_add_page(_("Conversations"), NULL, conv_page(), &p2, NULL, notebook_page++); prefs_notebook_add_page(_("IMs"), NULL, im_page(), &c, &p2, notebook_page++); prefs_notebook_add_page(_("Chats"), NULL, chat_page(), &c, &p2, notebook_page++); - /* XXX */prefs_notebook_add_page(_("Network"), NULL, network_page(), &p, NULL, notebook_page++); + prefs_notebook_add_page(_("Network"), NULL, network_page(), &p, NULL, notebook_page++); prefs_notebook_add_page(_("Proxy"), NULL, proxy_page(), &p, NULL, notebook_page++); #ifndef _WIN32 /* We use the registered default browser in windows */
--- a/src/gtkprefs.h Thu Feb 12 07:16:33 2004 +0000 +++ b/src/gtkprefs.h Thu Feb 12 17:02:35 2004 +0000 @@ -73,6 +73,9 @@ * @param min The minimum value of the spin button * @param max The maximum value of the spin button * @param sg If not NULL, the size group to which the spin button will be added + * @return An hbox containing both the label and the spinner. Can be + * used to set the widgets to sensitive or insensitve based on the + * value of a checkbox. */ GtkWidget *gaim_gtk_prefs_labeled_spin_button(GtkWidget *page, const gchar *title, char *key, int min, int max, GtkSizeGroup *sg);