annotate src/buddy.c @ 922:b544df1b1c17

[gaim-migrate @ 932] Waa committer: Tailor Script <tailor@pidgin.im>
author Rob Flynn <gaim@robflynn.com>
date Sat, 16 Sep 2000 01:09:23 +0000
parents d2e865d64dd8
children 5e6ca3dd4d02
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1 /*
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2 * gaim
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
4 * Copyright (C) 1998-1999, Mark Spencer <markster@marko.net>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
5 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
6 * This program is free software; you can redistribute it and/or modify
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
7 * it under the terms of the GNU General Public License as published by
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
8 * the Free Software Foundation; either version 2 of the License, or
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
9 * (at your option) any later version.
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
10 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
11 * This program is distributed in the hope that it will be useful,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
14 * GNU General Public License for more details.
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
15 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
16 * You should have received a copy of the GNU General Public License
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
17 * along with this program; if not, write to the Free Software
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
19 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
20 */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
21
349
b402a23f35df [gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 342
diff changeset
22 #ifdef HAVE_CONFIG_H
b402a23f35df [gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 342
diff changeset
23 #include "../config.h"
b402a23f35df [gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 342
diff changeset
24 #endif
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
25 #ifdef USE_APPLET
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
26 #include <gnome.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
27 #include <applet-widget.h>
84
51943f1a97a0 [gaim-migrate @ 94]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 70
diff changeset
28 #include "gnome_applet_mgr.h"
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
29 #endif /* USE_APPLET */
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
30 #ifdef GAIM_PLUGINS
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
31 #include <dlfcn.h>
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
32 #endif /* GAIM_PLUGINS */
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
33 #include <string.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
34 #include <stdio.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
35 #include <stdlib.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
36 #include <math.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
37 #include <time.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
38
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
39 #include <gtk/gtk.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
40 #include <gdk/gdkx.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
41 #include "gaim.h"
513
eaddaa0dbbcb [gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 511
diff changeset
42 #include <aim.h>
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
43 #include "pixmaps/admin_icon.xpm"
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
44 #include "pixmaps/aol_icon.xpm"
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
45 #include "pixmaps/free_icon.xpm"
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
46 #include "pixmaps/dt_icon.xpm"
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
47 #include "pixmaps/no_icon.xpm"
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
48 #include "pixmaps/login_icon.xpm"
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
49 #include "pixmaps/logout_icon.xpm"
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
50
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
51 #include "pixmaps/buddyadd.xpm"
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
52 #include "pixmaps/buddydel.xpm"
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
53 #include "pixmaps/buddychat.xpm"
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
54 #include "pixmaps/im.xpm"
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
55 #include "pixmaps/info.xpm"
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
56 #include "pixmaps/away_icon.xpm"
872
0532f6f85fac [gaim-migrate @ 882]
Rob Flynn <gaim@robflynn.com>
parents: 870
diff changeset
57 #include "pixmaps/away_small.xpm"
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
58
150
d4e99c17e399 [gaim-migrate @ 160]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 146
diff changeset
59 #include "pixmaps/daemon-buddyadd.xpm"
d4e99c17e399 [gaim-migrate @ 160]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 146
diff changeset
60 #include "pixmaps/daemon-buddydel.xpm"
d4e99c17e399 [gaim-migrate @ 160]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 146
diff changeset
61 #include "pixmaps/daemon-buddychat.xpm"
d4e99c17e399 [gaim-migrate @ 160]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 146
diff changeset
62 #include "pixmaps/daemon-im.xpm"
d4e99c17e399 [gaim-migrate @ 160]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 146
diff changeset
63 #include "pixmaps/daemon-info.xpm"
d4e99c17e399 [gaim-migrate @ 160]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 146
diff changeset
64
714
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
65 #include "pixmaps/add_small.xpm"
718
c2e3e4e59a17 [gaim-migrate @ 728]
Rob Flynn <gaim@robflynn.com>
parents: 714
diff changeset
66 #include "pixmaps/import_small.xpm"
733
8f3bcde94e2c [gaim-migrate @ 743]
Rob Flynn <gaim@robflynn.com>
parents: 727
diff changeset
67 #include "pixmaps/export_small.xpm"
885
db5f5c33e83f [gaim-migrate @ 895]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 875
diff changeset
68 #if defined(GAIM_PLUGINS) || defined(USE_PERL)
801
1a47432e2ba1 [gaim-migrate @ 811]
Rob Flynn <gaim@robflynn.com>
parents: 798
diff changeset
69 #include "pixmaps/plugins_small.xpm"
1a47432e2ba1 [gaim-migrate @ 811]
Rob Flynn <gaim@robflynn.com>
parents: 798
diff changeset
70 #endif
1a47432e2ba1 [gaim-migrate @ 811]
Rob Flynn <gaim@robflynn.com>
parents: 798
diff changeset
71 #include "pixmaps/prefs_small.xpm"
1a47432e2ba1 [gaim-migrate @ 811]
Rob Flynn <gaim@robflynn.com>
parents: 798
diff changeset
72 #include "pixmaps/search_small.xpm"
747
eec93c5929b9 [gaim-migrate @ 757]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 746
diff changeset
73 #ifdef USE_APPLET
727
8b9f0537f473 [gaim-migrate @ 737]
Rob Flynn <gaim@robflynn.com>
parents: 719
diff changeset
74 #include "pixmaps/close_small.xpm"
747
eec93c5929b9 [gaim-migrate @ 757]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 746
diff changeset
75 #endif
727
8b9f0537f473 [gaim-migrate @ 737]
Rob Flynn <gaim@robflynn.com>
parents: 719
diff changeset
76 #include "pixmaps/exit_small.xpm"
865
789b2f0bb133 [gaim-migrate @ 875]
Rob Flynn <gaim@robflynn.com>
parents: 864
diff changeset
77 #include "pixmaps/pounce_small.xpm"
874
69669b9b3e3b [gaim-migrate @ 884]
Rob Flynn <gaim@robflynn.com>
parents: 872
diff changeset
78 #include "pixmaps/about_small.xpm"
714
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
79
820
fe2e1ad4495b [gaim-migrate @ 830]
Rob Flynn <gaim@robflynn.com>
parents: 813
diff changeset
80 #include "pixmaps/tmp_send.xpm"
fe2e1ad4495b [gaim-migrate @ 830]
Rob Flynn <gaim@robflynn.com>
parents: 813
diff changeset
81 #include "pixmaps/tb_search.xpm"
870
9b8b83592bb6 [gaim-migrate @ 880]
Rob Flynn <gaim@robflynn.com>
parents: 865
diff changeset
82 #include "pixmaps/join.xpm"
875
450db0a5bbe4 [gaim-migrate @ 885]
Rob Flynn <gaim@robflynn.com>
parents: 874
diff changeset
83 #include "pixmaps/gnome_add.xpm"
450db0a5bbe4 [gaim-migrate @ 885]
Rob Flynn <gaim@robflynn.com>
parents: 874
diff changeset
84 #include "pixmaps/gnome_remove.xpm"
450db0a5bbe4 [gaim-migrate @ 885]
Rob Flynn <gaim@robflynn.com>
parents: 874
diff changeset
85 #include "pixmaps/group.xpm"
820
fe2e1ad4495b [gaim-migrate @ 830]
Rob Flynn <gaim@robflynn.com>
parents: 813
diff changeset
86
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
87 static GtkTooltips *tips;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
88 static GtkWidget *editpane;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
89 static GtkWidget *buddypane;
696
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
90 static GtkWidget *imchatbox;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
91 static GtkWidget *edittree;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
92 static GtkWidget *imbutton, *infobutton, *chatbutton;
577
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 544
diff changeset
93 static GtkWidget *addbutton, *groupbutton, *rembutton;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
94
436
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 432
diff changeset
95 extern int ticker_prefs;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
96
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
97 GtkWidget *blist = NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
98 GtkWidget *bpmenu;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
99 GtkWidget *buddies;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
100 int permdeny;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
101
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents: 423
diff changeset
102 void BuddyTickerLogonTimeout( gpointer data );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents: 423
diff changeset
103 void BuddyTickerLogoutTimeout( gpointer data );
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
104
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
105 /* Predefine some functions */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
106 static void new_bp_callback(GtkWidget *w, char *name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
107 static void log_callback(GtkWidget *w, char *name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
108
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
109
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
110 void destroy_buddy()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
111 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
112 if (blist)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
113 gtk_widget_destroy(blist);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
114 blist=NULL;
700
d904bf694bd7 [gaim-migrate @ 710]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 696
diff changeset
115 imchatbox = NULL;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
116 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
117
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
118 void update_num_groups()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
119 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
120 GList *grp = groups;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
121 GList *mem;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
122 struct buddy *b;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
123 struct group *g;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
124 int pres, total;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
125 char buf[BUF_LONG];
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
126
342
f4fba304b236 [gaim-migrate @ 352]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 341
diff changeset
127 #ifndef USE_APPLET
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
128 if (!(display_options & OPT_DISP_SHOW_GRPNUM))
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
129 return;
342
f4fba304b236 [gaim-migrate @ 352]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 341
diff changeset
130 #else
f4fba304b236 [gaim-migrate @ 352]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 341
diff changeset
131 int onl = 0;
f4fba304b236 [gaim-migrate @ 352]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 341
diff changeset
132 int all = 0;
f4fba304b236 [gaim-migrate @ 352]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 341
diff changeset
133 #endif
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
134
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
135 while(grp) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
136 g = (struct group *)grp->data;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
137 mem = g->members;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
138 pres = 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
139 total = 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
140 while(mem) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
141 b = (struct buddy *)mem->data;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
142 if (b->present)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
143 pres++;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
144 total++;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
145
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
146
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
147 mem = mem->next;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
148 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
149
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
150 g_snprintf(buf, sizeof(buf), "%s (%d/%d)", g->name, pres, total);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
151
342
f4fba304b236 [gaim-migrate @ 352]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 341
diff changeset
152 #ifdef USE_APPLET
f4fba304b236 [gaim-migrate @ 352]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 341
diff changeset
153 onl += pres;
f4fba304b236 [gaim-migrate @ 352]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 341
diff changeset
154 all += total;
f4fba304b236 [gaim-migrate @ 352]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 341
diff changeset
155 if (display_options & OPT_DISP_SHOW_GRPNUM)
f4fba304b236 [gaim-migrate @ 352]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 341
diff changeset
156 #endif
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
157 gtk_label_set(GTK_LABEL(g->label), buf);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
158 grp = grp->next;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
159 }
342
f4fba304b236 [gaim-migrate @ 352]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 341
diff changeset
160 #ifdef USE_APPLET
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
161 g_snprintf(buf, sizeof(buf), _("%d/%d Buddies Online"), onl, all);
342
f4fba304b236 [gaim-migrate @ 352]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 341
diff changeset
162 applet_set_tooltips(buf);
f4fba304b236 [gaim-migrate @ 352]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 341
diff changeset
163 #endif
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
164 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
165
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
166 void update_show_idlepix()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
167 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
168 GList *grp = groups;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
169 GList *mem;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
170 struct group *g;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
171 struct buddy *b;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
172
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
173 while (grp) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
174 g = (struct group *)grp->data;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
175 mem = g->members;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
176
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
177 while(mem) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
178 b = (struct buddy *)mem->data;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
179
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
180 if (display_options & OPT_DISP_SHOW_IDLETIME)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
181 gtk_widget_show(b->idletime);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
182 else
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
183 gtk_widget_hide(b->idletime);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
184
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
185 if (display_options & OPT_DISP_SHOW_PIXMAPS)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
186 gtk_widget_show(b->pix);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
187 else
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
188 gtk_widget_hide(b->pix);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
189 mem = mem->next;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
190 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
191 grp = grp->next;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
192 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
193 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
194
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
195 void update_all_buddies()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
196 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
197 GList *grp = groups;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
198 GList *mem;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
199 struct buddy *b;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
200 struct group *g;
912
5a517b4f0be4 [gaim-migrate @ 922]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
201 int count;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
202
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
203 while(grp) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
204 g = (struct group *)grp->data;
912
5a517b4f0be4 [gaim-migrate @ 922]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
205 count = 0;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
206 mem = g->members;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
207 while(mem) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
208 b = (struct buddy *)mem->data;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
209
59
af088e5b2e30 [gaim-migrate @ 69]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 58
diff changeset
210 if (b->present || !GTK_WIDGET_VISIBLE(b->item))
af088e5b2e30 [gaim-migrate @ 69]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 58
diff changeset
211 set_buddy(b);
902
bd5f4997f063 [gaim-migrate @ 912]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 892
diff changeset
212
912
5a517b4f0be4 [gaim-migrate @ 922]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
213 if (b->present) count++;
5a517b4f0be4 [gaim-migrate @ 922]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
214
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
215 mem = mem->next;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
216 }
912
5a517b4f0be4 [gaim-migrate @ 922]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
217 /* this is a fall-back in case we missed any */
913
8de59874f5ce [gaim-migrate @ 923]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 912
diff changeset
218 if (!count && (display_options & OPT_DISP_NO_MT_GRP))
8de59874f5ce [gaim-migrate @ 923]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 912
diff changeset
219 gtk_widget_hide(g->item);
912
5a517b4f0be4 [gaim-migrate @ 922]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
220 else gtk_widget_show(g->item);
5a517b4f0be4 [gaim-migrate @ 922]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
221
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
222 grp = grp->next;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
223 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
224
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
225
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
226 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
227
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
228 static void adjust_pic(GtkWidget *button, const char *c, gchar **xpm)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
229 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
230 GdkPixmap *pm;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
231 GdkBitmap *bm;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
232 GtkWidget *pic;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
233 GtkWidget *label;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
234
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
235 /*if the user had opted to put pictures on the buttons*/
577
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 544
diff changeset
236 if (display_options & OPT_DISP_SHOW_BUTTON_XPM && xpm) {
820
fe2e1ad4495b [gaim-migrate @ 830]
Rob Flynn <gaim@robflynn.com>
parents: 813
diff changeset
237 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm, NULL, xpm);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
238 pic = gtk_pixmap_new(pm, bm);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
239 gtk_widget_show(pic);
644
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 608
diff changeset
240 gdk_pixmap_unref(pm);
804
17def2bb9720 [gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 803
diff changeset
241 gdk_bitmap_unref(bm);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
242 label = GTK_BIN(button)->child;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
243 gtk_container_remove(GTK_CONTAINER(button), label);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
244 gtk_container_add(GTK_CONTAINER(button), pic);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
245 } else {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
246 label = gtk_label_new(c);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
247 gtk_widget_show(label);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
248 pic = GTK_BIN(button)->child;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
249 gtk_container_remove(GTK_CONTAINER(button), pic);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
250 gtk_container_add(GTK_CONTAINER(button), label);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
251 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
252
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
253 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
254
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
255
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
256 void update_button_pix()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
257 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
258
875
450db0a5bbe4 [gaim-migrate @ 885]
Rob Flynn <gaim@robflynn.com>
parents: 874
diff changeset
259 adjust_pic(addbutton, _("Add"), (gchar **)gnome_add_xpm);
450db0a5bbe4 [gaim-migrate @ 885]
Rob Flynn <gaim@robflynn.com>
parents: 874
diff changeset
260 adjust_pic(groupbutton, _("Group"), (gchar **)group_xpm);
450db0a5bbe4 [gaim-migrate @ 885]
Rob Flynn <gaim@robflynn.com>
parents: 874
diff changeset
261 adjust_pic(rembutton, _("Remove"), (gchar **)gnome_remove_xpm);
450db0a5bbe4 [gaim-migrate @ 885]
Rob Flynn <gaim@robflynn.com>
parents: 874
diff changeset
262
820
fe2e1ad4495b [gaim-migrate @ 830]
Rob Flynn <gaim@robflynn.com>
parents: 813
diff changeset
263 if (!(display_options & OPT_DISP_NO_BUTTONS)) {
870
9b8b83592bb6 [gaim-migrate @ 880]
Rob Flynn <gaim@robflynn.com>
parents: 865
diff changeset
264 adjust_pic(chatbutton, _("Chat"), (gchar **)join_xpm);
820
fe2e1ad4495b [gaim-migrate @ 830]
Rob Flynn <gaim@robflynn.com>
parents: 813
diff changeset
265 adjust_pic(imbutton, _("IM"), (gchar **)tmp_send_xpm);
fe2e1ad4495b [gaim-migrate @ 830]
Rob Flynn <gaim@robflynn.com>
parents: 813
diff changeset
266 adjust_pic(infobutton, _("Info"), (gchar **)tb_search_xpm);
fe2e1ad4495b [gaim-migrate @ 830]
Rob Flynn <gaim@robflynn.com>
parents: 813
diff changeset
267 }
544
53a85529d670 [gaim-migrate @ 554]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 535
diff changeset
268 gtk_widget_hide(addbutton->parent);
53a85529d670 [gaim-migrate @ 554]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 535
diff changeset
269 gtk_widget_show(addbutton->parent);
696
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
270 if (!(display_options & OPT_DISP_NO_BUTTONS)) {
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
271 gtk_widget_hide(chatbutton->parent);
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
272 gtk_widget_show(chatbutton->parent);
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
273 }
820
fe2e1ad4495b [gaim-migrate @ 830]
Rob Flynn <gaim@robflynn.com>
parents: 813
diff changeset
274 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
275
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
276
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
277
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
278 #ifdef USE_APPLET
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
279 gint applet_destroy_buddy( GtkWidget *widget, GdkEvent *event,gpointer *data ) {
746
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 733
diff changeset
280 applet_buddy_show = FALSE;
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 733
diff changeset
281 gtk_widget_hide(blist);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
282 return (TRUE);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
283 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
284
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
285 #endif
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
286
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
287
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
288 void signoff()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
289 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
290 GList *mem;
94
9f6ce50ffb78 [gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 90
diff changeset
291
780
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 774
diff changeset
292 plugin_event(event_signoff, 0, 0, 0);
94
9f6ce50ffb78 [gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 90
diff changeset
293
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
294 while(groups) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
295 mem = ((struct group *)groups->data)->members;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
296 while(mem) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
297 g_free(mem->data);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
298 mem = g_list_remove(mem, mem->data);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
299 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
300 g_free(groups->data);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
301 groups = g_list_remove(groups, groups->data);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
302 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
303
813
d06bed40a86b [gaim-migrate @ 823]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 804
diff changeset
304 sprintf(debug_buff, "date: %s\n", full_date());
d06bed40a86b [gaim-migrate @ 823]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 804
diff changeset
305 debug_print(debug_buff);
891
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 885
diff changeset
306 update_keepalive(FALSE);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
307 serv_close();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
308 destroy_all_dialogs();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
309 destroy_buddy();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
310 hide_login_progress("");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
311 #ifdef USE_APPLET
746
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 733
diff changeset
312 set_user_state(offline);
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 733
diff changeset
313 applet_buddy_show = FALSE;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
314 applet_widget_unregister_callback(APPLET_WIDGET(applet),"signoff");
18
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 10
diff changeset
315 remove_applet_away();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
316 applet_widget_register_callback(APPLET_WIDGET(applet),
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
317 "signon",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
318 _("Signon"),
342
f4fba304b236 [gaim-migrate @ 352]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 341
diff changeset
319 applet_do_signon,
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
320 NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
321 #else
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
322 show_login();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
323 #endif /* USE_APPLET */
436
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 432
diff changeset
324 if ( ticker_prefs & OPT_DISP_SHOW_BUDDYTICKER )
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 432
diff changeset
325 BuddyTickerSignoff();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
326 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
327
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
328 void handle_click_group(GtkWidget *widget, GdkEventButton *event, gpointer func_data)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
329 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
330 if (event->type == GDK_2BUTTON_PRESS) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
331 if (GTK_TREE_ITEM(widget)->expanded)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
332 gtk_tree_item_collapse(GTK_TREE_ITEM(widget));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
333 else
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
334 gtk_tree_item_expand(GTK_TREE_ITEM(widget));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
335 } else {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
336 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
337 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
338
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
339 void pressed_im(GtkWidget *widget, struct buddy *b)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
340 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
341 struct conversation *c;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
342
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
343 c = find_conversation(b->name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
344
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
345 if (c != NULL) {
87
8923e3bd6c5a [gaim-migrate @ 97]
Syd Logan <slogan>
parents: 84
diff changeset
346 gdk_window_show(c->window->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
347 } else {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
348 c = new_conversation(b->name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
349 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
350 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
351
438
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
352 void pressed_ticker(char *buddy)
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
353 {
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
354 struct conversation *c;
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
355
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
356 c = find_conversation(buddy);
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
357
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
358 if (c != NULL) {
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
359 gdk_window_show(c->window->window);
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
360 } else {
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
361 c = new_conversation(buddy);
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
362 }
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
363 }
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
364
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
365 void pressed_info(GtkWidget *widget, struct buddy *b)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
366 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
367 serv_get_info(b->name);
710
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 703
diff changeset
368 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
369
710
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 703
diff changeset
370 void pressed_alias(GtkWidget *widget, struct buddy *b)
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 703
diff changeset
371 {
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 703
diff changeset
372 alias_dialog(b);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
373 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
374
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
375 void pressed_dir_info(GtkWidget *widget, struct buddy *b)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
376 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
377 serv_get_dir(b->name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
378
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
379 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
380
249
810c595258c8 [gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 228
diff changeset
381 void pressed_away_msg(GtkWidget *widget, struct buddy *b)
810c595258c8 [gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 228
diff changeset
382 {
810c595258c8 [gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 228
diff changeset
383 serv_get_away_msg(b->name);
810c595258c8 [gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 228
diff changeset
384
810c595258c8 [gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 228
diff changeset
385 }
810c595258c8 [gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 228
diff changeset
386
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
387 void handle_click_buddy(GtkWidget *widget, GdkEventButton *event, struct buddy *b)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
388 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
389 if (event->type == GDK_2BUTTON_PRESS && event->button == 1) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
390 struct conversation *c;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
391
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
392 c = find_conversation(b->name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
393
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
394 if (c != NULL) {
87
8923e3bd6c5a [gaim-migrate @ 97]
Syd Logan <slogan>
parents: 84
diff changeset
395 gdk_window_show(c->window->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
396 } else {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
397 c = new_conversation(b->name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
398 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
399 } else if (event->type == GDK_BUTTON_PRESS && event->button == 3) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
400 GtkWidget *menu, *button;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
401 /* We're gonna make us a menu right here */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
402
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
403 menu = gtk_menu_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
404
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
405 button = gtk_menu_item_new_with_label(_("IM"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
406 gtk_signal_connect(GTK_OBJECT(button), "activate",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
407 GTK_SIGNAL_FUNC(pressed_im), b);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
408 gtk_menu_append(GTK_MENU(menu), button);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
409 gtk_widget_show(button);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
410
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
411 button = gtk_menu_item_new_with_label(_("Info"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
412 gtk_signal_connect(GTK_OBJECT(button), "activate",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
413 GTK_SIGNAL_FUNC(pressed_info), b);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
414 gtk_menu_append(GTK_MENU(menu), button);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
415 gtk_widget_show(button);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
416
710
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 703
diff changeset
417 button = gtk_menu_item_new_with_label(_("Alias"));
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 703
diff changeset
418 gtk_signal_connect(GTK_OBJECT(button), "activate",
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 703
diff changeset
419 GTK_SIGNAL_FUNC(pressed_alias), b);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 703
diff changeset
420 gtk_menu_append(GTK_MENU(menu), button);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 703
diff changeset
421 gtk_widget_show(button);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 703
diff changeset
422
760
d2eef8a40a77 [gaim-migrate @ 770]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
423 if (!USE_OSCAR) {
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
424 button = gtk_menu_item_new_with_label(_("Dir Info"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
425 gtk_signal_connect(GTK_OBJECT(button), "activate",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
426 GTK_SIGNAL_FUNC(pressed_dir_info), b);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
427 gtk_menu_append(GTK_MENU(menu), button);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
428 gtk_widget_show(button);
760
d2eef8a40a77 [gaim-migrate @ 770]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
429 } else {
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
430
515
b33ed0a7f49b [gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 514
diff changeset
431 button = gtk_menu_item_new_with_label(_("Direct IM"));
b33ed0a7f49b [gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 514
diff changeset
432 gtk_signal_connect(GTK_OBJECT(button), "activate",
b33ed0a7f49b [gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 514
diff changeset
433 GTK_SIGNAL_FUNC(serv_do_imimage), b->name);
b33ed0a7f49b [gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 514
diff changeset
434 gtk_menu_append(GTK_MENU(menu), button);
b33ed0a7f49b [gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 514
diff changeset
435 gtk_widget_show(button);
b33ed0a7f49b [gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 514
diff changeset
436
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
437 button = gtk_menu_item_new_with_label(_("Away Msg"));
249
810c595258c8 [gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 228
diff changeset
438 gtk_signal_connect(GTK_OBJECT(button), "activate",
810c595258c8 [gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 228
diff changeset
439 GTK_SIGNAL_FUNC(pressed_away_msg), b);
810c595258c8 [gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 228
diff changeset
440 gtk_menu_append(GTK_MENU(menu), button);
810c595258c8 [gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 228
diff changeset
441 gtk_widget_show(button);
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 403
diff changeset
442 }
249
810c595258c8 [gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 228
diff changeset
443
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
444 button = gtk_menu_item_new_with_label(_("Toggle Logging"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
445 gtk_signal_connect(GTK_OBJECT(button), "activate",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
446 GTK_SIGNAL_FUNC(log_callback), b->name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
447 gtk_menu_append(GTK_MENU(menu), button);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
448 gtk_widget_show(button);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
449
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
450 button = gtk_menu_item_new_with_label(_("Add Buddy Pounce"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
451 gtk_signal_connect(GTK_OBJECT(button), "activate",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
452 GTK_SIGNAL_FUNC(new_bp_callback), b->name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
453 gtk_menu_append(GTK_MENU(menu), button);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
454 gtk_widget_show(button);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
455
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
456
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
457
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
458 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
459 event->button, event->time);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
460
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
461 } else if (event->type == GDK_3BUTTON_PRESS && event->button == 2) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
462 if (!strcasecmp("zilding", normalize(b->name)))
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
463 show_ee_dialog(0);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
464 else if (!strcasecmp("robflynn", normalize(b->name)))
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
465 show_ee_dialog(1);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
466 else if (!strcasecmp("flynorange", normalize(b->name)))
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
467 show_ee_dialog(2);
338
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 318
diff changeset
468 else if (!strcasecmp("ewarmenhoven", normalize(b->name)))
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 318
diff changeset
469 show_ee_dialog(3);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
470
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
471 } else {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
472
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
473 /* Anything for other buttons? :) */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
474 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
475 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
476
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
477
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
478
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
479 void remove_buddy(struct group *rem_g, struct buddy *rem_b)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
480 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
481 GList *grp;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
482 GList *mem;
912
5a517b4f0be4 [gaim-migrate @ 922]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
483 struct buddy *b;
5a517b4f0be4 [gaim-migrate @ 922]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
484 int count = 0;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
485
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
486 struct group *delg;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
487 struct buddy *delb;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
488
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
489 grp = g_list_find(groups, rem_g);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
490 delg = (struct group *)grp->data;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
491 mem = delg->members;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
492
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
493 mem = g_list_find(mem, rem_b);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
494 delb = (struct buddy *)mem->data;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
495
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
496 gtk_tree_remove_items(GTK_TREE(delg->tree), g_list_append(NULL, delb->item));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
497 delg->members = g_list_remove(delg->members, delb);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
498 serv_remove_buddy(delb->name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
499 g_free(delb);
912
5a517b4f0be4 [gaim-migrate @ 922]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
500 mem = delg->members;
5a517b4f0be4 [gaim-migrate @ 922]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
501 while (mem && !count) {
5a517b4f0be4 [gaim-migrate @ 922]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
502 b = (struct buddy *)mem->data;
5a517b4f0be4 [gaim-migrate @ 922]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
503 if (b->present) count++;
5a517b4f0be4 [gaim-migrate @ 922]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
504 mem = mem->next;
5a517b4f0be4 [gaim-migrate @ 922]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
505 }
913
8de59874f5ce [gaim-migrate @ 923]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 912
diff changeset
506 if (!count && (display_options & OPT_DISP_NO_MT_GRP))
8de59874f5ce [gaim-migrate @ 923]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 912
diff changeset
507 gtk_widget_hide(delg->item);
912
5a517b4f0be4 [gaim-migrate @ 922]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
508
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
509
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
510 serv_save_config();
228
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 225
diff changeset
511
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 225
diff changeset
512 // flush buddy list to cache
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 225
diff changeset
513
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 225
diff changeset
514 do_export( (GtkWidget *) NULL, 0 );
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
515
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
516 update_num_groups();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
517
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
518
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
519 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
520
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
521 void remove_group(struct group *rem_g)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
522 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
523 GList *grp;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
524 GList *mem;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
525
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
526 struct group *delg;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
527 struct buddy *delb;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
528
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
529 grp = g_list_find(groups, rem_g);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
530 delg = (struct group *)grp->data;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
531 mem = delg->members;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
532
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
533 while(delg->members) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
534 delb = (struct buddy *)delg->members->data;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
535 gtk_tree_remove_items(GTK_TREE(delg->tree), g_list_append(NULL, delb->item));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
536 delg->members = g_list_remove(delg->members, delb);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
537 serv_remove_buddy(delb->name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
538 g_free(delb);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
539 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
540
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
541
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
542 gtk_tree_remove_items(GTK_TREE(buddies), g_list_append(NULL, delg->item));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
543 groups = g_list_remove(groups, delg);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
544 g_free(delg);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
545
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
546 serv_save_config();
228
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 225
diff changeset
547
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 225
diff changeset
548 // flush buddy list to cache
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 225
diff changeset
549
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 225
diff changeset
550 do_export( (GtkWidget *) NULL, 0 );
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
551 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
552
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
553
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
554
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
555
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
556
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
557 gboolean edit_drag_compare_func (GtkCTree *ctree, GtkCTreeNode *source_node,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
558 GtkCTreeNode *new_parent, GtkCTreeNode *new_sibling)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
559 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
560 gboolean leaf;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
561
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
562 gtk_ctree_get_node_info (ctree, source_node, NULL,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
563 NULL, NULL, NULL, NULL, NULL, &leaf, NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
564
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
565
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
566 if (leaf) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
567 if (!new_parent)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
568 return FALSE;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
569 } else {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
570
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
571 if (new_parent)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
572 return FALSE;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
573
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
574 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
575
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
576 return TRUE;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
577 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
578
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
579
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
580
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
581 static void edit_tree_move (GtkCTree *ctree, GtkCTreeNode *child, GtkCTreeNode *parent,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
582 GtkCTreeNode *sibling, gpointer data)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
583 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
584 char *source;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
585 char *target1;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
586 char *target2;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
587
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
588 gtk_ctree_get_node_info (ctree, child, &source,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
589 NULL, NULL, NULL, NULL, NULL, NULL, NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
590 if (parent)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
591 gtk_ctree_get_node_info (ctree, parent, &target1,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
592 NULL, NULL, NULL, NULL, NULL, NULL, NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
593 if (sibling)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
594 gtk_ctree_get_node_info (ctree, sibling, &target2,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
595 NULL, NULL, NULL, NULL, NULL, NULL, NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
596
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
597
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
598 if (!parent) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
599 GList *grps, *buds;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
600 struct group *g, *g2;
912
5a517b4f0be4 [gaim-migrate @ 922]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
601 GList *tmp, *mem;
5a517b4f0be4 [gaim-migrate @ 922]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
602 int pos, count;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
603 struct buddy *b;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
604 /* Okay we've moved group order... */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
605
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
606 g = find_group(source);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
607
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
608 gtk_widget_ref(g->tree);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
609
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
610 buds = g->members;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
611 while(buds) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
612 b = (struct buddy *)buds->data;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
613 gtk_widget_ref(b->item);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
614 gtk_widget_ref(b->label);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
615 gtk_widget_ref(b->idletime);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
616 gtk_widget_ref(b->pix);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
617 buds = buds->next;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
618 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
619
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
620
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
621
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
622
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
623 pos = g_list_index(GTK_TREE(buddies)->children, g->item);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
624
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
625 tmp = g_list_append(NULL, g->item);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
626 gtk_tree_remove_items(GTK_TREE(buddies), tmp);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
627 g_list_free(tmp);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
628
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
629 groups = g_list_remove(groups, g);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
630
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
631 g->item = gtk_tree_item_new_with_label(g->name);
912
5a517b4f0be4 [gaim-migrate @ 922]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
632 mem = g->members; count = 0;
5a517b4f0be4 [gaim-migrate @ 922]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
633 while (mem && !count) {
5a517b4f0be4 [gaim-migrate @ 922]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
634 b = (struct buddy *)mem->data;
5a517b4f0be4 [gaim-migrate @ 922]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
635 if (b->present) count++;
5a517b4f0be4 [gaim-migrate @ 922]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
636 mem = mem->next;
5a517b4f0be4 [gaim-migrate @ 922]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
637 }
5a517b4f0be4 [gaim-migrate @ 922]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
638 if (!count) gtk_widget_show(g->item);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
639
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
640 if (sibling) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
641 g2 = find_group(target2);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
642 pos = g_list_index(groups, g2);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
643 if (pos == 0) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
644 groups = g_list_prepend(groups, g);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
645 gtk_tree_prepend(GTK_TREE(buddies), g->item);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
646 } else {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
647 groups = g_list_insert(groups, g, pos);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
648 gtk_tree_insert(GTK_TREE(buddies), g->item, pos);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
649 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
650
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
651 } else {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
652 groups = g_list_append(groups, g);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
653 gtk_tree_append(GTK_TREE(buddies), g->item);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
654
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
655 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
656
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
657 gtk_tree_item_set_subtree (GTK_TREE_ITEM(g->item), g->tree);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
658 gtk_tree_item_expand (GTK_TREE_ITEM(g->item));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
659 gtk_signal_connect(GTK_OBJECT(g->item), "button_press_event",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
660 GTK_SIGNAL_FUNC(handle_click_group),
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
661 NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
662 gtk_object_set_user_data(GTK_OBJECT(g->item), NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
663
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
664 gtk_widget_unref(g->tree);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
665
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
666 update_num_groups();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
667
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
668
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
669 buds = g->members;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
670
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
671 while(buds) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
672 b = (struct buddy *)buds->data;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
673 set_buddy(b);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
674 buds = buds->next;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
675 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
676
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
677 grps = groups;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
678 while(grps) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
679 g = (struct group *)grps->data;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
680 grps = grps->next;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
681 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
682
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
683 } else {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
684 struct group *new_g, *old_g;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
685 struct buddy *b, *s;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
686 GtkWidget *gtree;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
687 GtkWidget *owner;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
688 GList *temp;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
689 int pos;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
690
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
691 b = find_buddy(source);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
692 new_g = find_group(target1);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
693 old_g = find_group_by_buddy(source);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
694 gtree = old_g->tree;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
695 if (sibling)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
696 s = find_buddy(target2);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
697 else
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
698 s = NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
699
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
700 old_g->members = g_list_remove(old_g->members, b);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
701
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
702 gtk_widget_ref(b->item);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
703 gtk_widget_ref(b->label);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
704 gtk_widget_ref(b->pix);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
705 gtk_widget_ref(b->idletime);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
706 gtk_widget_ref(gtree);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
707
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
708 owner = GTK_TREE(gtree)->tree_owner;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
709
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
710 temp = g_list_append(NULL, b->item);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
711 gtk_tree_remove_items(GTK_TREE(old_g->tree), temp);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
712 g_list_free(temp);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
713
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
714 if (gtree->parent == NULL){
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
715 gtk_tree_item_set_subtree (GTK_TREE_ITEM(owner), gtree);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
716 gtk_tree_item_expand (GTK_TREE_ITEM(owner));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
717 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
718
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
719 if (!sibling) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
720 gtk_tree_append(GTK_TREE(new_g->tree), b->item);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
721 new_g->members = g_list_append(new_g->members, b);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
722 } else {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
723 pos = g_list_index(new_g->members, s);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
724 if (pos != 0) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
725 new_g->members = g_list_insert(new_g->members, b, pos);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
726 gtk_tree_insert(GTK_TREE(new_g->tree), b->item, pos);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
727 } else {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
728 new_g->members = g_list_prepend(new_g->members, b);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
729 gtk_tree_prepend(GTK_TREE(new_g->tree), b->item);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
730
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
731 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
732 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
733
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
734 gtk_widget_unref(b->item);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
735 gtk_widget_unref(b->label);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
736 gtk_widget_unref(b->pix);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
737 gtk_widget_unref(b->idletime);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
738 gtk_widget_unref(gtree);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
739
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
740 gtk_ctree_expand(ctree, parent);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
741
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
742 update_num_groups();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
743 update_show_idlepix();
912
5a517b4f0be4 [gaim-migrate @ 922]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
744 if (b->present) {
5a517b4f0be4 [gaim-migrate @ 922]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
745 GList *mem = old_g->members;
5a517b4f0be4 [gaim-migrate @ 922]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
746 struct buddy *bt;
5a517b4f0be4 [gaim-migrate @ 922]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
747 int count = 0;
5a517b4f0be4 [gaim-migrate @ 922]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
748 while (mem && !count) {
5a517b4f0be4 [gaim-migrate @ 922]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
749 bt = (struct buddy *)mem->data;
5a517b4f0be4 [gaim-migrate @ 922]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
750 if (bt->present) count++;
5a517b4f0be4 [gaim-migrate @ 922]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
751 mem = mem->next;
5a517b4f0be4 [gaim-migrate @ 922]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
752 }
913
8de59874f5ce [gaim-migrate @ 923]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 912
diff changeset
753 if (!count && (display_options & OPT_DISP_NO_MT_GRP))
8de59874f5ce [gaim-migrate @ 923]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 912
diff changeset
754 gtk_widget_hide(old_g->item);
903
16492f41410d [gaim-migrate @ 913]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 902
diff changeset
755 gtk_widget_show(new_g->item);
912
5a517b4f0be4 [gaim-migrate @ 922]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
756 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
757 set_buddy(b);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
758
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
759
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
760
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
761
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
762
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
763 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
764
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
765 serv_save_config();
228
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 225
diff changeset
766
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 225
diff changeset
767 // flush buddy list to cache
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 225
diff changeset
768
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 225
diff changeset
769 do_export( (GtkWidget *) NULL, 0 );
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
770 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
771
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
772
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
773
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
774 void build_edit_tree()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
775 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
776 GtkCTreeNode *p = NULL, *n;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
777 GList *grp = groups;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
778 GList *mem;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
779 struct group *g;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
780 struct buddy *b;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
781 char *text[1];
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
782
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
783 gtk_clist_freeze(GTK_CLIST(edittree));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
784 gtk_clist_clear(GTK_CLIST(edittree));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
785
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
786
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
787 while(grp) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
788 g = (struct group *)grp->data;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
789
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
790 text[0] = g->name;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
791
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
792 p = gtk_ctree_insert_node(GTK_CTREE(edittree), NULL,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
793 NULL, text, 5, NULL, NULL,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
794 NULL, NULL, 0, 1);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
795
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
796 n = NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
797
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
798 mem = g->members;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
799
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
800 while(mem) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
801 b = (struct buddy *)mem->data;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
802
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
803 text[0] = b->name;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
804
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
805 n = gtk_ctree_insert_node(GTK_CTREE(edittree),
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
806 p, NULL, text, 5,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
807 NULL, NULL,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
808 NULL, NULL, 1, 1);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
809
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
810 mem = mem->next;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
811
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
812 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
813 grp = grp->next;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
814 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
815
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
816 gtk_clist_thaw(GTK_CLIST(edittree));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
817
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
818 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
819
710
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 703
diff changeset
820 struct buddy *add_buddy(char *group, char *buddy, char *show)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
821 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
822 struct buddy *b;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
823 struct group *g;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
824 GdkPixmap *pm;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
825 GdkBitmap *bm;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
826 GtkWidget *box;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
827
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
828
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
829 if ((b = find_buddy(buddy)) != NULL)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
830 return b;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
831
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
832 g = find_group(group);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
833
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
834 if (g == NULL)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
835 g = add_group(group);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
836
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
837 b = (struct buddy *)g_new0(struct buddy, 1);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
838
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
839 if (!b)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
840 return NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
841
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
842 b->present = 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
843 b->item = gtk_tree_item_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
844
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
845 g_snprintf(b->name, sizeof(b->name), "%s", buddy);
710
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 703
diff changeset
846 g_snprintf(b->show, sizeof(b->show), "%s", show ? (show[0] ? show : buddy) : buddy);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 703
diff changeset
847
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
848 g->members = g_list_append(g->members, b);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
849
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
850
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
851 if (blist == NULL)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
852 return b;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
853
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
854 box = gtk_hbox_new(FALSE, 1);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
855 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
856 NULL, (gchar **)login_icon_xpm);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
857 b->pix = gtk_pixmap_new(pm, bm);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
858
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
859 b->idle = 0;
515
b33ed0a7f49b [gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 514
diff changeset
860 b->caps = 0;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
861
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
862 gtk_widget_show(b->pix);
644
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 608
diff changeset
863 gdk_pixmap_unref(pm);
804
17def2bb9720 [gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 803
diff changeset
864 gdk_bitmap_unref(bm);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
865
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
866 b->label = gtk_label_new(buddy);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
867 gtk_misc_set_alignment(GTK_MISC(b->label), 0.0, 0.5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
868
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
869 b->idletime = gtk_label_new("");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
870
921
d2e865d64dd8 [gaim-migrate @ 931]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 920
diff changeset
871 gtk_tree_append(GTK_TREE(g->tree),b->item);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
872 gtk_container_add(GTK_CONTAINER(b->item), box);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
873
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
874 gtk_box_pack_start(GTK_BOX(box), b->pix, FALSE, FALSE, 1);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
875 gtk_box_pack_start(GTK_BOX(box), b->label, TRUE, TRUE, 1);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
876 gtk_box_pack_start(GTK_BOX(box), b->idletime, FALSE, FALSE, 1);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
877
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
878 gtk_widget_show(b->label);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
879 gtk_widget_show(box);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
880
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
881 gtk_object_set_user_data(GTK_OBJECT(b->item), b);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
882
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
883 gtk_signal_connect(GTK_OBJECT(b->item), "button_press_event",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
884 GTK_SIGNAL_FUNC(handle_click_buddy), b);
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents: 423
diff changeset
885
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
886 return b;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
887 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
888
921
d2e865d64dd8 [gaim-migrate @ 931]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 920
diff changeset
889
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
890 struct group *add_group(char *group)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
891 {
318
35796808896a [gaim-migrate @ 328]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 281
diff changeset
892 struct group *g = find_group(group);
35796808896a [gaim-migrate @ 328]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 281
diff changeset
893 if (g)
35796808896a [gaim-migrate @ 328]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 281
diff changeset
894 return g;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
895 g = (struct group *)g_new0(struct group, 1);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
896 if (!g)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
897 return NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
898
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
899 strncpy(g->name, group, sizeof(g->name));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
900 groups = g_list_append(groups, g);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
901
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
902 if (blist == NULL)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
903 return g;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
904
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
905 g->item = gtk_tree_item_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
906 g->label = gtk_label_new(g->name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
907 gtk_misc_set_alignment(GTK_MISC(g->label), 0.0, 0.5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
908 gtk_widget_show(g->label);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
909 gtk_container_add(GTK_CONTAINER(g->item), g->label);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
910 g->tree = gtk_tree_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
911 gtk_widget_show(g->item);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
912 gtk_widget_show(g->tree);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
913 gtk_tree_append(GTK_TREE(buddies), g->item);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
914 gtk_tree_item_set_subtree(GTK_TREE_ITEM(g->item), g->tree);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
915 gtk_tree_item_expand(GTK_TREE_ITEM(g->item));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
916 gtk_signal_connect(GTK_OBJECT(g->item), "button_press_event",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
917 GTK_SIGNAL_FUNC(handle_click_group),
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
918 NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
919 gtk_object_set_user_data(GTK_OBJECT(g->item), NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
920 g->members = NULL;
903
16492f41410d [gaim-migrate @ 913]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 902
diff changeset
921 if (display_options & OPT_DISP_NO_MT_GRP)
16492f41410d [gaim-migrate @ 913]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 902
diff changeset
922 gtk_widget_hide(g->item);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
923
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
924
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
925 build_edit_tree();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
926
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
927 return g;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
928
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
929 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
930
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
931
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
932 static void do_del_buddy(GtkWidget *w, GtkCTree *ctree)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
933 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
934 GtkCTreeNode *node;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
935 char *bud, *grp;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
936 struct buddy *b;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
937 struct group *g;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
938 GList *i;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
939
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
940 i = GTK_CLIST(edittree)->selection;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
941 if (i) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
942 node = i->data;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
943
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
944 if (GTK_CTREE_ROW(node)->is_leaf) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
945 gtk_ctree_get_node_info (GTK_CTREE(edittree), node, &bud,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
946 NULL, NULL, NULL, NULL, NULL, NULL, NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
947
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
948 b = find_buddy(bud);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
949 g = find_group_by_buddy(bud);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
950 remove_buddy(g, b);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
951 } else {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
952 gtk_ctree_get_node_info (ctree, node, &grp,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
953 NULL, NULL, NULL, NULL, NULL, NULL, NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
954 g = find_group(grp);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
955 remove_group(g);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
956 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
957
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
958 build_edit_tree();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
959 serv_save_config();
228
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 225
diff changeset
960
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 225
diff changeset
961 // flush buddy list to cache
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 225
diff changeset
962
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 225
diff changeset
963 do_export( (GtkWidget *) NULL, 0 );
f3b61c04f44e [gaim-migrate @ 238]
Syd Logan <slogan>
parents: 225
diff changeset
964
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
965 } else {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
966 /* Nothing selected. */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
967 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
968 update_num_groups();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
969 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
970
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
971
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
972 void gaimreg_callback(GtkWidget *widget)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
973 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
974 show_register_dialog();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
975 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
976
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
977 void import_callback(GtkWidget *widget, void *null)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
978 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
979 show_import_dialog();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
980 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
981
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
982 void export_callback(GtkWidget *widget, void *null)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
983 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
984 show_export_dialog();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
985 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
986
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
987
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
988
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
989 void do_quit()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
990 {
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
991 #ifdef GAIM_PLUGINS
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
992 GList *c;
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
993 struct gaim_plugin *p;
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
994 void (*gaim_plugin_remove)();
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
995 char *error;
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
996
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
997 /* first we tell those who have requested it we're quitting */
780
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 774
diff changeset
998 plugin_event(event_quit, 0, 0, 0);
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
999
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
1000 /* then we remove everyone in a mass suicide */
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
1001 c = plugins;
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
1002 while (c) {
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
1003 p = (struct gaim_plugin *)c->data;
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
1004 gaim_plugin_remove = dlsym(p->handle, "gaim_plugin_remove");
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
1005 if ((error = (char *)dlerror()) == NULL)
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
1006 (*gaim_plugin_remove)();
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
1007 /* we don't need to worry about removing callbacks since
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
1008 * there won't be any more chance to call them back :) */
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
1009 dlclose(p->handle);
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
1010 g_free(p->filename); /* why do i bother? */
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
1011 g_free(p);
403
d6f02d7f78d8 [gaim-migrate @ 413]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 391
diff changeset
1012 c = c->next;
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
1013 }
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
1014 #endif
784
4c292b3f74ea [gaim-migrate @ 794]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 780
diff changeset
1015 #ifdef USE_PERL
4c292b3f74ea [gaim-migrate @ 794]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 780
diff changeset
1016 perl_end();
4c292b3f74ea [gaim-migrate @ 794]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 780
diff changeset
1017 #endif
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
1018
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1019 exit(0);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1020 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1021
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1022 void add_buddy_callback(GtkWidget *widget, void *dummy)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1023 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1024 char *grp = NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1025 GtkCTreeNode *node;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1026 GList *i;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1027
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1028 i = GTK_CLIST(edittree)->selection;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1029 if (i) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1030 node = i->data;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1031
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1032 if (GTK_CTREE_ROW(node)->is_leaf) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1033 node = GTK_CTREE_ROW(node)->parent;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1034 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1035
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1036 gtk_ctree_get_node_info (GTK_CTREE(edittree), node, &grp,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1037 NULL, NULL, NULL, NULL, NULL, NULL, NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1038 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1039 show_add_buddy(NULL, grp);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1040
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1041 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1042
577
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 544
diff changeset
1043 void add_group_callback(GtkWidget *widget, void *dummy)
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 544
diff changeset
1044 {
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 544
diff changeset
1045 show_add_group();
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 544
diff changeset
1046 }
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 544
diff changeset
1047
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1048 static void info_callback(GtkWidget *widget, GtkTree *tree)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1049 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1050 GList *i;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1051 struct buddy *b = NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1052 i = GTK_TREE_SELECTION(tree);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1053 if (i) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1054 b = gtk_object_get_user_data(GTK_OBJECT(i->data));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1055 } else {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1056 return;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1057 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1058 if (!b->name)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1059 return;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1060 serv_get_info(b->name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1061 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1062
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1063
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1064 void chat_callback(GtkWidget *widget, GtkTree *tree)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1065 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1066 join_chat();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1067 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1068
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1069 struct group *find_group(char *group)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1070 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1071 struct group *g;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1072 GList *grp = groups;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1073 char *grpname = g_malloc(strlen(group) + 1);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1074
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1075 strcpy(grpname, normalize(group));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1076 while (grp) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1077 g = (struct group *)grp->data;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1078 if (!strcasecmp(normalize(g->name), grpname)) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1079 g_free(grpname);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1080 return g;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1081 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1082 grp = grp->next;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1083 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1084
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1085 g_free(grpname);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1086 return NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1087
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1088 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1089
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1090
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1091 struct group *find_group_by_buddy(char *who)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1092 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1093 struct group *g;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1094 struct buddy *b;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1095 GList *grp = groups;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1096 GList *mem;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1097 char *whoname = g_malloc(strlen(who) + 1);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1098
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1099 strcpy(whoname, normalize(who));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1100
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1101 while(grp) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1102 g = (struct group *)grp->data;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1103
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1104 mem = g->members;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1105 while(mem) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1106 b = (struct buddy *)mem->data;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1107 if (!strcasecmp(normalize(b->name), whoname)) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1108 g_free(whoname);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1109 return g;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1110 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1111 mem = mem->next;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1112 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1113 grp = grp->next;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1114 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1115 g_free(whoname);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1116 return NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1117 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1118
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1119
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1120 struct buddy *find_buddy(char *who)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1121 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1122 struct group *g;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1123 struct buddy *b;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1124 GList *grp = groups;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1125 GList *mem;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1126 char *whoname = g_malloc(strlen(who) + 1);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1127
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1128 strcpy(whoname, normalize(who));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1129
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1130 while(grp) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1131 g = (struct group *)grp->data;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1132
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1133 mem = g->members;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1134 while(mem) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1135 b = (struct buddy *)mem->data;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1136 if (!strcasecmp(normalize(b->name), whoname)) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1137 g_free(whoname);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1138 return b;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1139 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1140 mem = mem->next;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1141 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1142 grp = grp->next;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1143 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1144 g_free(whoname);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1145 return NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1146 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1147
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1148
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1149 void rem_bp(GtkWidget *w, struct buddy_pounce *b)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1150 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1151 buddy_pounces = g_list_remove(buddy_pounces, b);
689
4e3f5d9cacd5 [gaim-migrate @ 699]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 678
diff changeset
1152 do_bp_menu();
4e3f5d9cacd5 [gaim-migrate @ 699]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 678
diff changeset
1153 save_prefs();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1154 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1155
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1156 void do_pounce(char *name)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1157 {
26
b9e90a914e20 [gaim-migrate @ 35]
Rob Flynn <gaim@robflynn.com>
parents: 18
diff changeset
1158 char *who;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1159
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1160 struct buddy_pounce *b;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1161 struct conversation *c;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1162
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1163 GList *bp = buddy_pounces;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1164
26
b9e90a914e20 [gaim-migrate @ 35]
Rob Flynn <gaim@robflynn.com>
parents: 18
diff changeset
1165 who = g_strdup(normalize(name));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1166
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1167 while(bp) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1168 b = (struct buddy_pounce *)bp->data;;
26
b9e90a914e20 [gaim-migrate @ 35]
Rob Flynn <gaim@robflynn.com>
parents: 18
diff changeset
1169 bp = bp->next; /* increment the list here because rem_bp can make our handle bad */
b9e90a914e20 [gaim-migrate @ 35]
Rob Flynn <gaim@robflynn.com>
parents: 18
diff changeset
1170
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1171 if (!strcasecmp(who, normalize(b->name))) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1172 if (b->popup == 1)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1173 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1174 c = find_conversation(name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1175 if (c == NULL)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1176 c = new_conversation(name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1177 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1178 if (b->sendim == 1)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1179 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1180 c = find_conversation(name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1181 if (c == NULL)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1182 c = new_conversation(name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1183
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 438
diff changeset
1184 write_to_conv(c, b->message, WFLAG_SEND, NULL);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1185
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1186 escape_text(b->message);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1187
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1188 serv_send_im(name, b->message, 0);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1189 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1190
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1191 rem_bp(NULL, b);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1192
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1193 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1194 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1195 g_free(who);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1196 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1197
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1198 static void new_bp_callback(GtkWidget *w, char *name)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1199 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1200 show_new_bp(name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1201 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1202
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1203 static void log_callback(GtkWidget *w, char *name)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1204 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1205 struct conversation *c = find_conversation(name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1206
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1207 if (find_log_info(name))
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1208 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1209 if (c) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1210 set_state_lock(1);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1211 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(c->log_button), FALSE);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1212 set_state_lock(0);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1213 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1214 rm_log(find_log_info(name));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1215 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1216 else
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1217 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1218 if (c) {
700
d904bf694bd7 [gaim-migrate @ 710]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 696
diff changeset
1219 show_log_dialog(c);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1220 set_state_lock(1);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1221 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(c->log_button), TRUE);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1222 set_state_lock(0);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1223 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1224 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1225 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1226
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1227 void do_bp_menu()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1228 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1229 GtkWidget *menuitem, *mess, *messmenu;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1230 static GtkWidget *remmenu;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1231 GtkWidget *remitem;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1232 GtkWidget *sep;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1233 GList *l;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1234 struct buddy_pounce *b;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1235 GList *bp = buddy_pounces;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1236
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1237 l = gtk_container_children(GTK_CONTAINER(bpmenu));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1238
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1239 while(l) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1240 gtk_widget_destroy(GTK_WIDGET(l->data));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1241 l = l->next;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1242 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1243
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1244 remmenu = gtk_menu_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1245
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1246 menuitem = gtk_menu_item_new_with_label(_("New Buddy Pounce"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1247 gtk_menu_append(GTK_MENU(bpmenu), menuitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1248 gtk_widget_show(menuitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1249 gtk_signal_connect(GTK_OBJECT(menuitem), "activate", GTK_SIGNAL_FUNC(new_bp_callback), NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1250
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1251
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1252 while(bp) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1253
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1254 b = (struct buddy_pounce *)bp->data;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1255 remitem = gtk_menu_item_new_with_label(b->name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1256 gtk_menu_append(GTK_MENU(remmenu), remitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1257 gtk_widget_show(remitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1258 gtk_signal_connect(GTK_OBJECT(remitem), "activate", GTK_SIGNAL_FUNC(rem_bp), b);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1259
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1260 bp = bp->next;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1261
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1262 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1263
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1264 menuitem = gtk_menu_item_new_with_label(_("Remove Buddy Pounce"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1265 gtk_menu_append(GTK_MENU(bpmenu), menuitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1266 gtk_widget_show(menuitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1267 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), remmenu);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1268 gtk_widget_show(remmenu);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1269
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1270
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1271 sep = gtk_hseparator_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1272 menuitem = gtk_menu_item_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1273 gtk_menu_append(GTK_MENU(bpmenu), menuitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1274 gtk_container_add(GTK_CONTAINER(menuitem), sep);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1275 gtk_widget_set_sensitive(menuitem, FALSE);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1276 gtk_widget_show(menuitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1277 gtk_widget_show(sep);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1278
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1279 bp = buddy_pounces;;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1280
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1281 while(bp) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1282
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1283 b = (struct buddy_pounce *)bp->data;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1284
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1285 menuitem = gtk_menu_item_new_with_label(b->name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1286 gtk_menu_append(GTK_MENU(bpmenu), menuitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1287 messmenu = gtk_menu_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1288 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), messmenu);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1289 gtk_widget_show(menuitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1290
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1291
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1292
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1293 mess = gtk_menu_item_new_with_label(b->message);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1294 gtk_menu_append(GTK_MENU(messmenu), mess);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1295 gtk_widget_show(mess);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1296
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1297 bp = bp->next;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1298
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1299 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1300
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1301 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1302
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1303
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1304 gint log_timeout(char *name)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1305 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1306 struct buddy *b;
119
66ec3865bd46 [gaim-migrate @ 129]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 107
diff changeset
1307 struct group *g;
903
16492f41410d [gaim-migrate @ 913]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 902
diff changeset
1308 GList *mem;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1309
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1310 b = find_buddy(name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1311
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1312 if(!b)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1313 return FALSE;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1314
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1315 b->log_timer = 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1316
119
66ec3865bd46 [gaim-migrate @ 129]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 107
diff changeset
1317 if (!b->present) {
903
16492f41410d [gaim-migrate @ 913]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 902
diff changeset
1318 int count = 0;
921
d2e865d64dd8 [gaim-migrate @ 931]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 920
diff changeset
1319 gtk_widget_hide(b->item);
119
66ec3865bd46 [gaim-migrate @ 129]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 107
diff changeset
1320 g = find_group_by_buddy(name);
903
16492f41410d [gaim-migrate @ 913]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 902
diff changeset
1321 mem = g->members;
16492f41410d [gaim-migrate @ 913]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 902
diff changeset
1322 while (mem) {
16492f41410d [gaim-migrate @ 913]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 902
diff changeset
1323 b = (struct buddy *)mem->data;
16492f41410d [gaim-migrate @ 913]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 902
diff changeset
1324 if (b->present) {
16492f41410d [gaim-migrate @ 913]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 902
diff changeset
1325 count++;
16492f41410d [gaim-migrate @ 913]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 902
diff changeset
1326 break;
16492f41410d [gaim-migrate @ 913]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 902
diff changeset
1327 }
16492f41410d [gaim-migrate @ 913]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 902
diff changeset
1328 mem = mem->next;
16492f41410d [gaim-migrate @ 913]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 902
diff changeset
1329 }
16492f41410d [gaim-migrate @ 913]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 902
diff changeset
1330 if (!count && (display_options & OPT_DISP_NO_MT_GRP))
16492f41410d [gaim-migrate @ 913]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 902
diff changeset
1331 gtk_widget_hide(g->item);
120
991d5f0c6c90 [gaim-migrate @ 130]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 119
diff changeset
1332 if (GTK_TREE_ITEM(g->item)->expanded) {
991d5f0c6c90 [gaim-migrate @ 130]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 119
diff changeset
1333 gtk_tree_item_collapse(GTK_TREE_ITEM(g->item));
991d5f0c6c90 [gaim-migrate @ 130]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 119
diff changeset
1334 gtk_tree_item_expand(GTK_TREE_ITEM(g->item));
991d5f0c6c90 [gaim-migrate @ 130]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 119
diff changeset
1335 }
119
66ec3865bd46 [gaim-migrate @ 129]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 107
diff changeset
1336 } else
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1337 set_buddy(b);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1338
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1339 return FALSE;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1340 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1341
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1342
513
eaddaa0dbbcb [gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 511
diff changeset
1343 static char *caps_string(u_short caps)
eaddaa0dbbcb [gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 511
diff changeset
1344 {
eaddaa0dbbcb [gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 511
diff changeset
1345 static char buf[BUF_LEN];
eaddaa0dbbcb [gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 511
diff changeset
1346 int count = 0, i = 0;
eaddaa0dbbcb [gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 511
diff changeset
1347 u_short bit = 1;
eaddaa0dbbcb [gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 511
diff changeset
1348 while (bit <= AIM_CAPS_SENDFILE) {
eaddaa0dbbcb [gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 511
diff changeset
1349 if (bit & caps) {
eaddaa0dbbcb [gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 511
diff changeset
1350 switch (bit) {
eaddaa0dbbcb [gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 511
diff changeset
1351 case AIM_CAPS_BUDDYICON:
514
44123888a941 [gaim-migrate @ 524]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 513
diff changeset
1352 i += g_snprintf(buf + i, sizeof(buf) - i, _("%sBuddy Icon"), count ? ", " : "");
513
eaddaa0dbbcb [gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 511
diff changeset
1353 break;
eaddaa0dbbcb [gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 511
diff changeset
1354 case AIM_CAPS_VOICE:
514
44123888a941 [gaim-migrate @ 524]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 513
diff changeset
1355 i += g_snprintf(buf + i, sizeof(buf) - i, _("%sVoice"), count ? ", " : "");
513
eaddaa0dbbcb [gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 511
diff changeset
1356 break;
eaddaa0dbbcb [gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 511
diff changeset
1357 case AIM_CAPS_IMIMAGE:
514
44123888a941 [gaim-migrate @ 524]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 513
diff changeset
1358 i += g_snprintf(buf + i, sizeof(buf) - i, _("%sIM Image"), count ? ", " : "");
513
eaddaa0dbbcb [gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 511
diff changeset
1359 break;
eaddaa0dbbcb [gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 511
diff changeset
1360 case AIM_CAPS_CHAT:
514
44123888a941 [gaim-migrate @ 524]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 513
diff changeset
1361 i += g_snprintf(buf + i, sizeof(buf) - i, _("%sChat"), count ? ", " : "");
513
eaddaa0dbbcb [gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 511
diff changeset
1362 break;
eaddaa0dbbcb [gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 511
diff changeset
1363 case AIM_CAPS_GETFILE:
514
44123888a941 [gaim-migrate @ 524]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 513
diff changeset
1364 i += g_snprintf(buf + i, sizeof(buf) - i, _("%sGet File"), count ? ", " : "");
513
eaddaa0dbbcb [gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 511
diff changeset
1365 break;
eaddaa0dbbcb [gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 511
diff changeset
1366 case AIM_CAPS_SENDFILE:
514
44123888a941 [gaim-migrate @ 524]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 513
diff changeset
1367 i += g_snprintf(buf + i, sizeof(buf) - i, _("%sSend File"), count ? ", " : "");
513
eaddaa0dbbcb [gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 511
diff changeset
1368 break;
eaddaa0dbbcb [gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 511
diff changeset
1369 }
eaddaa0dbbcb [gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 511
diff changeset
1370 count++;
eaddaa0dbbcb [gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 511
diff changeset
1371 }
eaddaa0dbbcb [gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 511
diff changeset
1372 bit <<= 1;
eaddaa0dbbcb [gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 511
diff changeset
1373 }
eaddaa0dbbcb [gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 511
diff changeset
1374 return buf;
eaddaa0dbbcb [gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 511
diff changeset
1375 }
eaddaa0dbbcb [gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 511
diff changeset
1376
eaddaa0dbbcb [gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 511
diff changeset
1377
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1378 void set_buddy(struct buddy *b)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1379 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1380 char infotip[256];
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1381 char idlet[16];
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1382 char warn[256];
513
eaddaa0dbbcb [gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 511
diff changeset
1383 char caps[256];
70
dead1eb6d654 [gaim-migrate @ 80]
Rob Flynn <gaim@robflynn.com>
parents: 59
diff changeset
1384 char *who;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1385 int i;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1386 int ihrs, imin;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1387 time_t t;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1388 GdkPixmap *pm;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1389 GdkBitmap *bm;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1390 char *itime, *sotime;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1391
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1392 if (b->present) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1393 time(&t);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1394
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1395 ihrs = (t - b->idle) / 3600;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1396 imin = ((t - b->idle) / 60) % 60;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1397
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1398 if (ihrs)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1399 g_snprintf(idlet, sizeof(idlet), "(%d:%02d)", ihrs, imin);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1400 else
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1401 g_snprintf(idlet, sizeof(idlet), "(%02d)", imin);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1402
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1403 gtk_widget_hide(b->idletime);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1404
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1405 if (b->idle)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1406 gtk_label_set(GTK_LABEL(b->idletime), idlet);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1407 else
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1408 gtk_label_set(GTK_LABEL(b->idletime), "");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1409 if (display_options & OPT_DISP_SHOW_IDLETIME)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1410 gtk_widget_show(b->idletime);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1411
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1412
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1413 sotime = sec_to_text(t - b->signon + correction_time);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1414 if (b->idle) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1415 itime = sec_to_text(t - b->idle);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1416 } else {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1417 itime = g_malloc(1);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1418 itime[0] = 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1419 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1420
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1421 if (b->evil) {
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1422 g_snprintf(warn, sizeof(warn), _("Warnings: %d%%\n"), b->evil);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1423
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1424 } else
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1425 warn[0] = '\0';
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1426
513
eaddaa0dbbcb [gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 511
diff changeset
1427 if (b->caps) {
eaddaa0dbbcb [gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 511
diff changeset
1428 g_snprintf(caps, sizeof(caps), _("Capabilities: %s\n"), caps_string(b->caps));
eaddaa0dbbcb [gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 511
diff changeset
1429 } else
eaddaa0dbbcb [gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 511
diff changeset
1430 caps[0] = '\0';
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1431
837
113205ae7e72 [gaim-migrate @ 847]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 824
diff changeset
1432 i = g_snprintf(infotip, sizeof(infotip), _("Alias: %s \nScreen Name: %s\nLogged in: %s\n%s%s%s%s%s"), b->show, b->name, sotime, warn, ((b->idle) ? _("Idle: ") : ""), itime, ((b->idle) ? "\n" : ""), caps);
513
eaddaa0dbbcb [gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 511
diff changeset
1433
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1434 gtk_tooltips_set_tip(tips, GTK_WIDGET(b->item), infotip, "");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1435
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1436 g_free(sotime);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1437 g_free(itime);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1438
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1439
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1440
121
3571b593f423 [gaim-migrate @ 131]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 120
diff changeset
1441 /* this check should also depend on whether they left,
3571b593f423 [gaim-migrate @ 131]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 120
diff changeset
1442 * and signed on again before they got erased */
3571b593f423 [gaim-migrate @ 131]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 120
diff changeset
1443 if (!GTK_WIDGET_VISIBLE(b->item) || b->present == 1) {
780
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 774
diff changeset
1444 plugin_event(event_buddy_signon, b->name, 0, 0);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1445
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1446 play_sound(BUDDY_ARRIVE);
121
3571b593f423 [gaim-migrate @ 131]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 120
diff changeset
1447 b->present = 2;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1448
710
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 703
diff changeset
1449 who = g_malloc(sizeof(b->show) + 10);
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 703
diff changeset
1450 strcpy(who, b->show);
70
dead1eb6d654 [gaim-migrate @ 80]
Rob Flynn <gaim@robflynn.com>
parents: 59
diff changeset
1451 gtk_label_set(GTK_LABEL(b->label), who);
dead1eb6d654 [gaim-migrate @ 80]
Rob Flynn <gaim@robflynn.com>
parents: 59
diff changeset
1452 g_free(who);
dead1eb6d654 [gaim-migrate @ 80]
Rob Flynn <gaim@robflynn.com>
parents: 59
diff changeset
1453
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1454 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1455 NULL, (gchar **)login_icon_xpm);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1456 gtk_widget_hide(b->pix);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1457 gtk_pixmap_set(GTK_PIXMAP(b->pix), pm, bm);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1458 if (display_options & OPT_DISP_SHOW_PIXMAPS)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1459 gtk_widget_show(b->pix);
644
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 608
diff changeset
1460 gdk_pixmap_unref(pm);
804
17def2bb9720 [gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 803
diff changeset
1461 gdk_bitmap_unref(bm);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1462
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents: 423
diff changeset
1463 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm,
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents: 423
diff changeset
1464 NULL, (gchar **)login_icon_xpm);
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents: 423
diff changeset
1465
436
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 432
diff changeset
1466 if ( ticker_prefs & OPT_DISP_SHOW_BUDDYTICKER )
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 432
diff changeset
1467 BuddyTickerAddUser( b->name, pm, bm );
644
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 608
diff changeset
1468 gdk_pixmap_unref(pm);
804
17def2bb9720 [gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 803
diff changeset
1469 gdk_bitmap_unref(bm);
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents: 423
diff changeset
1470
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1471 if (display_options & OPT_DISP_SHOW_LOGON) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1472 struct conversation *c = find_conversation(b->name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1473 if (c) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1474 char tmp[1024];
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1475
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1476
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1477 g_snprintf(tmp, sizeof(tmp), _("<HR><B>%s logged in%s%s.</B><BR><HR>"), b->name,
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1478 ((display_options & OPT_DISP_SHOW_TIME) ? " @ " : ""),
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1479 ((display_options & OPT_DISP_SHOW_TIME) ? date() : ""));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1480
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1481
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 438
diff changeset
1482 write_to_conv(c, tmp, WFLAG_SYSTEM, NULL);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1483
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1484 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1485 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1486
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1487
921
d2e865d64dd8 [gaim-migrate @ 931]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 920
diff changeset
1488 { struct group *g = find_group_by_buddy(b->name);
d2e865d64dd8 [gaim-migrate @ 931]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 920
diff changeset
1489 gtk_widget_show(g->item); }
d2e865d64dd8 [gaim-migrate @ 931]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 920
diff changeset
1490 gtk_widget_show(b->item);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1491 gtk_widget_show(b->label);
58
60fa62507184 [gaim-migrate @ 68]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 50
diff changeset
1492 b->log_timer = gtk_timeout_add(10000, (GtkFunction) log_timeout, b->name);
436
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 432
diff changeset
1493 if ( ticker_prefs & OPT_DISP_SHOW_BUDDYTICKER )
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 432
diff changeset
1494 gtk_timeout_add(10000, (GtkFunction) BuddyTickerLogonTimeout, b->name);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1495 update_num_groups();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1496 update_show_idlepix();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1497 setup_buddy_chats();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1498 return;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1499 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1500
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1501
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1502
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1503 if (!b->log_timer) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1504 gtk_widget_hide(b->pix);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1505 if (b->uc & UC_UNAVAILABLE) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1506 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1507 NULL, (gchar **)away_icon_xpm);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1508 gtk_pixmap_set(GTK_PIXMAP(b->pix), pm, bm);
644
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 608
diff changeset
1509 gdk_pixmap_unref(pm);
804
17def2bb9720 [gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 803
diff changeset
1510 gdk_bitmap_unref(bm);
436
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 432
diff changeset
1511 if ( ticker_prefs & OPT_DISP_SHOW_BUDDYTICKER )
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 432
diff changeset
1512 {
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 432
diff changeset
1513 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm,
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents: 423
diff changeset
1514 NULL, (gchar **)away_icon_xpm);
436
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 432
diff changeset
1515 BuddyTickerSetPixmap(b->name, pm, bm);
644
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 608
diff changeset
1516 gdk_pixmap_unref(pm);
804
17def2bb9720 [gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 803
diff changeset
1517 gdk_bitmap_unref(bm);
436
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 432
diff changeset
1518 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1519 } else if (b->uc & UC_AOL) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1520 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1521 NULL, (gchar **)aol_icon_xpm);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1522 gtk_pixmap_set(GTK_PIXMAP(b->pix), pm, bm);
644
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 608
diff changeset
1523 gdk_pixmap_unref(pm);
804
17def2bb9720 [gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 803
diff changeset
1524 gdk_bitmap_unref(bm);
436
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 432
diff changeset
1525 if ( ticker_prefs & OPT_DISP_SHOW_BUDDYTICKER )
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 432
diff changeset
1526 {
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 432
diff changeset
1527 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm,
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents: 423
diff changeset
1528 NULL, (gchar **)aol_icon_xpm);
436
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 432
diff changeset
1529 BuddyTickerSetPixmap(b->name, pm, bm);
644
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 608
diff changeset
1530 gdk_pixmap_unref(pm);
804
17def2bb9720 [gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 803
diff changeset
1531 gdk_bitmap_unref(bm);
436
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 432
diff changeset
1532 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1533 } else if (b->uc & UC_NORMAL) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1534 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1535 NULL, (gchar **)free_icon_xpm);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1536 gtk_pixmap_set(GTK_PIXMAP(b->pix), pm, bm);
644
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 608
diff changeset
1537 gdk_pixmap_unref(pm);
804
17def2bb9720 [gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 803
diff changeset
1538 gdk_bitmap_unref(bm);
436
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 432
diff changeset
1539 if ( ticker_prefs & OPT_DISP_SHOW_BUDDYTICKER )
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 432
diff changeset
1540 {
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 432
diff changeset
1541 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm,
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents: 423
diff changeset
1542 NULL, (gchar **)free_icon_xpm);
436
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 432
diff changeset
1543 BuddyTickerSetPixmap(b->name, pm, bm);
644
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 608
diff changeset
1544 gdk_pixmap_unref(pm);
804
17def2bb9720 [gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 803
diff changeset
1545 gdk_bitmap_unref(bm);
436
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 432
diff changeset
1546 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1547 } else if (b->uc & UC_ADMIN) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1548 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1549 NULL, (gchar **)admin_icon_xpm);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1550 gtk_pixmap_set(GTK_PIXMAP(b->pix), pm, bm);
644
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 608
diff changeset
1551 gdk_pixmap_unref(pm);
804
17def2bb9720 [gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 803
diff changeset
1552 gdk_bitmap_unref(bm);
436
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 432
diff changeset
1553 if ( ticker_prefs & OPT_DISP_SHOW_BUDDYTICKER )
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 432
diff changeset
1554 {
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 432
diff changeset
1555 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm,
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents: 423
diff changeset
1556 NULL, (gchar **)admin_icon_xpm);
436
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 432
diff changeset
1557 BuddyTickerSetPixmap(b->name, pm, bm);
644
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 608
diff changeset
1558 gdk_pixmap_unref(pm);
804
17def2bb9720 [gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 803
diff changeset
1559 gdk_bitmap_unref(bm);
436
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 432
diff changeset
1560 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1561 } else if (b->uc & UC_UNCONFIRMED) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1562 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1563 NULL, (gchar **)dt_icon_xpm);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1564 gtk_pixmap_set(GTK_PIXMAP(b->pix), pm, bm);
644
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 608
diff changeset
1565 gdk_pixmap_unref(pm);
804
17def2bb9720 [gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 803
diff changeset
1566 gdk_bitmap_unref(bm);
436
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 432
diff changeset
1567 if ( ticker_prefs & OPT_DISP_SHOW_BUDDYTICKER )
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 432
diff changeset
1568 {
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 432
diff changeset
1569 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm,
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents: 423
diff changeset
1570 NULL, (gchar **)dt_icon_xpm);
436
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 432
diff changeset
1571 BuddyTickerSetPixmap(b->name, pm, bm);
644
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 608
diff changeset
1572 gdk_pixmap_unref(pm);
804
17def2bb9720 [gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 803
diff changeset
1573 gdk_bitmap_unref(bm);
436
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 432
diff changeset
1574 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1575 } else {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1576 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1577 NULL, (gchar **)no_icon_xpm);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1578 gtk_pixmap_set(GTK_PIXMAP(b->pix), pm, bm);
644
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 608
diff changeset
1579 gdk_pixmap_unref(pm);
804
17def2bb9720 [gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 803
diff changeset
1580 gdk_bitmap_unref(bm);
436
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 432
diff changeset
1581 if ( ticker_prefs & OPT_DISP_SHOW_BUDDYTICKER )
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 432
diff changeset
1582 {
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 432
diff changeset
1583 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm,
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents: 423
diff changeset
1584 NULL, (gchar **)no_icon_xpm);
436
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 432
diff changeset
1585 BuddyTickerSetPixmap(b->name, pm, bm);
644
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 608
diff changeset
1586 gdk_pixmap_unref(pm);
804
17def2bb9720 [gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 803
diff changeset
1587 gdk_bitmap_unref(bm);
436
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 432
diff changeset
1588 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1589 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1590 if (display_options & OPT_DISP_SHOW_PIXMAPS)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1591 gtk_widget_show(b->pix);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1592 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1593
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1594
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1595
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1596 } else {
59
af088e5b2e30 [gaim-migrate @ 69]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 58
diff changeset
1597 if (GTK_WIDGET_VISIBLE(b->item)) {
780
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 774
diff changeset
1598 plugin_event(event_buddy_signoff, b->name, 0, 0);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1599 play_sound(BUDDY_LEAVE);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1600 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1601 NULL, (gchar **)logout_icon_xpm);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1602 gtk_widget_hide(b->pix);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1603 gtk_pixmap_set(GTK_PIXMAP(b->pix), pm, bm);
644
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 608
diff changeset
1604 if (display_options & OPT_DISP_SHOW_PIXMAPS)
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 608
diff changeset
1605 gtk_widget_show(b->pix);
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 608
diff changeset
1606 gdk_pixmap_unref(pm);
804
17def2bb9720 [gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 803
diff changeset
1607 gdk_bitmap_unref(bm);
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents: 423
diff changeset
1608 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm,
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents: 423
diff changeset
1609 NULL, (gchar **)logout_icon_xpm);
436
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 432
diff changeset
1610 if ( ticker_prefs & OPT_DISP_SHOW_BUDDYTICKER )
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 432
diff changeset
1611 BuddyTickerSetPixmap( b->name, pm, bm );
644
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 608
diff changeset
1612 gdk_pixmap_unref(pm);
804
17def2bb9720 [gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 803
diff changeset
1613 gdk_bitmap_unref(bm);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1614 if (display_options & OPT_DISP_SHOW_LOGON) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1615 struct conversation *c = find_conversation(b->name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1616 if (c) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1617 char tmp[1024];
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1618
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1619
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1620 g_snprintf(tmp, sizeof(tmp), _("<HR><B>%s logged out%s%s.</B><BR><HR>"), b->name,
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1621 ((display_options & OPT_DISP_SHOW_TIME) ? " @ " : ""),
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1622 ((display_options & OPT_DISP_SHOW_TIME) ? date() : ""));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1623
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1624
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 438
diff changeset
1625 write_to_conv(c, tmp, WFLAG_SYSTEM, NULL);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1626
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1627 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1628 }
58
60fa62507184 [gaim-migrate @ 68]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 50
diff changeset
1629 b->log_timer = gtk_timeout_add(10000, (GtkFunction)log_timeout, b->name);
436
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 432
diff changeset
1630 if ( ticker_prefs & OPT_DISP_SHOW_BUDDYTICKER )
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 432
diff changeset
1631 gtk_timeout_add(10000, (GtkFunction)BuddyTickerLogoutTimeout, b->name);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1632 update_num_groups();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1633 update_show_idlepix();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1634 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1635 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1636 setup_buddy_chats();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1637 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1638
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1639
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1640 static void move_blist_window(GtkWidget *w, GdkEventConfigure *e, void *dummy)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1641 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1642 int x, y, width, height;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1643 int save = 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1644 gdk_window_get_position(blist->window, &x, &y);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1645 gdk_window_get_size(blist->window, &width, &height);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1646
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1647 if(e->send_event) { /* Is a position event */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1648 if (blist_pos.x != x || blist_pos.y != y)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1649 save = 1;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1650 blist_pos.x = x;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1651 blist_pos.y = y;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1652 } else { /* Is a size event */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1653 if (blist_pos.xoff != x || blist_pos.yoff != y ||
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1654 blist_pos.width != width || blist_pos.width != width)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1655 save = 1;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1656
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1657 blist_pos.width = width;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1658 blist_pos.height = height;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1659 blist_pos.xoff = x;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1660 blist_pos.yoff = y;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1661 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1662
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1663 if (save)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1664 save_prefs();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1665
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1666 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1667
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1668
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1669 /*******************************************************************
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1670 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1671 * Helper funs for making the menu
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1672 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1673 *******************************************************************/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1674
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1675 void gaim_seperator(GtkWidget *menu)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1676 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1677 GtkWidget *sep, *menuitem;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1678 sep = gtk_hseparator_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1679 menuitem = gtk_menu_item_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1680 gtk_menu_append(GTK_MENU(menu), menuitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1681 gtk_container_add(GTK_CONTAINER(menuitem), sep);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1682 gtk_widget_set_sensitive(menuitem, FALSE);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1683 gtk_widget_show(menuitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1684 gtk_widget_show(sep);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1685 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1686
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1687 GtkWidget *gaim_new_item(GtkWidget *menu, const char *str, GtkSignalFunc sf)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1688 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1689 GtkWidget *menuitem;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1690 menuitem = gtk_menu_item_new_with_label(str);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1691 if (menu)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1692 gtk_menu_append(GTK_MENU(menu), menuitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1693 gtk_widget_show(menuitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1694 if (sf)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1695 gtk_signal_connect(GTK_OBJECT(menuitem), "activate", sf, NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1696 return menuitem;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1697 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1698
714
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
1699 GtkWidget *gaim_new_item_with_pixmap(GtkWidget *menu, const char *str, char **xpm, GtkSignalFunc sf)
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
1700 {
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
1701 GtkWidget *menuitem;
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
1702 GtkWidget *hbox;
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
1703 GtkWidget *label;
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
1704 GtkWidget *pixmap;
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
1705 GdkPixmap *pm;
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
1706 GdkBitmap *mask;
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
1707
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
1708 menuitem = gtk_menu_item_new();
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
1709 gtk_widget_show(menuitem);
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
1710
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
1711 /* Create our container */
718
c2e3e4e59a17 [gaim-migrate @ 728]
Rob Flynn <gaim@robflynn.com>
parents: 714
diff changeset
1712 hbox = gtk_hbox_new(FALSE, 2);
714
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
1713
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
1714 /* Create our pixmap and pack it */
719
7e5523de52e2 [gaim-migrate @ 729]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 718
diff changeset
1715 gtk_widget_realize(menu->parent);
714
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
1716 pm = gdk_pixmap_create_from_xpm_d(menu->parent->window, &mask, NULL, xpm);
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
1717
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
1718 pixmap = gtk_pixmap_new(pm, mask);
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
1719 gtk_widget_show(pixmap);
803
7f75b17d4e14 [gaim-migrate @ 813]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 801
diff changeset
1720 gdk_pixmap_unref(pm);
804
17def2bb9720 [gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 803
diff changeset
1721 gdk_bitmap_unref(mask);
714
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
1722
718
c2e3e4e59a17 [gaim-migrate @ 728]
Rob Flynn <gaim@robflynn.com>
parents: 714
diff changeset
1723 gtk_box_pack_start(GTK_BOX(hbox), pixmap, FALSE, FALSE, 2);
c2e3e4e59a17 [gaim-migrate @ 728]
Rob Flynn <gaim@robflynn.com>
parents: 714
diff changeset
1724
c2e3e4e59a17 [gaim-migrate @ 728]
Rob Flynn <gaim@robflynn.com>
parents: 714
diff changeset
1725 /* Create our label and pack it */
714
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
1726
718
c2e3e4e59a17 [gaim-migrate @ 728]
Rob Flynn <gaim@robflynn.com>
parents: 714
diff changeset
1727 label = gtk_label_new(str);
c2e3e4e59a17 [gaim-migrate @ 728]
Rob Flynn <gaim@robflynn.com>
parents: 714
diff changeset
1728 gtk_widget_show(label);
c2e3e4e59a17 [gaim-migrate @ 728]
Rob Flynn <gaim@robflynn.com>
parents: 714
diff changeset
1729 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
c2e3e4e59a17 [gaim-migrate @ 728]
Rob Flynn <gaim@robflynn.com>
parents: 714
diff changeset
1730
714
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
1731 /* And finally, pack our box within our menu item */
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
1732
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
1733 gtk_container_add(GTK_CONTAINER(menuitem), hbox);
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
1734 gtk_widget_show(hbox);
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
1735
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
1736 if (menu)
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
1737 gtk_menu_append(GTK_MENU(menu), menuitem);
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
1738
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
1739 if (sf)
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
1740 gtk_signal_connect(GTK_OBJECT(menuitem), "activate", sf, NULL);
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
1741 return menuitem;
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
1742 }
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
1743
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1744
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1745
696
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1746 void build_imchat_box(gboolean on)
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1747 {
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1748 if (on) {
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1749 if (imchatbox) return;
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1750
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1751 imbutton = gtk_button_new_with_label(_("IM"));
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1752 infobutton = gtk_button_new_with_label(_("Info"));
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1753 chatbutton = gtk_button_new_with_label(_("Chat"));
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1754
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1755 imchatbox = gtk_hbox_new(TRUE, 10);
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1756
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1757 if (display_options & OPT_DISP_COOL_LOOK)
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1758 {
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1759 gtk_button_set_relief(GTK_BUTTON(imbutton), GTK_RELIEF_NONE);
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1760 gtk_button_set_relief(GTK_BUTTON(infobutton), GTK_RELIEF_NONE);
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1761 gtk_button_set_relief(GTK_BUTTON(chatbutton), GTK_RELIEF_NONE);
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1762 }
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1763
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1764 /* Put the buttons in the hbox */
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1765 gtk_widget_show(imbutton);
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1766 gtk_widget_show(chatbutton);
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1767 gtk_widget_show(infobutton);
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1768
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1769 gtk_box_pack_start(GTK_BOX(imchatbox), imbutton, TRUE, TRUE, 0);
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1770 gtk_box_pack_start(GTK_BOX(imchatbox), infobutton, TRUE, TRUE, 0);
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1771 gtk_box_pack_start(GTK_BOX(imchatbox), chatbutton, TRUE, TRUE, 0);
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1772 gtk_container_border_width(GTK_CONTAINER(imchatbox), 10);
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1773
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1774 gtk_signal_connect(GTK_OBJECT(imbutton), "clicked", GTK_SIGNAL_FUNC(show_im_dialog), buddies);
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1775 gtk_signal_connect(GTK_OBJECT(infobutton), "clicked", GTK_SIGNAL_FUNC(info_callback), buddies);
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1776 gtk_signal_connect(GTK_OBJECT(chatbutton), "clicked", GTK_SIGNAL_FUNC(chat_callback), buddies);
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1777
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1778 gtk_tooltips_set_tip(tips,infobutton, _("Information on selected Buddy"), "Penguin");
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1779 gtk_tooltips_set_tip(tips,imbutton, _("Send Instant Message"), "Penguin");
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1780 gtk_tooltips_set_tip(tips,chatbutton, _("Start/join a Buddy Chat"), "Penguin");
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1781
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1782 gtk_box_pack_start(GTK_BOX(buddypane), imchatbox, FALSE, FALSE, 0);
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1783
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1784 gtk_widget_show(imchatbox);
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1785 } else {
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1786 if (imchatbox)
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1787 gtk_widget_destroy(imchatbox);
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1788 imchatbox = NULL;
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1789 }
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1790 }
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1791
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1792
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1793
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1794 void show_buddy_list()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1795 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1796
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1797 /* Build the buddy list, based on *config */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1798
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1799 GtkWidget *sw;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1800 GtkWidget *menu;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1801 GtkWidget *findmenu;
798
9dc39872e1f9 [gaim-migrate @ 808]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 784
diff changeset
1802 #ifdef USE_PERL
9dc39872e1f9 [gaim-migrate @ 808]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 784
diff changeset
1803 GtkWidget *perlmenu;
9dc39872e1f9 [gaim-migrate @ 808]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 784
diff changeset
1804 #endif
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1805 GtkWidget *setmenu;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1806 GtkWidget *menubar;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1807 GtkWidget *vbox;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1808 GtkWidget *menuitem;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1809 GtkWidget *notebook;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1810 GtkWidget *label;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1811 GtkWidget *bbox;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1812 GtkWidget *tbox;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1813
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1814
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1815 #ifdef USE_APPLET
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1816 blist = gtk_window_new(GTK_WINDOW_DIALOG);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1817 #else
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1818 blist = gtk_window_new(GTK_WINDOW_TOPLEVEL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1819 #endif
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1820
905
2876c40108cd [gaim-migrate @ 915]
Rob Flynn <gaim@robflynn.com>
parents: 903
diff changeset
1821 gtk_window_set_wmclass(GTK_WINDOW(blist), "buddy_list", "Gaim" );
2876c40108cd [gaim-migrate @ 915]
Rob Flynn <gaim@robflynn.com>
parents: 903
diff changeset
1822
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1823 gtk_widget_realize(blist);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1824 aol_icon(blist->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1825
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1826 gtk_window_set_policy(GTK_WINDOW(blist), TRUE, TRUE, TRUE);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1827
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1828 menubar = gtk_menu_bar_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1829
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1830 menu = gtk_menu_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1831
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1832
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1833 menuitem = gaim_new_item(NULL, _("File"), NULL);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1834 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), menu);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1835 gtk_menu_bar_append(GTK_MENU_BAR(menubar), menuitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1836
714
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
1837 // gaim_new_item(menu, _("Add A Buddy"), GTK_SIGNAL_FUNC(add_buddy_callback));
d7557252bfb1 [gaim-migrate @ 724]
Rob Flynn <gaim@robflynn.com>
parents: 710
diff changeset
1838 gaim_new_item_with_pixmap(menu, _("Add A Buddy"), add_small_xpm, GTK_SIGNAL_FUNC(add_buddy_callback));
870
9b8b83592bb6 [gaim-migrate @ 880]
Rob Flynn <gaim@robflynn.com>
parents: 865
diff changeset
1839 gaim_new_item_with_pixmap(menu, _("Join A Chat"), pounce_small_xpm, GTK_SIGNAL_FUNC(chat_callback));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1840 gaim_seperator(menu);
718
c2e3e4e59a17 [gaim-migrate @ 728]
Rob Flynn <gaim@robflynn.com>
parents: 714
diff changeset
1841 gaim_new_item_with_pixmap(menu, _("Import Buddy List"), import_small_xpm, GTK_SIGNAL_FUNC(import_callback));
733
8f3bcde94e2c [gaim-migrate @ 743]
Rob Flynn <gaim@robflynn.com>
parents: 727
diff changeset
1842 gaim_new_item_with_pixmap(menu, _("Export Buddy List"), export_small_xpm,GTK_SIGNAL_FUNC(export_callback));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1843 if (!(general_options & OPT_GEN_REGISTERED))
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1844 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1845 gaim_seperator(menu);
718
c2e3e4e59a17 [gaim-migrate @ 728]
Rob Flynn <gaim@robflynn.com>
parents: 714
diff changeset
1846 gaim_new_item_with_pixmap(menu, _("Register"), add_small_xpm, GTK_SIGNAL_FUNC(gaimreg_callback));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1847 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1848 gaim_seperator(menu);
733
8f3bcde94e2c [gaim-migrate @ 743]
Rob Flynn <gaim@robflynn.com>
parents: 727
diff changeset
1849 gaim_new_item_with_pixmap(menu, _("Signoff"), logout_icon_xpm, GTK_SIGNAL_FUNC(signoff));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1850
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1851 #ifndef USE_APPLET
727
8b9f0537f473 [gaim-migrate @ 737]
Rob Flynn <gaim@robflynn.com>
parents: 719
diff changeset
1852 gaim_new_item_with_pixmap(menu, _("Quit"), exit_small_xpm, GTK_SIGNAL_FUNC(do_quit));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1853 #else
727
8b9f0537f473 [gaim-migrate @ 737]
Rob Flynn <gaim@robflynn.com>
parents: 719
diff changeset
1854 gaim_new_item_with_pixmap(menu, _("Close"), close_small_xpm, GTK_SIGNAL_FUNC(applet_destroy_buddy));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1855 #endif
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1856
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1857 menu = gtk_menu_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1858
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1859 menuitem = gaim_new_item(NULL, _("Tools"), NULL);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1860 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), menu);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1861 gtk_menu_bar_append(GTK_MENU_BAR(menubar), menuitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1862
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1863 awaymenu = gtk_menu_new();
872
0532f6f85fac [gaim-migrate @ 882]
Rob Flynn <gaim@robflynn.com>
parents: 870
diff changeset
1864 menuitem = gaim_new_item_with_pixmap(menu, _("Away"), away_small_xpm, NULL);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1865 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), awaymenu);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1866 do_away_menu();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1867
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1868 bpmenu = gtk_menu_new();
865
789b2f0bb133 [gaim-migrate @ 875]
Rob Flynn <gaim@robflynn.com>
parents: 864
diff changeset
1869 menuitem = gaim_new_item_with_pixmap(menu, _("Buddy Pounce"), pounce_small_xpm, NULL);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1870 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), bpmenu);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1871 do_bp_menu();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1872
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1873 gaim_seperator(menu);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1874
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1875 findmenu = gtk_menu_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1876 gtk_widget_show(findmenu);
801
1a47432e2ba1 [gaim-migrate @ 811]
Rob Flynn <gaim@robflynn.com>
parents: 798
diff changeset
1877 menuitem = gaim_new_item_with_pixmap(menu, _("Search for Buddy"), search_small_xpm, NULL);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1878 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), findmenu);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1879 gtk_widget_show(menuitem);
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1880 menuitem = gtk_menu_item_new_with_label(_("by Email"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1881 gtk_menu_append(GTK_MENU(findmenu), menuitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1882 gtk_signal_connect(GTK_OBJECT(menuitem), "activate", GTK_SIGNAL_FUNC(show_find_email), NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1883 gtk_widget_show(menuitem);
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1884 menuitem = gtk_menu_item_new_with_label(_("by Dir Info"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1885 gtk_menu_append(GTK_MENU(findmenu), menuitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1886 gtk_signal_connect(GTK_OBJECT(menuitem), "activate", GTK_SIGNAL_FUNC(show_find_info), NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1887 gtk_widget_show(menuitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1888
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1889 setmenu = gtk_menu_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1890 gtk_widget_show(setmenu);
864
4a6ab6995439 [gaim-migrate @ 874]
Rob Flynn <gaim@robflynn.com>
parents: 837
diff changeset
1891 //menuitem = gaim_new_item(menu, _("Settings"), NULL);
4a6ab6995439 [gaim-migrate @ 874]
Rob Flynn <gaim@robflynn.com>
parents: 837
diff changeset
1892 menuitem = gaim_new_item_with_pixmap(menu, _("Settings"), prefs_small_xpm, NULL);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1893 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), setmenu);
864
4a6ab6995439 [gaim-migrate @ 874]
Rob Flynn <gaim@robflynn.com>
parents: 837
diff changeset
1894 //gtk_widget_show(menuitem);
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1895 menuitem = gtk_menu_item_new_with_label(_("User Info"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1896 gtk_menu_append(GTK_MENU(setmenu), menuitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1897 gtk_signal_connect(GTK_OBJECT(menuitem), "activate", GTK_SIGNAL_FUNC(show_set_info), NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1898 gtk_widget_show(menuitem);
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1899 menuitem = gtk_menu_item_new_with_label(_("Directory Info"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1900 gtk_menu_append(GTK_MENU(setmenu), menuitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1901 gtk_signal_connect(GTK_OBJECT(menuitem), "activate", GTK_SIGNAL_FUNC(show_set_dir), NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1902 gtk_widget_show(menuitem);
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1903 menuitem = gtk_menu_item_new_with_label(_("Change Password"));
146
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 139
diff changeset
1904 gtk_menu_append(GTK_MENU(setmenu), menuitem);
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 139
diff changeset
1905 gtk_signal_connect(GTK_OBJECT(menuitem), "activate", GTK_SIGNAL_FUNC(show_change_passwd), NULL);
99248fb977c2 [gaim-migrate @ 156]
Rob Flynn <gaim@robflynn.com>
parents: 139
diff changeset
1906 gtk_widget_show(menuitem);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1907 gaim_seperator(menu);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1908
801
1a47432e2ba1 [gaim-migrate @ 811]
Rob Flynn <gaim@robflynn.com>
parents: 798
diff changeset
1909 gaim_new_item_with_pixmap(menu, _("Preferences"), prefs_small_xpm, GTK_SIGNAL_FUNC(show_prefs));
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 87
diff changeset
1910
152
cb0d3ec5a4c8 [gaim-migrate @ 162]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 150
diff changeset
1911 #ifdef GAIM_PLUGINS
801
1a47432e2ba1 [gaim-migrate @ 811]
Rob Flynn <gaim@robflynn.com>
parents: 798
diff changeset
1912 gaim_new_item_with_pixmap(menu, _("Plugins"), plugins_small_xpm, GTK_SIGNAL_FUNC(show_plugins));
152
cb0d3ec5a4c8 [gaim-migrate @ 162]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 150
diff changeset
1913 #endif
798
9dc39872e1f9 [gaim-migrate @ 808]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 784
diff changeset
1914 #ifdef USE_PERL
9dc39872e1f9 [gaim-migrate @ 808]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 784
diff changeset
1915 perlmenu = gtk_menu_new();
9dc39872e1f9 [gaim-migrate @ 808]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 784
diff changeset
1916 gtk_widget_show(perlmenu);
864
4a6ab6995439 [gaim-migrate @ 874]
Rob Flynn <gaim@robflynn.com>
parents: 837
diff changeset
1917 menuitem = gaim_new_item_with_pixmap(menu, _("Perl"), plugins_small_xpm, NULL);
798
9dc39872e1f9 [gaim-migrate @ 808]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 784
diff changeset
1918 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), perlmenu);
9dc39872e1f9 [gaim-migrate @ 808]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 784
diff changeset
1919 gtk_widget_show(menuitem);
9dc39872e1f9 [gaim-migrate @ 808]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 784
diff changeset
1920 menuitem = gtk_menu_item_new_with_label(_("Load Script"));
9dc39872e1f9 [gaim-migrate @ 808]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 784
diff changeset
1921 gtk_menu_append(GTK_MENU(perlmenu), menuitem);
9dc39872e1f9 [gaim-migrate @ 808]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 784
diff changeset
1922 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
1923 gtk_widget_show(menuitem);
9dc39872e1f9 [gaim-migrate @ 808]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 784
diff changeset
1924 menuitem = gtk_menu_item_new_with_label(_("Unload All Scripts"));
9dc39872e1f9 [gaim-migrate @ 808]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 784
diff changeset
1925 gtk_menu_append(GTK_MENU(perlmenu), menuitem);
9dc39872e1f9 [gaim-migrate @ 808]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 784
diff changeset
1926 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
1927 gtk_widget_show(menuitem);
9dc39872e1f9 [gaim-migrate @ 808]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 784
diff changeset
1928 menuitem = gtk_menu_item_new_with_label(_("List Scripts"));
9dc39872e1f9 [gaim-migrate @ 808]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 784
diff changeset
1929 gtk_menu_append(GTK_MENU(perlmenu), menuitem);
9dc39872e1f9 [gaim-migrate @ 808]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 784
diff changeset
1930 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
1931 gtk_widget_show(menuitem);
9dc39872e1f9 [gaim-migrate @ 808]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 784
diff changeset
1932 #endif
90
f5b305c0d974 [gaim-migrate @ 100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 87
diff changeset
1933
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1934 menu = gtk_menu_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1935
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1936 menuitem = gaim_new_item(NULL, _("Help"), NULL);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1937 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), menu);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1938 gtk_menu_item_right_justify(GTK_MENU_ITEM(menuitem));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1939 gtk_menu_bar_append(GTK_MENU_BAR(menubar), menuitem);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1940
874
69669b9b3e3b [gaim-migrate @ 884]
Rob Flynn <gaim@robflynn.com>
parents: 872
diff changeset
1941 gaim_new_item_with_pixmap(menu, _("About Gaim"), about_small_xpm, show_about);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1942
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1943 gtk_widget_show(menubar);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1944
892
36dcec9595ee [gaim-migrate @ 902]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 891
diff changeset
1945 vbox = gtk_vbox_new(FALSE, 5);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1946
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1947 notebook = gtk_notebook_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1948
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1949
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1950
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1951
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1952 /* Do buddy list stuff */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1953
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1954 buddypane = gtk_vbox_new(FALSE, 0);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1955
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1956 buddies = gtk_tree_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1957 sw = gtk_scrolled_window_new(NULL, NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1958
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1959 tips = gtk_tooltips_new();
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1960 gtk_object_set_data(GTK_OBJECT(blist), _("Buddy List"), tips);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1961
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1962 /* Now the buddy list */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1963 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw),buddies);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1964 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1965 GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1966 gtk_widget_set_usize(sw,200,200);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1967 gtk_widget_show(buddies);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1968 gtk_widget_show(sw);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1969
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1970 gtk_box_pack_start(GTK_BOX(buddypane), sw, TRUE, TRUE, 0);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1971 gtk_widget_show(buddypane);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1972
696
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1973 if (!(display_options & OPT_DISP_NO_BUTTONS))
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 689
diff changeset
1974 build_imchat_box(TRUE);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1975
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1976
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1977 /* Swing the edit buddy */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1978 editpane = gtk_vbox_new(FALSE, 0);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1979
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1980
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1981 addbutton = gtk_button_new_with_label(_("Add"));
577
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 544
diff changeset
1982 groupbutton = gtk_button_new_with_label(_("Group"));
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1983 rembutton = gtk_button_new_with_label(_("Remove"));
535
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 515
diff changeset
1984
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 515
diff changeset
1985 if (display_options & OPT_DISP_COOL_LOOK)
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 515
diff changeset
1986 {
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 515
diff changeset
1987 gtk_button_set_relief(GTK_BUTTON(addbutton), GTK_RELIEF_NONE);
577
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 544
diff changeset
1988 gtk_button_set_relief(GTK_BUTTON(groupbutton), GTK_RELIEF_NONE);
535
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 515
diff changeset
1989 gtk_button_set_relief(GTK_BUTTON(rembutton), GTK_RELIEF_NONE);
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 515
diff changeset
1990 }
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 515
diff changeset
1991
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1992 edittree = gtk_ctree_new(1, 0);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1993 gtk_ctree_set_line_style (GTK_CTREE(edittree), GTK_CTREE_LINES_SOLID);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1994 gtk_ctree_set_expander_style(GTK_CTREE(edittree), GTK_CTREE_EXPANDER_SQUARE);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1995 gtk_clist_set_reorderable(GTK_CLIST(edittree), TRUE);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1996
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1997 gtk_ctree_set_drag_compare_func (GTK_CTREE(edittree),
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1998 (GtkCTreeCompareDragFunc)edit_drag_compare_func);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1999
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2000
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2001 gtk_signal_connect_after (GTK_OBJECT (edittree), "tree_move",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2002 GTK_SIGNAL_FUNC (edit_tree_move), NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2003
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2004
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2005 bbox = gtk_hbox_new(TRUE, 10);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2006 tbox = gtk_scrolled_window_new(NULL, NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2007 /* Put the buttons in the box */
577
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 544
diff changeset
2008 gtk_box_pack_start(GTK_BOX(bbox), addbutton, TRUE, TRUE, 0);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 544
diff changeset
2009 gtk_box_pack_start(GTK_BOX(bbox), groupbutton, TRUE, TRUE, 0);
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 544
diff changeset
2010 gtk_box_pack_start(GTK_BOX(bbox), rembutton, TRUE, TRUE, 0);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2011
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
2012 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
2013 gtk_tooltips_set_tip(tips, groupbutton, _("Add a new Group"), "Penguin");
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
2014 gtk_tooltips_set_tip(tips, rembutton, _("Remove selected Buddy"), "Penguin");
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2015
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2016 /* And the boxes in the box */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2017 gtk_box_pack_start(GTK_BOX(editpane), tbox, TRUE, TRUE, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2018 gtk_box_pack_start(GTK_BOX(editpane), bbox, FALSE, FALSE, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2019
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2020 /* Handle closes right */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2021
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2022
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2023
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2024 /* Finish up */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2025 gtk_widget_show(addbutton);
577
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 544
diff changeset
2026 gtk_widget_show(groupbutton);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2027 gtk_widget_show(rembutton);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2028 gtk_widget_show(edittree);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2029 gtk_widget_show(tbox);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2030 gtk_widget_show(bbox);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2031 gtk_widget_show(editpane);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2032
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2033
535
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 515
diff changeset
2034
703
20553b584ccb [gaim-migrate @ 713]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
2035 update_button_pix();
20553b584ccb [gaim-migrate @ 713]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
2036
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2037
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2038
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
2039 label = gtk_label_new(_("Online"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2040 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), buddypane, label);
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
2041 label = gtk_label_new(_("Edit Buddies"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2042 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), editpane, label);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2043
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2044 gtk_widget_show_all(notebook);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2045
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2046 /* Pack things in the vbox */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2047 gtk_widget_show(vbox);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2048
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2049
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2050 gtk_widget_show(notebook);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2051
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2052 /* Enable buttons */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2053
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2054 gtk_signal_connect(GTK_OBJECT(rembutton), "clicked", GTK_SIGNAL_FUNC(do_del_buddy), edittree);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2055 gtk_signal_connect(GTK_OBJECT(addbutton), "clicked", GTK_SIGNAL_FUNC(add_buddy_callback), NULL);
577
aa9a8bcddd80 [gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 544
diff changeset
2056 gtk_signal_connect(GTK_OBJECT(groupbutton), "clicked", GTK_SIGNAL_FUNC(add_group_callback), NULL);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2057 gtk_box_pack_start(GTK_BOX(vbox), menubar, FALSE, TRUE, 0);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2058 gtk_box_pack_start(GTK_BOX(vbox), notebook, TRUE, TRUE, 0);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2059
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2060 gtk_container_add(GTK_CONTAINER(blist), vbox);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2061
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2062 #ifndef USE_APPLET
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2063 gtk_signal_connect(GTK_OBJECT(blist), "delete_event", GTK_SIGNAL_FUNC(do_quit), blist);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2064 #else
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2065 gtk_signal_connect(GTK_OBJECT(blist), "delete_event", GTK_SIGNAL_FUNC(applet_destroy_buddy), NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2066 #endif
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2067
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2068 gtk_signal_connect(GTK_OBJECT(blist), "configure_event", GTK_SIGNAL_FUNC(move_blist_window), NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2069
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2070
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2071
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2072 /* The edit tree */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2073 gtk_container_add(GTK_CONTAINER(tbox), edittree);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2074 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(tbox),
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2075 GTK_POLICY_NEVER,GTK_POLICY_AUTOMATIC);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2076
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2077
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
2078 gtk_window_set_title(GTK_WINDOW(blist), _("Gaim - Buddy List"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2079
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2080 if (general_options & OPT_GEN_SAVED_WINDOWS) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2081 if (blist_pos.width != 0) { /* Sanity check! */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2082 gtk_widget_set_uposition(blist, blist_pos.x - blist_pos.xoff, blist_pos.y - blist_pos.yoff);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2083 gtk_widget_set_usize(blist, blist_pos.width, blist_pos.height);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2084 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2085 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2086 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2087
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2088 void refresh_buddy_window()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2089 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2090 build_edit_tree();
678
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
2091 build_permit_tree();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2092
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2093 update_button_pix();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2094 gtk_widget_show(blist);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2095 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2096