| 87 |
87 |
| 88 GtkWidget * |
88 GtkWidget * |
| 89 pidgin_prefs_labeled_spin_button(GtkWidget *box, const gchar *title, |
89 pidgin_prefs_labeled_spin_button(GtkWidget *box, const gchar *title, |
| 90 const char *key, int min, int max, GtkSizeGroup *sg) |
90 const char *key, int min, int max, GtkSizeGroup *sg) |
| 91 { |
91 { |
| 92 GtkWidget *hbox; |
|
| 93 GtkWidget *label; |
|
| 94 GtkWidget *spin; |
92 GtkWidget *spin; |
| 95 GtkObject *adjust; |
93 GtkObject *adjust; |
| 96 int val; |
94 int val; |
| 97 |
95 |
| 98 val = purple_prefs_get_int(key); |
96 val = purple_prefs_get_int(key); |
| 99 |
|
| 100 hbox = gtk_hbox_new(FALSE, 5); |
|
| 101 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5); |
|
| 102 gtk_widget_show(hbox); |
|
| 103 |
|
| 104 label = gtk_label_new_with_mnemonic(title); |
|
| 105 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
|
| 106 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
|
| 107 gtk_widget_show(label); |
|
| 108 |
97 |
| 109 adjust = gtk_adjustment_new(val, min, max, 1, 1, 1); |
98 adjust = gtk_adjustment_new(val, min, max, 1, 1, 1); |
| 110 spin = gtk_spin_button_new(GTK_ADJUSTMENT(adjust), 1, 0); |
99 spin = gtk_spin_button_new(GTK_ADJUSTMENT(adjust), 1, 0); |
| 111 g_object_set_data(G_OBJECT(spin), "val", (char *)key); |
100 g_object_set_data(G_OBJECT(spin), "val", (char *)key); |
| 112 if (max < 10000) |
101 if (max < 10000) |
| 113 gtk_widget_set_size_request(spin, 50, -1); |
102 gtk_widget_set_size_request(spin, 50, -1); |
| 114 else |
103 else |
| 115 gtk_widget_set_size_request(spin, 60, -1); |
104 gtk_widget_set_size_request(spin, 60, -1); |
| 116 gtk_box_pack_start(GTK_BOX(hbox), spin, FALSE, FALSE, 0); |
|
| 117 g_signal_connect(G_OBJECT(adjust), "value-changed", |
105 g_signal_connect(G_OBJECT(adjust), "value-changed", |
| 118 G_CALLBACK(update_spin_value), GTK_WIDGET(spin)); |
106 G_CALLBACK(update_spin_value), GTK_WIDGET(spin)); |
| 119 gtk_widget_show(spin); |
107 gtk_widget_show(spin); |
| 120 |
108 |
| 121 gtk_label_set_mnemonic_widget(GTK_LABEL(label), spin); |
109 return pidgin_add_widget_to_vbox(GTK_BOX(box), title, sg, spin, FALSE, NULL); |
| 122 |
|
| 123 if (sg) { |
|
| 124 gtk_size_group_add_widget(sg, label); |
|
| 125 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); |
|
| 126 } |
|
| 127 |
|
| 128 pidgin_set_accessible_label (spin, label); |
|
| 129 |
|
| 130 return hbox; |
|
| 131 } |
110 } |
| 132 |
111 |
| 133 static void |
112 static void |
| 134 entry_set(GtkEntry *entry, gpointer data) { |
113 entry_set(GtkEntry *entry, gpointer data) { |
| 135 const char *key = (const char*)data; |
114 const char *key = (const char*)data; |
| 139 |
118 |
| 140 GtkWidget * |
119 GtkWidget * |
| 141 pidgin_prefs_labeled_entry(GtkWidget *page, const gchar *title, |
120 pidgin_prefs_labeled_entry(GtkWidget *page, const gchar *title, |
| 142 const char *key, GtkSizeGroup *sg) |
121 const char *key, GtkSizeGroup *sg) |
| 143 { |
122 { |
| 144 GtkWidget *hbox, *label, *entry; |
123 GtkWidget *entry; |
| 145 const gchar *value; |
124 const gchar *value; |
| 146 |
125 |
| 147 value = purple_prefs_get_string(key); |
126 value = purple_prefs_get_string(key); |
| 148 |
|
| 149 hbox = gtk_hbox_new(FALSE, 5); |
|
| 150 gtk_box_pack_start(GTK_BOX(page), hbox, FALSE, FALSE, 0); |
|
| 151 gtk_widget_show(hbox); |
|
| 152 |
|
| 153 label = gtk_label_new_with_mnemonic(title); |
|
| 154 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
|
| 155 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
|
| 156 gtk_widget_show(label); |
|
| 157 |
127 |
| 158 entry = gtk_entry_new(); |
128 entry = gtk_entry_new(); |
| 159 gtk_entry_set_text(GTK_ENTRY(entry), value); |
129 gtk_entry_set_text(GTK_ENTRY(entry), value); |
| 160 gtk_box_pack_start(GTK_BOX(hbox), entry, FALSE, FALSE, 0); |
|
| 161 g_signal_connect(G_OBJECT(entry), "changed", |
130 g_signal_connect(G_OBJECT(entry), "changed", |
| 162 G_CALLBACK(entry_set), (char*)key); |
131 G_CALLBACK(entry_set), (char*)key); |
| 163 gtk_widget_show(entry); |
132 gtk_widget_show(entry); |
| 164 |
133 |
| 165 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
134 return pidgin_add_widget_to_vbox(GTK_BOX(page), title, sg, entry, TRUE, NULL); |
| 166 |
|
| 167 if(sg) { |
|
| 168 gtk_size_group_add_widget(sg, label); |
|
| 169 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); |
|
| 170 } |
|
| 171 |
|
| 172 pidgin_set_accessible_label(entry, label); |
|
| 173 |
|
| 174 return hbox; |
|
| 175 } |
135 } |
| 176 |
136 |
| 177 static void |
137 static void |
| 178 dropdown_set(GObject *w, const char *key) |
138 dropdown_set(GObject *w, const char *key) |
| 179 { |
139 { |
| 203 pidgin_prefs_dropdown_from_list(GtkWidget *box, const gchar *title, |
163 pidgin_prefs_dropdown_from_list(GtkWidget *box, const gchar *title, |
| 204 PurplePrefType type, const char *key, GList *menuitems) |
164 PurplePrefType type, const char *key, GList *menuitems) |
| 205 { |
165 { |
| 206 GtkWidget *dropdown, *opt, *menu; |
166 GtkWidget *dropdown, *opt, *menu; |
| 207 GtkWidget *label = NULL; |
167 GtkWidget *label = NULL; |
| 208 GtkWidget *hbox; |
|
| 209 gchar *text; |
168 gchar *text; |
| 210 const char *stored_str = NULL; |
169 const char *stored_str = NULL; |
| 211 int stored_int = 0; |
170 int stored_int = 0; |
| 212 int int_value = 0; |
171 int int_value = 0; |
| 213 const char *str_value = NULL; |
172 const char *str_value = NULL; |
| 214 int o = 0; |
173 int o = 0; |
| 215 |
174 |
| 216 g_return_val_if_fail(menuitems != NULL, NULL); |
175 g_return_val_if_fail(menuitems != NULL, NULL); |
| 217 |
|
| 218 if (title != NULL) { |
|
| 219 hbox = gtk_hbox_new(FALSE, 5); |
|
| 220 /*gtk_container_add (GTK_CONTAINER (box), hbox);*/ |
|
| 221 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0); |
|
| 222 gtk_widget_show(hbox); |
|
| 223 |
|
| 224 label = gtk_label_new_with_mnemonic(title); |
|
| 225 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
|
| 226 gtk_widget_show(label); |
|
| 227 } else { |
|
| 228 hbox = box; |
|
| 229 } |
|
| 230 |
176 |
| 231 #if 0 /* GTK_CHECK_VERSION(2,4,0) */ |
177 #if 0 /* GTK_CHECK_VERSION(2,4,0) */ |
| 232 if(type == PURPLE_PREF_INT) |
178 if(type == PURPLE_PREF_INT) |
| 233 model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT); |
179 model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT); |
| 234 else if(type == PURPLE_PREF_STRING) |
180 else if(type == PURPLE_PREF_STRING) |
| 237 #else |
183 #else |
| 238 dropdown = gtk_option_menu_new(); |
184 dropdown = gtk_option_menu_new(); |
| 239 menu = gtk_menu_new(); |
185 menu = gtk_menu_new(); |
| 240 #endif |
186 #endif |
| 241 |
187 |
| 242 if (label != NULL) { |
|
| 243 gtk_label_set_mnemonic_widget(GTK_LABEL(label), dropdown); |
|
| 244 pidgin_set_accessible_relations (dropdown, label); |
|
| 245 } |
|
| 246 |
|
| 247 if (type == PURPLE_PREF_INT) |
188 if (type == PURPLE_PREF_INT) |
| 248 stored_int = purple_prefs_get_int(key); |
189 stored_int = purple_prefs_get_int(key); |
| 249 else if (type == PURPLE_PREF_STRING) |
190 else if (type == PURPLE_PREF_STRING) |
| 250 stored_str = purple_prefs_get_string(key); |
191 stored_str = purple_prefs_get_string(key); |
| 251 |
192 |
| 1024 vbox = pidgin_make_frame(ret, _("Font")); |
964 vbox = pidgin_make_frame(ret, _("Font")); |
| 1025 if (purple_running_gnome()) |
965 if (purple_running_gnome()) |
| 1026 fontpref = pidgin_prefs_checkbox(_("Use document font from _theme"), PIDGIN_PREFS_ROOT "/conversations/use_theme_font", vbox); |
966 fontpref = pidgin_prefs_checkbox(_("Use document font from _theme"), PIDGIN_PREFS_ROOT "/conversations/use_theme_font", vbox); |
| 1027 else |
967 else |
| 1028 fontpref = pidgin_prefs_checkbox(_("Use font from _theme"), PIDGIN_PREFS_ROOT "/conversations/use_theme_font", vbox); |
968 fontpref = pidgin_prefs_checkbox(_("Use font from _theme"), PIDGIN_PREFS_ROOT "/conversations/use_theme_font", vbox); |
| 1029 hbox = gtk_hbox_new(FALSE, 3); |
969 |
| 1030 label = gtk_label_new_with_mnemonic(_("Conversation _font:")); |
|
| 1031 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
|
| 1032 font_name = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/custom_font"); |
970 font_name = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/custom_font"); |
| 1033 font_button = gtk_font_button_new_with_font(font_name ? font_name : NULL); |
971 font_button = gtk_font_button_new_with_font(font_name ? font_name : NULL); |
| 1034 gtk_font_button_set_show_style(GTK_FONT_BUTTON(font_button), TRUE); |
972 gtk_font_button_set_show_style(GTK_FONT_BUTTON(font_button), TRUE); |
| 1035 gtk_box_pack_start(GTK_BOX(hbox), font_button, FALSE, FALSE, 0); |
973 hbox = pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("Conversation _font:"), NULL, font_button, FALSE, NULL); |
| 1036 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
|
| 1037 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/use_theme_font")) |
974 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/use_theme_font")) |
| 1038 gtk_widget_set_sensitive(hbox, FALSE); |
975 gtk_widget_set_sensitive(hbox, FALSE); |
| 1039 g_signal_connect(G_OBJECT(fontpref), "clicked", G_CALLBACK(pidgin_toggle_sensitive), hbox); |
976 g_signal_connect(G_OBJECT(fontpref), "clicked", G_CALLBACK(pidgin_toggle_sensitive), hbox); |
| 1040 g_signal_connect(G_OBJECT(font_button), "font-set", G_CALLBACK(pidgin_custom_font_set), NULL); |
977 g_signal_connect(G_OBJECT(font_button), "font-set", G_CALLBACK(pidgin_custom_font_set), NULL); |
| 1041 gtk_widget_show_all(hbox); |
|
| 1042 #endif |
978 #endif |
| 1043 |
979 |
| 1044 vbox = pidgin_make_frame(ret, _("Default Formatting")); |
980 vbox = pidgin_make_frame(ret, _("Default Formatting")); |
| 1045 gtk_box_set_child_packing(GTK_BOX(vbox->parent), vbox, TRUE, TRUE, 0, GTK_PACK_START); |
981 gtk_box_set_child_packing(GTK_BOX(vbox->parent), vbox, TRUE, TRUE, 0, GTK_PACK_START); |
| 1046 |
982 |
| 1518 gtk_widget_set_sensitive(hbox, FALSE); |
1454 gtk_widget_set_sensitive(hbox, FALSE); |
| 1519 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/browsers/browser", |
1455 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/browsers/browser", |
| 1520 browser_changed1_cb, hbox); |
1456 browser_changed1_cb, hbox); |
| 1521 } |
1457 } |
| 1522 |
1458 |
| 1523 hbox = gtk_hbox_new(FALSE, 5); |
|
| 1524 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
|
| 1525 label = gtk_label_new_with_mnemonic(_("_Manual:\n(%s for URL)")); |
|
| 1526 gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); |
|
| 1527 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
|
| 1528 gtk_size_group_add_widget(sg, label); |
|
| 1529 |
|
| 1530 entry = gtk_entry_new(); |
1459 entry = gtk_entry_new(); |
| 1531 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
|
| 1532 |
|
| 1533 if (strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/browsers/browser"), "custom")) |
1460 if (strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/browsers/browser"), "custom")) |
| 1534 gtk_widget_set_sensitive(hbox, FALSE); |
1461 gtk_widget_set_sensitive(hbox, FALSE); |
| 1535 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/browsers/browser", |
1462 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/browsers/browser", |
| 1536 browser_changed2_cb, hbox); |
1463 browser_changed2_cb, hbox); |
| 1537 |
|
| 1538 gtk_box_pack_start (GTK_BOX (hbox), entry, FALSE, FALSE, 0); |
|
| 1539 |
|
| 1540 gtk_entry_set_text(GTK_ENTRY(entry), |
1464 gtk_entry_set_text(GTK_ENTRY(entry), |
| 1541 purple_prefs_get_path(PIDGIN_PREFS_ROOT "/browsers/command")); |
1465 purple_prefs_get_path(PIDGIN_PREFS_ROOT "/browsers/command")); |
| 1542 g_signal_connect(G_OBJECT(entry), "focus-out-event", |
1466 g_signal_connect(G_OBJECT(entry), "focus-out-event", |
| 1543 G_CALLBACK(manual_browser_set), NULL); |
1467 G_CALLBACK(manual_browser_set), NULL); |
| 1544 pidgin_set_accessible_label (entry, label); |
1468 pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("_Manual:\n(%s for URL)"), sg, entry, TRUE, NULL); |
| 1545 |
1469 |
| 1546 gtk_widget_show_all(ret); |
1470 gtk_widget_show_all(ret); |
| 1547 g_object_unref(sg); |
1471 g_object_unref(sg); |
| 1548 return ret; |
1472 return ret; |
| 1549 } |
1473 } |
| 1822 _("No sounds"), "none", |
1746 _("No sounds"), "none", |
| 1823 NULL); |
1747 NULL); |
| 1824 gtk_size_group_add_widget(sg, dd); |
1748 gtk_size_group_add_widget(sg, dd); |
| 1825 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0.5); |
1749 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0.5); |
| 1826 |
1750 |
| 1827 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
|
| 1828 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
|
| 1829 |
|
| 1830 label = gtk_label_new_with_mnemonic(_("Sound c_ommand:\n(%s for filename)")); |
|
| 1831 gtk_size_group_add_widget(sg, label); |
|
| 1832 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
|
| 1833 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
|
| 1834 |
|
| 1835 entry = gtk_entry_new(); |
1751 entry = gtk_entry_new(); |
| 1836 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
1752 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
| 1837 |
|
| 1838 gtk_editable_set_editable(GTK_EDITABLE(entry), TRUE); |
1753 gtk_editable_set_editable(GTK_EDITABLE(entry), TRUE); |
| 1839 cmd = purple_prefs_get_path(PIDGIN_PREFS_ROOT "/sound/command"); |
1754 cmd = purple_prefs_get_path(PIDGIN_PREFS_ROOT "/sound/command"); |
| 1840 if(cmd) |
1755 if(cmd) |
| 1841 gtk_entry_set_text(GTK_ENTRY(entry), cmd); |
1756 gtk_entry_set_text(GTK_ENTRY(entry), cmd); |
| 1842 |
|
| 1843 gtk_box_pack_start(GTK_BOX(hbox), entry, TRUE, TRUE, 0); |
|
| 1844 g_signal_connect(G_OBJECT(entry), "changed", |
1757 g_signal_connect(G_OBJECT(entry), "changed", |
| 1845 G_CALLBACK(sound_cmd_yeah), NULL); |
1758 G_CALLBACK(sound_cmd_yeah), NULL); |
| 1846 |
1759 |
| |
1760 hbox = pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("Sound c_ommand:\n(%s for filename)"), sg, entry, TRUE, NULL); |
| 1847 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/sound/method", |
1761 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/sound/method", |
| 1848 sound_changed1_cb, hbox); |
1762 sound_changed1_cb, hbox); |
| 1849 gtk_widget_set_sensitive(hbox, |
1763 gtk_widget_set_sensitive(hbox, |
| 1850 !strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"), |
1764 !strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"), |
| 1851 "custom")); |
1765 "custom")); |
| 1852 |
|
| 1853 pidgin_set_accessible_label (entry, label); |
|
| 1854 #endif /* _WIN32 */ |
1766 #endif /* _WIN32 */ |
| 1855 |
1767 |
| 1856 vbox = pidgin_make_frame (ret, _("Sound Options")); |
1768 vbox = pidgin_make_frame (ret, _("Sound Options")); |
| 1857 pidgin_prefs_checkbox(_("Sounds when conversation has _focus"), |
1769 pidgin_prefs_checkbox(_("Sounds when conversation has _focus"), |
| 1858 PIDGIN_PREFS_ROOT "/sound/conv_focus", vbox); |
1770 PIDGIN_PREFS_ROOT "/sound/conv_focus", vbox); |
| 2058 _("_Minutes before becoming idle:"), "/purple/away/mins_before_away", |
1969 _("_Minutes before becoming idle:"), "/purple/away/mins_before_away", |
| 2059 1, 24 * 60, sg); |
1970 1, 24 * 60, sg); |
| 2060 g_signal_connect(G_OBJECT(button), "clicked", |
1971 g_signal_connect(G_OBJECT(button), "clicked", |
| 2061 G_CALLBACK(pidgin_toggle_sensitive), select); |
1972 G_CALLBACK(pidgin_toggle_sensitive), select); |
| 2062 |
1973 |
| 2063 hbox = gtk_hbox_new(FALSE, 0); |
1974 /* TODO: Show something useful if we don't have any saved statuses. */ |
| 2064 gtk_container_add(GTK_CONTAINER(vbox), hbox); |
1975 menu = pidgin_status_menu(purple_savedstatus_get_idleaway(), G_CALLBACK(set_idle_away)); |
| 2065 |
1976 pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("Change _status to:"), sg, menu, TRUE, &label); |
| 2066 label = gtk_label_new_with_mnemonic(_("Change _status to:")); |
1977 g_signal_connect(G_OBJECT(button), "clicked", |
| 2067 gtk_size_group_add_widget(sg, label); |
1978 G_CALLBACK(pidgin_toggle_sensitive), menu); |
| 2068 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
|
| 2069 g_signal_connect(G_OBJECT(button), "clicked", |
1979 g_signal_connect(G_OBJECT(button), "clicked", |
| 2070 G_CALLBACK(pidgin_toggle_sensitive), label); |
1980 G_CALLBACK(pidgin_toggle_sensitive), label); |
| 2071 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
|
| 2072 |
|
| 2073 /* TODO: Show something useful if we don't have any saved statuses. */ |
|
| 2074 menu = pidgin_status_menu(purple_savedstatus_get_idleaway(), G_CALLBACK(set_idle_away)); |
|
| 2075 gtk_box_pack_start(GTK_BOX(hbox), menu, FALSE, FALSE, 0); |
|
| 2076 g_signal_connect(G_OBJECT(button), "clicked", |
|
| 2077 G_CALLBACK(pidgin_toggle_sensitive), menu); |
|
| 2078 gtk_label_set_mnemonic_widget(GTK_LABEL(label), menu); |
|
| 2079 |
1981 |
| 2080 if (!purple_prefs_get_bool("/purple/away/away_when_idle")) { |
1982 if (!purple_prefs_get_bool("/purple/away/away_when_idle")) { |
| 2081 gtk_widget_set_sensitive(GTK_WIDGET(menu), FALSE); |
1983 gtk_widget_set_sensitive(GTK_WIDGET(menu), FALSE); |
| 2082 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
1984 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
| 2083 gtk_widget_set_sensitive(GTK_WIDGET(label), FALSE); |
1985 gtk_widget_set_sensitive(GTK_WIDGET(label), FALSE); |
| 2087 vbox = pidgin_make_frame(ret, _("Status at Startup")); |
1989 vbox = pidgin_make_frame(ret, _("Status at Startup")); |
| 2088 |
1990 |
| 2089 button = pidgin_prefs_checkbox(_("Use status from last _exit at startup"), |
1991 button = pidgin_prefs_checkbox(_("Use status from last _exit at startup"), |
| 2090 "/purple/savedstatus/startup_current_status", vbox); |
1992 "/purple/savedstatus/startup_current_status", vbox); |
| 2091 |
1993 |
| 2092 hbox = gtk_hbox_new(FALSE, 0); |
1994 /* TODO: Show something useful if we don't have any saved statuses. */ |
| 2093 gtk_container_add(GTK_CONTAINER(vbox), hbox); |
1995 menu = pidgin_status_menu(purple_savedstatus_get_startup(), G_CALLBACK(set_startupstatus)); |
| 2094 |
1996 g_signal_connect(G_OBJECT(button), "clicked", |
| 2095 label = gtk_label_new_with_mnemonic(_("Status to a_pply at startup:")); |
1997 G_CALLBACK(pidgin_toggle_sensitive), menu); |
| 2096 gtk_size_group_add_widget(sg, label); |
1998 pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("Status to a_pply at startup:"), sg, menu, TRUE, &label); |
| 2097 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
|
| 2098 g_signal_connect(G_OBJECT(button), "clicked", |
1999 g_signal_connect(G_OBJECT(button), "clicked", |
| 2099 G_CALLBACK(pidgin_toggle_sensitive), label); |
2000 G_CALLBACK(pidgin_toggle_sensitive), label); |
| 2100 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
|
| 2101 |
|
| 2102 /* TODO: Show something useful if we don't have any saved statuses. */ |
|
| 2103 menu = pidgin_status_menu(purple_savedstatus_get_startup(), G_CALLBACK(set_startupstatus)); |
|
| 2104 gtk_box_pack_start(GTK_BOX(hbox), menu, FALSE, FALSE, 0); |
|
| 2105 g_signal_connect(G_OBJECT(button), "clicked", |
|
| 2106 G_CALLBACK(pidgin_toggle_sensitive), menu); |
|
| 2107 gtk_label_set_mnemonic_widget(GTK_LABEL(label), menu); |
|
| 2108 |
2001 |
| 2109 if (purple_prefs_get_bool("/purple/savedstatus/startup_current_status")) { |
2002 if (purple_prefs_get_bool("/purple/savedstatus/startup_current_status")) { |
| 2110 gtk_widget_set_sensitive(GTK_WIDGET(menu), FALSE); |
2003 gtk_widget_set_sensitive(GTK_WIDGET(menu), FALSE); |
| 2111 gtk_widget_set_sensitive(GTK_WIDGET(label), FALSE); |
2004 gtk_widget_set_sensitive(GTK_WIDGET(label), FALSE); |
| 2112 } |
2005 } |