comparison src/gtkaccount.c @ 5690:08d20eb262c7

[gaim-migrate @ 6111] Protocol options from one protocol type to another no longer carry over when switching protocols. You couldn't have waited for this, CIA, could you? committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Tue, 03 Jun 2003 06:00:37 +0000
parents 7a619706e048
children b1eb9fc30ff8
comparison
equal deleted inserted replaced
5689:7a619706e048 5690:08d20eb262c7
402 402
403 static void 403 static void
404 __add_protocol_options(AccountPrefsDialog *dialog, GtkWidget *parent) 404 __add_protocol_options(AccountPrefsDialog *dialog, GtkWidget *parent)
405 { 405 {
406 GaimAccountOption *option; 406 GaimAccountOption *option;
407 GaimAccount *account;
407 GtkWidget *frame; 408 GtkWidget *frame;
408 GtkWidget *vbox; 409 GtkWidget *vbox;
409 GtkWidget *check; 410 GtkWidget *check;
410 GtkWidget *entry; 411 GtkWidget *entry;
411 GList *l; 412 GList *l;
424 dialog->prpl_info->protocol_options == NULL) { 425 dialog->prpl_info->protocol_options == NULL) {
425 426
426 return; 427 return;
427 } 428 }
428 429
430 account = dialog->account;
431
429 /* Build the protocol options frame. */ 432 /* Build the protocol options frame. */
430 g_snprintf(buf, sizeof(buf), _("%s Options"), dialog->plugin->info->name); 433 g_snprintf(buf, sizeof(buf), _("%s Options"), dialog->plugin->info->name);
431 434
432 frame = gaim_gtk_make_frame(parent, buf); 435 frame = gaim_gtk_make_frame(parent, buf);
433 dialog->protocol_frame = 436 dialog->protocol_frame =
444 for (l = dialog->prpl_info->protocol_options; l != NULL; l = l->next) { 447 for (l = dialog->prpl_info->protocol_options; l != NULL; l = l->next) {
445 option = (GaimAccountOption *)l->data; 448 option = (GaimAccountOption *)l->data;
446 449
447 switch (gaim_account_option_get_type(option)) { 450 switch (gaim_account_option_get_type(option)) {
448 case GAIM_PREF_BOOLEAN: 451 case GAIM_PREF_BOOLEAN:
449 if (dialog->account == NULL) 452 if (account == NULL ||
453 gaim_account_get_protocol(account) != dialog->protocol) {
454
450 bool_value = gaim_account_option_get_default_bool(option); 455 bool_value = gaim_account_option_get_default_bool(option);
456 }
451 else 457 else
452 bool_value = gaim_account_get_bool(dialog->account, 458 bool_value = gaim_account_get_bool(account,
453 gaim_account_option_get_setting(option), 459 gaim_account_option_get_setting(option),
454 gaim_account_option_get_default_bool(option)); 460 gaim_account_option_get_default_bool(option));
455 461
456 check = gtk_check_button_new_with_label( 462 check = gtk_check_button_new_with_label(
457 gaim_account_option_get_text(option)); 463 gaim_account_option_get_text(option));
462 gtk_box_pack_start(GTK_BOX(vbox), check, FALSE, FALSE, 0); 468 gtk_box_pack_start(GTK_BOX(vbox), check, FALSE, FALSE, 0);
463 gtk_widget_show(check); 469 gtk_widget_show(check);
464 break; 470 break;
465 471
466 case GAIM_PREF_INT: 472 case GAIM_PREF_INT:
467 if (dialog->account == NULL) 473 if (account == NULL ||
474 gaim_account_get_protocol(account) != dialog->protocol) {
475
468 int_value = gaim_account_option_get_default_int(option); 476 int_value = gaim_account_option_get_default_int(option);
477 }
469 else 478 else
470 int_value = gaim_account_get_int(dialog->account, 479 int_value = gaim_account_get_int(account,
471 gaim_account_option_get_setting(option), 480 gaim_account_option_get_setting(option),
472 gaim_account_option_get_default_int(option)); 481 gaim_account_option_get_default_int(option));
473 482
474 g_snprintf(buf, sizeof(buf), "%d", int_value); 483 g_snprintf(buf, sizeof(buf), "%d", int_value);
475 484
483 492
484 g_free(title); 493 g_free(title);
485 break; 494 break;
486 495
487 case GAIM_PREF_STRING: 496 case GAIM_PREF_STRING:
488 if (dialog->account == NULL) 497 if (account == NULL ||
498 gaim_account_get_protocol(account) != dialog->protocol) {
499
489 str_value = gaim_account_option_get_default_string(option); 500 str_value = gaim_account_option_get_default_string(option);
501 }
490 else 502 else
491 str_value = gaim_account_get_string(dialog->account, 503 str_value = gaim_account_get_string(account,
492 gaim_account_option_get_setting(option), 504 gaim_account_option_get_setting(option),
493 gaim_account_option_get_default_string(option)); 505 gaim_account_option_get_default_string(option));
494 506
495 entry = gtk_entry_new(); 507 entry = gtk_entry_new();
496 508