pidgin/gtkroomlist.c

changeset 40534
8dad2981fb86
parent 40496
6941fece679b
child 40898
06e5a2a8f49a
equal deleted inserted replaced
40533:b1921b17b683 40534:8dad2981fb86
108 108
109 return FALSE; 109 return FALSE;
110 } 110 }
111 111
112 static void 112 static void
113 dialog_select_account_cb(GtkWidget *chooser, PidginRoomlistDialog *dialog) 113 dialog_select_account_cb(GtkWidget *w, PidginRoomlistDialog *dialog) {
114 { 114 PidginAccountChooser *chooser = PIDGIN_ACCOUNT_CHOOSER(w);
115 PurpleAccount *account = pidgin_account_chooser_get_selected(chooser); 115 PurpleAccount *account = pidgin_account_chooser_get_selected(chooser);
116 gboolean change = (account != dialog->account); 116 gboolean change = (account != dialog->account);
117 dialog->account = account; 117 dialog->account = account;
118 118
119 if (change && dialog->roomlist) { 119 if (change && dialog->roomlist) {
564 } 564 }
565 565
566 static PidginRoomlistDialog * 566 static PidginRoomlistDialog *
567 pidgin_roomlist_dialog_new_with_account(PurpleAccount *account) 567 pidgin_roomlist_dialog_new_with_account(PurpleAccount *account)
568 { 568 {
569 PidginRoomlistDialog *dialog; 569 PidginRoomlistDialog *dialog = NULL;
570 PidginAccountChooser *chooser = NULL;
570 571
571 dialog = g_object_new(PIDGIN_TYPE_ROOMLIST_DIALOG, NULL); 572 dialog = g_object_new(PIDGIN_TYPE_ROOMLIST_DIALOG, NULL);
572 dialog->account = account; 573 dialog->account = account;
574
575 chooser = PIDGIN_ACCOUNT_CHOOSER(dialog->account_widget);
573 576
574 if (!account) { 577 if (!account) {
575 /* This is normally NULL, and we normally don't care what the 578 /* This is normally NULL, and we normally don't care what the
576 * first selected item is */ 579 * first selected item is */
577 dialog->account = pidgin_account_chooser_get_selected( 580 dialog->account = pidgin_account_chooser_get_selected(chooser);
578 dialog->account_widget);
579 } else { 581 } else {
580 pidgin_account_chooser_set_selected(dialog->account_widget, 582 pidgin_account_chooser_set_selected(chooser, account);
581 account);
582 } 583 }
583 584
584 /* show the dialog window and return the dialog */ 585 /* show the dialog window and return the dialog */
585 gtk_widget_show(GTK_WIDGET(dialog)); 586 gtk_widget_show(GTK_WIDGET(dialog));
586 587

mercurial