Mercurial > pidgin.yaz
comparison pidgin/gtkprivacy.c @ 32827:4a34689eeb33 default tip
merged from im.pidgin.pidgin
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Sat, 19 Nov 2011 14:42:54 +0900 |
parents | 10e5000326a5 |
children |
comparison
equal
deleted
inserted
replaced
32692:0f94ec89f0bc | 32827:4a34689eeb33 |
---|---|
209 int i; | 209 int i; |
210 | 210 |
211 dialog->account = account; | 211 dialog->account = account; |
212 | 212 |
213 for (i = 0; i < menu_entry_count; i++) { | 213 for (i = 0; i < menu_entry_count; i++) { |
214 if (menu_entries[i].num == account->perm_deny) { | 214 if (menu_entries[i].num == purple_account_get_privacy_type(account)) { |
215 gtk_combo_box_set_active(GTK_COMBO_BOX(dialog->type_menu), i); | 215 gtk_combo_box_set_active(GTK_COMBO_BOX(dialog->type_menu), i); |
216 break; | 216 break; |
217 } | 217 } |
218 } | 218 } |
219 | 219 |
228 static void | 228 static void |
229 type_changed_cb(GtkComboBox *combo, PidginPrivacyDialog *dialog) | 229 type_changed_cb(GtkComboBox *combo, PidginPrivacyDialog *dialog) |
230 { | 230 { |
231 int new_type = menu_entries[gtk_combo_box_get_active(combo)].num; | 231 int new_type = menu_entries[gtk_combo_box_get_active(combo)].num; |
232 | 232 |
233 dialog->account->perm_deny = new_type; | 233 purple_account_set_privacy_type(dialog->account, new_type); |
234 serv_set_permit_deny(purple_account_get_connection(dialog->account)); | 234 serv_set_permit_deny(purple_account_get_connection(dialog->account)); |
235 | 235 |
236 gtk_widget_hide(dialog->allow_widget); | 236 gtk_widget_hide(dialog->allow_widget); |
237 gtk_widget_hide(dialog->block_widget); | 237 gtk_widget_hide(dialog->block_widget); |
238 gtk_widget_hide_all(dialog->button_box); | 238 gtk_widget_hide_all(dialog->button_box); |
369 | 369 |
370 for (i = 0; i < menu_entry_count; i++) { | 370 for (i = 0; i < menu_entry_count; i++) { |
371 gtk_combo_box_append_text(GTK_COMBO_BOX(dialog->type_menu), | 371 gtk_combo_box_append_text(GTK_COMBO_BOX(dialog->type_menu), |
372 _(menu_entries[i].text)); | 372 _(menu_entries[i].text)); |
373 | 373 |
374 if (menu_entries[i].num == dialog->account->perm_deny) | 374 if (menu_entries[i].num == purple_account_get_privacy_type(dialog->account)) |
375 selected = i; | 375 selected = i; |
376 } | 376 } |
377 | 377 |
378 gtk_combo_box_set_active(GTK_COMBO_BOX(dialog->type_menu), selected); | 378 gtk_combo_box_set_active(GTK_COMBO_BOX(dialog->type_menu), selected); |
379 | 379 |
409 button = pidgin_dialog_add_button(GTK_DIALOG(dialog->win), GTK_STOCK_CLOSE, G_CALLBACK(close_cb), dialog); | 409 button = pidgin_dialog_add_button(GTK_DIALOG(dialog->win), GTK_STOCK_CLOSE, G_CALLBACK(close_cb), dialog); |
410 dialog->close_button = button; | 410 dialog->close_button = button; |
411 | 411 |
412 type_changed_cb(GTK_COMBO_BOX(dialog->type_menu), dialog); | 412 type_changed_cb(GTK_COMBO_BOX(dialog->type_menu), dialog); |
413 #if 0 | 413 #if 0 |
414 if (dialog->account->perm_deny == PURPLE_PRIVACY_ALLOW_USERS) { | 414 if (purple_account_get_privacy_type(dialog->account) == PURPLE_PRIVACY_ALLOW_USERS) { |
415 gtk_widget_show(dialog->allow_widget); | 415 gtk_widget_show(dialog->allow_widget); |
416 gtk_widget_show(dialog->button_box); | 416 gtk_widget_show(dialog->button_box); |
417 dialog->in_allow_list = TRUE; | 417 dialog->in_allow_list = TRUE; |
418 } | 418 } |
419 else if (dialog->account->perm_deny == PURPLE_PRIVACY_DENY_USERS) { | 419 else if (purple_account_get_privacy_type(dialog->account) == PURPLE_PRIVACY_DENY_USERS) { |
420 gtk_widget_show(dialog->block_widget); | 420 gtk_widget_show(dialog->block_widget); |
421 gtk_widget_show(dialog->button_box); | 421 gtk_widget_show(dialog->button_box); |
422 dialog->in_allow_list = FALSE; | 422 dialog->in_allow_list = FALSE; |
423 } | 423 } |
424 #endif | 424 #endif |