annotate src/buddy.c @ 2624:4d5c2c913750

[gaim-migrate @ 2637] this is good. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Fri, 26 Oct 2001 23:49:50 +0000
parents 6f7e1fc3e132
children 671c3a6a2c12
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1 /*
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2 * gaim
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
4 * Copyright (C) 1998-1999, Mark Spencer <markster@marko.net>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
5 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
6 * This program is free software; you can redistribute it and/or modify
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
7 * it under the terms of the GNU General Public License as published by
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
8 * the Free Software Foundation; either version 2 of the License, or
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
9 * (at your option) any later version.
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
10 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
11 * This program is distributed in the hope that it will be useful,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
14 * GNU General Public License for more details.
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
15 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
16 * You should have received a copy of the GNU General Public License
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
17 * along with this program; if not, write to the Free Software
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
19 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
20 */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
21
349
b402a23f35df [gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 342
diff changeset
22 #ifdef HAVE_CONFIG_H
2090
b66aca8e8dce [gaim-migrate @ 2100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2048
diff changeset
23 #include <config.h>
349
b402a23f35df [gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 342
diff changeset
24 #endif
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
25 #ifdef USE_APPLET
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
26 #include <gnome.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
27 #include <applet-widget.h>
1261
07f0bb41bbe1 [gaim-migrate @ 1271]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
28 #include "applet.h"
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
29 #endif /* USE_APPLET */
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
30 #ifdef GAIM_PLUGINS
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
31 #include <dlfcn.h>
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
32 #endif /* GAIM_PLUGINS */
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
33 #include <string.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
34 #include <stdio.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
35 #include <stdlib.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
36 #include <math.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
37 #include <time.h>
1233
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1230
diff changeset
38 #include <unistd.h>
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
39
1634
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
40 #include <gdk/gdkkeysyms.h>
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
41 #include <gtk/gtk.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
42 #include <gdk/gdkx.h>
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
43 #include "prpl.h"
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
44 #include "gaim.h"
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
45 #include "pixmaps/login_icon.xpm"
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
46 #include "pixmaps/logout_icon.xpm"
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
47 #include "pixmaps/no_icon.xpm"
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
48
872
0532f6f85fac [gaim-migrate @ 882]
Rob Flynn <gaim@robflynn.com>
parents: 870
diff changeset
49 #include "pixmaps/away_small.xpm"
1929
d51ea669d84e [gaim-migrate @ 1939]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1918
diff changeset
50 #include "pixmaps/away_big.xpm"
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
51
714
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
52 #include "pixmaps/add_small.xpm"
718
c2e3e4e59a17 [gaim-migrate @ 728]
Rob Flynn <gaim@robflynn.com>
parents: 714
diff changeset
53 #include "pixmaps/import_small.xpm"
1815
f15d449b3167 [gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1805
diff changeset
54 /*#include "pixmaps/export_small.xpm"*/
885
db5f5c33e83f [gaim-migrate @ 895]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 875
diff changeset
55 #if defined(GAIM_PLUGINS) || defined(USE_PERL)
801
1a47432e2ba1 [gaim-migrate @ 811]
Rob Flynn <gaim@robflynn.com>
parents: 798
diff changeset
56 #include "pixmaps/plugins_small.xpm"
1a47432e2ba1 [gaim-migrate @ 811]
Rob Flynn <gaim@robflynn.com>
parents: 798
diff changeset
57 #endif
1a47432e2ba1 [gaim-migrate @ 811]
Rob Flynn <gaim@robflynn.com>
parents: 798
diff changeset
58 #include "pixmaps/prefs_small.xpm"
1880
b8245bcce7e6 [gaim-migrate @ 1890]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1874
diff changeset
59 #include "pixmaps/search_small.xpm"
747
eec93c5929b9 [gaim-migrate @ 757]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 746
diff changeset
60 #ifdef USE_APPLET
727
8b9f0537f473 [gaim-migrate @ 737]
Rob Flynn <gaim@robflynn.com>
parents: 719
diff changeset
61 #include "pixmaps/close_small.xpm"
1456
6650776468b3 [gaim-migrate @ 1466]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1435
diff changeset
62 #else
6650776468b3 [gaim-migrate @ 1466]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1435
diff changeset
63 #include "pixmaps/exit_small.xpm"
747
eec93c5929b9 [gaim-migrate @ 757]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 746
diff changeset
64 #endif
865
789b2f0bb133 [gaim-migrate @ 875]
Rob Flynn <gaim@robflynn.com>
parents: 864
diff changeset
65 #include "pixmaps/pounce_small.xpm"
874
69669b9b3e3b [gaim-migrate @ 884]
Rob Flynn <gaim@robflynn.com>
parents: 872
diff changeset
66 #include "pixmaps/about_small.xpm"
714
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
67
820
fe2e1ad4495b [gaim-migrate @ 830]
Rob Flynn <gaim@robflynn.com>
parents: 813
diff changeset
68 #include "pixmaps/tmp_send.xpm"
1177
256e209c02ac [gaim-migrate @ 1187]
Rob Flynn <gaim@robflynn.com>
parents: 1172
diff changeset
69 #include "pixmaps/send_small.xpm"
820
fe2e1ad4495b [gaim-migrate @ 830]
Rob Flynn <gaim@robflynn.com>
parents: 813
diff changeset
70 #include "pixmaps/tb_search.xpm"
870
9b8b83592bb6 [gaim-migrate @ 880]
Rob Flynn <gaim@robflynn.com>
parents: 865
diff changeset
71 #include "pixmaps/join.xpm"
875
450db0a5bbe4 [gaim-migrate @ 885]
Rob Flynn <gaim@robflynn.com>
parents: 874
diff changeset
72 #include "pixmaps/gnome_add.xpm"
450db0a5bbe4 [gaim-migrate @ 885]
Rob Flynn <gaim@robflynn.com>
parents: 874
diff changeset
73 #include "pixmaps/gnome_remove.xpm"
450db0a5bbe4 [gaim-migrate @ 885]
Rob Flynn <gaim@robflynn.com>
parents: 874
diff changeset
74 #include "pixmaps/group.xpm"
820
fe2e1ad4495b [gaim-migrate @ 830]
Rob Flynn <gaim@robflynn.com>
parents: 813
diff changeset
75
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
76 static GtkTooltips *tips;
1634
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
77 static GtkAccelGroup *accel;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
78 static GtkWidget *editpane;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
79 static GtkWidget *buddypane;
696
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
80 static GtkWidget *imchatbox;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
81 static GtkWidget *edittree;
1929
d51ea669d84e [gaim-migrate @ 1939]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1918
diff changeset
82 static GtkWidget *imbutton, *infobutton, *chatbutton, *awaybutton;
577
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 544
diff changeset
83 static GtkWidget *addbutton, *groupbutton, *rembutton;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
84
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
85 GtkWidget *blist = NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
86 GtkWidget *bpmenu;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
87 GtkWidget *buddies;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
88
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
89 void BuddyTickerLogonTimeout(gpointer data);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
90 void BuddyTickerLogoutTimeout(gpointer data);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
91
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
92 struct buddy_show {
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
93 GtkWidget *item;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
94 GtkWidget *pix;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
95 GtkWidget *label;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
96 GtkWidget *warn;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
97 GtkWidget *idle;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
98 char *name;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
99 char *show;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
100 GSList *connlist;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
101 guint log_timer;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
102 gint sound;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
103 };
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
104
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
105 /* stuff for actual display of buddy list */
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
106 struct group_show {
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
107 GtkWidget *item;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
108 GtkWidget *label;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
109 GtkWidget *tree;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
110 GSList *members;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
111 char *name;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
112 };
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
113 static GSList *shows = NULL;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
114
2564
552a56d334ec [gaim-migrate @ 2577]
Rob Flynn <gaim@robflynn.com>
parents: 2560
diff changeset
115 /* Predefine some functions */
2569
a714b8223228 [gaim-migrate @ 2582]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2564
diff changeset
116 static void new_bp_callback(GtkWidget *w, struct buddy *bs);
1069
5d4926907b21 [gaim-migrate @ 1079]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1068
diff changeset
117 static struct group_show *find_group_show(char *group);
5d4926907b21 [gaim-migrate @ 1079]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1068
diff changeset
118 static struct buddy_show *find_buddy_show(struct group_show *gs, char *name);
5d4926907b21 [gaim-migrate @ 1079]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1068
diff changeset
119 static int group_number(char *group);
5d4926907b21 [gaim-migrate @ 1079]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1068
diff changeset
120 static int buddy_number(char *group, char *buddy);
5d4926907b21 [gaim-migrate @ 1079]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1068
diff changeset
121 static struct group_show *new_group_show(char *group);
1106
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
122 static struct buddy_show *new_buddy_show(struct group_show *gs, struct buddy *buddy, char **xpm);
1108
cb338aa38e78 [gaim-migrate @ 1118]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1106
diff changeset
123 static void remove_buddy_show(struct group_show *gs, struct buddy_show *bs);
1069
5d4926907b21 [gaim-migrate @ 1079]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1068
diff changeset
124 static struct group_show *find_gs_by_bs(struct buddy_show *b);
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
125 static void update_num_group(struct group_show *gs);
2624
4d5c2c913750 [gaim-migrate @ 2637]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
126 static void update_idle_time(struct buddy_show *bs);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
127
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
128 void handle_group_rename(struct group *g, char *prevname)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
129 {
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
130 struct group_show *gs, *new_gs;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
131 struct buddy_show *bs;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
132 struct buddy *b;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
133 GSList *m;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
134 GtkCTreeNode *c;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
135
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
136 c = gtk_ctree_find_by_row_data(GTK_CTREE(edittree), NULL, g);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
137 gtk_ctree_node_set_text(GTK_CTREE(edittree), c, 0, g->name);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
138
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
139 gs = find_group_show(prevname);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
140 if (!gs) {
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
141 return;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
142 }
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
143 new_gs = find_group_show(g->name);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
144 if (new_gs) {
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
145 /* transfer everything that was in gs and is in the same gaim_conn as g
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
146 * over to new_gs. */
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
147 m = gs->members;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
148 while (m) {
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
149 bs = (struct buddy_show *)m->data;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
150 if (g_slist_index(bs->connlist, g->gc) >= 0) {
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
151 b = find_buddy(g->gc, bs->name);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
152 m = g_slist_next(m);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
153 bs->connlist = g_slist_remove(bs->connlist, g->gc);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
154 if (!bs->connlist) {
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
155 gs->members = g_slist_remove(gs->members, bs);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
156 if (bs->log_timer > 0)
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
157 gtk_timeout_remove(bs->log_timer);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
158 bs->log_timer = 0;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
159 remove_buddy_show(gs, bs);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
160 g_free(bs->show);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
161 g_free(bs->name);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
162 g_free(bs);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
163 }
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
164 if ((bs = find_buddy_show(new_gs, b->name)) == NULL) {
2433
cac432940fb8 [gaim-migrate @ 2446]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2393
diff changeset
165 if (g->gc->prpl->list_icon) {
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
166 bs = new_buddy_show(new_gs, b,
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
167 (*g->gc->prpl->list_icon)(b->uc));
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
168 } else {
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
169 bs = new_buddy_show(new_gs, b, (char **)no_icon_xpm);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
170 }
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
171 }
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
172 bs->connlist = g_slist_append(bs->connlist, g->gc);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
173 } else {
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
174 m = g_slist_next(m);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
175 }
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
176 }
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
177 if (!gs->members) {
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
178 /* we just transferred all of the members out of this group_show,
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
179 * so this group_show serves no purpose now. */
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
180 shows = g_slist_remove(shows, gs);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
181 gtk_tree_remove_item(GTK_TREE(buddies), gs->item);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
182 g_free(gs->name);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
183 g_free(gs);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
184 } else {
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
185 update_num_group(gs);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
186 }
1748
2eec724fdbcd [gaim-migrate @ 1758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1739
diff changeset
187 update_num_group(new_gs);
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
188 } else {
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
189 /* two possible actions: if gs contains things that are only from g,
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
190 * just rename gs and fix the label. otherwise, move everything in g
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
191 * over to another group_show */
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
192 for (m = gs->members; m != NULL; m = g_slist_next(m)) {
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
193 bs = (struct buddy_show *)m->data;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
194 if (g_slist_index(bs->connlist, g->gc) < 0 || g_slist_length(bs->connlist) > 1) {
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
195 break;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
196 }
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
197 }
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
198 if (m) {
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
199 /* there's something from a different gaim_connection. */
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
200 new_gs = new_group_show(g->name);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
201 m = gs->members;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
202 while (m) {
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
203 bs = (struct buddy_show *)m->data;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
204 if (g_slist_index(bs->connlist, g->gc) >= 0) {
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
205 b = find_buddy(g->gc, bs->name);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
206 m = g_slist_next(m);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
207 bs->connlist = g_slist_remove(bs->connlist, g->gc);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
208 if (!bs->connlist) {
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
209 gs->members = g_slist_remove(gs->members, bs);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
210 if (bs->log_timer > 0)
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
211 gtk_timeout_remove(bs->log_timer);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
212 bs->log_timer = 0;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
213 remove_buddy_show(gs, bs);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
214 g_free(bs->show);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
215 g_free(bs->name);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
216 g_free(bs);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
217 }
2433
cac432940fb8 [gaim-migrate @ 2446]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2393
diff changeset
218 if (g->gc->prpl->list_icon) {
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
219 bs = new_buddy_show(new_gs, b,
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
220 (*g->gc->prpl->list_icon)(b->uc));
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
221 } else {
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
222 bs = new_buddy_show(new_gs, b, (char **)no_icon_xpm);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
223 }
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
224 bs->connlist = g_slist_append(NULL, g->gc);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
225 } else {
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
226 m = g_slist_next(m);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
227 }
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
228 }
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
229 update_num_group(gs);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
230 update_num_group(new_gs);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
231 } else {
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
232 g_free(gs->name);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
233 gs->name = g_strdup(g->name);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
234 update_num_group(gs);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
235 }
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
236 }
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
237 }
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
238
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
239 void handle_buddy_rename(struct buddy *b, char *prevname)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
240 {
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
241 struct buddy_show *bs;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
242 struct group_show *gs;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
243 struct group *g;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
244 GtkCTreeNode *c;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
245 char buf[256];
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
246
2607
e0d4a23aac89 [gaim-migrate @ 2620]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2606
diff changeset
247 /* well you shouldn't be calling this if nothing changed. duh. */
e0d4a23aac89 [gaim-migrate @ 2620]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2606
diff changeset
248 do_export(b->gc);
e0d4a23aac89 [gaim-migrate @ 2620]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2606
diff changeset
249
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
250 c = gtk_ctree_find_by_row_data(GTK_CTREE(edittree), NULL, b);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
251 if (strcmp(b->show, b->name))
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
252 g_snprintf(buf, sizeof(buf), "%s (%s)", b->name, b->show);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
253 else
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
254 g_snprintf(buf, sizeof(buf), "%s", b->name);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
255 gtk_ctree_node_set_text(GTK_CTREE(edittree), c, 0, buf);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
256
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
257 gs = find_group_show(prevname);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
258
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
259 g = find_group_by_buddy(b->gc, b->name);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
260 if (!g) {
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
261 /* shouldn't happen */
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
262 return;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
263 }
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
264 gs = find_group_show(g->name);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
265 if (!gs) {
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
266 return;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
267 }
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
268 bs = find_buddy_show(gs, prevname);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
269 if (!bs) {
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
270 /* buddy's offline */
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
271 return;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
272 }
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
273
2275
f7bf34a3b535 [gaim-migrate @ 2285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2255
diff changeset
274 if (g_strcasecmp(b->name, prevname)) {
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
275 bs->connlist = g_slist_remove(bs->connlist, b->gc);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
276 if (!bs->connlist) {
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
277 gs->members = g_slist_remove(gs->members, bs);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
278 if (bs->log_timer > 0)
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
279 gtk_timeout_remove(bs->log_timer);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
280 bs->log_timer = 0;
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
281 remove_buddy_show(gs, bs);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
282 g_free(bs->show);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
283 g_free(bs->name);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
284 g_free(bs);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
285 }
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
286 } else {
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
287 gtk_label_set_text(GTK_LABEL(bs->label), b->show);
2624
4d5c2c913750 [gaim-migrate @ 2637]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
288 update_idle_time(bs);
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
289 }
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
290 }
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
291
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
292 void destroy_buddy()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
293 {
2380
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
294 GSList *s = shows;
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
295 struct group_show *g;
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
296 GSList *m;
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
297 struct buddy_show *b;
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
298 while (s) {
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
299 g = (struct group_show *)s->data;
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
300 debug_printf("group_show still exists: %s\n", g->name);
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
301 m = g->members;
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
302 while (m) {
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
303 b = (struct buddy_show *)m->data;
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
304 debug_printf("buddy_show still exists: %s\n", b->name);
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
305 m = g_slist_remove(m, b);
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
306 if (b->log_timer > 0)
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
307 gtk_timeout_remove(b->log_timer);
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
308 b->log_timer = 0;
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
309 gtk_tree_remove_item(GTK_TREE(g->tree), b->item);
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
310 g_free(b->show);
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
311 g_free(b->name);
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
312 g_free(b);
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
313 }
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
314 gtk_tree_remove_item(GTK_TREE(buddies), g->item);
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
315 s = g_slist_remove(s, g);
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
316 g_free(g->name);
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
317 g_free(g);
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
318 }
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
319 shows = NULL;
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
320
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
321 if (blist)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
322 gtk_widget_destroy(blist);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
323 blist = NULL;
700
d904bf694bd7 [gaim-migrate @ 710]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 696
diff changeset
324 imchatbox = NULL;
1544
f7bef430ccd1 [gaim-migrate @ 1554]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1509
diff changeset
325 awaymenu = NULL;
f7bef430ccd1 [gaim-migrate @ 1554]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1509
diff changeset
326 protomenu = NULL;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
327 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
328
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
329 static void adjust_pic(GtkWidget *button, const char *c, gchar **xpm)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
330 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
331 GdkPixmap *pm;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
332 GdkBitmap *bm;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
333 GtkWidget *pic;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
334 GtkWidget *label;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
335
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
336 /*if the user had opted to put pictures on the buttons */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
337 if (blist_options & OPT_BLIST_SHOW_BUTTON_XPM && xpm) {
820
fe2e1ad4495b [gaim-migrate @ 830]
Rob Flynn <gaim@robflynn.com>
parents: 813
diff changeset
338 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm, NULL, xpm);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
339 pic = gtk_pixmap_new(pm, bm);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
340 gtk_widget_show(pic);
644
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 608
diff changeset
341 gdk_pixmap_unref(pm);
804
17def2bb9720 [gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 803
diff changeset
342 gdk_bitmap_unref(bm);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
343 label = GTK_BIN(button)->child;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
344 gtk_container_remove(GTK_CONTAINER(button), label);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
345 gtk_container_add(GTK_CONTAINER(button), pic);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
346 } else {
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
347 label = gtk_label_new(c);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
348 gtk_widget_show(label);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
349 pic = GTK_BIN(button)->child;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
350 gtk_container_remove(GTK_CONTAINER(button), pic);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
351 gtk_container_add(GTK_CONTAINER(button), label);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
352 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
353
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
354 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
355
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
356
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
357 void toggle_show_empty_groups()
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
358 {
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2281
diff changeset
359 if (blist_options & OPT_BLIST_NO_MT_GRP) {
1072
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
360 /* remove any group_shows with empty members */
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
361 GSList *s = shows;
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
362 struct group_show *g;
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
363
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
364 while (s) {
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
365 g = (struct group_show *)s->data;
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
366 if (!g_slist_length(g->members)) {
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
367 shows = g_slist_remove(shows, g);
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
368 s = shows;
1108
cb338aa38e78 [gaim-migrate @ 1118]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1106
diff changeset
369 gtk_tree_remove_item(GTK_TREE(buddies), g->item);
1072
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
370 g_free(g->name);
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
371 g_free(g);
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
372 } else
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
373 s = g_slist_next(s);
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
374 }
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
375
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
376 } else {
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
377 /* put back all groups */
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
378 GSList *c = connections;
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
379 struct gaim_connection *gc;
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
380 GSList *m;
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
381 struct group *g;
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
382
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
383 while (c) {
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
384 gc = (struct gaim_connection *)c->data;
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
385 m = gc->groups;
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
386 while (m) {
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
387 g = (struct group *)m->data;
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
388 m = g_slist_next(m);
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
389 if (!find_group_show(g->name))
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
390 new_group_show(g->name);
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
391 }
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
392 c = g_slist_next(c);
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
393 }
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
394
1072
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
395 }
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
396 }
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
397
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
398 void toggle_buddy_pixmaps()
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
399 {
1711
9b86520e04ac [gaim-migrate @ 1721]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1699
diff changeset
400 GSList *s = shows;
9b86520e04ac [gaim-migrate @ 1721]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1699
diff changeset
401 struct group_show *g;
9b86520e04ac [gaim-migrate @ 1721]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1699
diff changeset
402 GSList *m;
9b86520e04ac [gaim-migrate @ 1721]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1699
diff changeset
403 struct buddy_show *b;
9b86520e04ac [gaim-migrate @ 1721]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1699
diff changeset
404
9b86520e04ac [gaim-migrate @ 1721]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1699
diff changeset
405 while (s) {
9b86520e04ac [gaim-migrate @ 1721]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1699
diff changeset
406 g = s->data;
9b86520e04ac [gaim-migrate @ 1721]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1699
diff changeset
407 m = g->members;
9b86520e04ac [gaim-migrate @ 1721]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1699
diff changeset
408 while (m) {
9b86520e04ac [gaim-migrate @ 1721]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1699
diff changeset
409 b = m->data;
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2281
diff changeset
410 if (blist_options & OPT_BLIST_SHOW_PIXMAPS)
1711
9b86520e04ac [gaim-migrate @ 1721]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1699
diff changeset
411 gtk_widget_show(b->pix);
9b86520e04ac [gaim-migrate @ 1721]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1699
diff changeset
412 else
9b86520e04ac [gaim-migrate @ 1721]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1699
diff changeset
413 gtk_widget_hide(b->pix);
9b86520e04ac [gaim-migrate @ 1721]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1699
diff changeset
414 m = m->next;
9b86520e04ac [gaim-migrate @ 1721]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1699
diff changeset
415 }
9b86520e04ac [gaim-migrate @ 1721]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1699
diff changeset
416 s = s->next;
9b86520e04ac [gaim-migrate @ 1721]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1699
diff changeset
417 }
9b86520e04ac [gaim-migrate @ 1721]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1699
diff changeset
418 }
9b86520e04ac [gaim-migrate @ 1721]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1699
diff changeset
419
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
420 static void update_num_group(struct group_show *gs)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
421 {
1070
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
422 GSList *c = connections;
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
423 struct gaim_connection *gc;
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
424 struct group *g;
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
425 struct buddy_show *b;
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
426 int total = 0, on = 0;
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
427 char buf[256];
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
428
1106
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
429 if (!g_slist_find(shows, gs)) {
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
430 debug_printf("update_num_group called for unfound group_show %s\n", gs->name);
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
431 return;
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
432 }
1085
8da0bf36fb99 [gaim-migrate @ 1095]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1083
diff changeset
433
1070
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
434 while (c) {
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
435 gc = (struct gaim_connection *)c->data;
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
436 g = find_group(gc, gs->name);
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
437 if (g) {
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
438 total += g_slist_length(g->members);
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
439 }
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
440 c = g_slist_next(c);
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
441 }
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
442
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
443 c = gs->members;
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
444 while (c) {
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
445 b = (struct buddy_show *)c->data;
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
446 on += g_slist_length(b->connlist);
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
447 c = g_slist_next(c);
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
448 }
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
449
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2281
diff changeset
450 if (blist_options & OPT_BLIST_SHOW_GRPNUM)
1070
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
451 g_snprintf(buf, sizeof buf, "%s (%d/%d)", gs->name, on, total);
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
452 else
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
453 g_snprintf(buf, sizeof buf, "%s", gs->name);
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
454
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
455 gtk_label_set_text(GTK_LABEL(gs->label), buf);
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
456 }
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
457
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
458 void update_num_groups()
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
459 {
1070
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
460 GSList *s = shows;
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
461 struct group_show *g;
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
462
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
463 while (s) {
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
464 g = (struct group_show *)s->data;
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
465 update_num_group(g);
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
466 s = g_slist_next(s);
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
467 }
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
468 }
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
469
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
470 void update_button_pix()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
471 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
472
875
450db0a5bbe4 [gaim-migrate @ 885]
Rob Flynn <gaim@robflynn.com>
parents: 874
diff changeset
473 adjust_pic(addbutton, _("Add"), (gchar **)gnome_add_xpm);
450db0a5bbe4 [gaim-migrate @ 885]
Rob Flynn <gaim@robflynn.com>
parents: 874
diff changeset
474 adjust_pic(groupbutton, _("Group"), (gchar **)group_xpm);
450db0a5bbe4 [gaim-migrate @ 885]
Rob Flynn <gaim@robflynn.com>
parents: 874
diff changeset
475 adjust_pic(rembutton, _("Remove"), (gchar **)gnome_remove_xpm);
450db0a5bbe4 [gaim-migrate @ 885]
Rob Flynn <gaim@robflynn.com>
parents: 874
diff changeset
476
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2281
diff changeset
477 if (!(blist_options & OPT_BLIST_NO_BUTTONS)) {
1963
76c862e7402f [gaim-migrate @ 1973]
Rob Flynn <gaim@robflynn.com>
parents: 1929
diff changeset
478 adjust_pic(awaybutton, _("Away"), (gchar **)away_big_xpm);
870
9b8b83592bb6 [gaim-migrate @ 880]
Rob Flynn <gaim@robflynn.com>
parents: 865
diff changeset
479 adjust_pic(chatbutton, _("Chat"), (gchar **)join_xpm);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
480 adjust_pic(imbutton, _("IM"), (gchar **)tmp_send_xpm);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
481 adjust_pic(infobutton, _("Info"), (gchar **)tb_search_xpm);
820
fe2e1ad4495b [gaim-migrate @ 830]
Rob Flynn <gaim@robflynn.com>
parents: 813
diff changeset
482 }
544
53a85529d670 [gaim-migrate @ 554]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 535
diff changeset
483 gtk_widget_hide(addbutton->parent);
53a85529d670 [gaim-migrate @ 554]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 535
diff changeset
484 gtk_widget_show(addbutton->parent);
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2281
diff changeset
485 if (!(blist_options & OPT_BLIST_NO_BUTTONS)) {
696
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
486 gtk_widget_hide(chatbutton->parent);
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
487 gtk_widget_show(chatbutton->parent);
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
488 }
820
fe2e1ad4495b [gaim-migrate @ 830]
Rob Flynn <gaim@robflynn.com>
parents: 813
diff changeset
489 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
490
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
491
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
492
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
493 #ifdef USE_APPLET
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
494 gint applet_destroy_buddy(GtkWidget *widget, GdkEvent *event, gpointer *data)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
495 {
746
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 733
diff changeset
496 applet_buddy_show = FALSE;
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 733
diff changeset
497 gtk_widget_hide(blist);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
498 return (TRUE);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
499 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
500
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
501 #endif
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
502
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
503 void handle_click_group(GtkWidget *widget, GdkEventButton *event, struct group *g)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
504 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
505 if (event->type == GDK_2BUTTON_PRESS) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
506 if (GTK_TREE_ITEM(widget)->expanded)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
507 gtk_tree_item_collapse(GTK_TREE_ITEM(widget));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
508 else
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
509 gtk_tree_item_expand(GTK_TREE_ITEM(widget));
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
510 } else if ((event->type == GDK_BUTTON_PRESS) && (event->button == 3)) {
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
511 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
512 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
513
1739
0ddc5418a0b4 [gaim-migrate @ 1749]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
514 void pressed_im_bud(GtkWidget *widget, struct buddy *b)
0ddc5418a0b4 [gaim-migrate @ 1749]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
515 {
0ddc5418a0b4 [gaim-migrate @ 1749]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
516 struct conversation *c;
0ddc5418a0b4 [gaim-migrate @ 1749]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
517
0ddc5418a0b4 [gaim-migrate @ 1749]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
518 c = find_conversation(b->name);
0ddc5418a0b4 [gaim-migrate @ 1749]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
519
0ddc5418a0b4 [gaim-migrate @ 1749]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
520 if (c != NULL) {
0ddc5418a0b4 [gaim-migrate @ 1749]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
521 gdk_window_show(c->window->window);
0ddc5418a0b4 [gaim-migrate @ 1749]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
522 } else {
0ddc5418a0b4 [gaim-migrate @ 1749]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
523 c = new_conversation(b->name);
0ddc5418a0b4 [gaim-migrate @ 1749]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
524
1898
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1881
diff changeset
525 set_convo_gc(c, b->gc);
1739
0ddc5418a0b4 [gaim-migrate @ 1749]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
526 }
0ddc5418a0b4 [gaim-migrate @ 1749]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
527 }
0ddc5418a0b4 [gaim-migrate @ 1749]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
528
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
529 void pressed_im(GtkWidget *widget, struct buddy_show *b)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
530 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
531 struct conversation *c;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
532
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
533 c = find_conversation(b->name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
534
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
535 if (c != NULL) {
87
8923e3bd6c5a [gaim-migrate @ 97]
Syd Logan <slogan>
parents: 84
diff changeset
536 gdk_window_show(c->window->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
537 } else {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
538 c = new_conversation(b->name);
1150
aa3dda7fc352 [gaim-migrate @ 1160]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1138
diff changeset
539
1898
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1881
diff changeset
540 set_convo_gc(c, b->connlist->data);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
541 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
542 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
543
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
544 void pressed_log(GtkWidget *widget, char *name)
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1465
diff changeset
545 {
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1465
diff changeset
546 show_log(name);
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1465
diff changeset
547 }
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1465
diff changeset
548
1634
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
549 void show_syslog()
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
550 {
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
551 show_log(NULL);
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
552 }
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
553
438
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
554 void pressed_ticker(char *buddy)
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
555 {
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
556 struct conversation *c;
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
557
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
558 c = find_conversation(buddy);
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
559
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
560 if (c != NULL) {
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
561 gdk_window_show(c->window->window);
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
562 } else {
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
563 c = new_conversation(buddy);
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
564 }
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
565 }
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
566
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
567 void pressed_alias_bs(GtkWidget *widget, struct buddy_show *bs)
710
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 703
diff changeset
568 {
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
569 alias_dialog_bud(find_buddy(bs->connlist->data, bs->name));
1397
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
570 }
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
571
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
572 void pressed_alias_bud(GtkWidget *widget, struct buddy *b)
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
573 {
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
574 alias_dialog_bud(b);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
575 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
576
2170
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
577 static void menu_click(GtkObject *obj, char *who)
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
578 {
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
579 GList *list = gtk_object_get_user_data(obj);
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
580 GList *first = g_list_first(list);
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
581 struct proto_buddy_menu *pbm = list->data;
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
582 if (pbm->callback)
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
583 pbm->callback(pbm->gc, who);
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
584 g_list_foreach(first, (GFunc)g_free, NULL);
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
585 g_list_free(first);
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
586 }
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
587
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
588 void handle_click_buddy(GtkWidget *widget, GdkEventButton *event, struct buddy_show *b)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
589 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
590 if (!b->connlist)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
591 return;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
592 if (event->type == GDK_2BUTTON_PRESS && event->button == 1) {
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
593 struct conversation *c;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
594
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
595 c = find_conversation(b->name);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
596
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
597 if (c != NULL)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
598 gdk_window_show(c->window->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
599 else
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
600 c = new_conversation(b->name);
1150
aa3dda7fc352 [gaim-migrate @ 1160]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1138
diff changeset
601
2132
a6b9983cead1 [gaim-migrate @ 2142]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2131
diff changeset
602 set_convo_gc(c, b->connlist->data);
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2281
diff changeset
603 if (im_options & OPT_IM_ONE_WINDOW)
1594
ac8eddd16e89 [gaim-migrate @ 1604]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1591
diff changeset
604 raise_convo_tab(c);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
605 } else if (event->type == GDK_BUTTON_PRESS && event->button == 3) {
1032
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
606 GtkWidget *menu;
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
607 GtkWidget *button;
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
608 GtkWidget *menuitem;
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
609 GtkWidget *conmenu;
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
610 GSList *cn = b->connlist;
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
611 struct gaim_connection *g;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
612 /* We're gonna make us a menu right here */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
613
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
614 menu = gtk_menu_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
615
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
616 button = gtk_menu_item_new_with_label(_("IM"));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
617 gtk_signal_connect(GTK_OBJECT(button), "activate", GTK_SIGNAL_FUNC(pressed_im), b);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
618 gtk_menu_append(GTK_MENU(menu), button);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
619 gtk_widget_show(button);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
620
710
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 703
diff changeset
621 button = gtk_menu_item_new_with_label(_("Alias"));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
622 gtk_signal_connect(GTK_OBJECT(button), "activate", GTK_SIGNAL_FUNC(pressed_alias_bs), b);
710
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 703
diff changeset
623 gtk_menu_append(GTK_MENU(menu), button);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 703
diff changeset
624 gtk_widget_show(button);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 703
diff changeset
625
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
626 button = gtk_menu_item_new_with_label(_("Add Buddy Pounce"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
627 gtk_signal_connect(GTK_OBJECT(button), "activate",
2569
a714b8223228 [gaim-migrate @ 2582]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2564
diff changeset
628 GTK_SIGNAL_FUNC(new_bp_callback),
a714b8223228 [gaim-migrate @ 2582]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2564
diff changeset
629 cn ? find_buddy(cn->data, b->name) : NULL);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
630 gtk_menu_append(GTK_MENU(menu), button);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
631 gtk_widget_show(button);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
632
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1465
diff changeset
633 button = gtk_menu_item_new_with_label(_("View Log"));
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1465
diff changeset
634 gtk_signal_connect(GTK_OBJECT(button), "activate",
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1465
diff changeset
635 GTK_SIGNAL_FUNC(pressed_log), b->name);
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1465
diff changeset
636 gtk_menu_append(GTK_MENU(menu), button);
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1465
diff changeset
637 gtk_widget_show(button);
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1465
diff changeset
638
1032
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
639 if (g_slist_length(cn) > 1) {
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
640 while (cn) {
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
641 g = (struct gaim_connection *)cn->data;
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1496
diff changeset
642 if (g->prpl->buddy_menu) {
2170
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
643 GList *mo = (*g->prpl->buddy_menu)(g, b->name);
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
644
1032
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
645 menuitem = gtk_menu_item_new_with_label(g->username);
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
646 gtk_menu_append(GTK_MENU(menu), menuitem);
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
647 gtk_widget_show(menuitem);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
648
1032
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
649 conmenu = gtk_menu_new();
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
650 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), conmenu);
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
651 gtk_widget_show(conmenu);
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
652
2170
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
653 while (mo) {
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
654 struct proto_buddy_menu *pbm = mo->data;
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
655 GtkWidget *button;
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
656
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
657 button = gtk_menu_item_new_with_label(pbm->label);
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
658 gtk_signal_connect(GTK_OBJECT(button), "activate",
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
659 GTK_SIGNAL_FUNC(menu_click), b->name);
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
660 gtk_object_set_user_data(GTK_OBJECT(button), mo);
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
661 gtk_menu_append(GTK_MENU(conmenu), button);
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
662 gtk_widget_show(button);
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
663
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
664 mo = mo->next;
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
665 }
1032
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
666 }
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
667 cn = g_slist_next(cn);
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
668 }
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
669 } else {
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
670 g = (struct gaim_connection *)cn->data;
2170
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
671 if (g->prpl->buddy_menu) {
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
672 GList *mo = (*g->prpl->buddy_menu)(g, b->name);
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
673
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
674 while (mo) {
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
675 struct proto_buddy_menu *pbm = mo->data;
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
676 GtkWidget *button;
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
677
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
678 button = gtk_menu_item_new_with_label(pbm->label);
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
679 gtk_signal_connect(GTK_OBJECT(button), "activate",
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
680 GTK_SIGNAL_FUNC(menu_click), b->name);
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
681 gtk_object_set_user_data(GTK_OBJECT(button), mo);
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
682 gtk_menu_append(GTK_MENU(menu), button);
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
683 gtk_widget_show(button);
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
684
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
685 mo = mo->next;
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
686 }
c24595d3c364 [gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2140
diff changeset
687 }
1032
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
688 }
1874
1e33bd2d7780 [gaim-migrate @ 1884]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1870
diff changeset
689
1e33bd2d7780 [gaim-migrate @ 1884]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1870
diff changeset
690 /* we send the menu widget so we can add menuitems within a plugin */
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
691 plugin_event(event_draw_menu, menu, b->name, 0, 0);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
692
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
693 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, event->button, event->time);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
694
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
695 } else if (event->type == GDK_3BUTTON_PRESS && event->button == 2) {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
696 if (!g_strcasecmp("zilding", normalize (b->name)))
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
697 show_ee_dialog(0);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
698 else if (!g_strcasecmp("robflynn", normalize (b->name)))
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
699 show_ee_dialog(1);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
700 else if (!g_strcasecmp("flynorange", normalize (b->name)))
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
701 show_ee_dialog(2);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
702 else if (!g_strcasecmp("ewarmenhoven", normalize (b->name)))
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
703 show_ee_dialog(3);
2472
dd4114ed4c07 [gaim-migrate @ 2485]
Rob Flynn <gaim@robflynn.com>
parents: 2433
diff changeset
704 else if (!g_strcasecmp("markster97", normalize (b->name)))
dd4114ed4c07 [gaim-migrate @ 2485]
Rob Flynn <gaim@robflynn.com>
parents: 2433
diff changeset
705 show_ee_dialog(4);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
706
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
707 } else {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
708
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
709 /* Anything for other buttons? :) */
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
710 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
711 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
712
1396
df7c3cacac92 [gaim-migrate @ 1406]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1392
diff changeset
713 static void un_alias(GtkWidget *a, struct buddy *b)
df7c3cacac92 [gaim-migrate @ 1406]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1392
diff changeset
714 {
df7c3cacac92 [gaim-migrate @ 1406]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1392
diff changeset
715 struct group *g = find_group_by_buddy(b->gc, b->name);
df7c3cacac92 [gaim-migrate @ 1406]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1392
diff changeset
716 struct group_show *gs = find_group_show(g->name);
1397
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
717 struct buddy_show *bs = NULL;
1396
df7c3cacac92 [gaim-migrate @ 1406]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1392
diff changeset
718 GtkCTreeNode *node = gtk_ctree_find_by_row_data(GTK_CTREE(edittree), NULL, b);
df7c3cacac92 [gaim-migrate @ 1406]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1392
diff changeset
719 g_snprintf(b->show, sizeof(b->show), "%s", b->name);
df7c3cacac92 [gaim-migrate @ 1406]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1392
diff changeset
720 gtk_ctree_node_set_text(GTK_CTREE(edittree), node, 0, b->name);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
721 if (gs)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
722 bs = find_buddy_show(gs, b->name);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
723 if (bs)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
724 gtk_label_set(GTK_LABEL(bs->label), b->name);
1805
caa605e70917 [gaim-migrate @ 1815]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1794
diff changeset
725 do_export(b->gc);
1396
df7c3cacac92 [gaim-migrate @ 1406]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1392
diff changeset
726 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
727
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
728 static gboolean click_edit_tree(GtkWidget *widget, GdkEventButton *event, gpointer data)
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
729 {
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
730 GtkCTreeNode *node;
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
731 int *type;
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
732 int row, column;
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
733 GtkWidget *menu;
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
734 GtkWidget *button;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
735
1392
dc6ba774bfc5 [gaim-migrate @ 1402]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1391
diff changeset
736 if (event->button != 3 || event->type != GDK_BUTTON_PRESS)
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
737 return TRUE;
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
738
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
739 if (!gtk_clist_get_selection_info(GTK_CLIST(edittree), event->x, event->y, &row, &column))
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
740 return TRUE;
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
741
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
742 node = gtk_ctree_node_nth(GTK_CTREE(edittree), row);
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
743 type = gtk_ctree_node_get_row_data(GTK_CTREE(edittree), node);
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
744 if (*type == EDIT_GROUP) {
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
745 struct group *group = (struct group *)type;
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
746 menu = gtk_menu_new();
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
747
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
748 button = gtk_menu_item_new_with_label(_("Rename"));
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
749 gtk_signal_connect(GTK_OBJECT(button), "activate",
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
750 GTK_SIGNAL_FUNC(show_rename_group), group);
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
751 gtk_menu_append(GTK_MENU(menu), button);
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
752 gtk_widget_show(button);
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
753
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
754 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, event->button, event->time);
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
755 } else if (*type == EDIT_BUDDY) {
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
756 struct buddy *b = (struct buddy *)type;
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
757 menu = gtk_menu_new();
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
758
1739
0ddc5418a0b4 [gaim-migrate @ 1749]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
759 button = gtk_menu_item_new_with_label(_("IM"));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
760 gtk_signal_connect(GTK_OBJECT(button), "activate", GTK_SIGNAL_FUNC(pressed_im_bud), b);
1739
0ddc5418a0b4 [gaim-migrate @ 1749]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
761 gtk_menu_append(GTK_MENU(menu), button);
0ddc5418a0b4 [gaim-migrate @ 1749]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
762 gtk_widget_show(button);
0ddc5418a0b4 [gaim-migrate @ 1749]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
763
1392
dc6ba774bfc5 [gaim-migrate @ 1402]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1391
diff changeset
764 button = gtk_menu_item_new_with_label(_("Alias"));
dc6ba774bfc5 [gaim-migrate @ 1402]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1391
diff changeset
765 gtk_signal_connect(GTK_OBJECT(button), "activate",
1397
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
766 GTK_SIGNAL_FUNC(pressed_alias_bud), b);
1392
dc6ba774bfc5 [gaim-migrate @ 1402]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1391
diff changeset
767 gtk_menu_append(GTK_MENU(menu), button);
dc6ba774bfc5 [gaim-migrate @ 1402]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1391
diff changeset
768 gtk_widget_show(button);
dc6ba774bfc5 [gaim-migrate @ 1402]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1391
diff changeset
769
1396
df7c3cacac92 [gaim-migrate @ 1406]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1392
diff changeset
770 if (strcmp(b->name, b->show)) {
df7c3cacac92 [gaim-migrate @ 1406]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1392
diff changeset
771 button = gtk_menu_item_new_with_label(_("Un-Alias"));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
772 gtk_signal_connect(GTK_OBJECT(button), "activate", GTK_SIGNAL_FUNC(un_alias), b);
1396
df7c3cacac92 [gaim-migrate @ 1406]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1392
diff changeset
773 gtk_menu_append(GTK_MENU(menu), button);
df7c3cacac92 [gaim-migrate @ 1406]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1392
diff changeset
774 gtk_widget_show(button);
df7c3cacac92 [gaim-migrate @ 1406]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1392
diff changeset
775 }
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
776
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
777 button = gtk_menu_item_new_with_label(_("Rename"));
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
778 gtk_signal_connect(GTK_OBJECT(button), "activate",
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
779 GTK_SIGNAL_FUNC(show_rename_buddy), b);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
780 gtk_menu_append(GTK_MENU(menu), button);
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
781 gtk_widget_show(button);
1396
df7c3cacac92 [gaim-migrate @ 1406]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1392
diff changeset
782
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
783 button = gtk_menu_item_new_with_label(_("Add Buddy Pounce"));
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
784 gtk_signal_connect(GTK_OBJECT(button), "activate",
2564
552a56d334ec [gaim-migrate @ 2577]
Rob Flynn <gaim@robflynn.com>
parents: 2560
diff changeset
785 GTK_SIGNAL_FUNC(new_bp_callback), b);
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
786 gtk_menu_append(GTK_MENU(menu), button);
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
787 gtk_widget_show(button);
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
788
1477
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1465
diff changeset
789 button = gtk_menu_item_new_with_label(_("View Log"));
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1465
diff changeset
790 gtk_signal_connect(GTK_OBJECT(button), "activate",
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1465
diff changeset
791 GTK_SIGNAL_FUNC(pressed_log), b->name);
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1465
diff changeset
792 gtk_menu_append(GTK_MENU(menu), button);
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1465
diff changeset
793 gtk_widget_show(button);
1d0fc2622b29 [gaim-migrate @ 1487]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1465
diff changeset
794
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
795 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, event->button, event->time);
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
796 }
1456
6650776468b3 [gaim-migrate @ 1466]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1435
diff changeset
797
6650776468b3 [gaim-migrate @ 1466]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1435
diff changeset
798 return TRUE;
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
799 }
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
800
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
801
2382
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2380
diff changeset
802 void ui_remove_buddy(struct gaim_connection *gc, struct group *rem_g, struct buddy *rem_b)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
803 {
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
804 struct conversation *c;
1069
5d4926907b21 [gaim-migrate @ 1079]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1068
diff changeset
805 struct group_show *gs;
5d4926907b21 [gaim-migrate @ 1079]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1068
diff changeset
806 struct buddy_show *bs;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
807
1069
5d4926907b21 [gaim-migrate @ 1079]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1068
diff changeset
808 gs = find_group_show(rem_g->name);
5d4926907b21 [gaim-migrate @ 1079]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1068
diff changeset
809 if (gs) {
5d4926907b21 [gaim-migrate @ 1079]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1068
diff changeset
810 bs = find_buddy_show(gs, rem_b->name);
5d4926907b21 [gaim-migrate @ 1079]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1068
diff changeset
811 if (bs) {
5d4926907b21 [gaim-migrate @ 1079]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1068
diff changeset
812 if (g_slist_find(bs->connlist, gc)) {
5d4926907b21 [gaim-migrate @ 1079]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1068
diff changeset
813 bs->connlist = g_slist_remove(bs->connlist, gc);
5d4926907b21 [gaim-migrate @ 1079]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1068
diff changeset
814 if (!g_slist_length(bs->connlist)) {
5d4926907b21 [gaim-migrate @ 1079]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1068
diff changeset
815 gs->members = g_slist_remove(gs->members, bs);
5d4926907b21 [gaim-migrate @ 1079]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1068
diff changeset
816 if (bs->log_timer > 0)
5d4926907b21 [gaim-migrate @ 1079]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1068
diff changeset
817 gtk_timeout_remove(bs->log_timer);
1098
b335c0ce305e [gaim-migrate @ 1108]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1097
diff changeset
818 bs->log_timer = 0;
1108
cb338aa38e78 [gaim-migrate @ 1118]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1106
diff changeset
819 remove_buddy_show(gs, bs);
1069
5d4926907b21 [gaim-migrate @ 1079]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1068
diff changeset
820 g_free(bs->show);
5d4926907b21 [gaim-migrate @ 1079]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1068
diff changeset
821 g_free(bs->name);
5d4926907b21 [gaim-migrate @ 1079]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1068
diff changeset
822 g_free(bs);
1083
12478dd1e9d7 [gaim-migrate @ 1093]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1081
diff changeset
823 if (!g_slist_length(gs->members) &&
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
824 (blist_options & OPT_BLIST_NO_MT_GRP)) {
1069
5d4926907b21 [gaim-migrate @ 1079]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1068
diff changeset
825 shows = g_slist_remove(shows, gs);
1108
cb338aa38e78 [gaim-migrate @ 1118]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1106
diff changeset
826 gtk_tree_remove_item(GTK_TREE(buddies), gs->item);
1069
5d4926907b21 [gaim-migrate @ 1079]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1068
diff changeset
827 g_free(gs->name);
5d4926907b21 [gaim-migrate @ 1079]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1068
diff changeset
828 g_free(gs);
1083
12478dd1e9d7 [gaim-migrate @ 1093]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1081
diff changeset
829 } else
12478dd1e9d7 [gaim-migrate @ 1093]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1081
diff changeset
830 update_num_group(gs);
12478dd1e9d7 [gaim-migrate @ 1093]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1081
diff changeset
831 } else
12478dd1e9d7 [gaim-migrate @ 1093]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1081
diff changeset
832 update_num_group(gs);
1364
ce379d65a5e3 [gaim-migrate @ 1374]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
833 } else
ce379d65a5e3 [gaim-migrate @ 1374]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
834 update_num_group(gs);
ce379d65a5e3 [gaim-migrate @ 1374]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
835 } else
ce379d65a5e3 [gaim-migrate @ 1374]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
836 update_num_group(gs);
1069
5d4926907b21 [gaim-migrate @ 1079]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1068
diff changeset
837 }
5d4926907b21 [gaim-migrate @ 1079]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1068
diff changeset
838
2382
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2380
diff changeset
839 c = find_conversation(rem_b->name);
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
840 if (c)
1352
2e8213567278 [gaim-migrate @ 1362]
Rob Flynn <gaim@robflynn.com>
parents: 1340
diff changeset
841 update_buttons_by_protocol(c);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
842 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
843
2382
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2380
diff changeset
844 void ui_remove_group(struct gaim_connection *gc, struct group *rem_g)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
845 {
1297
aa6a0fe8e03f [gaim-migrate @ 1307]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
846 struct group_show *gs;
2382
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2380
diff changeset
847
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2380
diff changeset
848 if ((gs = find_group_show(rem_g->name)) != NULL) {
1465
163b9ee8d789 [gaim-migrate @ 1475]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
849 shows = g_slist_remove(shows, gs);
1297
aa6a0fe8e03f [gaim-migrate @ 1307]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
850 gtk_tree_remove_item(GTK_TREE(buddies), gs->item);
aa6a0fe8e03f [gaim-migrate @ 1307]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
851 g_free(gs->name);
aa6a0fe8e03f [gaim-migrate @ 1307]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
852 g_free(gs);
aa6a0fe8e03f [gaim-migrate @ 1307]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
853 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
854 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
855
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
856 gboolean edit_drag_compare_func(GtkCTree *ctree, GtkCTreeNode *source_node,
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
857 GtkCTreeNode *new_parent, GtkCTreeNode *new_sibling)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
858 {
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
859 int *type;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
860
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
861 type = (int *)gtk_ctree_node_get_row_data(GTK_CTREE(ctree), source_node);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
862
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
863 if (*type == EDIT_GC) {
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
864 if (!new_parent)
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
865 return TRUE;
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
866 } else if (*type == EDIT_BUDDY) {
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
867 if (new_parent) {
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
868 type = (int *)gtk_ctree_node_get_row_data(GTK_CTREE(ctree), new_parent);
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
869 if (*type == EDIT_GROUP)
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
870 return TRUE;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
871 }
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
872 } else { /* group */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
873
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
874 if (g_slist_length(connections) > 1 && new_parent) {
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
875 type = (int *)gtk_ctree_node_get_row_data(GTK_CTREE(ctree), new_parent);
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
876 if (*type == EDIT_GC)
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
877 return TRUE;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
878 } else if (g_slist_length(connections) == 1 && !new_parent)
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
879 return TRUE;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
880 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
881
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
882 return FALSE;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
883 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
884
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
885
2380
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
886 /* you really shouldn't call this function */
6f83c22d9e70 [gaim-migrate @ 2393]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
887 void redo_buddy_list()
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
888 {
1069
5d4926907b21 [gaim-migrate @ 1079]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1068
diff changeset
889 /* so here we can safely assume that we don't have to add or delete anything, we
5d4926907b21 [gaim-migrate @ 1079]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1068
diff changeset
890 * just have to go through and reorder everything. remember, nothing is going to
5d4926907b21 [gaim-migrate @ 1079]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1068
diff changeset
891 * change connections, so we can assume that we don't have to change any user
5d4926907b21 [gaim-migrate @ 1079]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1068
diff changeset
892 * data or anything. this is just a simple reordering. so calm down. */
1106
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
893 /* note: we only have to do this if we want to strongly enforce order; however,
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
894 * order doesn't particularly matter to the stability of the program. but, it's
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
895 * kind of nice to have */
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
896 /* the easy way to implement this is just to go through shows and destroy all the
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
897 * group_shows, then go through the connections and put everything back. though,
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
898 * there are slight complications with that; most of them deal with timeouts and
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
899 * people not seeing the login icon for the full 10 seconds. butt fuck them. */
1069
5d4926907b21 [gaim-migrate @ 1079]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1068
diff changeset
900 GSList *s = shows;
1106
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
901 struct group_show *gs;
1069
5d4926907b21 [gaim-migrate @ 1079]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1068
diff changeset
902 GSList *m;
1106
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
903 struct buddy_show *bs;
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
904 GSList *c = connections;
1069
5d4926907b21 [gaim-migrate @ 1079]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1068
diff changeset
905 struct gaim_connection *gc;
1106
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
906 GSList *gr;
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
907 struct group *g;
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
908 struct buddy *b;
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
909
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
910 if (!blist)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
911 return;
1150
aa3dda7fc352 [gaim-migrate @ 1160]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1138
diff changeset
912
1106
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
913 while (s) {
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
914 gs = (struct group_show *)s->data;
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
915 s = g_slist_remove(s, gs);
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
916 m = gs->members;
1108
cb338aa38e78 [gaim-migrate @ 1118]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1106
diff changeset
917 gtk_tree_remove_item(GTK_TREE(buddies), gs->item);
1106
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
918 while (m) {
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
919 bs = (struct buddy_show *)m->data;
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
920 m = g_slist_remove(m, bs);
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
921 if (bs->log_timer > 0)
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
922 gtk_timeout_remove(bs->log_timer);
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
923 g_free(bs->show);
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
924 g_free(bs->name);
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
925 g_free(bs);
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
926 }
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
927 g_free(gs->name);
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
928 g_free(gs);
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
929 }
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
930 shows = NULL;
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
931 while (c) {
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
932 gc = (struct gaim_connection *)c->data;
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
933 c = c->next;
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
934 gr = gc->groups;
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
935 while (gr) {
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
936 g = (struct group *)gr->data;
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
937 gr = gr->next;
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
938 gs = find_group_show(g->name);
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2281
diff changeset
939 if (!gs && !(blist_options & OPT_BLIST_NO_MT_GRP))
1106
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
940 gs = new_group_show(g->name);
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
941 m = g->members;
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
942 while (m) {
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
943 b = (struct buddy *)m->data;
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
944 m = m->next;
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
945 if (b->present) {
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
946 if (!gs)
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
947 gs = new_group_show(g->name);
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
948 bs = find_buddy_show(gs, b->name);
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
949 if (!bs) {
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
950 if (gc->prpl->list_icon)
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
951 bs = new_buddy_show(gs, b,
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
952 (*gc->prpl->list_icon)(b->
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
953 uc));
1106
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
954 else
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
955 bs = new_buddy_show(gs, b, (char **)no_icon_xpm);
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
956 }
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
957 bs->connlist = g_slist_append(bs->connlist, gc);
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
958 }
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
959 }
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
960 }
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
961 }
2605
ff9d9b4f7aa2 [gaim-migrate @ 2618]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2598
diff changeset
962 update_idle_times();
1069
5d4926907b21 [gaim-migrate @ 1079]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1068
diff changeset
963 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
964
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
965 static void edit_tree_move(GtkCTree *ctree, GtkCTreeNode *child, GtkCTreeNode *parent,
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
966 GtkCTreeNode *sibling, gpointer data)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
967 {
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
968 struct gaim_connection *gc, *pc = NULL, *sc = NULL;
1456
6650776468b3 [gaim-migrate @ 1466]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1435
diff changeset
969 int *ctype, *ptype = NULL, *stype = NULL;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
970
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
971 ctype = (int *)gtk_ctree_node_get_row_data(GTK_CTREE(ctree), child);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
972
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
973 if (parent)
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
974 ptype = (int *)gtk_ctree_node_get_row_data(GTK_CTREE(ctree), parent);
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
975
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
976 if (sibling)
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
977 stype = (int *)gtk_ctree_node_get_row_data(GTK_CTREE(ctree), sibling);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
978
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
979 if (*ctype == EDIT_GC) {
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
980 /* not that it particularly matters which order the connections
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
981 * are in, but just for debugging sake, i guess.... */
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
982 gc = (struct gaim_connection *)ctype;
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
983 connections = g_slist_remove(connections, gc);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
984 if (sibling) {
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
985 int pos;
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
986 sc = (struct gaim_connection *)stype;
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
987 pos = g_slist_index(connections, sc);
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
988 if (pos)
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
989 connections = g_slist_insert(connections, gc, pos);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
990 else
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
991 connections = g_slist_prepend(connections, gc);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
992 } else
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
993 connections = g_slist_append(connections, gc);
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
994 } else if (*ctype == EDIT_BUDDY) {
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
995 /* we moved a buddy. hopefully we just changed groups or positions or something.
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
996 * if we changed connections, we copy the buddy to the new connection. if the new
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
997 * connection already had the buddy in its buddy list but in a different group,
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
998 * we change the group that the buddy is in */
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
999 struct group *old_g, *new_g = (struct group *)ptype;
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1000 struct buddy *s = NULL, *buddy = (struct buddy *)ctype;
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1001 int pos;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1002
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1003 if (buddy->gc != new_g->gc) {
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1004 /* we changed connections */
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1005 struct buddy *a;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1006
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1007 a = find_buddy(new_g->gc, buddy->name);
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1008
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1009 if (a) {
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1010 /* the buddy is in the new connection, so we'll remove it from
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1011 * its current group and add it to the proper group below */
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1012 struct group *og;
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1013 og = find_group_by_buddy(new_g->gc, buddy->name);
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1014 og->members = g_slist_remove(og->members, a);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1015 } else {
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1016 /* we don't have this buddy yet; let's add him */
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1017 serv_add_buddy(new_g->gc, buddy->name);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1018 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1019 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1020
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1021 old_g = find_group_by_buddy(buddy->gc, buddy->name);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1022
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1023 if (buddy->gc == new_g->gc)
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1024 /* this is the same connection, so we'll remove it from its old group */
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1025 old_g->members = g_slist_remove(old_g->members, buddy);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1026
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1027 if (sibling) {
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1028 s = (struct buddy *)stype;
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1029 pos = g_slist_index(new_g->members, s);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1030 if (pos)
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1031 new_g->members = g_slist_insert(new_g->members, buddy, pos);
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1032 else
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1033 new_g->members = g_slist_prepend(new_g->members, buddy);
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1034 } else
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1035 new_g->members = g_slist_append(new_g->members, buddy);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1036
1805
caa605e70917 [gaim-migrate @ 1815]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1794
diff changeset
1037 do_export(buddy->gc);
caa605e70917 [gaim-migrate @ 1815]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1794
diff changeset
1038 if (buddy->gc != new_g->gc) {
caa605e70917 [gaim-migrate @ 1815]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1794
diff changeset
1039 do_export(new_g->gc);
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1040 build_edit_tree();
1805
caa605e70917 [gaim-migrate @ 1815]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1794
diff changeset
1041 }
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1042 } else { /* group */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1043
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1044 /* move the group. if moving connections, copy the group, and each buddy in the
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1045 * group. if the buddy exists in the new connection, leave it where it is. */
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1046
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1047 struct group *g, *g2, *group;
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1048 int pos;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1049
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1050 pc = (struct gaim_connection *)ptype;
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1051 group = (struct group *)ctype;
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1052
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1053 if (g_slist_length(connections) > 1) {
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1054 g = find_group(pc, group->name);
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1055 if (!g)
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1056 g = add_group(pc, group->name);
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1057
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1058 pc->groups = g_slist_remove(pc->groups, g);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1059
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1060 if (sibling) {
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1061 g2 = (struct group *)stype;
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1062 pos = g_slist_index(pc->groups, g2);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1063 if (pos)
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1064 pc->groups = g_slist_insert(pc->groups, g, pos);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1065 else
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1066 pc->groups = g_slist_prepend(pc->groups, g);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1067 } else
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1068 pc->groups = g_slist_append(pc->groups, g);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1069
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1070 if (pc != group->gc) {
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1071 GSList *mem;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1072 struct buddy *b;
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1073 g2 = group;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1074
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1075 mem = g2->members;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1076 while (mem) {
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1077 b = (struct buddy *)mem->data;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1078 if (!find_buddy(pc, b->name))
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1079 add_buddy(pc, g->name, b->name, b->show);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1080 mem = mem->next;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1081 }
912
5a517b4f0be4 [gaim-migrate @ 922]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
1082 }
1805
caa605e70917 [gaim-migrate @ 1815]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1794
diff changeset
1083 do_export(pc);
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1084 } else {
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1085 g = group;
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1086 gc = g->gc;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1087
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1088 gc->groups = g_slist_remove(gc->groups, g);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1089
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1090 if (sibling) {
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1091 g2 = (struct group *)stype;
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1092 pos = g_slist_index(gc->groups, g2);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1093 if (pos)
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1094 gc->groups = g_slist_insert(gc->groups, g, pos);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1095 else
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1096 gc->groups = g_slist_prepend(gc->groups, g);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1097 } else
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1098 gc->groups = g_slist_append(gc->groups, g);
1805
caa605e70917 [gaim-migrate @ 1815]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1794
diff changeset
1099 do_export(gc);
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1100 }
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1101 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1102
1069
5d4926907b21 [gaim-migrate @ 1079]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1068
diff changeset
1103 redo_buddy_list();
1070
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
1104 update_num_groups();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1105 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1106
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1107
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1108
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1109 void build_edit_tree()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1110 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1111 GtkCTreeNode *c = NULL, *p = NULL, *n;
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1112 GSList *con = connections;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1113 GSList *grp;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1114 GSList *mem;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1115 struct gaim_connection *z;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1116 struct group *g;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1117 struct buddy *b;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1118 char *text[1];
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1119
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1120 if (!blist)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1121 return;
1032
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
1122
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1123 gtk_clist_freeze(GTK_CLIST(edittree));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1124 gtk_clist_clear(GTK_CLIST(edittree));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1125
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1126
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1127 while (con) {
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1128 z = (struct gaim_connection *)con->data;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1129
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1130 if (g_slist_length(connections) > 1) {
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1131 text[0] = z->username;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1132
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1133 c = gtk_ctree_insert_node(GTK_CTREE(edittree), NULL,
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1134 NULL, text, 5, NULL, NULL, NULL, NULL, 0, 1);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1135
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1136 gtk_ctree_node_set_row_data(GTK_CTREE(edittree), c, z);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1137 } else
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1138 c = NULL;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1139
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1140 grp = z->groups;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1141
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1142 while (grp) {
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1143 g = (struct group *)grp->data;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1144
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1145 text[0] = g->name;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1146
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1147 p = gtk_ctree_insert_node(GTK_CTREE(edittree), c,
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1148 NULL, text, 5, NULL, NULL, NULL, NULL, 0, 1);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1149
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1150 gtk_ctree_node_set_row_data(GTK_CTREE(edittree), p, g);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1151
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1152 n = NULL;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1153
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1154 mem = g->members;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1155
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1156 while (mem) {
1396
df7c3cacac92 [gaim-migrate @ 1406]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1392
diff changeset
1157 char buf[256];
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1158 b = (struct buddy *)mem->data;
1396
df7c3cacac92 [gaim-migrate @ 1406]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1392
diff changeset
1159 if (strcmp(b->name, b->show)) {
df7c3cacac92 [gaim-migrate @ 1406]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1392
diff changeset
1160 g_snprintf(buf, sizeof(buf), "%s (%s)", b->name, b->show);
df7c3cacac92 [gaim-migrate @ 1406]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1392
diff changeset
1161 text[0] = buf;
df7c3cacac92 [gaim-migrate @ 1406]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1392
diff changeset
1162 } else
df7c3cacac92 [gaim-migrate @ 1406]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1392
diff changeset
1163 text[0] = b->name;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1164
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1165 n = gtk_ctree_insert_node(GTK_CTREE(edittree),
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1166 p, NULL, text, 5,
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1167 NULL, NULL, NULL, NULL, 1, 1);
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1168
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1169 gtk_ctree_node_set_row_data(GTK_CTREE(edittree), n, b);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1170
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1171 mem = mem->next;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1172
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1173 }
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1174 grp = g_slist_next(grp);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1175 }
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1176 con = g_slist_next(con);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1177 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1178
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1179 gtk_clist_thaw(GTK_CLIST(edittree));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1180
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1181 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1182
2382
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2380
diff changeset
1183 void ui_add_buddy(struct gaim_connection *gc, struct group *g, struct buddy *b)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1184 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1185 GtkCTreeNode *p = NULL, *n;
1699
644056e095f1 [gaim-migrate @ 1709]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1694
diff changeset
1186 char *text[1];
644056e095f1 [gaim-migrate @ 1709]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1694
diff changeset
1187 char buf[256];
2382
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2380
diff changeset
1188 struct group_show *gs = find_group_show(g->name);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1189
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1190 b->edittype = EDIT_BUDDY;
1088
18a14e6dd0af [gaim-migrate @ 1098]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1085
diff changeset
1191
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1192 if (gs)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1193 update_num_group(gs);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1194
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1195 if (!blist)
2382
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2380
diff changeset
1196 return;
1699
644056e095f1 [gaim-migrate @ 1709]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1694
diff changeset
1197
644056e095f1 [gaim-migrate @ 1709]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1694
diff changeset
1198 p = gtk_ctree_find_by_row_data(GTK_CTREE(edittree), NULL, g);
644056e095f1 [gaim-migrate @ 1709]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1694
diff changeset
1199 if (strcmp(b->name, b->show)) {
644056e095f1 [gaim-migrate @ 1709]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1694
diff changeset
1200 g_snprintf(buf, sizeof(buf), "%s (%s)", b->name, b->show);
644056e095f1 [gaim-migrate @ 1709]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1694
diff changeset
1201 text[0] = buf;
644056e095f1 [gaim-migrate @ 1709]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1694
diff changeset
1202 } else
644056e095f1 [gaim-migrate @ 1709]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1694
diff changeset
1203 text[0] = b->name;
644056e095f1 [gaim-migrate @ 1709]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1694
diff changeset
1204
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1205 n = gtk_ctree_insert_node(GTK_CTREE(edittree), p, NULL, text, 5, NULL, NULL, NULL, NULL, 1, 1);
1699
644056e095f1 [gaim-migrate @ 1709]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1694
diff changeset
1206 gtk_ctree_node_set_row_data(GTK_CTREE(edittree), n, b);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1207 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1208
2382
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2380
diff changeset
1209 void ui_add_group(struct gaim_connection *gc, struct group *g)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1210 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1211 GtkCTreeNode *c = NULL, *p;
1663
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1662
diff changeset
1212 char *text[1];
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1213
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1214 g->edittype = EDIT_GROUP;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1215
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1216 if (!blist)
2382
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2380
diff changeset
1217 return;
1088
18a14e6dd0af [gaim-migrate @ 1098]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1085
diff changeset
1218
1663
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1662
diff changeset
1219 c = gtk_ctree_find_by_row_data(GTK_CTREE(edittree), NULL, gc);
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1662
diff changeset
1220 text[0] = g->name;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1221 p = gtk_ctree_insert_node(GTK_CTREE(edittree), c, NULL, text, 5, NULL, NULL, NULL, NULL, 0, 1);
1663
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1662
diff changeset
1222 gtk_ctree_node_set_row_data(GTK_CTREE(edittree), p, g);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1223
2382
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2380
diff changeset
1224 if (!(blist_options & OPT_BLIST_NO_MT_GRP) && !find_group_show(g->name))
569ae9f2bb89 [gaim-migrate @ 2395]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2380
diff changeset
1225 new_group_show(g->name);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1226 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1227
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1228
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1229 static void do_del_buddy(GtkWidget *w, GtkCTree *ctree)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1230 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1231 GtkCTreeNode *node;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1232 struct buddy *b;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1233 struct group *g;
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1234 int *type;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1235 GList *i;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1236
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1237 i = GTK_CLIST(edittree)->selection;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1238 if (i) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1239 node = i->data;
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1240 type = (int *)gtk_ctree_node_get_row_data(GTK_CTREE(edittree), node);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1241
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1242 if (*type == EDIT_BUDDY) {
1821
5fc89f9e7f3e [gaim-migrate @ 1831]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1817
diff changeset
1243 struct gaim_connection *gct;
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1244 b = (struct buddy *)type;
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1245 g = find_group_by_buddy(b->gc, b->name);
1821
5fc89f9e7f3e [gaim-migrate @ 1831]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1817
diff changeset
1246 gct = b->gc;
2334
b53cd5b63a99 [gaim-migrate @ 2347]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2313
diff changeset
1247 serv_remove_buddy(b->gc, b->name);
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1248 remove_buddy(b->gc, g, b);
1662
88e72116639d [gaim-migrate @ 1672]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1661
diff changeset
1249 gtk_ctree_remove_node(GTK_CTREE(edittree), node);
1821
5fc89f9e7f3e [gaim-migrate @ 1831]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1817
diff changeset
1250 do_export(gct);
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1251 } else if (*type == EDIT_GROUP) {
1825
b96f07ff3f78 [gaim-migrate @ 1835]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1821
diff changeset
1252 struct gaim_connection *gc = ((struct group *)type)->gc;
b96f07ff3f78 [gaim-migrate @ 1835]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1821
diff changeset
1253 remove_group(gc, (struct group *)type);
1662
88e72116639d [gaim-migrate @ 1672]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1661
diff changeset
1254 gtk_ctree_remove_node(GTK_CTREE(edittree), node);
1825
b96f07ff3f78 [gaim-migrate @ 1835]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1821
diff changeset
1255 do_export(gc);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1256 }
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1257
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1258 } else {
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1259 /* Nothing selected. */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1260 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1261 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1262
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1263
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1264 void import_callback(GtkWidget *widget, void *null)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1265 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1266 show_import_dialog();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1267 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1268
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1269 void do_quit()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1270 {
1591
5c74d8b6cb57 [gaim-migrate @ 1601]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1590
diff changeset
1271 #ifdef USE_APPLET
5c74d8b6cb57 [gaim-migrate @ 1601]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1590
diff changeset
1272 applet = NULL;
5c74d8b6cb57 [gaim-migrate @ 1601]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1590
diff changeset
1273 #endif
5c74d8b6cb57 [gaim-migrate @ 1601]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1590
diff changeset
1274
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
1275 /* first we tell those who have requested it we're quitting */
1000
91b7377e7b45 [gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 991
diff changeset
1276 plugin_event(event_quit, 0, 0, 0, 0);
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
1277
2560
0417ecaff0e5 [gaim-migrate @ 2573]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2559
diff changeset
1278 signoff_all();
2140
66a84ff0445a [gaim-migrate @ 2150]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2134
diff changeset
1279 #ifdef GAIM_PLUGINS
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
1280 /* then we remove everyone in a mass suicide */
2125
af59d854de29 [gaim-migrate @ 2135]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2111
diff changeset
1281 remove_all_plugins();
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
1282 #endif
1575
427e1409917c [gaim-migrate @ 1585]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1544
diff changeset
1283 system_log(log_quit, NULL, NULL, OPT_LOG_BUDDY_SIGNON | OPT_LOG_MY_SIGNON);
784
4c292b3f74ea [gaim-migrate @ 794]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 780
diff changeset
1284 #ifdef USE_PERL
4c292b3f74ea [gaim-migrate @ 794]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 780
diff changeset
1285 perl_end();
4c292b3f74ea [gaim-migrate @ 794]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 780
diff changeset
1286 #endif
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
1287
1117
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1115
diff changeset
1288 gtk_main_quit();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1289 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1290
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1291 void add_buddy_callback(GtkWidget *widget, void *dummy)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1292 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1293 char *grp = NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1294 GtkCTreeNode *node;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1295 GList *i;
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1296 struct gaim_connection *gc = NULL;
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1297 int *type;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1298
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1299 i = GTK_CLIST(edittree)->selection;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1300 if (i) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1301 node = i->data;
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1302 type = (int *)gtk_ctree_node_get_row_data(GTK_CTREE(edittree), node);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1303
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1304 if (*type == EDIT_BUDDY) {
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1305 struct buddy *b = (struct buddy *)type;
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1306 struct group *g = find_group_by_buddy(b->gc, b->name);
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1307 grp = g->name;
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1308 gc = b->gc;
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1309 } else if (*type == EDIT_GROUP) {
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1310 struct group *g = (struct group *)type;
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1311 grp = g->name;
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1312 gc = g->gc;
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1313 } else {
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1314 gc = (struct gaim_connection *)type;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1315 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1316 }
2582
5efa8077107f [gaim-migrate @ 2595]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2569
diff changeset
1317 show_add_buddy(gc, NULL, grp, NULL);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1318
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1319 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1320
577
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 544
diff changeset
1321 void add_group_callback(GtkWidget *widget, void *dummy)
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 544
diff changeset
1322 {
1072
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
1323 GtkCTreeNode *node;
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
1324 GList *i;
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
1325 struct gaim_connection *gc = NULL;
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1326 int *type;
1072
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
1327
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
1328 i = GTK_CLIST(edittree)->selection;
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
1329 if (i) {
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
1330 node = i->data;
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1331 type = (int *)gtk_ctree_node_get_row_data(GTK_CTREE(edittree), node);
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1332 if (*type == EDIT_BUDDY)
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1333 gc = ((struct buddy *)type)->gc;
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1334 else if (*type == EDIT_GROUP)
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1335 gc = ((struct group *)type)->gc;
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1336 else
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
1337 gc = (struct gaim_connection *)type;
1072
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
1338 }
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
1339 show_add_group(gc);
577
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 544
diff changeset
1340 }
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 544
diff changeset
1341
935
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 921
diff changeset
1342 static void im_callback(GtkWidget *widget, GtkTree *tree)
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 921
diff changeset
1343 {
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 921
diff changeset
1344 GList *i;
1032
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
1345 struct buddy_show *b = NULL;
935
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 921
diff changeset
1346 struct conversation *c;
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 921
diff changeset
1347 i = GTK_TREE_SELECTION(tree);
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 921
diff changeset
1348 if (i) {
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 921
diff changeset
1349 b = gtk_object_get_user_data(GTK_OBJECT(i->data));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1350 }
1095
ca8206682e3f [gaim-migrate @ 1105]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1092
diff changeset
1351 if (!i || !b) {
935
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 921
diff changeset
1352 show_im_dialog();
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 921
diff changeset
1353 return;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1354 }
935
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 921
diff changeset
1355 if (!b->name)
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 921
diff changeset
1356 return;
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 921
diff changeset
1357
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1358 c = find_conversation(b->name);
935
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 921
diff changeset
1359 if (c == NULL) {
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 921
diff changeset
1360 c = new_conversation(b->name);
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 921
diff changeset
1361 } else {
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 921
diff changeset
1362 gdk_window_raise(c->window->window);
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 921
diff changeset
1363 }
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 921
diff changeset
1364 }
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1365
935
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 921
diff changeset
1366
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1367 static void info_callback(GtkWidget *widget, GtkTree *tree)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1368 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1369 GList *i;
1032
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
1370 struct buddy_show *b = NULL;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1371 i = GTK_TREE_SELECTION(tree);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1372 if (i) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1373 b = gtk_object_get_user_data(GTK_OBJECT(i->data));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1374 }
1095
ca8206682e3f [gaim-migrate @ 1105]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1092
diff changeset
1375 if (!i || !b) {
935
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 921
diff changeset
1376 show_info_dialog();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1377 return;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1378 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1379 if (!b->name)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1380 return;
1693
6ccd49e6f24c [gaim-migrate @ 1703]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1681
diff changeset
1381 if (b->connlist)
6ccd49e6f24c [gaim-migrate @ 1703]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1681
diff changeset
1382 serv_get_info(b->connlist->data, b->name);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1383 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1384
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1385
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1386 void chat_callback(GtkWidget *widget, GtkTree *tree)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1387 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1388 join_chat();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1389 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1390
1929
d51ea669d84e [gaim-migrate @ 1939]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1918
diff changeset
1391 static void away_callback(GtkWidget *widget, GtkTree *tree)
d51ea669d84e [gaim-migrate @ 1939]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1918
diff changeset
1392 {
d51ea669d84e [gaim-migrate @ 1939]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1918
diff changeset
1393 GSList *awy = away_messages;
d51ea669d84e [gaim-migrate @ 1939]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1918
diff changeset
1394 GtkWidget *menu;
d51ea669d84e [gaim-migrate @ 1939]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1918
diff changeset
1395 GtkWidget *menuitem;
d51ea669d84e [gaim-migrate @ 1939]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1918
diff changeset
1396
d51ea669d84e [gaim-migrate @ 1939]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1918
diff changeset
1397 if (!awy)
d51ea669d84e [gaim-migrate @ 1939]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1918
diff changeset
1398 return;
d51ea669d84e [gaim-migrate @ 1939]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1918
diff changeset
1399
d51ea669d84e [gaim-migrate @ 1939]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1918
diff changeset
1400 menu = gtk_menu_new();
d51ea669d84e [gaim-migrate @ 1939]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1918
diff changeset
1401
d51ea669d84e [gaim-migrate @ 1939]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1918
diff changeset
1402 while (awy) {
d51ea669d84e [gaim-migrate @ 1939]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1918
diff changeset
1403 struct away_message *a = awy->data;
d51ea669d84e [gaim-migrate @ 1939]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1918
diff changeset
1404
d51ea669d84e [gaim-migrate @ 1939]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1918
diff changeset
1405 menuitem = gtk_menu_item_new_with_label(a->name);
d51ea669d84e [gaim-migrate @ 1939]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1918
diff changeset
1406 gtk_menu_append(GTK_MENU(menu), menuitem);
d51ea669d84e [gaim-migrate @ 1939]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1918
diff changeset
1407 gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
d51ea669d84e [gaim-migrate @ 1939]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1918
diff changeset
1408 GTK_SIGNAL_FUNC(do_away_message), a);
d51ea669d84e [gaim-migrate @ 1939]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1918
diff changeset
1409 gtk_widget_show(menuitem);
d51ea669d84e [gaim-migrate @ 1939]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1918
diff changeset
1410
d51ea669d84e [gaim-migrate @ 1939]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1918
diff changeset
1411 awy = awy->next;
d51ea669d84e [gaim-migrate @ 1939]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1918
diff changeset
1412 }
d51ea669d84e [gaim-migrate @ 1939]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1918
diff changeset
1413
d51ea669d84e [gaim-migrate @ 1939]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1918
diff changeset
1414 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, 1, time(NULL));
d51ea669d84e [gaim-migrate @ 1939]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1918
diff changeset
1415 }
d51ea669d84e [gaim-migrate @ 1939]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1918
diff changeset
1416
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1417 void rem_bp(GtkWidget *w, struct buddy_pounce *b)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1418 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1419 buddy_pounces = g_list_remove(buddy_pounces, b);
689
4e3f5d9cacd5 [gaim-migrate @ 699]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 678
diff changeset
1420 do_bp_menu();
4e3f5d9cacd5 [gaim-migrate @ 699]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 678
diff changeset
1421 save_prefs();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1422 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1423
2131
acc11216ec5d [gaim-migrate @ 2141]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2125
diff changeset
1424 void do_pounce(struct gaim_connection *gc, char *name, int when)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1425 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1426 char *who;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1427
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1428 struct buddy_pounce *b;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1429 struct conversation *c;
1155
f4d4a14752ee [gaim-migrate @ 1165]
Rob Flynn <gaim@robflynn.com>
parents: 1150
diff changeset
1430 struct aim_user *u;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1431
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1432 GList *bp = buddy_pounces;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1433
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1434 who = g_strdup(normalize (name));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1435
1857
9ea0b9531bc9 [gaim-migrate @ 1867]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1825
diff changeset
1436 while (bp) {
1155
f4d4a14752ee [gaim-migrate @ 1165]
Rob Flynn <gaim@robflynn.com>
parents: 1150
diff changeset
1437 b = (struct buddy_pounce *)bp->data;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1438 bp = bp->next; /* increment the list here because rem_bp can make our handle bad */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1439
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1440 if (!(b->options & when))
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1441 continue;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1442
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1443 u = find_user(b->pouncer, b->protocol); /* find our user */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1444 if (u == NULL)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1445 continue;
1155
f4d4a14752ee [gaim-migrate @ 1165]
Rob Flynn <gaim@robflynn.com>
parents: 1150
diff changeset
1446
1230
5395053cdee1 [gaim-migrate @ 1240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1229
diff changeset
1447 /* check and see if we're signed on as the pouncer */
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1448 if (u->gc != gc)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1449 continue;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1450
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1451 if (!g_strcasecmp(who, normalize (b->name))) { /* find someone to pounce */
1857
9ea0b9531bc9 [gaim-migrate @ 1867]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1825
diff changeset
1452 if (b->options & OPT_POUNCE_POPUP) {
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1453 c = find_conversation(name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1454 if (c == NULL)
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1455 c = new_conversation(name);
1857
9ea0b9531bc9 [gaim-migrate @ 1867]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1825
diff changeset
1456
1898
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1881
diff changeset
1457 set_convo_gc(c, u->gc);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1458 }
2550
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2472
diff changeset
1459 if (b->options & OPT_POUNCE_NOTIFY) {
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2472
diff changeset
1460 char tmp[1024];
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2472
diff changeset
1461
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2472
diff changeset
1462 /* I know the line below is really ugly. I only did it this way
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2472
diff changeset
1463 * because I thought it'd be funny :-) */
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2472
diff changeset
1464
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2472
diff changeset
1465 g_snprintf(tmp, sizeof(tmp), "%s has %s", name,
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2472
diff changeset
1466 (b->options & OPT_POUNCE_SIGNON) ? "signed on" :
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2472
diff changeset
1467 (b->options & OPT_POUNCE_UNIDLE) ? "returned from being idle" :
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2472
diff changeset
1468 "returned from being away");
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2472
diff changeset
1469
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2472
diff changeset
1470 do_error_dialog(tmp, _("Buddy Pounce"));
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2472
diff changeset
1471 }
1857
9ea0b9531bc9 [gaim-migrate @ 1867]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1825
diff changeset
1472 if (b->options & OPT_POUNCE_SEND_IM) {
2550
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2472
diff changeset
1473 if (strlen(b->message) > 0) {
2552
83f914362d72 [gaim-migrate @ 2565]
Rob Flynn <gaim@robflynn.com>
parents: 2550
diff changeset
1474 c = find_conversation(name);
83f914362d72 [gaim-migrate @ 2565]
Rob Flynn <gaim@robflynn.com>
parents: 2550
diff changeset
1475
83f914362d72 [gaim-migrate @ 2565]
Rob Flynn <gaim@robflynn.com>
parents: 2550
diff changeset
1476 if (c == NULL)
83f914362d72 [gaim-migrate @ 2565]
Rob Flynn <gaim@robflynn.com>
parents: 2550
diff changeset
1477 c = new_conversation(name);
83f914362d72 [gaim-migrate @ 2565]
Rob Flynn <gaim@robflynn.com>
parents: 2550
diff changeset
1478
83f914362d72 [gaim-migrate @ 2565]
Rob Flynn <gaim@robflynn.com>
parents: 2550
diff changeset
1479 set_convo_gc(c, u->gc);
83f914362d72 [gaim-migrate @ 2565]
Rob Flynn <gaim@robflynn.com>
parents: 2550
diff changeset
1480
2550
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2472
diff changeset
1481 write_to_conv(c, b->message, WFLAG_SEND, NULL, time((time_t) NULL));
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2472
diff changeset
1482 serv_send_im(u->gc, name, b->message, 0);
01dad6d8ba5b [gaim-migrate @ 2563]
Rob Flynn <gaim@robflynn.com>
parents: 2472
diff changeset
1483 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1484 }
1857
9ea0b9531bc9 [gaim-migrate @ 1867]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1825
diff changeset
1485 if (b->options & OPT_POUNCE_COMMAND) {
1229
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1183
diff changeset
1486 int pid = fork();
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1183
diff changeset
1487
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1183
diff changeset
1488 if (pid == 0) {
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1183
diff changeset
1489 char *args[4];
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1183
diff changeset
1490 args[0] = "sh";
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1183
diff changeset
1491 args[1] = "-c";
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1183
diff changeset
1492 args[2] = b->command;
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1183
diff changeset
1493 args[3] = NULL;
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1183
diff changeset
1494 execvp(args[0], args);
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1183
diff changeset
1495 _exit(0);
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1183
diff changeset
1496 } else if (pid > 0) {
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1183
diff changeset
1497 gtk_timeout_add(100, (GtkFunction)clean_pid, NULL);
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1183
diff changeset
1498 }
229bf438c591 [gaim-migrate @ 1239]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1183
diff changeset
1499 }
1857
9ea0b9531bc9 [gaim-migrate @ 1867]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1825
diff changeset
1500 if (b->options & OPT_POUNCE_SOUND) {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1501 if (strlen(b->sound))
1857
9ea0b9531bc9 [gaim-migrate @ 1867]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1825
diff changeset
1502 play_file(b->sound);
1694
bea407767ac1 [gaim-migrate @ 1704]
Rob Flynn <gaim@robflynn.com>
parents: 1693
diff changeset
1503 else
1857
9ea0b9531bc9 [gaim-migrate @ 1867]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1825
diff changeset
1504 play_sound(POUNCE_DEFAULT);
1694
bea407767ac1 [gaim-migrate @ 1704]
Rob Flynn <gaim@robflynn.com>
parents: 1693
diff changeset
1505 }
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1506
1235
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
1507 if (!(b->options & OPT_POUNCE_SAVE))
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
1508 rem_bp(NULL, b);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1509
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1510 }
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1511 }
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1512 g_free(who);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1513 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1514
2569
a714b8223228 [gaim-migrate @ 2582]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2564
diff changeset
1515 static void new_bp_callback(GtkWidget *w, struct buddy *b)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1516 {
2569
a714b8223228 [gaim-migrate @ 2582]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2564
diff changeset
1517 if (b)
a714b8223228 [gaim-migrate @ 2582]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2564
diff changeset
1518 show_new_bp(b->name, b->gc, b->idle, b->uc & UC_UNAVAILABLE);
a714b8223228 [gaim-migrate @ 2582]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2564
diff changeset
1519 else
2564
552a56d334ec [gaim-migrate @ 2577]
Rob Flynn <gaim@robflynn.com>
parents: 2560
diff changeset
1520 show_new_bp(NULL, NULL, 0, 0);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1521 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1522
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1523 void do_bp_menu()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1524 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1525 GtkWidget *menuitem, *mess, *messmenu;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1526 static GtkWidget *remmenu;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1527 GtkWidget *remitem;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1528 GtkWidget *sep;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1529 GList *l;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1530 struct buddy_pounce *b;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1531 GList *bp = buddy_pounces;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1532
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1533 l = gtk_container_children(GTK_CONTAINER(bpmenu));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1534
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1535 while (l) {
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1536 gtk_widget_destroy(GTK_WIDGET(l->data));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1537 l = l->next;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1538 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1539
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1540 remmenu = gtk_menu_new();
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1541
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1542 menuitem = gtk_menu_item_new_with_label(_("New Buddy Pounce"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1543 gtk_menu_append(GTK_MENU(bpmenu), menuitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1544 gtk_widget_show(menuitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1545 gtk_signal_connect(GTK_OBJECT(menuitem), "activate", GTK_SIGNAL_FUNC(new_bp_callback), NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1546
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1547
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1548 while (bp) {
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1549
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1550 b = (struct buddy_pounce *)bp->data;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1551 remitem = gtk_menu_item_new_with_label(b->name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1552 gtk_menu_append(GTK_MENU(remmenu), remitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1553 gtk_widget_show(remitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1554 gtk_signal_connect(GTK_OBJECT(remitem), "activate", GTK_SIGNAL_FUNC(rem_bp), b);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1555
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1556 bp = bp->next;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1557
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1558 }
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1559
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1560 menuitem = gtk_menu_item_new_with_label(_("Remove Buddy Pounce"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1561 gtk_menu_append(GTK_MENU(bpmenu), menuitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1562 gtk_widget_show(menuitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1563 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), remmenu);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1564 gtk_widget_show(remmenu);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1565
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1566 sep = gtk_hseparator_new();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1567 menuitem = gtk_menu_item_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1568 gtk_menu_append(GTK_MENU(bpmenu), menuitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1569 gtk_container_add(GTK_CONTAINER(menuitem), sep);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1570 gtk_widget_set_sensitive(menuitem, FALSE);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1571 gtk_widget_show(menuitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1572 gtk_widget_show(sep);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1573
1138
68f2f021ad1b [gaim-migrate @ 1148]
Rob Flynn <gaim@robflynn.com>
parents: 1137
diff changeset
1574 bp = buddy_pounces;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1575
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1576 while (bp) {
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1577
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1578 b = (struct buddy_pounce *)bp->data;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1579
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1580 menuitem = gtk_menu_item_new_with_label(b->name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1581 gtk_menu_append(GTK_MENU(bpmenu), menuitem);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1582 messmenu = gtk_menu_new();
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1583 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), messmenu);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1584 gtk_widget_show(menuitem);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1585
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1586 mess = gtk_menu_item_new_with_label(b->message);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1587 gtk_menu_append(GTK_MENU(messmenu), mess);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1588 gtk_widget_show(mess);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1589
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1590 bp = bp->next;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1591
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1592 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1593
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1594 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1595
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1596
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1597 static struct group_show *find_group_show(char *group)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1598 {
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1599 GSList *m = shows;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1600 struct group_show *g = NULL;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1601 char *who = g_strdup(normalize (group));
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1602
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1603 while (m) {
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1604 g = (struct group_show *)m->data;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1605 if (!g_strcasecmp(normalize (g->name), who))
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1606 break;
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1607 g = NULL;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1608 m = m->next;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1609 }
1106
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
1610 g_free(who);
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1611
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1612 return g;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1613 }
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1614
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1615 static struct buddy_show *find_buddy_show(struct group_show *gs, char *name)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1616 {
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1617 GSList *m = gs->members;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1618 struct buddy_show *b = NULL;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1619 char *who = g_strdup(normalize (name));
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1620
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1621 while (m) {
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1622 b = (struct buddy_show *)m->data;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1623 if (!g_strcasecmp(normalize (b->name), who))
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1624 break;
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1625 b = NULL;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1626 m = m->next;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1627 }
1098
b335c0ce305e [gaim-migrate @ 1108]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1097
diff changeset
1628 g_free(who);
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1629
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1630 return b;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1631 }
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1632
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1633 static int group_number(char *group)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1634 {
1037
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1635 GSList *c = connections;
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1636 struct gaim_connection *g;
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1637 GSList *m;
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1638 struct group *p;
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1639 int pos = 0;
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1640
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1641 while (c) {
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1642 g = (struct gaim_connection *)c->data;
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1643 m = g->groups;
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1644 while (m) {
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1645 p = (struct group *)m->data;
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1646 if (!strcmp(p->name, group))
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1647 return pos;
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1648 if (find_group_show(p->name))
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1649 pos++;
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1650 m = m->next;
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1651 }
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1652 c = c->next;
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1653 }
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1654 /* um..... we'll never get here */
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1655 return -1;
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1656 }
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1657
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1658 static int buddy_number(char *group, char *buddy)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1659 {
1037
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1660 GSList *c = connections;
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1661 struct gaim_connection *g;
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1662 struct group *p;
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1663 GSList *z;
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1664 struct buddy *b;
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1665 int pos = 0;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1666 char *tmp1 = g_strdup(normalize (buddy));
1037
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1667 struct group_show *gs = find_group_show(group);
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1668
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1669 while (c) {
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1670 g = (struct gaim_connection *)c->data;
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1671 p = find_group(g, group);
1049
749e25dc90cb [gaim-migrate @ 1059]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1047
diff changeset
1672 if (!p) {
749e25dc90cb [gaim-migrate @ 1059]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1047
diff changeset
1673 c = c->next;
749e25dc90cb [gaim-migrate @ 1059]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1047
diff changeset
1674 continue;
749e25dc90cb [gaim-migrate @ 1059]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1047
diff changeset
1675 }
1037
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1676 z = p->members;
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1677 while (z) {
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1678 b = (struct buddy *)z->data;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1679 if (!strcmp(tmp1, normalize (b->name))) {
1037
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1680 g_free(tmp1);
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1681 return pos;
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1682 }
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1683 if (find_buddy_show(gs, b->name))
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1684 pos++;
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1685 z = z->next;
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1686 }
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1687 c = c->next;
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1688 }
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1689 /* we shouldn't ever get here */
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1690 debug_printf("got to bad place in buddy_number\n");
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1691 g_free(tmp1);
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1692 return -1;
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1693 }
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1694
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1695 static struct group_show *new_group_show(char *group)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1696 {
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1697 struct group_show *g = g_new0(struct group_show, 1);
1037
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1698 int pos = group_number(group);
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1699
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1700 g->name = g_strdup(group);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1701
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1702 g->item = gtk_tree_item_new();
1037
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1703 gtk_tree_insert(GTK_TREE(buddies), g->item, pos);
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1704 gtk_signal_connect(GTK_OBJECT(g->item), "button_press_event",
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
1705 GTK_SIGNAL_FUNC(handle_click_group), g);
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1706 gtk_widget_show(g->item);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1707
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1708 g->label = gtk_label_new(group);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1709 gtk_misc_set_alignment(GTK_MISC(g->label), 0.0, 0.5);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1710 gtk_container_add(GTK_CONTAINER(g->item), g->label);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1711 gtk_widget_show(g->label);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1712
1037
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1713 shows = g_slist_insert(shows, g, pos);
1072
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
1714 update_num_groups(g);
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1715 return g;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1716 }
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1717
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1718 static struct buddy_show *new_buddy_show(struct group_show *gs, struct buddy *buddy, char **xpm)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1719 {
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1720 struct buddy_show *b = g_new0(struct buddy_show, 1);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1721 GtkWidget *box;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1722 GdkPixmap *pm;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1723 GdkBitmap *bm;
1037
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1724 int pos = buddy_number(gs->name, buddy->name);
1299
18c3874ea051 [gaim-migrate @ 1309]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1297
diff changeset
1725 b->sound = 0;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1726
1409
17e544f8c7fb [gaim-migrate @ 1419]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1401
diff changeset
1727 if (gs->members == NULL) {
17e544f8c7fb [gaim-migrate @ 1419]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1401
diff changeset
1728 gs->tree = gtk_tree_new();
17e544f8c7fb [gaim-migrate @ 1419]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1401
diff changeset
1729 gtk_tree_item_set_subtree(GTK_TREE_ITEM(gs->item), gs->tree);
17e544f8c7fb [gaim-migrate @ 1419]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1401
diff changeset
1730 gtk_tree_item_expand(GTK_TREE_ITEM(gs->item));
17e544f8c7fb [gaim-migrate @ 1419]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1401
diff changeset
1731 gtk_widget_show(gs->tree);
17e544f8c7fb [gaim-migrate @ 1419]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1401
diff changeset
1732 }
17e544f8c7fb [gaim-migrate @ 1419]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1401
diff changeset
1733
1036
faa5afc2b89e [gaim-migrate @ 1046]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1033
diff changeset
1734 b->name = g_strdup(buddy->name);
faa5afc2b89e [gaim-migrate @ 1046]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1033
diff changeset
1735 b->show = g_strdup(buddy->show);
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1736
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1737 b->item = gtk_tree_item_new();
1037
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1738 gtk_tree_insert(GTK_TREE(gs->tree), b->item, pos);
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1739 gtk_object_set_user_data(GTK_OBJECT(b->item), b);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1740 gtk_signal_connect(GTK_OBJECT(b->item), "button_press_event",
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1741 GTK_SIGNAL_FUNC(handle_click_buddy), b);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1742 gtk_widget_show(b->item);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1743
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1744 box = gtk_hbox_new(FALSE, 1);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1745 gtk_container_add(GTK_CONTAINER(b->item), box);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1746 gtk_widget_show(box);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1747
1729
251c19bf5763 [gaim-migrate @ 1739]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1714
diff changeset
1748 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm, NULL, xpm ? xpm : no_icon_xpm);
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1749 b->pix = gtk_pixmap_new(pm, bm);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1750 gtk_box_pack_start(GTK_BOX(box), b->pix, FALSE, FALSE, 1);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1751 gtk_widget_show(b->pix);
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2281
diff changeset
1752 if (!(blist_options & OPT_BLIST_SHOW_PIXMAPS))
1711
9b86520e04ac [gaim-migrate @ 1721]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1699
diff changeset
1753 gtk_widget_hide(b->pix);
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1754 gdk_pixmap_unref(pm);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1755 gdk_bitmap_unref(bm);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1756
1036
faa5afc2b89e [gaim-migrate @ 1046]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1033
diff changeset
1757 b->label = gtk_label_new(buddy->show);
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1758 gtk_misc_set_alignment(GTK_MISC(b->label), 0.0, 0.5);
1242
8cb5c1000ea9 [gaim-migrate @ 1252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1759 gtk_box_pack_start(GTK_BOX(box), b->label, FALSE, FALSE, 1);
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1760 gtk_widget_show(b->label);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1761
1242
8cb5c1000ea9 [gaim-migrate @ 1252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1762 b->warn = gtk_label_new("");
8cb5c1000ea9 [gaim-migrate @ 1252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1763 gtk_box_pack_start(GTK_BOX(box), b->warn, FALSE, FALSE, 1);
8cb5c1000ea9 [gaim-migrate @ 1252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1764 gtk_widget_show(b->warn);
8cb5c1000ea9 [gaim-migrate @ 1252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1765
1058
4927ce25d8cc [gaim-migrate @ 1068]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1057
diff changeset
1766 b->idle = gtk_label_new("");
1242
8cb5c1000ea9 [gaim-migrate @ 1252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1767 gtk_box_pack_end(GTK_BOX(box), b->idle, FALSE, FALSE, 1);
1058
4927ce25d8cc [gaim-migrate @ 1068]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1057
diff changeset
1768 gtk_widget_show(b->idle);
4927ce25d8cc [gaim-migrate @ 1068]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1057
diff changeset
1769
1037
1c663beef29d [gaim-migrate @ 1047]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1036
diff changeset
1770 gs->members = g_slist_insert(gs->members, b, pos);
1070
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
1771 update_num_group(gs);
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1772 return b;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1773 }
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1774
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1775 static void remove_buddy_show(struct group_show *gs, struct buddy_show *bs)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1776 {
1108
cb338aa38e78 [gaim-migrate @ 1118]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1106
diff changeset
1777 /* the name of this function may be misleading, but don't let it fool you. the point
cb338aa38e78 [gaim-migrate @ 1118]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1106
diff changeset
1778 * of this is to remove bs->item from gs->tree, and make sure gs->tree still exists
cb338aa38e78 [gaim-migrate @ 1118]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1106
diff changeset
1779 * and is a valid tree afterwards. Otherwise, Bad Things will happen. */
cb338aa38e78 [gaim-migrate @ 1118]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1106
diff changeset
1780 gtk_tree_remove_item(GTK_TREE(gs->tree), bs->item);
cb338aa38e78 [gaim-migrate @ 1118]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1106
diff changeset
1781 bs->item = NULL;
cb338aa38e78 [gaim-migrate @ 1118]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1106
diff changeset
1782 }
cb338aa38e78 [gaim-migrate @ 1118]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1106
diff changeset
1783
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1784 static struct group_show *find_gs_by_bs(struct buddy_show *b)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1785 {
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1786 GSList *m, *n;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1787 struct group_show *g = NULL;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1788 struct buddy_show *h;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1789
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1790 m = shows;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1791 while (m) {
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1792 g = (struct group_show *)m->data;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1793 n = g->members;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1794 while (n) {
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1795 h = (struct buddy_show *)n->data;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1796 if (h == b)
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1797 return g;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1798 n = n->next;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1799 }
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1800 g = NULL;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1801 m = m->next;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1802 }
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1803
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1804 return g;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1805 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1806
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1807 static gint log_timeout(struct buddy_show *b)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1808 {
2255
aaa82fd67a7b [gaim-migrate @ 2265]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2191
diff changeset
1809 /* this part is really just a bad hack because of a bug I can't find */
aaa82fd67a7b [gaim-migrate @ 2265]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2191
diff changeset
1810 GSList *s = shows;
aaa82fd67a7b [gaim-migrate @ 2265]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2191
diff changeset
1811 while (s) {
aaa82fd67a7b [gaim-migrate @ 2265]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2191
diff changeset
1812 struct group_show *gs = s->data;
aaa82fd67a7b [gaim-migrate @ 2265]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2191
diff changeset
1813 GSList *m = gs->members;
aaa82fd67a7b [gaim-migrate @ 2265]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2191
diff changeset
1814 while (m) {
aaa82fd67a7b [gaim-migrate @ 2265]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2191
diff changeset
1815 if (b == m->data)
aaa82fd67a7b [gaim-migrate @ 2265]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2191
diff changeset
1816 break;
aaa82fd67a7b [gaim-migrate @ 2265]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2191
diff changeset
1817 m = m->next;
aaa82fd67a7b [gaim-migrate @ 2265]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2191
diff changeset
1818 }
aaa82fd67a7b [gaim-migrate @ 2265]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2191
diff changeset
1819 if (m != NULL)
aaa82fd67a7b [gaim-migrate @ 2265]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2191
diff changeset
1820 break;
aaa82fd67a7b [gaim-migrate @ 2265]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2191
diff changeset
1821 s = s->next;
aaa82fd67a7b [gaim-migrate @ 2265]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2191
diff changeset
1822 }
aaa82fd67a7b [gaim-migrate @ 2265]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2191
diff changeset
1823 if (!s)
aaa82fd67a7b [gaim-migrate @ 2265]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2191
diff changeset
1824 return 0;
aaa82fd67a7b [gaim-migrate @ 2265]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2191
diff changeset
1825
aaa82fd67a7b [gaim-migrate @ 2265]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2191
diff changeset
1826 /* this is the real part. */
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1827 if (!b->connlist) {
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1828 struct group_show *g = find_gs_by_bs(b);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1829 g->members = g_slist_remove(g->members, b);
1091
3d6ab4f1fa55 [gaim-migrate @ 1101]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1089
diff changeset
1830 if (blist)
1108
cb338aa38e78 [gaim-migrate @ 1118]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1106
diff changeset
1831 remove_buddy_show(g, b);
1091
3d6ab4f1fa55 [gaim-migrate @ 1101]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1089
diff changeset
1832 else
3d6ab4f1fa55 [gaim-migrate @ 1101]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1089
diff changeset
1833 debug_printf("log_timeout but buddy list not available\n");
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2281
diff changeset
1834 if ((g->members == NULL) && (blist_options & OPT_BLIST_NO_MT_GRP)) {
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1835 shows = g_slist_remove(shows, g);
1091
3d6ab4f1fa55 [gaim-migrate @ 1101]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1089
diff changeset
1836 if (blist)
1108
cb338aa38e78 [gaim-migrate @ 1118]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1106
diff changeset
1837 gtk_tree_remove_item(GTK_TREE(buddies), g->item);
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1838 g_free(g->name);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1839 g_free(g);
1089
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1088
diff changeset
1840 }
1106
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
1841 gtk_timeout_remove(b->log_timer);
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
1842 b->log_timer = 0;
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1843 g_free(b->name);
1036
faa5afc2b89e [gaim-migrate @ 1046]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1033
diff changeset
1844 g_free(b->show);
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1845 g_free(b);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1846 } else {
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1847 /* um.... what do we have to do here? just update the pixmap? */
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1848 GdkPixmap *pm;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1849 GdkBitmap *bm;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1850 gchar **xpm = NULL;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1851 struct buddy *light = find_buddy(b->connlist->data, b->name);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1852 if (((struct gaim_connection *)b->connlist->data)->prpl->list_icon)
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1853 xpm =
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1854 (*((struct gaim_connection *)b->connlist->data)->prpl->list_icon)(light->uc);
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1855 if (xpm == NULL)
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1856 xpm = (char **)no_icon_xpm;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1857 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm, NULL, xpm);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1858 gtk_widget_hide(b->pix);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1859 gtk_pixmap_set(GTK_PIXMAP(b->pix), pm, bm);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1860 gtk_widget_show(b->pix);
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2281
diff changeset
1861 if (!(blist_options & OPT_BLIST_SHOW_PIXMAPS))
1711
9b86520e04ac [gaim-migrate @ 1721]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1699
diff changeset
1862 gtk_widget_hide(b->pix);
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2281
diff changeset
1863 if (misc_options & OPT_MISC_BUDDY_TICKER)
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1864 BuddyTickerSetPixmap(b->name, pm, bm);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1865 gdk_pixmap_unref(pm);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1866 gdk_bitmap_unref(bm);
1106
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
1867 gtk_timeout_remove(b->log_timer);
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
1868 b->log_timer = 0;
1299
18c3874ea051 [gaim-migrate @ 1309]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1297
diff changeset
1869 b->sound = 0;
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1870 }
1091
3d6ab4f1fa55 [gaim-migrate @ 1101]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1089
diff changeset
1871 return 0;
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1872 }
513
eaddaa0dbbcb [gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 511
diff changeset
1873
1068
ed28707debdc [gaim-migrate @ 1078]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1066
diff changeset
1874 static char *caps_string(gushort caps)
ed28707debdc [gaim-migrate @ 1078]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1066
diff changeset
1875 {
ed28707debdc [gaim-migrate @ 1078]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1066
diff changeset
1876 static char buf[256], *tmp;
ed28707debdc [gaim-migrate @ 1078]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1066
diff changeset
1877 int count = 0, i = 0;
ed28707debdc [gaim-migrate @ 1078]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1066
diff changeset
1878 gushort bit = 1;
1310
035945fca2d5 [gaim-migrate @ 1320]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1299
diff changeset
1879 while (bit <= 0x80) {
1068
ed28707debdc [gaim-migrate @ 1078]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1066
diff changeset
1880 if (bit & caps) {
ed28707debdc [gaim-migrate @ 1078]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1066
diff changeset
1881 switch (bit) {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1882 case 0x1:
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1883 tmp = _("Buddy Icon");
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1884 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1885 case 0x2:
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1886 tmp = _("Voice");
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1887 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1888 case 0x4:
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1889 tmp = _("IM Image");
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1890 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1891 case 0x8:
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1892 tmp = _("Chat");
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1893 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1894 case 0x10:
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1895 tmp = _("Get File");
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1896 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1897 case 0x20:
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1898 tmp = _("Send File");
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1899 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1900 case 0x40:
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1901 tmp = _("Games");
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1902 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1903 case 0x80:
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1904 tmp = _("Stocks");
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1905 break;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1906 default:
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1907 tmp = NULL;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1908 break;
1068
ed28707debdc [gaim-migrate @ 1078]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1066
diff changeset
1909 }
ed28707debdc [gaim-migrate @ 1078]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1066
diff changeset
1910 if (tmp)
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1911 i += g_snprintf(buf + i, sizeof(buf) - i, "%s%s", (count ? ", " : ""),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1912 tmp);
1068
ed28707debdc [gaim-migrate @ 1078]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1066
diff changeset
1913 count++;
ed28707debdc [gaim-migrate @ 1078]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1066
diff changeset
1914 }
ed28707debdc [gaim-migrate @ 1078]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1066
diff changeset
1915 bit <<= 1;
ed28707debdc [gaim-migrate @ 1078]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1066
diff changeset
1916 }
ed28707debdc [gaim-migrate @ 1078]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1066
diff changeset
1917 return buf;
ed28707debdc [gaim-migrate @ 1078]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1066
diff changeset
1918 }
ed28707debdc [gaim-migrate @ 1078]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1066
diff changeset
1919
1163
8f70ecf3e884 [gaim-migrate @ 1173]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1159
diff changeset
1920 /* for this we're just going to assume the first connection that registered the buddy.
8f70ecf3e884 [gaim-migrate @ 1173]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1159
diff changeset
1921 * if it's not the one you were hoping for then you're shit out of luck */
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1922 static void update_idle_time(struct buddy_show *bs)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1923 {
1075
2fe18b2d6105 [gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1072
diff changeset
1924 /* this also updates the tooltip since that has idle time in it */
1242
8cb5c1000ea9 [gaim-migrate @ 1252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1925 char idlet[16], warnl[16];
1058
4927ce25d8cc [gaim-migrate @ 1068]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1057
diff changeset
1926 time_t t;
4927ce25d8cc [gaim-migrate @ 1068]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1057
diff changeset
1927 int ihrs, imin;
4927ce25d8cc [gaim-migrate @ 1068]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1057
diff changeset
1928 struct buddy *b;
2592
f194dd8250d4 [gaim-migrate @ 2605]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2587
diff changeset
1929 GtkStyle *style;
1058
4927ce25d8cc [gaim-migrate @ 1068]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1057
diff changeset
1930
1163
8f70ecf3e884 [gaim-migrate @ 1173]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1159
diff changeset
1931 char infotip[2048];
1068
ed28707debdc [gaim-migrate @ 1078]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1066
diff changeset
1932 char warn[256];
ed28707debdc [gaim-migrate @ 1078]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1066
diff changeset
1933 char caps[256];
1815
f15d449b3167 [gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1805
diff changeset
1934 char *sotime = NULL, *itime;
1068
ed28707debdc [gaim-migrate @ 1078]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1066
diff changeset
1935
1058
4927ce25d8cc [gaim-migrate @ 1068]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1057
diff changeset
1936 time(&t);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1937 if (!bs->connlist)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1938 return;
1163
8f70ecf3e884 [gaim-migrate @ 1173]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1159
diff changeset
1939 b = find_buddy(bs->connlist->data, bs->name);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1940 if (!b)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1941 return;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1942 ihrs = (t - b->idle) / 3600;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1943 imin = ((t - b->idle) / 60) % 60;
1058
4927ce25d8cc [gaim-migrate @ 1068]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1057
diff changeset
1944
1163
8f70ecf3e884 [gaim-migrate @ 1173]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1159
diff changeset
1945 if (ihrs)
8f70ecf3e884 [gaim-migrate @ 1173]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1159
diff changeset
1946 g_snprintf(idlet, sizeof idlet, "(%d:%02d)", ihrs, imin);
8f70ecf3e884 [gaim-migrate @ 1173]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1159
diff changeset
1947 else
8f70ecf3e884 [gaim-migrate @ 1173]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1159
diff changeset
1948 g_snprintf(idlet, sizeof idlet, "(%d)", imin);
1058
4927ce25d8cc [gaim-migrate @ 1068]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1057
diff changeset
1949
1163
8f70ecf3e884 [gaim-migrate @ 1173]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1159
diff changeset
1950 gtk_widget_hide(bs->idle);
8f70ecf3e884 [gaim-migrate @ 1173]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1159
diff changeset
1951 if (b->idle)
8f70ecf3e884 [gaim-migrate @ 1173]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1159
diff changeset
1952 gtk_label_set(GTK_LABEL(bs->idle), idlet);
8f70ecf3e884 [gaim-migrate @ 1173]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1159
diff changeset
1953 else
8f70ecf3e884 [gaim-migrate @ 1173]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1159
diff changeset
1954 gtk_label_set(GTK_LABEL(bs->idle), "");
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2281
diff changeset
1955 if (blist_options & OPT_BLIST_SHOW_IDLETIME)
1163
8f70ecf3e884 [gaim-migrate @ 1173]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1159
diff changeset
1956 gtk_widget_show(bs->idle);
1068
ed28707debdc [gaim-migrate @ 1078]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1066
diff changeset
1957
2613
6f7e1fc3e132 [gaim-migrate @ 2626]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2610
diff changeset
1958 style = gtk_style_copy(bs->idle->style);
2610
98928712e319 [gaim-migrate @ 2623]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2607
diff changeset
1959 if ((blist_options & OPT_BLIST_GREY_IDLERS) && (b->idle)) {
2592
f194dd8250d4 [gaim-migrate @ 2605]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2587
diff changeset
1960 style->fg[GTK_STATE_NORMAL].red =
2613
6f7e1fc3e132 [gaim-migrate @ 2626]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2610
diff changeset
1961 (style->fg[GTK_STATE_NORMAL].red / 2) + (style->base[GTK_STATE_NORMAL].red / 2);
2592
f194dd8250d4 [gaim-migrate @ 2605]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2587
diff changeset
1962 style->fg[GTK_STATE_NORMAL].green =
2613
6f7e1fc3e132 [gaim-migrate @ 2626]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2610
diff changeset
1963 (style->fg[GTK_STATE_NORMAL].green / 2) + (style->base[GTK_STATE_NORMAL].green / 2);
2592
f194dd8250d4 [gaim-migrate @ 2605]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2587
diff changeset
1964 style->fg[GTK_STATE_NORMAL].blue =
2613
6f7e1fc3e132 [gaim-migrate @ 2626]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2610
diff changeset
1965 (style->fg[GTK_STATE_NORMAL].blue / 2) + (style->base[GTK_STATE_NORMAL].blue / 2);
2592
f194dd8250d4 [gaim-migrate @ 2605]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2587
diff changeset
1966 }
f194dd8250d4 [gaim-migrate @ 2605]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2587
diff changeset
1967 gtk_widget_set_style(bs->label, style);
f194dd8250d4 [gaim-migrate @ 2605]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2587
diff changeset
1968 gtk_style_unref(style);
f194dd8250d4 [gaim-migrate @ 2605]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2587
diff changeset
1969
1163
8f70ecf3e884 [gaim-migrate @ 1173]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1159
diff changeset
1970 /* now we do the tooltip */
1496
d33bf6548543 [gaim-migrate @ 1506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1477
diff changeset
1971 if (b->signon) {
d33bf6548543 [gaim-migrate @ 1506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1477
diff changeset
1972 char *stime = sec_to_text(t - b->signon +
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1973 ((struct gaim_connection *)bs->connlist->data)->
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1974 correction_time);
1496
d33bf6548543 [gaim-migrate @ 1506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1477
diff changeset
1975 sotime = g_strdup_printf(_("Logged in: %s\n"), stime);
d33bf6548543 [gaim-migrate @ 1506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1477
diff changeset
1976 g_free(stime);
d33bf6548543 [gaim-migrate @ 1506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1477
diff changeset
1977 }
1068
ed28707debdc [gaim-migrate @ 1078]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1066
diff changeset
1978
1163
8f70ecf3e884 [gaim-migrate @ 1173]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1159
diff changeset
1979 if (b->idle)
8f70ecf3e884 [gaim-migrate @ 1173]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1159
diff changeset
1980 itime = sec_to_text(t - b->idle);
8f70ecf3e884 [gaim-migrate @ 1173]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1159
diff changeset
1981 else {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1982 itime = g_malloc(1);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
1983 itime[0] = 0;
1163
8f70ecf3e884 [gaim-migrate @ 1173]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1159
diff changeset
1984 }
1068
ed28707debdc [gaim-migrate @ 1078]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1066
diff changeset
1985
1242
8cb5c1000ea9 [gaim-migrate @ 1252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1986 if (b->evil) {
1163
8f70ecf3e884 [gaim-migrate @ 1173]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1159
diff changeset
1987 g_snprintf(warn, sizeof warn, _("Warnings: %d%%\n"), b->evil);
1242
8cb5c1000ea9 [gaim-migrate @ 1252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1988 g_snprintf(warnl, sizeof warnl, "(%d%%)", b->evil);
8cb5c1000ea9 [gaim-migrate @ 1252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1989 } else {
1163
8f70ecf3e884 [gaim-migrate @ 1173]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1159
diff changeset
1990 warn[0] = '\0';
1242
8cb5c1000ea9 [gaim-migrate @ 1252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1991 warnl[0] = '\0';
8cb5c1000ea9 [gaim-migrate @ 1252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1992 }
8cb5c1000ea9 [gaim-migrate @ 1252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1993 gtk_widget_hide(bs->warn);
8cb5c1000ea9 [gaim-migrate @ 1252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1994 gtk_label_set(GTK_LABEL(bs->warn), warnl);
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2281
diff changeset
1995 if (blist_options & OPT_BLIST_SHOW_WARN)
1242
8cb5c1000ea9 [gaim-migrate @ 1252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1996 gtk_widget_show(bs->warn);
1068
ed28707debdc [gaim-migrate @ 1078]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1066
diff changeset
1997
1163
8f70ecf3e884 [gaim-migrate @ 1173]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1159
diff changeset
1998 if (b->caps)
8f70ecf3e884 [gaim-migrate @ 1173]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1159
diff changeset
1999 g_snprintf(caps, sizeof caps, _("Capabilities: %s\n"), caps_string(b->caps));
8f70ecf3e884 [gaim-migrate @ 1173]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1159
diff changeset
2000 else
8f70ecf3e884 [gaim-migrate @ 1173]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1159
diff changeset
2001 caps[0] = '\0';
1068
ed28707debdc [gaim-migrate @ 1078]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1066
diff changeset
2002
1163
8f70ecf3e884 [gaim-migrate @ 1173]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1159
diff changeset
2003 g_snprintf(infotip, sizeof infotip, _("Alias: %s \nScreen Name: %s\n"
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2004 "%s%s%s%s%s%s"),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2005 b->show, b->name,
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2006 (b->signon ? sotime : ""), warn,
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2007 (b->idle ? _("Idle: ") : ""), itime, (b->idle ? "\n" : ""), caps);
1068
ed28707debdc [gaim-migrate @ 1078]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1066
diff changeset
2008
1163
8f70ecf3e884 [gaim-migrate @ 1173]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1159
diff changeset
2009 gtk_tooltips_set_tip(tips, GTK_WIDGET(bs->item), infotip, "");
1068
ed28707debdc [gaim-migrate @ 1078]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1066
diff changeset
2010
1496
d33bf6548543 [gaim-migrate @ 1506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1477
diff changeset
2011 if (b->signon)
d33bf6548543 [gaim-migrate @ 1506]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1477
diff changeset
2012 g_free(sotime);
1163
8f70ecf3e884 [gaim-migrate @ 1173]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1159
diff changeset
2013 g_free(itime);
1058
4927ce25d8cc [gaim-migrate @ 1068]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1057
diff changeset
2014 }
4927ce25d8cc [gaim-migrate @ 1068]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1057
diff changeset
2015
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2016 void update_idle_times()
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2017 {
1058
4927ce25d8cc [gaim-migrate @ 1068]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1057
diff changeset
2018 GSList *grp = shows;
4927ce25d8cc [gaim-migrate @ 1068]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1057
diff changeset
2019 GSList *mem;
1667
b5635d882116 [gaim-migrate @ 1677]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1666
diff changeset
2020 struct buddy_show *b;
b5635d882116 [gaim-migrate @ 1677]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1666
diff changeset
2021 struct group_show *g;
1058
4927ce25d8cc [gaim-migrate @ 1068]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1057
diff changeset
2022
4927ce25d8cc [gaim-migrate @ 1068]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1057
diff changeset
2023 while (grp) {
1667
b5635d882116 [gaim-migrate @ 1677]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1666
diff changeset
2024 g = (struct group_show *)grp->data;
b5635d882116 [gaim-migrate @ 1677]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1666
diff changeset
2025 mem = g->members;
1058
4927ce25d8cc [gaim-migrate @ 1068]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1057
diff changeset
2026 while (mem) {
1667
b5635d882116 [gaim-migrate @ 1677]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1666
diff changeset
2027 b = (struct buddy_show *)mem->data;
b5635d882116 [gaim-migrate @ 1677]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1666
diff changeset
2028 update_idle_time(b);
1058
4927ce25d8cc [gaim-migrate @ 1068]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1057
diff changeset
2029 mem = mem->next;
4927ce25d8cc [gaim-migrate @ 1068]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1057
diff changeset
2030 }
4927ce25d8cc [gaim-migrate @ 1068]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1057
diff changeset
2031 grp = grp->next;
4927ce25d8cc [gaim-migrate @ 1068]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1057
diff changeset
2032 }
4927ce25d8cc [gaim-migrate @ 1068]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1057
diff changeset
2033 }
4927ce25d8cc [gaim-migrate @ 1068]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1057
diff changeset
2034
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2035 void set_buddy(struct gaim_connection *gc, struct buddy *b)
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2036 {
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2037 struct group *g = find_group_by_buddy(gc, b->name);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2038 struct group_show *gs;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2039 struct buddy_show *bs;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2040 GdkPixmap *pm;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2041 GdkBitmap *bm;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2042 char **xpm = NULL;
1058
4927ce25d8cc [gaim-migrate @ 1068]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1057
diff changeset
2043
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2044 if (!blist)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2045 return;
1063
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1061
diff changeset
2046
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2047 if (b->present) {
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2048 if ((gs = find_group_show(g->name)) == NULL)
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2049 gs = new_group_show(g->name);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2050 if ((bs = find_buddy_show(gs, b->name)) == NULL)
1106
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2051 bs = new_buddy_show(gs, b, (char **)login_icon_xpm);
1164
ed5bb86253c6 [gaim-migrate @ 1174]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1163
diff changeset
2052 if (!g_slist_find(bs->connlist, gc))
ed5bb86253c6 [gaim-migrate @ 1174]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1163
diff changeset
2053 bs->connlist = g_slist_append(bs->connlist, gc);
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2054 if (b->present == 1) {
1299
18c3874ea051 [gaim-migrate @ 1309]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1297
diff changeset
2055 if (bs->sound != 2)
18c3874ea051 [gaim-migrate @ 1309]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1297
diff changeset
2056 play_sound(BUDDY_ARRIVE);
1039
67ed2ee5be9f [gaim-migrate @ 1049]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1037
diff changeset
2057 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm,
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2058 NULL, (char **)login_icon_xpm);
1039
67ed2ee5be9f [gaim-migrate @ 1049]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1037
diff changeset
2059 gtk_widget_hide(bs->pix);
67ed2ee5be9f [gaim-migrate @ 1049]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1037
diff changeset
2060 gtk_pixmap_set(GTK_PIXMAP(bs->pix), pm, bm);
67ed2ee5be9f [gaim-migrate @ 1049]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1037
diff changeset
2061 gtk_widget_show(bs->pix);
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2281
diff changeset
2062 if (misc_options & OPT_MISC_BUDDY_TICKER) {
1066
d6c70d58a4b2 [gaim-migrate @ 1076]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1063
diff changeset
2063 BuddyTickerAddUser(b->name, pm, bm);
d6c70d58a4b2 [gaim-migrate @ 1076]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1063
diff changeset
2064 gtk_timeout_add(10000, (GtkFunction)BuddyTickerLogonTimeout, b->name);
d6c70d58a4b2 [gaim-migrate @ 1076]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1063
diff changeset
2065 }
1039
67ed2ee5be9f [gaim-migrate @ 1049]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1037
diff changeset
2066 gdk_pixmap_unref(pm);
67ed2ee5be9f [gaim-migrate @ 1049]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1037
diff changeset
2067 gdk_bitmap_unref(bm);
121
3571b593f423 [gaim-migrate @ 131]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 120
diff changeset
2068 b->present = 2;
1106
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2069 if (bs->log_timer > 0)
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2070 gtk_timeout_remove(bs->log_timer);
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2071 bs->log_timer = gtk_timeout_add(10000, (GtkFunction)log_timeout, bs);
1070
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1069
diff changeset
2072 update_num_group(gs);
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2281
diff changeset
2073 if ((bs->sound != 2) && (im_options & OPT_IM_LOGON)) {
1066
d6c70d58a4b2 [gaim-migrate @ 1076]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1063
diff changeset
2074 struct conversation *c = find_conversation(b->name);
d6c70d58a4b2 [gaim-migrate @ 1076]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1063
diff changeset
2075 if (c) {
d6c70d58a4b2 [gaim-migrate @ 1076]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1063
diff changeset
2076 char tmp[1024];
1735
00f74db70f2d [gaim-migrate @ 1745]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1729
diff changeset
2077 g_snprintf(tmp, sizeof(tmp), _("%s logged in."), b->name);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2078 write_to_conv(c, tmp, WFLAG_SYSTEM, NULL, time((time_t) NULL));
1066
d6c70d58a4b2 [gaim-migrate @ 1076]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1063
diff changeset
2079 }
d6c70d58a4b2 [gaim-migrate @ 1076]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1063
diff changeset
2080 }
1661
6cea395b627d [gaim-migrate @ 1671]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1634
diff changeset
2081 bs->sound = 2;
1098
b335c0ce305e [gaim-migrate @ 1108]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1097
diff changeset
2082 } else if (bs->log_timer == 0) {
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2083 if (gc->prpl->list_icon)
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2084 xpm = (*gc->prpl->list_icon)(b->uc);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2085 if (xpm == NULL)
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2086 xpm = (char **)no_icon_xpm;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2087 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm, NULL, xpm);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2088 gtk_widget_hide(bs->pix);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2089 gtk_pixmap_set(GTK_PIXMAP(bs->pix), pm, bm);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2090 gtk_widget_show(bs->pix);
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2281
diff changeset
2091 if (!(blist_options & OPT_BLIST_SHOW_PIXMAPS))
1711
9b86520e04ac [gaim-migrate @ 1721]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1699
diff changeset
2092 gtk_widget_hide(bs->pix);
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2281
diff changeset
2093 if (misc_options & OPT_MISC_BUDDY_TICKER)
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2094 BuddyTickerSetPixmap(b->name, pm, bm);
644
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 608
diff changeset
2095 gdk_pixmap_unref(pm);
804
17def2bb9720 [gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 803
diff changeset
2096 gdk_bitmap_unref(bm);
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2097 }
1058
4927ce25d8cc [gaim-migrate @ 1068]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1057
diff changeset
2098 update_idle_time(bs);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2099 } else {
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2100 gs = find_group_show(g->name);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2101 if (!gs)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2102 return;
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2103 bs = find_buddy_show(gs, b->name);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2104 if (!bs)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2105 return;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2106 if (!bs->connlist)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2107 return; /* we won't do signoff updates for
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2108 buddies that have already signed
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2109 off */
1299
18c3874ea051 [gaim-migrate @ 1309]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1297
diff changeset
2110 if (bs->sound != 1)
18c3874ea051 [gaim-migrate @ 1309]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1297
diff changeset
2111 play_sound(BUDDY_LEAVE);
1106
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2112
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2113 bs->connlist = g_slist_remove(bs->connlist, gc);
1032
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
2114 if (bs->log_timer > 0)
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
2115 gtk_timeout_remove(bs->log_timer);
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
2116 bs->log_timer = gtk_timeout_add(10000, (GtkFunction)log_timeout, bs);
1106
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2117 update_num_group(gs);
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2118 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm, NULL, logout_icon_xpm);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2119 gtk_widget_hide(bs->pix);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2120 gtk_pixmap_set(GTK_PIXMAP(bs->pix), pm, bm);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2121 gtk_widget_show(bs->pix);
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2281
diff changeset
2122 if (misc_options & OPT_MISC_BUDDY_TICKER) {
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2123 BuddyTickerSetPixmap(b->name, pm, bm);
1066
d6c70d58a4b2 [gaim-migrate @ 1076]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1063
diff changeset
2124 gtk_timeout_add(10000, (GtkFunction)BuddyTickerLogoutTimeout, b->name);
d6c70d58a4b2 [gaim-migrate @ 1076]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1063
diff changeset
2125 }
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2126 gdk_pixmap_unref(pm);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2127 gdk_bitmap_unref(bm);
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2281
diff changeset
2128 if ((bs->sound != 1) && (im_options & OPT_IM_LOGON)) {
1066
d6c70d58a4b2 [gaim-migrate @ 1076]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1063
diff changeset
2129 struct conversation *c = find_conversation(b->name);
d6c70d58a4b2 [gaim-migrate @ 1076]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1063
diff changeset
2130 if (c) {
d6c70d58a4b2 [gaim-migrate @ 1076]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1063
diff changeset
2131 char tmp[1024];
1735
00f74db70f2d [gaim-migrate @ 1745]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1729
diff changeset
2132 g_snprintf(tmp, sizeof(tmp), _("%s logged out."), b->name);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2133 write_to_conv(c, tmp, WFLAG_SYSTEM, NULL, time((time_t) NULL));
1066
d6c70d58a4b2 [gaim-migrate @ 1076]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1063
diff changeset
2134 }
d6c70d58a4b2 [gaim-migrate @ 1076]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1063
diff changeset
2135 }
1661
6cea395b627d [gaim-migrate @ 1671]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1634
diff changeset
2136
6cea395b627d [gaim-migrate @ 1671]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1634
diff changeset
2137 bs->sound = 1;
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2138 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2139 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2140
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2141
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2142 static void move_blist_window(GtkWidget *w, GdkEventConfigure *e, void *dummy)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2143 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2144 int x, y, width, height;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2145 int save = 0;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2146 gdk_window_get_position(blist->window, &x, &y);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2147 gdk_window_get_size(blist->window, &width, &height);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2148
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2149 if (e->send_event) { /* Is a position event */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2150 if (blist_pos.x != x || blist_pos.y != y)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2151 save = 1;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2152 blist_pos.x = x;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2153 blist_pos.y = y;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2154 } else { /* Is a size event */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2155 if (blist_pos.xoff != x || blist_pos.yoff != y || blist_pos.width != width)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2156 save = 1;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2157
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2158 blist_pos.width = width;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2159 blist_pos.height = height;
1420
9be6790092dc [gaim-migrate @ 1430]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1413
diff changeset
2160 blist_pos.xoff = x;
9be6790092dc [gaim-migrate @ 1430]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1413
diff changeset
2161 blist_pos.yoff = y;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2162 }
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2163
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2164 if (save)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2165 save_prefs();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2166
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2167 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2168
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2169
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2170 /*******************************************************************
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2171 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2172 * Helper funs for making the menu
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2173 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2174 *******************************************************************/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2175
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1496
diff changeset
2176 void gaim_separator(GtkWidget *menu)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2177 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2178 GtkWidget *sep, *menuitem;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2179 sep = gtk_hseparator_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2180 menuitem = gtk_menu_item_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2181 gtk_menu_append(GTK_MENU(menu), menuitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2182 gtk_container_add(GTK_CONTAINER(menuitem), sep);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2183 gtk_widget_set_sensitive(menuitem, FALSE);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2184 gtk_widget_show(menuitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2185 gtk_widget_show(sep);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2186 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2187
1634
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2188 GtkWidget *gaim_new_item(GtkWidget *menu, const char *str)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2189 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2190 GtkWidget *menuitem;
1634
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2191 GtkWidget *label;
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2192
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2193 menuitem = gtk_menu_item_new();
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2194 if (menu)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2195 gtk_menu_append(GTK_MENU(menu), menuitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2196 gtk_widget_show(menuitem);
1634
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2197
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2198 label = gtk_label_new(str);
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2199 gtk_label_set_pattern(GTK_LABEL(label), "_");
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2200 gtk_container_add(GTK_CONTAINER(menuitem), label);
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2201 gtk_widget_show(label);
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2202
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2203 gtk_widget_add_accelerator(menuitem, "activate-item", accel, str[0],
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2204 GDK_MOD1_MASK, GTK_ACCEL_LOCKED);
1634
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2205 gtk_widget_lock_accelerators(menuitem);
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2206
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2207 return menuitem;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2208 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2209
1634
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2210 GtkWidget *gaim_new_item_with_pixmap(GtkWidget *menu, const char *str, char **xpm, GtkSignalFunc sf,
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2211 guint accel_key, guint accel_mods, char *mod)
714
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
2212 {
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
2213 GtkWidget *menuitem;
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
2214 GtkWidget *hbox;
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
2215 GtkWidget *label;
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
2216 GtkWidget *pixmap;
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
2217 GdkPixmap *pm;
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
2218 GdkBitmap *mask;
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
2219
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
2220 menuitem = gtk_menu_item_new();
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2221 if (menu)
1634
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2222 gtk_menu_append(GTK_MENU(menu), menuitem);
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2223 if (sf)
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2224 /* passing 1 is necessary so if we sign off closing the account editor doesn't exit */
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2225 gtk_signal_connect(GTK_OBJECT(menuitem), "activate", sf, (void *)1);
714
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
2226 gtk_widget_show(menuitem);
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
2227
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
2228 /* Create our container */
718
c2e3e4e59a17 [gaim-migrate @ 728]
Rob Flynn <gaim@robflynn.com>
parents: 714
diff changeset
2229 hbox = gtk_hbox_new(FALSE, 2);
1634
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2230 gtk_container_add(GTK_CONTAINER(menuitem), hbox);
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2231 gtk_widget_show(hbox);
714
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
2232
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
2233 /* Create our pixmap and pack it */
719
7e5523de52e2 [gaim-migrate @ 729]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 718
diff changeset
2234 gtk_widget_realize(menu->parent);
714
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
2235 pm = gdk_pixmap_create_from_xpm_d(menu->parent->window, &mask, NULL, xpm);
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
2236 pixmap = gtk_pixmap_new(pm, mask);
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
2237 gtk_widget_show(pixmap);
803
7f75b17d4e14 [gaim-migrate @ 813]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 801
diff changeset
2238 gdk_pixmap_unref(pm);
804
17def2bb9720 [gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 803
diff changeset
2239 gdk_bitmap_unref(mask);
718
c2e3e4e59a17 [gaim-migrate @ 728]
Rob Flynn <gaim@robflynn.com>
parents: 714
diff changeset
2240 gtk_box_pack_start(GTK_BOX(hbox), pixmap, FALSE, FALSE, 2);
c2e3e4e59a17 [gaim-migrate @ 728]
Rob Flynn <gaim@robflynn.com>
parents: 714
diff changeset
2241
c2e3e4e59a17 [gaim-migrate @ 728]
Rob Flynn <gaim@robflynn.com>
parents: 714
diff changeset
2242 /* Create our label and pack it */
c2e3e4e59a17 [gaim-migrate @ 728]
Rob Flynn <gaim@robflynn.com>
parents: 714
diff changeset
2243 label = gtk_label_new(str);
c2e3e4e59a17 [gaim-migrate @ 728]
Rob Flynn <gaim@robflynn.com>
parents: 714
diff changeset
2244 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
1634
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2245 gtk_widget_show(label);
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2246
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2247 if (mod) {
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2248 label = gtk_label_new(mod);
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2249 gtk_box_pack_end(GTK_BOX(hbox), label, FALSE, FALSE, 2);
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2250 gtk_widget_show(label);
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2251 }
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2252
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2253 if (accel_key) {
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2254 gtk_widget_add_accelerator(menuitem, "activate", accel, accel_key,
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2255 accel_mods, GTK_ACCEL_LOCKED);
1634
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2256 gtk_widget_lock_accelerators(menuitem);
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2257 }
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2258
714
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
2259 return menuitem;
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
2260 }
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
2261
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2262
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2263
696
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
2264 void build_imchat_box(gboolean on)
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
2265 {
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
2266 if (on) {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2267 if (imchatbox)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2268 return;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2269
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2270 imbutton = gtk_button_new_with_label(_("IM"));
696
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
2271 infobutton = gtk_button_new_with_label(_("Info"));
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
2272 chatbutton = gtk_button_new_with_label(_("Chat"));
1929
d51ea669d84e [gaim-migrate @ 1939]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1918
diff changeset
2273 awaybutton = gtk_button_new_with_label(_("Away"));
696
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
2274
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2275 imchatbox = gtk_hbox_new(TRUE, 10);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2276
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2277 if (misc_options & OPT_MISC_COOL_LOOK) {
696
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
2278 gtk_button_set_relief(GTK_BUTTON(imbutton), GTK_RELIEF_NONE);
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
2279 gtk_button_set_relief(GTK_BUTTON(infobutton), GTK_RELIEF_NONE);
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
2280 gtk_button_set_relief(GTK_BUTTON(chatbutton), GTK_RELIEF_NONE);
1929
d51ea669d84e [gaim-migrate @ 1939]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1918
diff changeset
2281 gtk_button_set_relief(GTK_BUTTON(awaybutton), GTK_RELIEF_NONE);
696
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
2282 }
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
2283
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
2284 /* Put the buttons in the hbox */
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
2285 gtk_widget_show(imbutton);
1929
d51ea669d84e [gaim-migrate @ 1939]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1918
diff changeset
2286 gtk_widget_show(infobutton);
696
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
2287 gtk_widget_show(chatbutton);
1929
d51ea669d84e [gaim-migrate @ 1939]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1918
diff changeset
2288 gtk_widget_show(awaybutton);
696
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
2289
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
2290 gtk_box_pack_start(GTK_BOX(imchatbox), imbutton, TRUE, TRUE, 0);
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
2291 gtk_box_pack_start(GTK_BOX(imchatbox), infobutton, TRUE, TRUE, 0);
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
2292 gtk_box_pack_start(GTK_BOX(imchatbox), chatbutton, TRUE, TRUE, 0);
1929
d51ea669d84e [gaim-migrate @ 1939]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1918
diff changeset
2293 gtk_box_pack_start(GTK_BOX(imchatbox), awaybutton, TRUE, TRUE, 0);
1172
4135d8fc7b4e [gaim-migrate @ 1182]
Rob Flynn <gaim@robflynn.com>
parents: 1171
diff changeset
2294 gtk_container_border_width(GTK_CONTAINER(imchatbox), 5);
696
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
2295
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2296 gtk_signal_connect(GTK_OBJECT(imbutton), "clicked", GTK_SIGNAL_FUNC(im_callback),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2297 buddies);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2298 gtk_signal_connect(GTK_OBJECT(infobutton), "clicked", GTK_SIGNAL_FUNC(info_callback),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2299 buddies);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2300 gtk_signal_connect(GTK_OBJECT(chatbutton), "clicked", GTK_SIGNAL_FUNC(chat_callback),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2301 buddies);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2302 gtk_signal_connect(GTK_OBJECT(awaybutton), "clicked", GTK_SIGNAL_FUNC(away_callback),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2303 buddies);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2304
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2305 gtk_tooltips_set_tip(tips, infobutton, _("Information on selected Buddy"), "Penguin");
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2306 gtk_tooltips_set_tip(tips, imbutton, _("Send Instant Message"), "Penguin");
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2307 gtk_tooltips_set_tip(tips, chatbutton, _("Start/join a Buddy Chat"), "Penguin");
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2308 gtk_tooltips_set_tip(tips, awaybutton, _("Activate Away Message"), "Penguin");
696
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
2309
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
2310 gtk_box_pack_start(GTK_BOX(buddypane), imchatbox, FALSE, FALSE, 0);
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
2311
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
2312 gtk_widget_show(imchatbox);
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
2313 } else {
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
2314 if (imchatbox)
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
2315 gtk_widget_destroy(imchatbox);
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
2316 imchatbox = NULL;
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
2317 }
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
2318 }
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
2319
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2320
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2321
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2322 void show_buddy_list()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2323 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2324
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2325 /* Build the buddy list, based on *config */
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2326
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2327 GtkWidget *sw;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2328 GtkWidget *menu;
798
9dc39872e1f9 [gaim-migrate @ 808]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 784
diff changeset
2329 #ifdef USE_PERL
9dc39872e1f9 [gaim-migrate @ 808]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 784
diff changeset
2330 GtkWidget *perlmenu;
9dc39872e1f9 [gaim-migrate @ 808]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 784
diff changeset
2331 #endif
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1496
diff changeset
2332 #ifdef NO_MULTI
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2333 GtkWidget *setmenu;
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1496
diff changeset
2334 GtkWidget *findmenu;
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1496
diff changeset
2335 #endif
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2336 GtkWidget *menubar;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2337 GtkWidget *vbox;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2338 GtkWidget *menuitem;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2339 GtkWidget *notebook;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2340 GtkWidget *label;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2341 GtkWidget *bbox;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2342 GtkWidget *tbox;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2343
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 945
diff changeset
2344 if (blist) {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 945
diff changeset
2345 gtk_widget_show(blist);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 945
diff changeset
2346 return;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 945
diff changeset
2347 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 945
diff changeset
2348
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2349 #ifdef USE_APPLET
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2350 blist = gtk_window_new(GTK_WINDOW_DIALOG);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2351 #else
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2352 blist = gtk_window_new(GTK_WINDOW_TOPLEVEL);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2353 #endif
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2354
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2355 gtk_window_set_wmclass(GTK_WINDOW(blist), "buddy_list", "Gaim");
905
2876c40108cd [gaim-migrate @ 915]
Rob Flynn <gaim@robflynn.com>
parents: 903
diff changeset
2356
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2357 gtk_widget_realize(blist);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2358 aol_icon(blist->window);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2359
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2360 gtk_window_set_policy(GTK_WINDOW(blist), TRUE, TRUE, TRUE);
1634
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2361
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2362 accel = gtk_accel_group_new();
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2363 gtk_accel_group_attach(accel, GTK_OBJECT(blist));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2364
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2365 menubar = gtk_menu_bar_new();
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2366
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2367 menu = gtk_menu_new();
1634
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2368 gtk_menu_set_accel_group(GTK_MENU(menu), accel);
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2369
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2370
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2371 menuitem = gaim_new_item(NULL, _("File"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2372 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), menu);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2373 gtk_menu_bar_append(GTK_MENU_BAR(menubar), menuitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2374
1634
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2375 gaim_new_item_with_pixmap(menu, _("Add A Buddy"), add_small_xpm,
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2376 GTK_SIGNAL_FUNC(add_buddy_callback), 'b', GDK_CONTROL_MASK, "Ctl+B");
1634
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2377 gaim_new_item_with_pixmap(menu, _("Join A Chat"), pounce_small_xpm,
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2378 GTK_SIGNAL_FUNC(chat_callback), 'c', GDK_CONTROL_MASK, "Ctl+C");
1634
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2379 gaim_new_item_with_pixmap(menu, _("New Instant Message"), send_small_xpm,
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2380 GTK_SIGNAL_FUNC(show_im_dialog), 'i', GDK_CONTROL_MASK, "Ctl+I");
2587
cfb8c88d290e [gaim-migrate @ 2600]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2582
diff changeset
2381 gaim_new_item_with_pixmap(menu, _("Get User Info"), search_small_xpm,
cfb8c88d290e [gaim-migrate @ 2600]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2582
diff changeset
2382 GTK_SIGNAL_FUNC(show_info_dialog), 'j', GDK_CONTROL_MASK, "Ctl+J");
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2383
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2384 gaim_separator(menu);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2385
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2386 gaim_new_item_with_pixmap(menu, _("Import Buddy List"), import_small_xpm,
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2387 GTK_SIGNAL_FUNC(import_callback), 0, 0, 0);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2388 /*gaim_new_item_with_pixmap(menu, _("Export Buddy List"), export_small_xpm,
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2389 GTK_SIGNAL_FUNC(show_export_dialog), 0, 0, 0); */
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1496
diff changeset
2390 gaim_separator(menu);
1634
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2391 gaim_new_item_with_pixmap(menu, _("Signoff"), logout_icon_xpm,
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2392 GTK_SIGNAL_FUNC(signoff_all), 'd', GDK_CONTROL_MASK, "Ctl+D");
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2393
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2394 #ifndef USE_APPLET
1634
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2395 gaim_new_item_with_pixmap(menu, _("Quit"), exit_small_xpm,
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2396 GTK_SIGNAL_FUNC(do_quit), 'q', GDK_CONTROL_MASK, "Ctl+Q");
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2397 #else
1634
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2398 gaim_new_item_with_pixmap(menu, _("Close"), close_small_xpm,
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2399 GTK_SIGNAL_FUNC(applet_destroy_buddy), 'x', GDK_CONTROL_MASK, "Ctl+X");
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2400 #endif
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2401
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2402 menu = gtk_menu_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2403
1634
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2404 menuitem = gaim_new_item(NULL, _("Tools"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2405 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), menu);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2406 gtk_menu_bar_append(GTK_MENU_BAR(menubar), menuitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2407
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2408 awaymenu = gtk_menu_new();
1634
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2409 menuitem = gaim_new_item_with_pixmap(menu, _("Away"), away_small_xpm, NULL, 0, 0, 0);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2410 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), awaymenu);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2411 do_away_menu();
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2412
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2413 bpmenu = gtk_menu_new();
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2414 menuitem = gaim_new_item_with_pixmap(menu, _("Buddy Pounce"), pounce_small_xpm, NULL, 0, 0, 0);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2415 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), bpmenu);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2416 do_bp_menu();
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2417
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2418 gaim_separator(menu);
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1496
diff changeset
2419
2598
b2800bca74fe [gaim-migrate @ 2611]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2592
diff changeset
2420 #ifndef NO_MULTI
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2421 gaim_new_item_with_pixmap(menu, _("Accounts"), add_small_xpm,
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2422 GTK_SIGNAL_FUNC(account_editor), 'a', GDK_CONTROL_MASK, "Ctl+A");
2598
b2800bca74fe [gaim-migrate @ 2611]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2592
diff changeset
2423 #endif
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1496
diff changeset
2424
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1496
diff changeset
2425 protomenu = gtk_menu_new();
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2426 menuitem =
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2427 gaim_new_item_with_pixmap(menu, _("Protocol Actions"), prefs_small_xpm, NULL, 0, 0, 0);
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1496
diff changeset
2428 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), protomenu);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1496
diff changeset
2429 do_proto_menu();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2430
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2431 gaim_new_item_with_pixmap(menu, _("Preferences"), prefs_small_xpm,
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2432 GTK_SIGNAL_FUNC(show_prefs), 'p', GDK_CONTROL_MASK, "Ctl+P");
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2433 gaim_new_item_with_pixmap(menu, _("View System Log"), prefs_small_xpm,
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2434 GTK_SIGNAL_FUNC(show_syslog), 0, 0, 0);
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 87
diff changeset
2435
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1496
diff changeset
2436 gaim_separator(menu);
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1496
diff changeset
2437
152
cb0d3ec5a4c8 [gaim-migrate @ 162]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 150
diff changeset
2438 #ifdef GAIM_PLUGINS
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2439 gaim_new_item_with_pixmap(menu, _("Plugins"), plugins_small_xpm, GTK_SIGNAL_FUNC(show_plugins),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2440 0, 0, 0);
152
cb0d3ec5a4c8 [gaim-migrate @ 162]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 150
diff changeset
2441 #endif
798
9dc39872e1f9 [gaim-migrate @ 808]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 784
diff changeset
2442 #ifdef USE_PERL
9dc39872e1f9 [gaim-migrate @ 808]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 784
diff changeset
2443 perlmenu = gtk_menu_new();
9dc39872e1f9 [gaim-migrate @ 808]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 784
diff changeset
2444 gtk_widget_show(perlmenu);
1634
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2445 menuitem = gaim_new_item_with_pixmap(menu, _("Perl"), plugins_small_xpm, NULL, 0, 0, 0);
798
9dc39872e1f9 [gaim-migrate @ 808]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 784
diff changeset
2446 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), perlmenu);
9dc39872e1f9 [gaim-migrate @ 808]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 784
diff changeset
2447 gtk_widget_show(menuitem);
9dc39872e1f9 [gaim-migrate @ 808]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 784
diff changeset
2448 menuitem = gtk_menu_item_new_with_label(_("Load Script"));
9dc39872e1f9 [gaim-migrate @ 808]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 784
diff changeset
2449 gtk_menu_append(GTK_MENU(perlmenu), menuitem);
9dc39872e1f9 [gaim-migrate @ 808]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 784
diff changeset
2450 gtk_signal_connect(GTK_OBJECT(menuitem), "activate", GTK_SIGNAL_FUNC(load_perl_script), NULL);
9dc39872e1f9 [gaim-migrate @ 808]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 784
diff changeset
2451 gtk_widget_show(menuitem);
9dc39872e1f9 [gaim-migrate @ 808]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 784
diff changeset
2452 menuitem = gtk_menu_item_new_with_label(_("Unload All Scripts"));
9dc39872e1f9 [gaim-migrate @ 808]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 784
diff changeset
2453 gtk_menu_append(GTK_MENU(perlmenu), menuitem);
9dc39872e1f9 [gaim-migrate @ 808]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 784
diff changeset
2454 gtk_signal_connect(GTK_OBJECT(menuitem), "activate", GTK_SIGNAL_FUNC(unload_perl_scripts), NULL);
9dc39872e1f9 [gaim-migrate @ 808]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 784
diff changeset
2455 gtk_widget_show(menuitem);
9dc39872e1f9 [gaim-migrate @ 808]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 784
diff changeset
2456 menuitem = gtk_menu_item_new_with_label(_("List Scripts"));
9dc39872e1f9 [gaim-migrate @ 808]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 784
diff changeset
2457 gtk_menu_append(GTK_MENU(perlmenu), menuitem);
9dc39872e1f9 [gaim-migrate @ 808]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 784
diff changeset
2458 gtk_signal_connect(GTK_OBJECT(menuitem), "activate", GTK_SIGNAL_FUNC(list_perl_scripts), NULL);
9dc39872e1f9 [gaim-migrate @ 808]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 784
diff changeset
2459 gtk_widget_show(menuitem);
9dc39872e1f9 [gaim-migrate @ 808]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 784
diff changeset
2460 #endif
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 87
diff changeset
2461
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2462 menu = gtk_menu_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2463
1634
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2464 menuitem = gaim_new_item(NULL, _("Help"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2465 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), menu);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2466 gtk_menu_item_right_justify(GTK_MENU_ITEM(menuitem));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2467 gtk_menu_bar_append(GTK_MENU_BAR(menubar), menuitem);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2468
1634
d029dc28a61e [gaim-migrate @ 1644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2469 gaim_new_item_with_pixmap(menu, _("About Gaim"), about_small_xpm, show_about, GDK_F1, 0, NULL);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2470
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2471 gtk_widget_show(menubar);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2472
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2473 vbox = gtk_vbox_new(FALSE, 0);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2474
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2475 notebook = gtk_notebook_new();
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2476
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2477
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2478
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2479
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2480 /* Do buddy list stuff */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2481 /* FIXME: spacing on both panes is ad hoc */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2482 buddypane = gtk_vbox_new(FALSE, 1);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2483
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2484 buddies = gtk_tree_new();
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2485 sw = gtk_scrolled_window_new(NULL, NULL);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2486
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2487 tips = gtk_tooltips_new();
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
2488 gtk_object_set_data(GTK_OBJECT(blist), _("Buddy List"), tips);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2489
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2490 /* Now the buddy list */
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2491 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw), buddies);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2492 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2493 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2494 gtk_widget_set_usize(sw, 200, 200);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2495 gtk_widget_show(buddies);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2496 gtk_widget_show(sw);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2497
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2498 gtk_box_pack_start(GTK_BOX(buddypane), sw, TRUE, TRUE, 0);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2499 gtk_widget_show(buddypane);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2500
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2281
diff changeset
2501 if (!(blist_options & OPT_BLIST_NO_BUTTONS))
696
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
2502 build_imchat_box(TRUE);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2503
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2504
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2505 /* Swing the edit buddy */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2506 editpane = gtk_vbox_new(FALSE, 1);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2507
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2508 addbutton = gtk_button_new_with_label(_("Add"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2509 groupbutton = gtk_button_new_with_label(_("Group"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2510 rembutton = gtk_button_new_with_label(_("Remove"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2511
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2281
diff changeset
2512 if (misc_options & OPT_MISC_COOL_LOOK) {
535
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 515
diff changeset
2513 gtk_button_set_relief(GTK_BUTTON(addbutton), GTK_RELIEF_NONE);
577
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 544
diff changeset
2514 gtk_button_set_relief(GTK_BUTTON(groupbutton), GTK_RELIEF_NONE);
535
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 515
diff changeset
2515 gtk_button_set_relief(GTK_BUTTON(rembutton), GTK_RELIEF_NONE);
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 515
diff changeset
2516 }
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2517
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2518 edittree = gtk_ctree_new(1, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2519 gtk_ctree_set_line_style(GTK_CTREE(edittree), GTK_CTREE_LINES_SOLID);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2520 gtk_ctree_set_expander_style(GTK_CTREE(edittree), GTK_CTREE_EXPANDER_SQUARE);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2521 gtk_clist_set_reorderable(GTK_CLIST(edittree), TRUE);
1391
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
2522 gtk_signal_connect(GTK_OBJECT(edittree), "button_press_event",
d606da211acb [gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1376
diff changeset
2523 GTK_SIGNAL_FUNC(click_edit_tree), NULL);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2524
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2525 gtk_ctree_set_drag_compare_func(GTK_CTREE(edittree),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2526 (GtkCTreeCompareDragFunc) edit_drag_compare_func);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2527
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2528
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2529 gtk_signal_connect_after(GTK_OBJECT(edittree), "tree_move",
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2530 GTK_SIGNAL_FUNC(edit_tree_move), NULL);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2531
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2532
1172
4135d8fc7b4e [gaim-migrate @ 1182]
Rob Flynn <gaim@robflynn.com>
parents: 1171
diff changeset
2533 bbox = gtk_hbox_new(TRUE, 5);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2534 gtk_container_set_border_width(GTK_CONTAINER(bbox), 5);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2535 tbox = gtk_scrolled_window_new(NULL, NULL);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2536 /* Put the buttons in the box */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2537 gtk_box_pack_start(GTK_BOX(bbox), addbutton, TRUE, TRUE, 0);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2538 gtk_box_pack_start(GTK_BOX(bbox), groupbutton, TRUE, TRUE, 0);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2539 gtk_box_pack_start(GTK_BOX(bbox), rembutton, TRUE, TRUE, 0);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2540
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
2541 gtk_tooltips_set_tip(tips, addbutton, _("Add a new Buddy"), "Penguin");
577
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 544
diff changeset
2542 gtk_tooltips_set_tip(tips, groupbutton, _("Add a new Group"), "Penguin");
2134
6641141234b7 [gaim-migrate @ 2144]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2132
diff changeset
2543 gtk_tooltips_set_tip(tips, rembutton, _("Remove selected Buddy/Group"), "Penguin");
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2544
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2545 /* And the boxes in the box */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2546 gtk_box_pack_start(GTK_BOX(editpane), tbox, TRUE, TRUE, 0);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2547 gtk_box_pack_start(GTK_BOX(editpane), bbox, FALSE, FALSE, 0);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2548
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2549 /* Handle closes right */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2550
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2551
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2552
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2553 /* Finish up */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2554 gtk_widget_show(addbutton);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2555 gtk_widget_show(groupbutton);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2556 gtk_widget_show(rembutton);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2557 gtk_widget_show(edittree);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2558 gtk_widget_show(tbox);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2559 gtk_widget_show(bbox);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2560 gtk_widget_show(editpane);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2561
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2562
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2563
703
20553b584ccb [gaim-migrate @ 713]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
2564 update_button_pix();
20553b584ccb [gaim-migrate @ 713]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
2565
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2566
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2567
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2568 label = gtk_label_new(_("Online"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2569 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), buddypane, label);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2570 label = gtk_label_new(_("Edit Buddies"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2571 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), editpane, label);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2572
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2573 gtk_widget_show_all(notebook);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2574
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2575 /* Pack things in the vbox */
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2576 gtk_widget_show(vbox);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2577
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2578
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2579 gtk_widget_show(notebook);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2580
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2581 /* Enable buttons */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2582
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2583 gtk_signal_connect(GTK_OBJECT(rembutton), "clicked", GTK_SIGNAL_FUNC(do_del_buddy), edittree);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2584 gtk_signal_connect(GTK_OBJECT(addbutton), "clicked", GTK_SIGNAL_FUNC(add_buddy_callback), NULL);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2585 gtk_signal_connect(GTK_OBJECT(groupbutton), "clicked", GTK_SIGNAL_FUNC(add_group_callback),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2586 NULL);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2587 gtk_box_pack_start(GTK_BOX(vbox), menubar, FALSE, TRUE, 0);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2588 gtk_box_pack_start(GTK_BOX(vbox), notebook, TRUE, TRUE, 0);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2589
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2590 gtk_container_add(GTK_CONTAINER(blist), vbox);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2591
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2592 #ifndef USE_APPLET
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2593 gtk_signal_connect(GTK_OBJECT(blist), "delete_event", GTK_SIGNAL_FUNC(do_quit), blist);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2594 #else
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2595 gtk_signal_connect(GTK_OBJECT(blist), "delete_event", GTK_SIGNAL_FUNC(applet_destroy_buddy),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2596 NULL);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2597 #endif
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2598
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2599 gtk_signal_connect(GTK_OBJECT(blist), "configure_event", GTK_SIGNAL_FUNC(move_blist_window),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2600 NULL);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2601
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2602
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2603
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2604 /* The edit tree */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2605 gtk_container_add(GTK_CONTAINER(tbox), edittree);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2606 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(tbox),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2607 GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2608
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2609
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2610 gtk_window_set_title(GTK_WINDOW(blist), _("Gaim - Buddy List"));
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2611
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2612 if (blist_options & OPT_BLIST_SAVED_WINDOWS) {
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2613 if (blist_pos.width != 0) { /* Sanity check! */
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2614 gtk_widget_set_uposition(blist, blist_pos.x - blist_pos.xoff,
1420
9be6790092dc [gaim-migrate @ 1430]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1413
diff changeset
2615 blist_pos.y - blist_pos.yoff);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2616 gtk_widget_set_usize(blist, blist_pos.width, blist_pos.height);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2617 }
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2618 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2619 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2620
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2621 void refresh_buddy_window()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2622 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2623 build_edit_tree();
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2624
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2625 update_button_pix();
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2626 gtk_widget_show(blist);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2627 }