pidgin/gtkaccount.c

branch
soc.2013.gobjectification.plugins
changeset 36725
f17f9d4e710e
parent 36719
0d7682bdf828
child 36782
64936dae41a3
equal deleted inserted replaced
36724:41150570364f 36725:f17f9d4e710e
253 add_protocol_options(dialog); 253 add_protocol_options(dialog);
254 add_voice_options(dialog); 254 add_voice_options(dialog);
255 255
256 gtk_widget_grab_focus(dialog->protocol_menu); 256 gtk_widget_grab_focus(dialog->protocol_menu);
257 257
258 if (!dialog->protocol || !PURPLE_PROTOCOL_IMPLEMENTS(dialog->protocol, register_user)) { 258 if (!dialog->protocol || !PURPLE_PROTOCOL_IMPLEMENTS(dialog->protocol, SERVER_IFACE, register_user)) {
259 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( 259 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(
260 dialog->register_button), FALSE); 260 dialog->register_button), FALSE);
261 gtk_widget_hide(dialog->register_button); 261 gtk_widget_hide(dialog->register_button);
262 } else { 262 } else {
263 if (dialog->protocol != NULL && 263 if (dialog->protocol != NULL &&
305 { 305 {
306 GHashTable *table; 306 GHashTable *table;
307 const char *label; 307 const char *label;
308 308
309 if (!dialog->protocol || ! PURPLE_PROTOCOL_IMPLEMENTS( 309 if (!dialog->protocol || ! PURPLE_PROTOCOL_IMPLEMENTS(
310 dialog->protocol, get_account_text_table)) { 310 dialog->protocol, CLIENT_IFACE, get_account_text_table)) {
311 return FALSE; 311 return FALSE;
312 } 312 }
313 313
314 table = purple_protocol_client_iface_get_account_text_table(dialog->protocol, NULL); 314 table = purple_protocol_client_iface_get_account_text_table(dialog->protocol, NULL);
315 label = g_hash_table_lookup(table, "login_label"); 315 label = g_hash_table_lookup(table, "login_label");
332 username_nofocus_cb(GtkWidget *widget, GdkEventFocus *event, AccountPrefsDialog *dialog) 332 username_nofocus_cb(GtkWidget *widget, GdkEventFocus *event, AccountPrefsDialog *dialog)
333 { 333 {
334 GHashTable *table = NULL; 334 GHashTable *table = NULL;
335 const char *label = NULL; 335 const char *label = NULL;
336 336
337 if(PURPLE_PROTOCOL_IMPLEMENTS(dialog->protocol, get_account_text_table)) { 337 if(PURPLE_PROTOCOL_IMPLEMENTS(dialog->protocol, CLIENT_IFACE, get_account_text_table)) {
338 table = purple_protocol_client_iface_get_account_text_table(dialog->protocol, NULL); 338 table = purple_protocol_client_iface_get_account_text_table(dialog->protocol, NULL);
339 label = g_hash_table_lookup(table, "login_label"); 339 label = g_hash_table_lookup(table, "login_label");
340 340
341 if (*gtk_entry_get_text(GTK_ENTRY(widget)) == '\0') { 341 if (*gtk_entry_get_text(GTK_ENTRY(widget)) == '\0') {
342 /* We have to avoid hitting the username_changed_cb function 342 /* We have to avoid hitting the username_changed_cb function
624 624
625 if (dialog->account != NULL) 625 if (dialog->account != NULL)
626 username = g_strdup(purple_account_get_username(dialog->account)); 626 username = g_strdup(purple_account_get_username(dialog->account));
627 627
628 if (!username && dialog->protocol 628 if (!username && dialog->protocol
629 && PURPLE_PROTOCOL_IMPLEMENTS(dialog->protocol, get_account_text_table)) { 629 && PURPLE_PROTOCOL_IMPLEMENTS(dialog->protocol, CLIENT_IFACE, get_account_text_table)) {
630 GHashTable *table; 630 GHashTable *table;
631 const char *label; 631 const char *label;
632 table = purple_protocol_client_iface_get_account_text_table(dialog->protocol, NULL); 632 table = purple_protocol_client_iface_get_account_text_table(dialog->protocol, NULL);
633 label = g_hash_table_lookup(table, "login_label"); 633 label = g_hash_table_lookup(table, "login_label");
634 634
1324 1324
1325 static void 1325 static void
1326 add_voice_options(AccountPrefsDialog *dialog) 1326 add_voice_options(AccountPrefsDialog *dialog)
1327 { 1327 {
1328 #ifdef USE_VV 1328 #ifdef USE_VV
1329 if (!dialog->protocol || !PURPLE_PROTOCOL_IMPLEMENTS(dialog->protocol, initiate_media)) { 1329 if (!dialog->protocol || !PURPLE_PROTOCOL_IMPLEMENTS(dialog->protocol, MEDIA_IFACE, initiate_session)) {
1330 if (dialog->voice_frame) { 1330 if (dialog->voice_frame) {
1331 gtk_widget_destroy(dialog->voice_frame); 1331 gtk_widget_destroy(dialog->voice_frame);
1332 dialog->voice_frame = NULL; 1332 dialog->voice_frame = NULL;
1333 dialog->suppression_check = NULL; 1333 dialog->suppression_check = NULL;
1334 } 1334 }
1784 dialog->register_button = button; 1784 dialog->register_button = button;
1785 g_signal_connect(G_OBJECT(dialog->register_button), "toggled", G_CALLBACK(register_button_cb), dialog); 1785 g_signal_connect(G_OBJECT(dialog->register_button), "toggled", G_CALLBACK(register_button_cb), dialog);
1786 if (dialog->account == NULL) 1786 if (dialog->account == NULL)
1787 gtk_widget_set_sensitive(button, FALSE); 1787 gtk_widget_set_sensitive(button, FALSE);
1788 1788
1789 if (!dialog->protocol || !PURPLE_PROTOCOL_IMPLEMENTS(dialog->protocol, register_user)) 1789 if (!dialog->protocol || !PURPLE_PROTOCOL_IMPLEMENTS(dialog->protocol, SERVER_IFACE, register_user))
1790 gtk_widget_hide(button); 1790 gtk_widget_hide(button);
1791 1791
1792 /* Setup the page with 'Advanced' (protocol options). */ 1792 /* Setup the page with 'Advanced' (protocol options). */
1793 add_protocol_options(dialog); 1793 add_protocol_options(dialog);
1794 1794

mercurial