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