comparison plugins/idle.c @ 6008:35679a3f2bcc

[gaim-migrate @ 6456] The I'dle Mak'er plugin now uses the special account drop-down making function thing that other such things use. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Thu, 03 Jul 2003 23:40:10 +0000
parents 7d385de2f9cd
children 5239a3b4ab33
comparison
equal deleted inserted replaced
6007:3750fc0325ac 6008:35679a3f2bcc
34 gc->last_sent_time = t; 34 gc->last_sent_time = t;
35 serv_set_idle(gc, 60 * tm); 35 serv_set_idle(gc, 60 * tm);
36 gc->is_idle = 0; 36 gc->is_idle = 0;
37 } 37 }
38 38
39 static void sel_gc(GtkWidget *opt, GaimConnection *g) { 39 static void select_account_cb(GtkWidget *opt, GaimAccount *account)
40 gc = g; 40 {
41 gc = gaim_account_get_connection(account);
41 } 42 }
42 43
43 static void make_connect_menu(GtkWidget *box) { 44 static void make_connect_menu(GtkWidget *box) {
44 GtkWidget *optmenu, *menu, *opt; 45 GtkWidget *optmenu;
45 GaimAccount *account;
46 GList *c = gaim_connections_get_all();
47 GaimConnection *g;
48 46
49 optmenu = gtk_option_menu_new(); 47 optmenu = gaim_gtk_account_option_menu_new(NULL, FALSE,
48 G_CALLBACK(select_account_cb), NULL);
49
50 gtk_box_pack_start(GTK_BOX(box), optmenu, FALSE, FALSE, 5); 50 gtk_box_pack_start(GTK_BOX(box), optmenu, FALSE, FALSE, 5);
51
52 menu = gtk_menu_new();
53
54 while (c) {
55 g = (GaimConnection *)c->data;
56 account = gaim_connection_get_account(g);
57
58 opt = gtk_menu_item_new_with_label(gaim_account_get_username(account));
59 g_signal_connect(G_OBJECT(opt), "activate",
60 G_CALLBACK(sel_gc), g);
61 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt);
62 gtk_widget_show(opt);
63 c = g_list_next(c);
64 }
65
66 gtk_option_menu_remove_menu(GTK_OPTION_MENU(optmenu));
67 gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu), menu);
68 gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu), 0);
69 51
70 if (gaim_connections_get_all()) 52 if (gaim_connections_get_all())
71 gc = gaim_connections_get_all()->data; 53 gc = gaim_connections_get_all()->data;
72 else 54 else
73 gc = NULL; 55 gc = NULL;