comparison src/multi.c @ 4687:283fb289c510

[gaim-migrate @ 4998] This is a new buddy list. Lots of things about it just Don't Work. I probably already know about those things, and you'd just be wasting my time in submitting a bug report about it. I decided that instead of getting it to all work perfectly before committing, that I'd get it in cvs, and slowly fix it with regular commits. That way, it's easier to keep track of things, and other developers can help. Plus, I'm getting pissed off at the buddy list and want it to die. It's kinda boring, and doing nothing but the buddy list for such a long time has just gotten me very bitter. After 0.60 is released later this week, Gaim will resume being fun. This week is going to be very stressful, though, I'm sure. Things you ought to know about this buddy list: - It crashes - It leaks - There's no way to edit the buddy list, or access offline buddies - Most of the menus and buttons and whatnot just plain ol' don't work. - Status icons are only implemented for AIM. That's mostly just because I'm lazy. As such, you may want to be wary of updating this. If you do decide to update this, you may want to learn "cvs update -D yesterday" as well :) All the art there is just placeholder art. You probably won't really have as many problems as it sounds like you will from reading this. This message is extra-negative to stress that I don't want to be bothered with complaints about something not working about it :). I'll repeat: If something doesn't work, I probably already know about it. If you want to actually help with something, I'd be delighted to have it. IM me. -s. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Mon, 10 Mar 2003 05:30:31 +0000
parents 2c9f1ac20b36
children 4bdd9a5fd026
comparison
equal deleted inserted replaced
4686:a1de8a9c99ba 4687:283fb289c510
25 #include <gtk/gtk.h> 25 #include <gtk/gtk.h>
26 #include "prpl.h" 26 #include "prpl.h"
27 #include "multi.h" 27 #include "multi.h"
28 #include "gaim.h" 28 #include "gaim.h"
29 #include "conversation.h" 29 #include "conversation.h"
30 #include "gtklist.h"
30 31
31 #ifdef _WIN32 32 #ifdef _WIN32
32 #include "win32dep.h" 33 #include "win32dep.h"
33 #endif 34 #endif
34 35
183 save_prefs(); 184 save_prefs();
184 gtk_widget_destroy(acctedit); 185 gtk_widget_destroy(acctedit);
185 acctedit = NULL; 186 acctedit = NULL;
186 } 187 }
187 treeview = NULL; 188 treeview = NULL;
188 if (!d && !blist && !mainwindow && !connections) 189 if (!d && !gtkblist->window && !mainwindow && !connections)
189 do_quit(); 190 do_quit();
190 } 191 }
191 192
192 static void on_delete_acctedit(GtkWidget *w, GdkEvent *ev, gpointer d) 193 static void on_delete_acctedit(GtkWidget *w, GdkEvent *ev, gpointer d)
193 { 194 {
1332 g_hash_table_destroy(b->settings); 1333 g_hash_table_destroy(b->settings);
1333 g_free(b); 1334 g_free(b);
1334 } 1335 }
1335 } 1336 }
1336 if(!g->members) { 1337 if(!g->members) {
1337 ui_remove_group(g); 1338 gaim_blist_remove_group(g);
1338 groups = g_slist_remove(groups, g);
1339 g_free(g);
1340 } 1339 }
1341 } 1340 }
1342 1341
1343 gaim_accounts = g_slist_remove(gaim_accounts, account); 1342 gaim_accounts = g_slist_remove(gaim_accounts, account);
1344 1343
1473 GtkWidget *progress; 1472 GtkWidget *progress;
1474 GtkWidget *status; 1473 GtkWidget *status;
1475 }; 1474 };
1476 static GSList *meters = NULL; 1475 static GSList *meters = NULL;
1477 1476
1478 GtkWidget* create_meter_pixmap (GtkWidget *widget, struct gaim_connection *gc) 1477 GtkWidget* create_meter_pixmap (struct gaim_connection *gc)
1479 { 1478 {
1480 GdkPixmap *gdkpixmap; 1479 GdkPixbuf *pb = create_prpl_icon(gc->account);
1481 GdkBitmap *mask; 1480 GdkPixbuf *scale = gdk_pixbuf_scale_simple(pb, 30,30,GDK_INTERP_BILINEAR);
1482 GtkWidget *pixmap; 1481 GtkWidget *image =
1483 1482 gtk_image_new_from_pixbuf(scale);
1484 create_prpl_icon (widget, gc, &gdkpixmap, &mask); 1483 g_object_unref(G_OBJECT(pb));
1485 1484 g_object_unref(G_OBJECT(scale));
1486 pixmap = gtk_image_new_from_pixmap(gdkpixmap, mask); 1485 return image;
1487 gdk_pixmap_unref (gdkpixmap);
1488 gdk_bitmap_unref (mask);
1489 return pixmap;
1490 } 1486 }
1491 1487
1492 static struct signon_meter *find_signon_meter(struct gaim_connection *gc) 1488 static struct signon_meter *find_signon_meter(struct gaim_connection *gc)
1493 { 1489 {
1494 GSList *m = meters; 1490 GSList *m = meters;
1534 1530
1535 /* then we do the buddy list stuff */ 1531 /* then we do the buddy list stuff */
1536 if (mainwindow) 1532 if (mainwindow)
1537 gtk_widget_hide(mainwindow); 1533 gtk_widget_hide(mainwindow);
1538 1534
1539 show_buddy_list(); 1535 gaim_blist_show();
1540 1536
1541 update_privacy_connections(); 1537 update_privacy_connections();
1542 do_away_menu(); 1538 do_away_menu();
1543 do_proto_menu(); 1539 do_proto_menu();
1544 1540
1550 struct gaim_window *win = (struct gaim_window *)wins->data; 1546 struct gaim_window *win = (struct gaim_window *)wins->data;
1551 gaim_conversation_update(gaim_window_get_conversation_at(win, 0), 1547 gaim_conversation_update(gaim_window_get_conversation_at(win, 0),
1552 GAIM_CONV_ACCOUNT_ONLINE); 1548 GAIM_CONV_ACCOUNT_ONLINE);
1553 } 1549 }
1554 1550
1555 redo_buddy_list();
1556 gaim_setup(gc); 1551 gaim_setup(gc);
1557 1552
1558 gc->account->connecting = FALSE; 1553 gc->account->connecting = FALSE;
1559 connecting_count--; 1554 connecting_count--;
1560 debug_printf("connecting_count: %d\n", connecting_count); 1555 debug_printf("connecting_count: %d\n", connecting_count);
1627 g_free(meter); 1622 g_free(meter);
1628 } 1623 }
1629 debug_printf("Disconnecting. user = %p, gc = %p (%p)\n", 1624 debug_printf("Disconnecting. user = %p, gc = %p (%p)\n",
1630 gc->account, gc->account->gc, gc); 1625 gc->account, gc->account->gc, gc);
1631 gc->account->gc = NULL; /* wasn't that awkward? */ 1626 gc->account->gc = NULL; /* wasn't that awkward? */
1632
1633 /* take these buddies out of the edit tree */
1634 build_edit_tree();
1635 1627
1636 if (!acctedit) 1628 if (!acctedit)
1637 return; 1629 return;
1638 1630
1639 if (get_iter_from_data(GTK_TREE_VIEW(treeview), gc->account, &iter)) { 1631 if (get_iter_from_data(GTK_TREE_VIEW(treeview), gc->account, &iter)) {
1698 meter = g_new0(struct signon_meter, 1); 1690 meter = g_new0(struct signon_meter, 1);
1699 1691
1700 (*rows)++; 1692 (*rows)++;
1701 gtk_table_resize (table, *rows, 4); 1693 gtk_table_resize (table, *rows, 4);
1702 1694
1703 graphic = create_meter_pixmap( widget , gc); 1695 graphic = create_meter_pixmap(gc);
1704 1696
1705 nest_vbox = gtk_vbox_new (FALSE, 0); 1697 nest_vbox = gtk_vbox_new (FALSE, 0);
1706 1698
1707 g_string_prepend(name_to_print, _("Signon: ")); 1699 g_string_prepend(name_to_print, _("Signon: "));
1708 label = gtk_label_new (name_to_print->str); 1700 label = gtk_label_new (name_to_print->str);
1899 1891
1900 /* UI stuff */ 1892 /* UI stuff */
1901 /* CONV XXX 1893 /* CONV XXX
1902 convo_menu_remove(gc); 1894 convo_menu_remove(gc);
1903 remove_icon_data(gc); 1895 remove_icon_data(gc);
1904 */ 1896 */
1897
1898 gaim_blist_remove_account(gc->account);
1905 1899
1906 /* core stuff */ 1900 /* core stuff */
1907 /* remove this here so plugins get a sensible count of connections */ 1901 /* remove this here so plugins get a sensible count of connections */
1908 connections = g_slist_remove(connections, gc); 1902 connections = g_slist_remove(connections, gc);
1909 debug_printf("date: %s\n", full_date()); 1903 debug_printf("date: %s\n", full_date());
1918 } 1912 }
1919 debug_printf("connecting_count: %d\n", connecting_count); 1913 debug_printf("connecting_count: %d\n", connecting_count);
1920 serv_close(gc); 1914 serv_close(gc);
1921 1915
1922 /* more UI stuff */ 1916 /* more UI stuff */
1923 redo_buddy_list();
1924 do_away_menu(); 1917 do_away_menu();
1925 do_proto_menu(); 1918 do_proto_menu();
1926 1919
1927 /* 1920 /*
1928 * XXX This is a hack! Remove this and replace it with a better event 1921 * XXX This is a hack! Remove this and replace it with a better event
1939 /* in, out, shake it all about */ 1932 /* in, out, shake it all about */
1940 if (connections) 1933 if (connections)
1941 return; 1934 return;
1942 1935
1943 destroy_all_dialogs(); 1936 destroy_all_dialogs();
1944 destroy_buddy(); 1937 gaim_blist_destroy();
1945 1938
1946 show_login(); 1939 show_login();
1947 } 1940 }
1948 1941
1949 struct gaim_account *gaim_account_new(const char *name, int proto, int opts) 1942 struct gaim_account *gaim_account_new(const char *name, int proto, int opts)