| 1507 gtk_widget_set_sensitive(button, FALSE); |
1506 gtk_widget_set_sensitive(button, FALSE); |
| 1508 |
1507 |
| 1509 if (!dialog->prpl_info || !dialog->prpl_info->register_user) |
1508 if (!dialog->prpl_info || !dialog->prpl_info->register_user) |
| 1510 gtk_widget_hide(button); |
1509 gtk_widget_hide(button); |
| 1511 |
1510 |
| 1512 |
|
| 1513 |
|
| 1514 /* Setup the page with 'Advanced'. */ |
1511 /* Setup the page with 'Advanced'. */ |
| 1515 dialog->bottom_vbox = dbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BORDER); |
1512 dialog->bottom_vbox = dbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BORDER); |
| 1516 gtk_container_set_border_width(GTK_CONTAINER(dbox), PIDGIN_HIG_BORDER); |
1513 gtk_container_set_border_width(GTK_CONTAINER(dbox), PIDGIN_HIG_BORDER); |
| 1517 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), dbox, |
1514 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), dbox, |
| 1518 gtk_label_new_with_mnemonic(_("_Advanced"))); |
1515 gtk_label_new_with_mnemonic(_("_Advanced"))); |
| 1520 |
1517 |
| 1521 /** Setup the bottom frames. */ |
1518 /** Setup the bottom frames. */ |
| 1522 add_protocol_options(dialog, dbox); |
1519 add_protocol_options(dialog, dbox); |
| 1523 add_proxy_options(dialog, dbox); |
1520 add_proxy_options(dialog, dbox); |
| 1524 |
1521 |
| 1525 /* Setup the button box */ |
|
| 1526 bbox = pidgin_dialog_get_action_area(GTK_DIALOG(win)); |
|
| 1527 gtk_box_set_spacing(GTK_BOX(bbox), PIDGIN_HIG_BOX_SPACE); |
|
| 1528 gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END); |
|
| 1529 |
|
| 1530 /* Cancel button */ |
1522 /* Cancel button */ |
| 1531 button = gtk_button_new_from_stock(GTK_STOCK_CANCEL); |
1523 pidgin_dialog_add_button(GTK_DIALOG(win), GTK_STOCK_CANCEL, G_CALLBACK(cancel_account_prefs_cb), dialog); |
| 1532 gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 0); |
|
| 1533 gtk_widget_show(button); |
|
| 1534 |
|
| 1535 g_signal_connect(G_OBJECT(button), "clicked", |
|
| 1536 G_CALLBACK(cancel_account_prefs_cb), dialog); |
|
| 1537 |
1524 |
| 1538 /* Save button */ |
1525 /* Save button */ |
| 1539 button = gtk_button_new_from_stock(GTK_STOCK_SAVE); |
1526 button = pidgin_dialog_add_button(GTK_DIALOG(win), GTK_STOCK_SAVE, G_CALLBACK(ok_account_prefs_cb), dialog); |
| 1540 gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 0); |
|
| 1541 |
|
| 1542 if (dialog->account == NULL) |
1527 if (dialog->account == NULL) |
| 1543 gtk_widget_set_sensitive(button, FALSE); |
1528 gtk_widget_set_sensitive(button, FALSE); |
| 1544 |
|
| 1545 gtk_widget_show(button); |
|
| 1546 |
|
| 1547 dialog->ok_button = button; |
1529 dialog->ok_button = button; |
| 1548 |
1530 |
| 1549 /* Set up DND */ |
1531 /* Set up DND */ |
| 1550 gtk_drag_dest_set(dialog->window, |
1532 gtk_drag_dest_set(dialog->window, |
| 1551 GTK_DEST_DEFAULT_MOTION | |
1533 GTK_DEST_DEFAULT_MOTION | |
| 1554 sizeof(dnd_targets) / sizeof(GtkTargetEntry), |
1536 sizeof(dnd_targets) / sizeof(GtkTargetEntry), |
| 1555 GDK_ACTION_COPY); |
1537 GDK_ACTION_COPY); |
| 1556 |
1538 |
| 1557 g_signal_connect(G_OBJECT(dialog->window), "drag_data_received", |
1539 g_signal_connect(G_OBJECT(dialog->window), "drag_data_received", |
| 1558 G_CALLBACK(account_dnd_recv), dialog); |
1540 G_CALLBACK(account_dnd_recv), dialog); |
| 1559 |
|
| 1560 g_signal_connect(G_OBJECT(button), "clicked", |
|
| 1561 G_CALLBACK(ok_account_prefs_cb), dialog); |
|
| 1562 |
1541 |
| 1563 /* Show the window. */ |
1542 /* Show the window. */ |
| 1564 gtk_widget_show(win); |
1543 gtk_widget_show(win); |
| 1565 } |
1544 } |
| 1566 |
1545 |
| 2338 /* Setup the scrolled window that will contain the list of accounts. */ |
2316 /* Setup the scrolled window that will contain the list of accounts. */ |
| 2339 sw = create_accounts_list(dialog); |
2317 sw = create_accounts_list(dialog); |
| 2340 gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0); |
2318 gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0); |
| 2341 gtk_widget_show(sw); |
2319 gtk_widget_show(sw); |
| 2342 |
2320 |
| 2343 /* Button box. */ |
|
| 2344 bbox = pidgin_dialog_get_action_area(GTK_DIALOG(win)); |
|
| 2345 gtk_box_set_spacing(GTK_BOX(bbox), PIDGIN_HIG_BOX_SPACE); |
|
| 2346 gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END); |
|
| 2347 |
|
| 2348 /* Add button */ |
2321 /* Add button */ |
| 2349 button = gtk_button_new_from_stock(GTK_STOCK_ADD); |
2322 pidgin_dialog_add_button(GTK_DIALOG(win), GTK_STOCK_ADD, G_CALLBACK(add_account_cb), dialog); |
| 2350 gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 0); |
|
| 2351 gtk_widget_show(button); |
|
| 2352 |
|
| 2353 g_signal_connect(G_OBJECT(button), "clicked", |
|
| 2354 G_CALLBACK(add_account_cb), dialog); |
|
| 2355 |
2323 |
| 2356 /* Modify button */ |
2324 /* Modify button */ |
| 2357 button = gtk_button_new_from_stock(PIDGIN_STOCK_MODIFY); |
2325 button = pidgin_dialog_add_button(GTK_DIALOG(win), PIDGIN_STOCK_MODIFY, G_CALLBACK(modify_account_cb), dialog); |
| 2358 dialog->modify_button = button; |
2326 dialog->modify_button = button; |
| 2359 gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 0); |
|
| 2360 gtk_widget_set_sensitive(button, FALSE); |
2327 gtk_widget_set_sensitive(button, FALSE); |
| 2361 gtk_widget_show(button); |
|
| 2362 |
|
| 2363 g_signal_connect(G_OBJECT(button), "clicked", |
|
| 2364 G_CALLBACK(modify_account_cb), dialog); |
|
| 2365 |
2328 |
| 2366 /* Delete button */ |
2329 /* Delete button */ |
| 2367 button = gtk_button_new_from_stock(GTK_STOCK_DELETE); |
2330 button = pidgin_dialog_add_button(GTK_DIALOG(win), GTK_STOCK_DELETE, G_CALLBACK(ask_delete_account_cb), dialog); |
| 2368 dialog->delete_button = button; |
2331 dialog->delete_button = button; |
| 2369 gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 0); |
|
| 2370 gtk_widget_set_sensitive(button, FALSE); |
2332 gtk_widget_set_sensitive(button, FALSE); |
| 2371 gtk_widget_show(button); |
|
| 2372 |
|
| 2373 g_signal_connect(G_OBJECT(button), "clicked", |
|
| 2374 G_CALLBACK(ask_delete_account_cb), dialog); |
|
| 2375 |
2333 |
| 2376 /* Close button */ |
2334 /* Close button */ |
| 2377 button = gtk_button_new_from_stock(GTK_STOCK_CLOSE); |
2335 pidgin_dialog_add_button(GTK_DIALOG(win), GTK_STOCK_CLOSE, G_CALLBACK(close_accounts_cb), dialog); |
| 2378 gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 0); |
|
| 2379 gtk_widget_show(button); |
|
| 2380 |
|
| 2381 g_signal_connect(G_OBJECT(button), "clicked", |
|
| 2382 G_CALLBACK(close_accounts_cb), dialog); |
|
| 2383 |
2336 |
| 2384 purple_signal_connect(pidgin_account_get_handle(), "account-modified", |
2337 purple_signal_connect(pidgin_account_get_handle(), "account-modified", |
| 2385 accounts_window, |
2338 accounts_window, |
| 2386 PURPLE_CALLBACK(account_modified_cb), accounts_window); |
2339 PURPLE_CALLBACK(account_modified_cb), accounts_window); |
| 2387 purple_prefs_connect_callback(accounts_window, |
2340 purple_prefs_connect_callback(accounts_window, |