Mercurial > pidgin
comparison src/dialogs.c @ 1499:de0b946e86a4
[gaim-migrate @ 1509]
woohoo, i'm back.
committer: Tailor Script <tailor@pidgin.im>
| author | Eric Warmenhoven <eric@warmenhoven.org> |
|---|---|
| date | Fri, 23 Feb 2001 23:58:35 +0000 |
| parents | 55246babdeb3 |
| children | 1e2cc8c8bf3c |
comparison
equal
deleted
inserted
replaced
| 1498:0ef6603d986e | 1499:de0b946e86a4 |
|---|---|
| 169 GtkWidget *save; | 169 GtkWidget *save; |
| 170 GtkWidget *cancel; | 170 GtkWidget *cancel; |
| 171 }; | 171 }; |
| 172 | 172 |
| 173 struct set_dir_dlg { | 173 struct set_dir_dlg { |
| 174 struct gaim_connection *gc; | |
| 174 GtkWidget *window; | 175 GtkWidget *window; |
| 175 GtkWidget *first; | 176 GtkWidget *first; |
| 176 GtkWidget *middle; | 177 GtkWidget *middle; |
| 177 GtkWidget *last; | 178 GtkWidget *last; |
| 178 GtkWidget *maiden; | 179 GtkWidget *maiden; |
| 1284 char *maiden = gtk_entry_get_text(GTK_ENTRY(b->maiden)); | 1285 char *maiden = gtk_entry_get_text(GTK_ENTRY(b->maiden)); |
| 1285 char *city = gtk_entry_get_text(GTK_ENTRY(b->city)); | 1286 char *city = gtk_entry_get_text(GTK_ENTRY(b->city)); |
| 1286 char *state = gtk_entry_get_text(GTK_ENTRY(b->state)); | 1287 char *state = gtk_entry_get_text(GTK_ENTRY(b->state)); |
| 1287 char *country = gtk_entry_get_text(GTK_ENTRY(b->country)); | 1288 char *country = gtk_entry_get_text(GTK_ENTRY(b->country)); |
| 1288 | 1289 |
| 1289 | 1290 serv_set_dir(b->gc, first, middle, last, maiden, city, state, country, web); |
| 1290 /* FIXME : set dir. not important */ | |
| 1291 if (connections) | |
| 1292 serv_set_dir(connections->data, first, middle, last, maiden, city, state, country, web); | |
| 1293 | 1291 |
| 1294 destroy_dialog(NULL, b->window); | 1292 destroy_dialog(NULL, b->window); |
| 1295 g_free(b); | 1293 g_free(b); |
| 1296 } | 1294 } |
| 1297 | 1295 |
| 1298 void show_set_dir() | 1296 void show_set_dir(struct gaim_connection *gc) |
| 1299 { | 1297 { |
| 1300 GtkWidget *label; | 1298 GtkWidget *label; |
| 1301 GtkWidget *bot; | 1299 GtkWidget *bot; |
| 1302 GtkWidget *vbox; | 1300 GtkWidget *vbox; |
| 1303 GtkWidget *hbox; | 1301 GtkWidget *hbox; |
| 1304 GtkWidget *frame; | 1302 GtkWidget *frame; |
| 1305 GtkWidget *fbox; | 1303 GtkWidget *fbox; |
| 1304 char buf[256]; | |
| 1306 | 1305 |
| 1307 struct set_dir_dlg *b = g_new0(struct set_dir_dlg, 1); | 1306 struct set_dir_dlg *b = g_new0(struct set_dir_dlg, 1); |
| 1307 if (!g_slist_find(connections, gc)) | |
| 1308 gc = connections->data; | |
| 1309 b->gc = gc; | |
| 1308 | 1310 |
| 1309 b->window = gtk_window_new(GTK_WINDOW_DIALOG); | 1311 b->window = gtk_window_new(GTK_WINDOW_DIALOG); |
| 1310 //gtk_widget_set_usize(b->window, 300, 300); | 1312 dialogwindows = g_list_prepend(dialogwindows, b->window); |
| 1311 gtk_window_set_wmclass(GTK_WINDOW(b->window), "set_dir", "Gaim"); | 1313 gtk_window_set_wmclass(GTK_WINDOW(b->window), "set_dir", "Gaim"); |
| 1312 gtk_window_set_policy(GTK_WINDOW(b->window), FALSE, TRUE, TRUE); | 1314 gtk_window_set_policy(GTK_WINDOW(b->window), FALSE, TRUE, TRUE); |
| 1313 gtk_widget_show(b->window); | 1315 gtk_window_set_title(GTK_WINDOW(b->window), _("Gaim - Set Dir Info")); |
| 1314 | 1316 gtk_signal_connect(GTK_OBJECT(b->window), "destroy", |
| 1315 dialogwindows = g_list_prepend(dialogwindows, b->window); | 1317 GTK_SIGNAL_FUNC(destroy_dialog), b->window); |
| 1318 gtk_widget_realize(b->window); | |
| 1319 aol_icon(b->window->window); | |
| 1320 | |
| 1321 fbox = gtk_vbox_new(FALSE, 5); | |
| 1322 gtk_container_add(GTK_CONTAINER(b->window), fbox); | |
| 1323 gtk_widget_show(fbox); | |
| 1324 | |
| 1325 frame = gtk_frame_new(_("Directory Info")); | |
| 1326 gtk_container_set_border_width(GTK_CONTAINER(fbox), 5); | |
| 1327 gtk_box_pack_start(GTK_BOX(fbox), frame, FALSE, FALSE, 0); | |
| 1328 gtk_widget_show(frame); | |
| 1316 | 1329 |
| 1317 vbox = gtk_vbox_new(FALSE, 5); | 1330 vbox = gtk_vbox_new(FALSE, 5); |
| 1318 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); | 1331 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); |
| 1319 | 1332 gtk_container_add(GTK_CONTAINER(frame), vbox); |
| 1320 frame = gtk_frame_new(_("Directory Info")); | 1333 gtk_widget_show(vbox); |
| 1321 fbox = gtk_vbox_new(FALSE, 5); | 1334 |
| 1322 gtk_container_set_border_width(GTK_CONTAINER(fbox), 5); | 1335 g_snprintf(buf, sizeof(buf), "Setting Dir Info for %s:", gc->username); |
| 1323 | 1336 label = gtk_label_new(buf); |
| 1324 /* Build Save Button */ | 1337 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5); |
| 1325 | 1338 gtk_widget_show(label); |
| 1326 b->save = picture_button(b->window, _("Save"), save_xpm); | |
| 1327 b->cancel = picture_button(b->window, _("Cancel"), cancel_xpm); | |
| 1328 | |
| 1329 bot = gtk_hbox_new(FALSE, 5); | |
| 1330 | |
| 1331 gtk_box_pack_end(GTK_BOX(bot), b->cancel, FALSE, FALSE, 0); | |
| 1332 gtk_box_pack_end(GTK_BOX(bot), b->save, FALSE, FALSE, 0); | |
| 1333 | |
| 1334 gtk_widget_show(bot); | |
| 1335 | 1339 |
| 1336 b->first = gtk_entry_new(); | 1340 b->first = gtk_entry_new(); |
| 1337 b->middle = gtk_entry_new(); | 1341 b->middle = gtk_entry_new(); |
| 1338 b->last = gtk_entry_new(); | 1342 b->last = gtk_entry_new(); |
| 1339 b->maiden = gtk_entry_new(); | 1343 b->maiden = gtk_entry_new(); |
| 1425 hbox = gtk_hbox_new(FALSE, 5); | 1429 hbox = gtk_hbox_new(FALSE, 5); |
| 1426 gtk_box_pack_start(GTK_BOX(hbox), b->web, TRUE, TRUE, 0); | 1430 gtk_box_pack_start(GTK_BOX(hbox), b->web, TRUE, TRUE, 0); |
| 1427 gtk_widget_show(hbox); | 1431 gtk_widget_show(hbox); |
| 1428 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | 1432 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
| 1429 | 1433 |
| 1430 /* And add the buttons */ | |
| 1431 gtk_container_add(GTK_CONTAINER(frame), vbox); | |
| 1432 gtk_box_pack_start(GTK_BOX(fbox), frame, FALSE, FALSE, 0); | |
| 1433 gtk_box_pack_start(GTK_BOX(fbox), bot, FALSE, FALSE, 0); | |
| 1434 | |
| 1435 | |
| 1436 gtk_widget_show(vbox); | |
| 1437 gtk_widget_show(fbox); | |
| 1438 | |
| 1439 gtk_widget_show(frame); | |
| 1440 gtk_widget_show(b->first); | 1434 gtk_widget_show(b->first); |
| 1441 gtk_widget_show(b->middle); | 1435 gtk_widget_show(b->middle); |
| 1442 gtk_widget_show(b->last); | 1436 gtk_widget_show(b->last); |
| 1443 gtk_widget_show(b->maiden); | 1437 gtk_widget_show(b->maiden); |
| 1444 gtk_widget_show(b->city); | 1438 gtk_widget_show(b->city); |
| 1445 gtk_widget_show(b->state); | 1439 gtk_widget_show(b->state); |
| 1446 gtk_widget_show(b->country); | 1440 gtk_widget_show(b->country); |
| 1447 gtk_widget_show(b->web); | 1441 gtk_widget_show(b->web); |
| 1448 | 1442 |
| 1449 gtk_signal_connect(GTK_OBJECT(b->window), "destroy", | 1443 /* And add the buttons */ |
| 1450 GTK_SIGNAL_FUNC(destroy_dialog), b->window); | 1444 |
| 1445 bot = gtk_hbox_new(FALSE, 5); | |
| 1446 gtk_box_pack_start(GTK_BOX(fbox), bot, FALSE, FALSE, 0); | |
| 1447 gtk_widget_show(bot); | |
| 1448 | |
| 1449 b->cancel = picture_button(b->window, _("Cancel"), cancel_xpm); | |
| 1450 gtk_box_pack_end(GTK_BOX(bot), b->cancel, FALSE, FALSE, 0); | |
| 1451 gtk_signal_connect(GTK_OBJECT(b->cancel), "clicked", | 1451 gtk_signal_connect(GTK_OBJECT(b->cancel), "clicked", |
| 1452 GTK_SIGNAL_FUNC(destroy_dialog), b->window); | 1452 GTK_SIGNAL_FUNC(destroy_dialog), b->window); |
| 1453 | |
| 1454 b->save = picture_button(b->window, _("Save"), save_xpm); | |
| 1455 gtk_box_pack_end(GTK_BOX(bot), b->save, FALSE, FALSE, 0); | |
| 1453 gtk_signal_connect(GTK_OBJECT(b->save), "clicked", GTK_SIGNAL_FUNC(do_set_dir), b); | 1456 gtk_signal_connect(GTK_OBJECT(b->save), "clicked", GTK_SIGNAL_FUNC(do_set_dir), b); |
| 1454 | 1457 |
| 1455 gtk_container_add(GTK_CONTAINER(b->window), fbox); | |
| 1456 | |
| 1457 gtk_window_set_title(GTK_WINDOW(b->window), _("Gaim - Set Dir Info")); | |
| 1458 gtk_window_set_focus(GTK_WINDOW(b->window), b->first); | 1458 gtk_window_set_focus(GTK_WINDOW(b->window), b->first); |
| 1459 gtk_widget_realize(b->window); | |
| 1460 aol_icon(b->window->window); | |
| 1461 | 1459 |
| 1462 gtk_widget_show(b->window); | 1460 gtk_widget_show(b->window); |
| 1463 } | 1461 } |
| 1464 | 1462 |
| 1465 void do_change_password(GtkWidget *widget, struct passwddlg *b) | 1463 void do_change_password(GtkWidget *widget, struct passwddlg *b) |
| 1484 | 1482 |
| 1485 destroy_dialog(NULL, b->window); | 1483 destroy_dialog(NULL, b->window); |
| 1486 g_free(b); | 1484 g_free(b); |
| 1487 } | 1485 } |
| 1488 | 1486 |
| 1489 static void pwd_choose(GtkObject *obj, struct passwddlg *pwd) | 1487 void show_change_passwd(struct gaim_connection *gc) |
| 1490 { | |
| 1491 pwd->gc = (struct gaim_connection *)gtk_object_get_user_data(obj); | |
| 1492 } | |
| 1493 | |
| 1494 static void passwd_multi_menu(GtkWidget *box, struct passwddlg *pwd) | |
| 1495 { | |
| 1496 GtkWidget *hbox; | |
| 1497 GtkWidget *label; | |
| 1498 GtkWidget *optmenu; | |
| 1499 GtkWidget *menu; | |
| 1500 GtkWidget *opt; | |
| 1501 GSList *c = connections; | |
| 1502 struct gaim_connection *g; | |
| 1503 | |
| 1504 hbox = gtk_hbox_new(FALSE, 5); | |
| 1505 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0); | |
| 1506 gtk_widget_show(hbox); | |
| 1507 | |
| 1508 label = gtk_label_new(_("Change password for:")); | |
| 1509 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
| 1510 gtk_widget_show(label); | |
| 1511 | |
| 1512 optmenu = gtk_option_menu_new(); | |
| 1513 gtk_box_pack_end(GTK_BOX(hbox), optmenu, FALSE, FALSE, 0); | |
| 1514 gtk_widget_show(optmenu); | |
| 1515 | |
| 1516 menu = gtk_menu_new(); | |
| 1517 | |
| 1518 while (c) { | |
| 1519 g = (struct gaim_connection *)c->data; | |
| 1520 opt = gtk_menu_item_new_with_label(g->username); | |
| 1521 gtk_object_set_user_data(GTK_OBJECT(opt), g); | |
| 1522 gtk_signal_connect(GTK_OBJECT(opt), "activate", GTK_SIGNAL_FUNC(pwd_choose), pwd); | |
| 1523 gtk_menu_append(GTK_MENU(menu), opt); | |
| 1524 gtk_widget_show(opt); | |
| 1525 c = c->next; | |
| 1526 } | |
| 1527 | |
| 1528 gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu), menu); | |
| 1529 gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu), 0); | |
| 1530 | |
| 1531 pwd->gc = (struct gaim_connection *)connections->data; | |
| 1532 } | |
| 1533 | |
| 1534 void show_change_passwd() | |
| 1535 { | 1488 { |
| 1536 GtkWidget *hbox; | 1489 GtkWidget *hbox; |
| 1537 GtkWidget *label; | 1490 GtkWidget *label; |
| 1538 GtkWidget *vbox; | 1491 GtkWidget *vbox; |
| 1539 GtkWidget *fbox; | 1492 GtkWidget *fbox; |
| 1540 GtkWidget *frame; | 1493 GtkWidget *frame; |
| 1494 char buf[256]; | |
| 1541 | 1495 |
| 1542 struct passwddlg *b = g_new0(struct passwddlg, 1); | 1496 struct passwddlg *b = g_new0(struct passwddlg, 1); |
| 1497 if (!g_slist_find(connections, gc)) | |
| 1498 gc = connections->data; | |
| 1499 b->gc = gc; | |
| 1543 | 1500 |
| 1544 b->window = gtk_window_new(GTK_WINDOW_DIALOG); | 1501 b->window = gtk_window_new(GTK_WINDOW_DIALOG); |
| 1545 gtk_window_set_policy(GTK_WINDOW(b->window), FALSE, TRUE, TRUE); | 1502 gtk_window_set_policy(GTK_WINDOW(b->window), FALSE, TRUE, TRUE); |
| 1546 gtk_window_set_wmclass(GTK_WINDOW(b->window), "change_passwd", "Gaim"); | 1503 gtk_window_set_wmclass(GTK_WINDOW(b->window), "change_passwd", "Gaim"); |
| 1547 gtk_window_set_title(GTK_WINDOW(b->window), _("Gaim - Password Change")); | 1504 gtk_window_set_title(GTK_WINDOW(b->window), _("Gaim - Password Change")); |
| 1563 vbox = gtk_vbox_new(FALSE, 5); | 1520 vbox = gtk_vbox_new(FALSE, 5); |
| 1564 gtk_container_border_width(GTK_CONTAINER(vbox), 5); | 1521 gtk_container_border_width(GTK_CONTAINER(vbox), 5); |
| 1565 gtk_container_add(GTK_CONTAINER(frame), vbox); | 1522 gtk_container_add(GTK_CONTAINER(frame), vbox); |
| 1566 gtk_widget_show(vbox); | 1523 gtk_widget_show(vbox); |
| 1567 | 1524 |
| 1568 #ifndef NO_MULTI | 1525 g_snprintf(buf, sizeof(buf), "Changing password for %s:", gc->username); |
| 1569 passwd_multi_menu(vbox, b); | 1526 label = gtk_label_new(buf); |
| 1570 #else | 1527 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5); |
| 1571 b->gc = connections->data; | 1528 gtk_widget_show(label); |
| 1572 #endif | |
| 1573 | 1529 |
| 1574 /* First Line */ | 1530 /* First Line */ |
| 1575 hbox = gtk_hbox_new(FALSE, 5); | 1531 hbox = gtk_hbox_new(FALSE, 5); |
| 1576 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | 1532 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
| 1577 gtk_widget_show(hbox); | 1533 gtk_widget_show(hbox); |
| 1630 | 1586 |
| 1631 | 1587 |
| 1632 gtk_widget_show(b->window); | 1588 gtk_widget_show(b->window); |
| 1633 } | 1589 } |
| 1634 | 1590 |
| 1635 static void info_choose(GtkWidget *opt, struct set_info_dlg *b) | 1591 void show_set_info(struct gaim_connection *gc) |
| 1636 { | 1592 { |
| 1637 int text_len = gtk_text_get_length(GTK_TEXT(b->text)); | 1593 GtkWidget *buttons; |
| 1638 struct aim_user *u = gtk_object_get_user_data(GTK_OBJECT(opt)); | |
| 1639 gchar *buf = g_malloc(strlen(u->user_info)+1); | |
| 1640 b->user = u; | |
| 1641 | |
| 1642 strncpy_nohtml(buf, u->user_info, strlen(u->user_info)+1); | |
| 1643 | |
| 1644 gtk_text_set_point(GTK_TEXT(b->text), 0); | |
| 1645 gtk_text_forward_delete(GTK_TEXT(b->text), text_len); | |
| 1646 gtk_text_insert(GTK_TEXT(b->text), NULL, NULL, NULL, buf, -1); | |
| 1647 | |
| 1648 g_free(buf); | |
| 1649 } | |
| 1650 | |
| 1651 static void info_user_menu(struct set_info_dlg *b, GtkWidget *box) | |
| 1652 { | |
| 1653 GtkWidget *hbox; | |
| 1654 GtkWidget *label; | 1594 GtkWidget *label; |
| 1655 GtkWidget *optmenu; | |
| 1656 GtkWidget *menu; | |
| 1657 GtkWidget *opt; | |
| 1658 GList *u = aim_users; | |
| 1659 struct aim_user *a; | |
| 1660 | |
| 1661 hbox = gtk_hbox_new(FALSE, 5); | |
| 1662 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0); | |
| 1663 gtk_widget_show(hbox); | |
| 1664 | |
| 1665 label = gtk_label_new(_("Set info for:")); | |
| 1666 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
| 1667 gtk_widget_show(label); | |
| 1668 | |
| 1669 optmenu = gtk_option_menu_new(); | |
| 1670 gtk_box_pack_start(GTK_BOX(hbox), optmenu, FALSE, FALSE, 0); | |
| 1671 gtk_widget_show(optmenu); | |
| 1672 | |
| 1673 menu = gtk_menu_new(); | |
| 1674 | |
| 1675 while (u) { | |
| 1676 a = (struct aim_user *)u->data; | |
| 1677 opt = gtk_menu_item_new_with_label(a->username); | |
| 1678 gtk_object_set_user_data(GTK_OBJECT(opt), a); | |
| 1679 gtk_signal_connect(GTK_OBJECT(opt), "activate", GTK_SIGNAL_FUNC(info_choose), b); | |
| 1680 gtk_menu_append(GTK_MENU(menu), opt); | |
| 1681 gtk_widget_show(opt); | |
| 1682 u = u->next; | |
| 1683 } | |
| 1684 | |
| 1685 gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu), menu); | |
| 1686 gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu), | |
| 1687 g_list_index(aim_users, ((struct gaim_connection *)connections->data)->user)); | |
| 1688 | |
| 1689 b->menu = optmenu; | |
| 1690 } | |
| 1691 | |
| 1692 void show_set_info() | |
| 1693 { | |
| 1694 GtkWidget *buttons; | |
| 1695 GtkWidget *vbox; | 1595 GtkWidget *vbox; |
| 1696 gchar *buf; | 1596 gchar *buf; |
| 1697 struct aim_user *tmp; | 1597 struct aim_user *tmp; |
| 1698 | 1598 |
| 1699 struct set_info_dlg *b = g_new0(struct set_info_dlg, 1); | 1599 struct set_info_dlg *b = g_new0(struct set_info_dlg, 1); |
| 1600 if (!g_slist_find(connections, gc)) | |
| 1601 gc = connections->data; | |
| 1602 tmp = gc->user; | |
| 1603 b->user = tmp; | |
| 1700 | 1604 |
| 1701 b->window = gtk_window_new(GTK_WINDOW_DIALOG); | 1605 b->window = gtk_window_new(GTK_WINDOW_DIALOG); |
| 1702 gtk_window_set_wmclass(GTK_WINDOW(b->window), "set_info", "Gaim"); | 1606 gtk_window_set_wmclass(GTK_WINDOW(b->window), "set_info", "Gaim"); |
| 1703 dialogwindows = g_list_prepend(dialogwindows, b->window); | 1607 dialogwindows = g_list_prepend(dialogwindows, b->window); |
| 1608 gtk_window_set_title(GTK_WINDOW(b->window), _("Gaim - Set User Info")); | |
| 1609 gtk_signal_connect(GTK_OBJECT(b->window), "destroy", | |
| 1610 GTK_SIGNAL_FUNC(destroy_dialog), b->window); | |
| 1704 gtk_widget_realize(b->window); | 1611 gtk_widget_realize(b->window); |
| 1705 | 1612 aol_icon(b->window->window); |
| 1706 buttons = gtk_hbox_new(FALSE, 5); | 1613 |
| 1707 vbox = gtk_vbox_new(FALSE, 5); | 1614 vbox = gtk_vbox_new(FALSE, 5); |
| 1708 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); | 1615 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); |
| 1709 | 1616 gtk_container_add(GTK_CONTAINER(b->window), vbox); |
| 1710 /* Build OK Button */ | 1617 gtk_widget_show(vbox); |
| 1711 | 1618 |
| 1712 b->save = picture_button(b->window, _("Save"), save_xpm); | 1619 buf = g_malloc(256); |
| 1713 b->cancel = picture_button(b->window, _("Cancel"), cancel_xpm); | 1620 g_snprintf(buf, 256, "Changing info for %s:", tmp->username); |
| 1714 | 1621 label = gtk_label_new(buf); |
| 1715 gtk_box_pack_end(GTK_BOX(buttons), b->cancel, FALSE, FALSE, 0); | 1622 g_free(buf); |
| 1716 gtk_box_pack_end(GTK_BOX(buttons), b->save, FALSE, FALSE, 0); | 1623 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5); |
| 1717 | 1624 gtk_widget_show(label); |
| 1718 gtk_signal_connect(GTK_OBJECT(b->window), "destroy", | 1625 |
| 1719 GTK_SIGNAL_FUNC(destroy_dialog), b->window); | |
| 1720 gtk_signal_connect(GTK_OBJECT(b->cancel), "clicked", | |
| 1721 GTK_SIGNAL_FUNC(destroy_dialog), b->window); | |
| 1722 gtk_signal_connect(GTK_OBJECT(b->save), "clicked", | |
| 1723 GTK_SIGNAL_FUNC(do_save_info), b); | |
| 1724 | |
| 1725 info_user_menu(b, vbox); | |
| 1726 | |
| 1727 gtk_widget_show(buttons); | |
| 1728 | |
| 1729 b->text = gtk_text_new(NULL, NULL); | 1626 b->text = gtk_text_new(NULL, NULL); |
| 1730 gtk_text_set_word_wrap(GTK_TEXT(b->text), TRUE); | 1627 gtk_text_set_word_wrap(GTK_TEXT(b->text), TRUE); |
| 1731 gtk_text_set_editable(GTK_TEXT(b->text), TRUE); | 1628 gtk_text_set_editable(GTK_TEXT(b->text), TRUE); |
| 1732 gtk_widget_set_usize(b->text, 300, 200); | 1629 gtk_widget_set_usize(b->text, 300, 200); |
| 1733 if (aim_users) { | 1630 buf = g_malloc(strlen(tmp->user_info)+1); |
| 1734 tmp = ((struct gaim_connection *)connections->data)->user; | 1631 strncpy_nohtml(buf, tmp->user_info, strlen(tmp->user_info)+1); |
| 1735 buf = g_malloc(strlen(tmp->user_info)+1); | 1632 gtk_text_insert(GTK_TEXT(b->text), NULL, NULL, NULL, buf, -1); |
| 1736 strncpy_nohtml(buf, tmp->user_info, strlen(tmp->user_info)+1); | 1633 g_free(buf); |
| 1737 gtk_text_insert(GTK_TEXT(b->text), NULL, NULL, NULL, buf, -1); | 1634 gtk_box_pack_start(GTK_BOX(vbox), b->text, TRUE, TRUE, 0); |
| 1738 b->user = tmp; | |
| 1739 g_free(buf); | |
| 1740 } | |
| 1741 | |
| 1742 gtk_widget_show(b->text); | 1635 gtk_widget_show(b->text); |
| 1743 | 1636 gtk_window_set_focus(GTK_WINDOW(b->window), b->text); |
| 1744 gtk_box_pack_start(GTK_BOX(vbox), b->text, TRUE, TRUE, 0); | 1637 |
| 1745 gtk_widget_show(vbox); | 1638 buttons = gtk_hbox_new(FALSE, 5); |
| 1746 | |
| 1747 gtk_box_pack_start(GTK_BOX(vbox), buttons, FALSE, FALSE, 0); | 1639 gtk_box_pack_start(GTK_BOX(vbox), buttons, FALSE, FALSE, 0); |
| 1748 | 1640 gtk_widget_show(buttons); |
| 1749 gtk_container_add(GTK_CONTAINER(b->window), vbox); | 1641 |
| 1750 gtk_widget_realize(b->window); | 1642 b->cancel = picture_button(b->window, _("Cancel"), cancel_xpm); |
| 1751 aol_icon(b->window->window); | 1643 gtk_box_pack_end(GTK_BOX(buttons), b->cancel, FALSE, FALSE, 0); |
| 1752 | 1644 gtk_signal_connect(GTK_OBJECT(b->cancel), "clicked", |
| 1753 gtk_window_set_title(GTK_WINDOW(b->window), _("Gaim - Set User Info")); | 1645 GTK_SIGNAL_FUNC(destroy_dialog), b->window); |
| 1754 gtk_window_set_focus(GTK_WINDOW(b->window), b->text); | 1646 |
| 1647 b->save = picture_button(b->window, _("Save"), save_xpm); | |
| 1648 gtk_box_pack_end(GTK_BOX(buttons), b->save, FALSE, FALSE, 0); | |
| 1649 gtk_signal_connect(GTK_OBJECT(b->save), "clicked", | |
| 1650 GTK_SIGNAL_FUNC(do_save_info), b); | |
| 1651 | |
| 1755 gtk_widget_show(b->window); | 1652 gtk_widget_show(b->window); |
| 1756 | 1653 |
| 1757 } | 1654 } |
| 1758 | 1655 |
| 1759 /*------------------------------------------------------------------------*/ | 1656 /*------------------------------------------------------------------------*/ |
| 2290 struct findbyemail *b = g_new0(struct findbyemail, 1); | 2187 struct findbyemail *b = g_new0(struct findbyemail, 1); |
| 2291 b->window = gtk_window_new(GTK_WINDOW_DIALOG); | 2188 b->window = gtk_window_new(GTK_WINDOW_DIALOG); |
| 2292 gtk_window_set_policy(GTK_WINDOW(b->window), FALSE, TRUE, TRUE); | 2189 gtk_window_set_policy(GTK_WINDOW(b->window), FALSE, TRUE, TRUE); |
| 2293 gtk_window_set_wmclass(GTK_WINDOW(b->window), "find_email", "Gaim"); | 2190 gtk_window_set_wmclass(GTK_WINDOW(b->window), "find_email", "Gaim"); |
| 2294 gtk_widget_realize(b->window); | 2191 gtk_widget_realize(b->window); |
| 2192 aol_icon(b->window->window); | |
| 2295 dialogwindows = g_list_prepend(dialogwindows, b->window); | 2193 dialogwindows = g_list_prepend(dialogwindows, b->window); |
| 2194 gtk_signal_connect(GTK_OBJECT(b->window), "destroy", | |
| 2195 GTK_SIGNAL_FUNC(destroy_dialog), b->window); | |
| 2196 gtk_window_set_title(GTK_WINDOW(b->window), _("Gaim - Find Buddy By Email")); | |
| 2296 | 2197 |
| 2297 vbox = gtk_vbox_new(FALSE, 5); | 2198 vbox = gtk_vbox_new(FALSE, 5); |
| 2298 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); | 2199 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); |
| 2200 gtk_container_add(GTK_CONTAINER(b->window), vbox); | |
| 2299 | 2201 |
| 2300 frame = gtk_frame_new(_("Search for Buddy")); | 2202 frame = gtk_frame_new(_("Search for Buddy")); |
| 2203 gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0); | |
| 2204 | |
| 2301 topbox = gtk_hbox_new(FALSE, 5); | 2205 topbox = gtk_hbox_new(FALSE, 5); |
| 2206 gtk_container_add(GTK_CONTAINER(frame), topbox); | |
| 2302 gtk_container_set_border_width(GTK_CONTAINER(topbox), 5); | 2207 gtk_container_set_border_width(GTK_CONTAINER(topbox), 5); |
| 2303 | 2208 |
| 2209 label = gtk_label_new(_("Email")); | |
| 2210 gtk_box_pack_start(GTK_BOX(topbox), label, FALSE, FALSE, 0); | |
| 2211 | |
| 2212 b->emailentry = gtk_entry_new(); | |
| 2213 gtk_box_pack_start(GTK_BOX(topbox), b->emailentry, TRUE, TRUE, 0); | |
| 2214 gtk_signal_connect(GTK_OBJECT(b->emailentry), "activate", | |
| 2215 GTK_SIGNAL_FUNC(do_find_email), b); | |
| 2216 gtk_window_set_focus(GTK_WINDOW(b->window), b->emailentry); | |
| 2217 | |
| 2304 bbox = gtk_hbox_new(FALSE, 5); | 2218 bbox = gtk_hbox_new(FALSE, 5); |
| 2305 | 2219 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0); |
| 2306 b->emailentry = gtk_entry_new(); | |
| 2307 | |
| 2308 /* Build OK Button */ | |
| 2309 | 2220 |
| 2310 button = picture_button(b->window, _("Cancel"), cancel_xpm); | 2221 button = picture_button(b->window, _("Cancel"), cancel_xpm); |
| 2311 gtk_signal_connect(GTK_OBJECT(button), "clicked", | 2222 gtk_signal_connect(GTK_OBJECT(button), "clicked", |
| 2312 GTK_SIGNAL_FUNC(destroy_dialog), b->window); | 2223 GTK_SIGNAL_FUNC(destroy_dialog), b->window); |
| 2313 gtk_box_pack_end(GTK_BOX(bbox), button, FALSE, FALSE, 0); | 2224 gtk_box_pack_end(GTK_BOX(bbox), button, FALSE, FALSE, 0); |
| 2314 | 2225 |
| 2315 button = picture_button(b->window, _("OK"), ok_xpm); | 2226 button = picture_button(b->window, _("OK"), ok_xpm); |
| 2316 gtk_signal_connect(GTK_OBJECT(button), "clicked", | 2227 gtk_signal_connect(GTK_OBJECT(button), "clicked", |
| 2317 GTK_SIGNAL_FUNC(do_find_email), b); | 2228 GTK_SIGNAL_FUNC(do_find_email), b); |
| 2318 gtk_box_pack_end(GTK_BOX(bbox), button, FALSE, FALSE, 0); | 2229 gtk_box_pack_end(GTK_BOX(bbox), button, FALSE, FALSE, 0); |
| 2319 | |
| 2320 label = gtk_label_new(_("Email")); | |
| 2321 gtk_box_pack_start(GTK_BOX(topbox), label, FALSE, FALSE, 0); | |
| 2322 gtk_box_pack_start(GTK_BOX(topbox), b->emailentry, TRUE, TRUE, 0); | |
| 2323 | |
| 2324 gtk_container_add(GTK_CONTAINER(frame), topbox); | |
| 2325 gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0); | |
| 2326 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0); | |
| 2327 | |
| 2328 gtk_signal_connect(GTK_OBJECT(b->window), "destroy", | |
| 2329 GTK_SIGNAL_FUNC(destroy_dialog), b->window); | |
| 2330 gtk_signal_connect(GTK_OBJECT(b->emailentry), "activate", | |
| 2331 GTK_SIGNAL_FUNC(do_find_email), b); | |
| 2332 | |
| 2333 gtk_window_set_title(GTK_WINDOW(b->window), _("Gaim - Find Buddy By Email")); | |
| 2334 gtk_window_set_focus(GTK_WINDOW(b->window), b->emailentry); | |
| 2335 gtk_container_add(GTK_CONTAINER(b->window), vbox); | |
| 2336 aol_icon(b->window->window); | |
| 2337 | 2230 |
| 2338 gtk_widget_show_all(b->window); | 2231 gtk_widget_show_all(b->window); |
| 2339 } | 2232 } |
| 2340 | 2233 |
| 2341 /*------------------------------------------------------*/ | 2234 /*------------------------------------------------------*/ |
