Mercurial > pidgin
comparison src/gtkprefs.c @ 12195:d040123d2b69
[gaim-migrate @ 14497]
A saved status dropdown.
I don't know if it works, because the only way for me to test it right now
is through remote X, over 3000 miles away.
And I ain't puttin up with that for long. I'm going to check it out when I
get home and fix it up locally.
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Wed, 23 Nov 2005 02:04:59 +0000 |
parents | 762bb28154bf |
children | 1c0fd404e07e |
comparison
equal
deleted
inserted
replaced
12194:a1a835fae1dc | 12195:d040123d2b69 |
---|---|
30 #include "notify.h" | 30 #include "notify.h" |
31 #include "prefs.h" | 31 #include "prefs.h" |
32 #include "proxy.h" | 32 #include "proxy.h" |
33 #include "prpl.h" | 33 #include "prpl.h" |
34 #include "request.h" | 34 #include "request.h" |
35 #include "savedstatuses.h" | |
35 #include "sound.h" | 36 #include "sound.h" |
36 #include "util.h" | 37 #include "util.h" |
37 #include "network.h" | 38 #include "network.h" |
38 | 39 |
39 #include "gtkblist.h" | 40 #include "gtkblist.h" |
41 #include "gtkdebug.h" | 42 #include "gtkdebug.h" |
42 #include "gtkdialogs.h" | 43 #include "gtkdialogs.h" |
43 #include "gtkimhtml.h" | 44 #include "gtkimhtml.h" |
44 #include "gtkimhtmltoolbar.h" | 45 #include "gtkimhtmltoolbar.h" |
45 #include "gtkprefs.h" | 46 #include "gtkprefs.h" |
47 #include "gtksavedstatuses.h" | |
46 #include "gtksound.h" | 48 #include "gtksound.h" |
47 #include "gtkthemes.h" | 49 #include "gtkthemes.h" |
48 #include "gtkutils.h" | 50 #include "gtkutils.h" |
49 #include "gtkstock.h" | 51 #include "gtkstock.h" |
50 | 52 |
1630 #endif | 1632 #endif |
1631 | 1633 |
1632 return ret; | 1634 return ret; |
1633 } | 1635 } |
1634 | 1636 |
1635 /* XXX CORE/UI */ | 1637 |
1636 #if 0 | |
1637 static void | 1638 static void |
1638 set_default_away(GtkWidget *w, gpointer data) | 1639 set_idle_away(GaimSavedStatus *status) |
1639 { | 1640 { |
1640 struct away_message *default_away = NULL; | 1641 gaim_prefs_set_int("/core/savedstatus/idleaway", gaim_savedstatus_get_creation_time(status)); |
1641 int length = g_slist_length(away_messages); | 1642 } |
1642 int i = GPOINTER_TO_INT(data); | |
1643 | |
1644 if (away_messages == NULL) | |
1645 default_away = NULL; | |
1646 else if (i >= length) | |
1647 default_away = g_slist_nth_data(away_messages, length - 1); | |
1648 else | |
1649 default_away = g_slist_nth_data(away_messages, i); | |
1650 | |
1651 if(default_away) | |
1652 gaim_prefs_set_string("/core/away/default_message", default_away->name); | |
1653 else | |
1654 gaim_prefs_set_string("/core/away/default_message", ""); | |
1655 } | |
1656 #endif | |
1657 | 1643 |
1658 static GtkWidget * | 1644 static GtkWidget * |
1659 away_page() | 1645 away_page() |
1660 { | 1646 { |
1661 GtkWidget *ret; | 1647 GtkWidget *ret; |
1662 GtkWidget *vbox; | 1648 GtkWidget *vbox; |
1663 GtkWidget *hbox; | 1649 GtkWidget *hbox; |
1664 GtkWidget *label; | 1650 GtkWidget *label; |
1665 GtkWidget *button; | 1651 GtkWidget *button; |
1666 GtkWidget *select; | 1652 GtkWidget *select; |
1653 GtkWidget *menu; | |
1667 GtkSizeGroup *sg; | 1654 GtkSizeGroup *sg; |
1668 | 1655 |
1669 ret = gtk_vbox_new(FALSE, GAIM_HIG_CAT_SPACE); | 1656 ret = gtk_vbox_new(FALSE, GAIM_HIG_CAT_SPACE); |
1670 gtk_container_set_border_width (GTK_CONTAINER (ret), GAIM_HIG_BORDER); | 1657 gtk_container_set_border_width (GTK_CONTAINER (ret), GAIM_HIG_BORDER); |
1671 | 1658 |
1700 gtk_size_group_add_widget(sg, label); | 1687 gtk_size_group_add_widget(sg, label); |
1701 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); | 1688 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
1702 g_signal_connect(G_OBJECT(button), "clicked", | 1689 g_signal_connect(G_OBJECT(button), "clicked", |
1703 G_CALLBACK(gaim_gtk_toggle_sensitive), label); | 1690 G_CALLBACK(gaim_gtk_toggle_sensitive), label); |
1704 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | 1691 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
1692 menu = gaim_gtk_status_menu(gaim_savedstatus_get_idleaway(), G_CALLBACK(set_idle_away)); | |
1693 gtk_box_pack_start(GTK_BOX(hbox), menu, FALSE, FALSE, 0); | |
1694 g_signal_connect(G_OBJECT(button), "clicked", | |
1695 G_CALLBACK(gaim_gtk_toggle_sensitive), menu); | |
1705 | 1696 |
1706 /* | 1697 /* |
1707 * TODO: Need to allow users to choose a GaimSavedStatus | 1698 * TODO: Need to allow users to choose a GaimSavedStatus |
1708 * to use when going idle-away. Or figure out a | 1699 * to use when going idle-away. Or figure out a |
1709 * better UI for this. Set the preference | 1700 * better UI for this. Set the preference |
1711 * GaimSavedStatus to use. | 1702 * GaimSavedStatus to use. |
1712 * | 1703 * |
1713 */ | 1704 */ |
1714 | 1705 |
1715 if (!gaim_prefs_get_bool("/core/away/away_when_idle")) { | 1706 if (!gaim_prefs_get_bool("/core/away/away_when_idle")) { |
1707 gtk_widget_set_sensitive(GTK_WIDGET(menu), FALSE); | |
1716 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); | 1708 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
1717 gtk_widget_set_sensitive(GTK_WIDGET(label), FALSE); | 1709 gtk_widget_set_sensitive(GTK_WIDGET(label), FALSE); |
1718 } | 1710 } |
1719 | 1711 |
1720 gtk_widget_show_all(ret); | 1712 gtk_widget_show_all(ret); |