annotate src/buddy_chat.c @ 2257:eae25a0309c1

[gaim-migrate @ 2267] eyh luuve to leek you all uuver uur bohdee. sorry. i had to put "leek" in there and i already used "leek soup". and one of my co-workers is french. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Mon, 10 Sep 2001 17:09:46 +0000
parents 73872bedf07e
children a9787aad60f3
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: 344
diff changeset
22 #ifdef HAVE_CONFIG_H
2090
b66aca8e8dce [gaim-migrate @ 2100]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2048
diff changeset
23 #include <config.h>
349
b402a23f35df [gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 344
diff changeset
24 #endif
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
25 #include <string.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
26 #include <sys/time.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
27 #include <unistd.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
28 #include <stdio.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
29 #include <stdlib.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
30 #include <gtk/gtk.h>
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1398
diff changeset
31 #include "gtkimhtml.h"
1117
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1109
diff changeset
32 #include "gtkspell.h"
300
b32c83750104 [gaim-migrate @ 310]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 226
diff changeset
33 #include <gdk/gdkkeysyms.h>
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
34
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 457
diff changeset
35 #include "convo.h"
1235
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1228
diff changeset
36 #include "prpl.h"
344
2434adbb8703 [gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 338
diff changeset
37
834
bac7089491c1 [gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 823
diff changeset
38 #include "pixmaps/tb_forward.xpm"
604
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 535
diff changeset
39 #include "pixmaps/join.xpm"
909
9f2afe5faed5 [gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 907
diff changeset
40 #include "pixmaps/close.xpm"
604
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 535
diff changeset
41
1819
47e064712091 [gaim-migrate @ 1829]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1815
diff changeset
42 GtkWidget *joinchat;
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
43 static struct gaim_connection *joinchatgc;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
44 static GtkWidget *invite;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
45 static GtkWidget *inviteentry;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
46 static GtkWidget *invitemess;
1807
ba8f463744c0 [gaim-migrate @ 1817]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1806
diff changeset
47 static GtkWidget *jc_vbox = NULL;
2205
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
48 static GList *chatentries = NULL;
344
2434adbb8703 [gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 338
diff changeset
49 extern int state_lock;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
50
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
51 GList *chats = NULL;
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
52 GtkWidget *all_chats = NULL;
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
53 GtkWidget *chat_notebook = NULL;
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
54
1806
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1793
diff changeset
55
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
56 static void destroy_join_chat()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
57 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
58 if (joinchat)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
59 gtk_widget_destroy(joinchat);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
60 joinchat = NULL;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
61 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
62
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
63 static void destroy_invite()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
64 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
65 if (invite)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
66 gtk_widget_destroy(invite);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
67 invite = NULL;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
68 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
69
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
70
1819
47e064712091 [gaim-migrate @ 1829]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1815
diff changeset
71 void do_join_chat()
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
72 {
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
73 if (joinchat) {
2205
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
74 GList *data = NULL;
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
75 GList *tmp = chatentries;
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
76 int *ival;
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
77 char *sval;
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
78 while (tmp) {
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
79 if (gtk_object_get_user_data(tmp->data)) {
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
80 ival = g_new0(int, 1);
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
81 *ival = gtk_spin_button_get_value_as_int(tmp->data);
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
82 data = g_list_append(data, ival);
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
83 } else {
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
84 sval = g_strdup(gtk_entry_get_text(tmp->data));
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
85 data = g_list_append(data, sval);
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
86 }
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
87 tmp = tmp->next;
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
88 }
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
89 serv_join_chat(joinchatgc, data);
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
90
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
91 tmp = data;
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
92 while (tmp) {
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
93 g_free(tmp->data);
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
94 tmp = tmp->next;
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
95 }
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
96 g_list_free(data);
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
97
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
98 gtk_widget_destroy(joinchat);
2205
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
99 if (chatentries)
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
100 g_list_free(chatentries);
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
101 chatentries = NULL;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
102 }
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
103 joinchat = NULL;
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
1806
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1793
diff changeset
106 static void rebuild_jc()
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1793
diff changeset
107 {
2205
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
108 GList *list, *tmp;
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
109 struct proto_chat_entry *pce;
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
110
1806
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1793
diff changeset
111 if (!joinchatgc)
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1793
diff changeset
112 return;
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1793
diff changeset
113
2205
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
114 while (GTK_BOX(jc_vbox)->children)
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
115 gtk_container_remove(GTK_CONTAINER(jc_vbox),
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
116 ((GtkBoxChild *)GTK_BOX(jc_vbox)->children->data)->widget);
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
117 if (chatentries)
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
118 g_list_free(chatentries);
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
119 chatentries = NULL;
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
120
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
121 tmp = list = (*joinchatgc->prpl->chat_info)(joinchatgc);
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
122 while (list) {
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
123 GtkWidget *label;
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
124 GtkWidget *rowbox;
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
125 pce = list->data;
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
126
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
127 rowbox = gtk_hbox_new(FALSE, 5);
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
128 gtk_box_pack_start(GTK_BOX(jc_vbox), rowbox, TRUE, TRUE, 0);
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
129 gtk_widget_show(rowbox);
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
130
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
131 label = gtk_label_new(pce->label);
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
132 gtk_box_pack_start(GTK_BOX(rowbox), label, FALSE, FALSE, 0);
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
133 gtk_widget_show(label);
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
134
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
135 if (pce->is_int) {
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
136 GtkObject *adjust;
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
137 GtkWidget *spin;
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
138 adjust = gtk_adjustment_new(pce->min, pce->min, pce->max, 1, 10, 10);
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
139 spin = gtk_spin_button_new(GTK_ADJUSTMENT(adjust), 1, 0);
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
140 gtk_object_set_user_data(GTK_OBJECT(spin), (void *)1);
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
141 chatentries = g_list_append(chatentries, spin);
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
142 gtk_widget_set_usize(spin, 50, -1);
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
143 gtk_box_pack_start(GTK_BOX(rowbox), spin, FALSE, FALSE, 0);
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
144 gtk_widget_show(spin);
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
145 } else {
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
146 GtkWidget *entry;
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
147 entry = gtk_entry_new();
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
148 chatentries = g_list_append(chatentries, entry);
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
149 gtk_box_pack_start(GTK_BOX(rowbox), entry, TRUE, TRUE, 0);
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
150 if (pce->def)
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
151 gtk_entry_set_text(GTK_ENTRY(entry), pce->def);
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
152 gtk_widget_grab_focus(entry);
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
153 gtk_signal_connect(GTK_OBJECT(entry), "activate",
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
154 GTK_SIGNAL_FUNC(do_join_chat), NULL);
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
155 gtk_widget_show(entry);
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
156 }
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
157
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
158 g_free(pce);
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
159 list = list->next;
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
160 }
cff4fbe01c7b [gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2199
diff changeset
161 g_list_free(tmp);
1806
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1793
diff changeset
162 }
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1793
diff changeset
163
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
164 static void joinchat_choose(GtkWidget *w, struct gaim_connection *g)
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
165 {
1806
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1793
diff changeset
166 if (joinchatgc == g)
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1793
diff changeset
167 return;
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
168 joinchatgc = g;
1806
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1793
diff changeset
169 rebuild_jc();
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
170 }
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
171
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
172 static void create_joinchat_menu(GtkWidget *box)
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
173 {
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
174 GtkWidget *optmenu;
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
175 GtkWidget *menu;
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
176 GtkWidget *opt;
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
177 GSList *c = connections;
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
178 struct gaim_connection *g;
1235
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1228
diff changeset
179 char buf[2048];
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
180
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
181 optmenu = gtk_option_menu_new();
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1201
diff changeset
182 gtk_box_pack_start(GTK_BOX(box), optmenu, FALSE, FALSE, 0);
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
183
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
184 menu = gtk_menu_new();
1793
00c753b86710 [gaim-migrate @ 1803]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1780
diff changeset
185 joinchatgc = NULL;
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
186
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
187 while (c) {
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
188 g = (struct gaim_connection *)c->data;
1356
c22d04db51be [gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1343
diff changeset
189 c = c->next;
c22d04db51be [gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1343
diff changeset
190 if (!g->prpl->join_chat)
c22d04db51be [gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1343
diff changeset
191 continue;
1793
00c753b86710 [gaim-migrate @ 1803]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1780
diff changeset
192 if (!joinchatgc)
00c753b86710 [gaim-migrate @ 1803]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1780
diff changeset
193 joinchatgc = g;
1235
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1228
diff changeset
194 g_snprintf(buf, sizeof buf, "%s (%s)", g->username, (*g->prpl->name)());
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1228
diff changeset
195 opt = gtk_menu_item_new_with_label(buf);
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
196 gtk_object_set_user_data(GTK_OBJECT(opt), g);
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
197 gtk_signal_connect(GTK_OBJECT(opt), "activate", GTK_SIGNAL_FUNC(joinchat_choose), g);
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
198 gtk_menu_append(GTK_MENU(menu), opt);
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
199 gtk_widget_show(opt);
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
200 }
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
201
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
202 gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu), menu);
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
203 gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu), 0);
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
204 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
205
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
206 void join_chat()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
207 {
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1201
diff changeset
208 GtkWidget *mainbox;
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1201
diff changeset
209 GtkWidget *frame;
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1201
diff changeset
210 GtkWidget *fbox;
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1201
diff changeset
211 GtkWidget *rowbox;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
212 GtkWidget *bbox;
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1201
diff changeset
213 GtkWidget *join;
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1201
diff changeset
214 GtkWidget *cancel;
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1201
diff changeset
215 GtkWidget *label;
1356
c22d04db51be [gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1343
diff changeset
216 GSList *c = connections;
c22d04db51be [gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1343
diff changeset
217 struct gaim_connection *gc = NULL;
c22d04db51be [gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1343
diff changeset
218
c22d04db51be [gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1343
diff changeset
219 while (c) {
c22d04db51be [gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1343
diff changeset
220 gc = c->data;
c22d04db51be [gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1343
diff changeset
221 if (gc->prpl->join_chat)
c22d04db51be [gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1343
diff changeset
222 break;
c22d04db51be [gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1343
diff changeset
223 gc = NULL;
c22d04db51be [gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1343
diff changeset
224 c = c->next;
c22d04db51be [gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1343
diff changeset
225 }
c22d04db51be [gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1343
diff changeset
226 if (gc == NULL) {
1358
3c87aa8efdc9 [gaim-migrate @ 1368]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1356
diff changeset
227 do_error_dialog("You are not currently signed on with any protocols that have "
1356
c22d04db51be [gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1343
diff changeset
228 "the ability to chat.", "Unable to chat");
c22d04db51be [gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1343
diff changeset
229 return;
c22d04db51be [gaim-migrate @ 1366]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1343
diff changeset
230 }
456
725ffb93aedc [gaim-migrate @ 466]
Rob Flynn <gaim@robflynn.com>
parents: 449
diff changeset
231
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
232 if (!joinchat) {
457
5040146e18a8 [gaim-migrate @ 467]
Rob Flynn <gaim@robflynn.com>
parents: 456
diff changeset
233 joinchat = gtk_window_new(GTK_WINDOW_DIALOG);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
234 gtk_window_set_wmclass(GTK_WINDOW(joinchat), "joinchat", "Gaim");
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1201
diff changeset
235 gtk_window_set_policy(GTK_WINDOW(joinchat), FALSE, TRUE, TRUE);
834
bac7089491c1 [gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 823
diff changeset
236 gtk_widget_realize(joinchat);
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
237 gtk_signal_connect(GTK_OBJECT(joinchat), "delete_event",
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
238 GTK_SIGNAL_FUNC(destroy_join_chat), joinchat);
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
239 gtk_window_set_title(GTK_WINDOW(joinchat), _("Join Chat"));
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
240 aol_icon(joinchat->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
241
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
242 mainbox = gtk_vbox_new(FALSE, 5);
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1201
diff changeset
243 gtk_container_set_border_width(GTK_CONTAINER(mainbox), 5);
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1201
diff changeset
244 gtk_container_add(GTK_CONTAINER(joinchat), mainbox);
456
725ffb93aedc [gaim-migrate @ 466]
Rob Flynn <gaim@robflynn.com>
parents: 449
diff changeset
245
1211
892bb91e9a27 [gaim-migrate @ 1221]
Rob Flynn <gaim@robflynn.com>
parents: 1210
diff changeset
246 frame = gtk_frame_new(_("Buddy Chat"));
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
247 gtk_box_pack_start(GTK_BOX(mainbox), frame, TRUE, TRUE, 0);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
248
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1201
diff changeset
249 fbox = gtk_vbox_new(FALSE, 5);
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1201
diff changeset
250 gtk_container_set_border_width(GTK_CONTAINER(fbox), 5);
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1201
diff changeset
251 gtk_container_add(GTK_CONTAINER(frame), fbox);
456
725ffb93aedc [gaim-migrate @ 466]
Rob Flynn <gaim@robflynn.com>
parents: 449
diff changeset
252
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1018
diff changeset
253 #ifndef NO_MULTI
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1201
diff changeset
254 rowbox = gtk_hbox_new(FALSE, 5);
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1201
diff changeset
255 gtk_box_pack_start(GTK_BOX(fbox), rowbox, TRUE, TRUE, 0);
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
256
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
257 label = gtk_label_new(_("Join Chat As:"));
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1201
diff changeset
258 gtk_box_pack_start(GTK_BOX(rowbox), label, FALSE, FALSE, 0);
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
259
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1201
diff changeset
260 create_joinchat_menu(rowbox);
1806
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1793
diff changeset
261
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1793
diff changeset
262 {
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1793
diff changeset
263 GtkWidget *tmp = fbox;
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1793
diff changeset
264 fbox = gtk_vbox_new(FALSE, 5);
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1793
diff changeset
265 gtk_container_add(GTK_CONTAINER(tmp), fbox);
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1793
diff changeset
266 gtk_container_set_border_width(GTK_CONTAINER(fbox), 0);
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1793
diff changeset
267 jc_vbox = fbox;
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1793
diff changeset
268 }
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1018
diff changeset
269 #else
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1018
diff changeset
270 joinchatgc = connections->data;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1018
diff changeset
271 #endif
1806
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1793
diff changeset
272 rebuild_jc();
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
273 /* buttons */
692
f4026275bc9f [gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 666
diff changeset
274
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1201
diff changeset
275 bbox = gtk_hbox_new(FALSE, 5);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
276 gtk_box_pack_start(GTK_BOX(mainbox), bbox, FALSE, FALSE, 0);
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1201
diff changeset
277
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1201
diff changeset
278 cancel = picture_button(joinchat, _("Cancel"), cancel_xpm);
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1201
diff changeset
279 gtk_box_pack_end(GTK_BOX(bbox), cancel, FALSE, FALSE, 0);
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1201
diff changeset
280 gtk_signal_connect(GTK_OBJECT(cancel), "clicked",
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
281 GTK_SIGNAL_FUNC(destroy_join_chat), joinchat);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
282
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
283 join = picture_button(joinchat, _("Join"), join_xpm);
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1201
diff changeset
284 gtk_box_pack_end(GTK_BOX(bbox), join, FALSE, FALSE, 0);
1819
47e064712091 [gaim-migrate @ 1829]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1815
diff changeset
285 gtk_signal_connect(GTK_OBJECT(join), "clicked", GTK_SIGNAL_FUNC(do_join_chat), NULL);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
286 }
1210
265abea9db72 [gaim-migrate @ 1220]
Rob Flynn <gaim@robflynn.com>
parents: 1201
diff changeset
287 gtk_widget_show_all(joinchat);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
288 }
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
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 457
diff changeset
291 static void do_invite(GtkWidget *w, struct conversation *b)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
292 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
293 char *buddy;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
294 char *mess;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
295
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 457
diff changeset
296 if (!b->is_chat) {
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
297 debug_printf("do_invite: expecting chat, got IM\n");
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 457
diff changeset
298 return;
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 457
diff changeset
299 }
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 457
diff changeset
300
2252
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
301 buddy = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(inviteentry)->entry));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
302 mess = gtk_entry_get_text(GTK_ENTRY(invitemess));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
303
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
304 if (invite) {
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
305 serv_chat_invite(b->gc, b->id, mess, buddy);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
306 gtk_widget_destroy(invite);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
307 }
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
308 invite = NULL;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
309 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
310
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
311
2252
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
312 GList *generate_invite_user_names(struct gaim_connection *gc)
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
313 {
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
314 GSList *grp;
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
315 GSList *bl;
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
316 struct group *g;
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
317 struct buddy *buddy;
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
318
2257
eae25a0309c1 [gaim-migrate @ 2267]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2256
diff changeset
319 static GList *tmp = NULL;
eae25a0309c1 [gaim-migrate @ 2267]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2256
diff changeset
320
eae25a0309c1 [gaim-migrate @ 2267]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2256
diff changeset
321 if (tmp)
eae25a0309c1 [gaim-migrate @ 2267]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2256
diff changeset
322 g_list_free(tmp);
2252
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
323
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
324 tmp = g_list_append(tmp, "");
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
325
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
326 if (gc) {
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
327 grp = gc->groups;
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
328
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
329 while (grp) {
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
330 g = (struct group *)grp->data;
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
331
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
332 bl = g->members;
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
333
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
334 while (bl) {
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
335 buddy = (struct buddy *)bl->data;
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
336
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
337 if (buddy->present)
2257
eae25a0309c1 [gaim-migrate @ 2267]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2256
diff changeset
338 tmp = g_list_append(tmp, buddy->name);
2252
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
339
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
340 bl = g_slist_next(bl);
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
341 }
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
342
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
343 grp = g_slist_next(grp);
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
344 }
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
345 }
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
346
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
347 return tmp;
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
348
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
349 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
350
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 457
diff changeset
351 void invite_callback(GtkWidget *w, struct conversation *b)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
352 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
353 GtkWidget *cancel;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
354 GtkWidget *invite_btn;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
355 GtkWidget *label;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
356 GtkWidget *bbox;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
357 GtkWidget *vbox;
2252
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
358 GtkWidget *table;
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
359 GtkWidget *frame;
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
360
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
361 if (!invite) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
362 invite = gtk_window_new(GTK_WINDOW_DIALOG);
2252
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
363 gtk_widget_realize(invite);
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
364
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
365 cancel = picture_button(invite, _("Cancel"), cancel_xpm);
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
366 invite_btn = picture_button(invite, _("Invite"), join_xpm);
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
367 inviteentry = gtk_combo_new();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
368 invitemess = gtk_entry_new();
2252
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
369 frame = gtk_frame_new(_("Invite"));
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
370 table = gtk_table_new(2, 2, FALSE);
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
371
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
372 gtk_table_set_row_spacings(GTK_TABLE(table), 5);
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
373 gtk_table_set_col_spacings(GTK_TABLE(table), 5);
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
374 gtk_container_set_border_width(GTK_CONTAINER(table), 5);
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
375
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
376 gtk_container_set_border_width(GTK_CONTAINER(frame), 5);
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
377
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
378 /* Now we should fill out all of the names */
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
379 gtk_combo_set_popdown_strings(GTK_COMBO(inviteentry), generate_invite_user_names(b->gc));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
380
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
381 if (display_options & OPT_DISP_COOL_LOOK) {
535
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 485
diff changeset
382 gtk_button_set_relief(GTK_BUTTON(cancel), GTK_RELIEF_NONE);
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 485
diff changeset
383 gtk_button_set_relief(GTK_BUTTON(invite_btn), GTK_RELIEF_NONE);
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 485
diff changeset
384 }
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 485
diff changeset
385
2252
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
386 vbox = gtk_vbox_new(FALSE, 0);
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
387 gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
388 gtk_container_add(GTK_CONTAINER(frame), table);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
389
2252
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
390 label = gtk_label_new(_("Buddy"));
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
391 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
392 gtk_widget_show(label);
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
393 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0);
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
394
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
395 label = gtk_label_new(_("Message"));
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
396 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
397 gtk_widget_show(label);
2252
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
398 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, GTK_FILL, 0, 0, 0);
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
399
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
400 /* Now the right side of the table */
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
401 gtk_table_attach(GTK_TABLE(table), inviteentry, 1, 2, 0, 1, GTK_FILL | GTK_EXPAND, 0, 0, 0);
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
402 gtk_table_attach(GTK_TABLE(table), invitemess, 1, 2, 1, 2, GTK_FILL | GTK_EXPAND, 0, 0, 0);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
403
2252
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
404 /* And now for the button box */
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
405 bbox = gtk_hbox_new(FALSE, 10);
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
406 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
407
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
408 gtk_box_pack_end(GTK_BOX(bbox), cancel, FALSE, FALSE, 0);
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
409 gtk_box_pack_end(GTK_BOX(bbox), invite_btn, FALSE, FALSE, 0);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
410
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
411 /* Handle closes right */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
412 gtk_signal_connect(GTK_OBJECT(invite), "delete_event",
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
413 GTK_SIGNAL_FUNC(destroy_invite), invite);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
414
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
415 gtk_signal_connect(GTK_OBJECT(cancel), "clicked", GTK_SIGNAL_FUNC(destroy_invite), b);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
416 gtk_signal_connect(GTK_OBJECT(invite_btn), "clicked", GTK_SIGNAL_FUNC(do_invite), b);
2252
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
417 gtk_signal_connect(GTK_OBJECT(GTK_ENTRY(GTK_COMBO(inviteentry)->entry)), "activate", GTK_SIGNAL_FUNC(do_invite), b);
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
418
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
419 /* Finish up */
2252
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
420 gtk_widget_set_usize(GTK_WIDGET(invite), 550, 115);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
421 gtk_widget_show(invite_btn);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
422 gtk_widget_show(cancel);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
423 gtk_widget_show(inviteentry);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
424 gtk_widget_show(invitemess);
2252
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
425 gtk_widget_show(vbox);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
426 gtk_widget_show(bbox);
2252
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
427 gtk_widget_show(table);
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
428 gtk_widget_show(frame);
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
429 gtk_window_set_title(GTK_WINDOW(invite), _("Gaim - Invite Buddy Into Chat Room"));
2253
eb4401ac17ed [gaim-migrate @ 2263]
Rob Flynn <gaim@robflynn.com>
parents: 2252
diff changeset
430 gtk_window_set_focus(GTK_WINDOW(invite), GTK_WIDGET(GTK_COMBO(inviteentry)->entry));
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
431 gtk_container_add(GTK_CONTAINER(invite), vbox);
2252
912a25df97f3 [gaim-migrate @ 2262]
Rob Flynn <gaim@robflynn.com>
parents: 2208
diff changeset
432
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
433 aol_icon(invite->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
434
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
435 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
436 gtk_widget_show(invite);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
437 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
438
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
439 gboolean meify(char *message)
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
440 {
415
a266fd221c3c [gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
441 /* read /me-ify : if the message (post-HTML) starts with /me, remove
a266fd221c3c [gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
442 * the "/me " part of it (including that space) and return TRUE */
a266fd221c3c [gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
443 char *c = message;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
444 int inside_HTML = 0; /* i really don't like descriptive names */
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
445 if (!c)
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
446 return FALSE; /* um... this would be very bad if this happens */
415
a266fd221c3c [gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
447 while (*c) {
a266fd221c3c [gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
448 if (inside_HTML) {
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
449 if (*c == '>')
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
450 inside_HTML = 0;
415
a266fd221c3c [gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
451 } else {
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
452 if (*c == '<')
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
453 inside_HTML = 1;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
454 else
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
455 break;
415
a266fd221c3c [gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
456 }
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
457 c++; /* i really don't like c++ either */
415
a266fd221c3c [gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
458 }
a266fd221c3c [gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
459 /* k, so now we've gotten past all the HTML crap. */
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
460 if (!*c)
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
461 return FALSE;
2048
3366311426df [gaim-migrate @ 2058]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2017
diff changeset
462 if (!g_strncasecmp(c, "/me ", 4)) {
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
463 sprintf(c, "%s", c + 4);
415
a266fd221c3c [gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
464 return TRUE;
a266fd221c3c [gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
465 } else
a266fd221c3c [gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
466 return FALSE;
a266fd221c3c [gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
467 }
a266fd221c3c [gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
468
1764
1e0613d9526b [gaim-migrate @ 1774]
Rob Flynn <gaim@robflynn.com>
parents: 1757
diff changeset
469 void chat_write(struct conversation *b, char *who, int flag, char *message, time_t mtime)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
470 {
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
471 GList *ignore = b->ignored;
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 457
diff changeset
472 char *str;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
473
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 457
diff changeset
474 if (!b->is_chat) {
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
475 debug_printf("chat_write: expecting chat, got IM\n");
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 457
diff changeset
476 return;
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 457
diff changeset
477 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
478
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
479 while (ignore) {
2048
3366311426df [gaim-migrate @ 2058]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2017
diff changeset
480 if (!g_strcasecmp(who, ignore->data))
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
481 return;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
482 ignore = ignore->next;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
483 }
371
9d22acf6db73 [gaim-migrate @ 381]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 368
diff changeset
484
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
485
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
486 if (!(flag & WFLAG_WHISPER)) {
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 457
diff changeset
487 str = g_strdup(normalize(who));
2048
3366311426df [gaim-migrate @ 2058]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2017
diff changeset
488 if (!g_strcasecmp(str, normalize(b->gc->username))) {
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
489 debug_printf("%s %s\n", normalize(who), normalize(b->gc->username));
1006
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1000
diff changeset
490 if (b->makesound && (sound_options & OPT_SOUND_CHAT_YOU_SAY))
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1000
diff changeset
491 play_sound(CHAT_YOU_SAY);
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 457
diff changeset
492 flag |= WFLAG_SEND;
371
9d22acf6db73 [gaim-migrate @ 381]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 368
diff changeset
493 } else {
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 457
diff changeset
494 if (b->makesound && (sound_options & OPT_SOUND_CHAT_SAY))
1006
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1000
diff changeset
495 play_sound(CHAT_SAY);
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 457
diff changeset
496 flag |= WFLAG_RECV;
371
9d22acf6db73 [gaim-migrate @ 381]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 368
diff changeset
497 }
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 457
diff changeset
498 g_free(str);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
499 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
500
1764
1e0613d9526b [gaim-migrate @ 1774]
Rob Flynn <gaim@robflynn.com>
parents: 1757
diff changeset
501 write_to_conv(b, message, flag, who, mtime);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
502 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
503
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
504
368
9bf1f77985d2 [gaim-migrate @ 378]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 363
diff changeset
505
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 457
diff changeset
506 void whisper_callback(GtkWidget *widget, struct conversation *b)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
507 {
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
508 char buf[BUF_LEN * 4];
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
509 char buf2[BUF_LONG];
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
510 GList *selected;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
511 char *who;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
512
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
513 strncpy(buf, gtk_editable_get_chars(GTK_EDITABLE(b->entry), 0, -1), sizeof(buf) / 2);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
514 if (!strlen(buf))
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
515 return;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
516
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
517 selected = GTK_LIST(b->list)->selection;
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 if (!selected)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
520 return;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
521
1
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 who = GTK_LABEL(gtk_container_children(GTK_CONTAINER(selected->data))->data)->label;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
524
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
525 if (!who)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
526 return;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
527
338
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 300
diff changeset
528 gtk_editable_delete_text(GTK_EDITABLE(b->entry), 0, -1);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
529
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
530 escape_text(buf); /* it's ok to leave this here because oscar can't whisper */
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
531 serv_chat_whisper(b->gc, b->id, who, buf);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
532
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
533 g_snprintf(buf2, sizeof(buf2), "%s->%s", b->gc->username, who);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
534
1764
1e0613d9526b [gaim-migrate @ 1774]
Rob Flynn <gaim@robflynn.com>
parents: 1757
diff changeset
535 chat_write(b, buf2, WFLAG_WHISPER, buf, time((time_t)NULL));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
536
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
537 gtk_widget_grab_focus(GTK_WIDGET(b->entry));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
538
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
1920
5bed3bc833b5 [gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1898
diff changeset
542 void topic_callback(GtkWidget *widget, struct conversation *b) {
5bed3bc833b5 [gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1898
diff changeset
543 char *buf = gtk_entry_get_text(GTK_ENTRY(widget));;
5bed3bc833b5 [gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1898
diff changeset
544
5bed3bc833b5 [gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1898
diff changeset
545 serv_chat_set_topic(b->gc, b->id, buf);
5bed3bc833b5 [gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1898
diff changeset
546
5bed3bc833b5 [gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1898
diff changeset
547 g_free(buf);
5bed3bc833b5 [gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1898
diff changeset
548 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
549
1223
96ab3e7b7035 [gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1211
diff changeset
550 static gint insertname(gconstpointer one, gconstpointer two)
96ab3e7b7035 [gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1211
diff changeset
551 {
96ab3e7b7035 [gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1211
diff changeset
552 const char *a = (const char *)one;
96ab3e7b7035 [gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1211
diff changeset
553 const char *b = (const char *)two;
96ab3e7b7035 [gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1211
diff changeset
554
96ab3e7b7035 [gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1211
diff changeset
555 if (*a == '@') {
96ab3e7b7035 [gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1211
diff changeset
556 if (*b != '@')
96ab3e7b7035 [gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1211
diff changeset
557 return -1;
96ab3e7b7035 [gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1211
diff changeset
558 return (strcmp(a + 1, b + 1));
96ab3e7b7035 [gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1211
diff changeset
559 } else if (*a == '+') {
96ab3e7b7035 [gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1211
diff changeset
560 if (*b == '@')
96ab3e7b7035 [gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1211
diff changeset
561 return 1;
96ab3e7b7035 [gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1211
diff changeset
562 if (*b != '+')
96ab3e7b7035 [gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1211
diff changeset
563 return -1;
96ab3e7b7035 [gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1211
diff changeset
564 return (strcmp(a + 1, b + 1));
96ab3e7b7035 [gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1211
diff changeset
565 } else {
96ab3e7b7035 [gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1211
diff changeset
566 if (*b == '@' || *b == '+')
96ab3e7b7035 [gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1211
diff changeset
567 return 1;
96ab3e7b7035 [gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1211
diff changeset
568 return strcmp(a, b);
96ab3e7b7035 [gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1211
diff changeset
569 }
96ab3e7b7035 [gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1211
diff changeset
570 }
96ab3e7b7035 [gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1211
diff changeset
571
1398
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
572 static void chat_press_im(GtkObject *obj, struct conversation *b)
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
573 {
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
574 struct conversation *c;
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
575
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
576 c = find_conversation(gtk_object_get_user_data(obj));
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
577
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
578 if (c != NULL)
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
579 gdk_window_show(c->window->window);
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
580 else {
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
581 c = new_conversation(gtk_object_get_user_data(obj));
1898
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1860
diff changeset
582 set_convo_gc(c, b->gc);
1398
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
583 }
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
584 }
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
585
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
586 static void chat_press_ign(GtkWidget *obj, struct conversation *b)
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
587 {
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
588 gtk_list_select_child(GTK_LIST(b->list), gtk_object_get_user_data(GTK_OBJECT(obj)));
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
589 ignore_callback(obj, b);
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
590 }
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
591
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
592 static void chat_press_info(GtkObject *obj, struct conversation *b)
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
593 {
2208
9b3262a2f7c4 [gaim-migrate @ 2218]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2205
diff changeset
594 if (b->gc)
9b3262a2f7c4 [gaim-migrate @ 2218]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2205
diff changeset
595 (*b->gc->prpl->get_info)(b->gc, gtk_object_get_user_data(obj));
1398
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
596 }
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
597
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
598 static gint right_click_chat(GtkObject *obj, GdkEventButton *event, struct conversation *b)
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
599 {
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
600 if (event->button == 3 && event->type == GDK_BUTTON_PRESS) {
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
601 GtkWidget *menu;
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
602 GtkWidget *button;
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
603
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
604 menu = gtk_menu_new();
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
605
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
606 button = gtk_menu_item_new_with_label(_("IM"));
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
607 gtk_signal_connect(GTK_OBJECT(button), "activate", GTK_SIGNAL_FUNC(chat_press_im), b);
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
608 gtk_object_set_user_data(GTK_OBJECT(button), gtk_object_get_user_data(obj));
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
609 gtk_menu_append(GTK_MENU(menu), button);
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
610 gtk_widget_show(button);
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
611
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
612 button = gtk_menu_item_new_with_label(_("Ignore"));
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
613 gtk_signal_connect(GTK_OBJECT(button), "activate", GTK_SIGNAL_FUNC(chat_press_ign), b);
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
614 gtk_object_set_user_data(GTK_OBJECT(button), obj);
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
615 gtk_menu_append(GTK_MENU(menu), button);
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
616 gtk_widget_show(button);
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
617
2208
9b3262a2f7c4 [gaim-migrate @ 2218]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2205
diff changeset
618 if (b->gc && b->gc->prpl->get_info) {
1398
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
619 button = gtk_menu_item_new_with_label(_("Info"));
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
620 gtk_signal_connect(GTK_OBJECT(button), "activate",
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
621 GTK_SIGNAL_FUNC(chat_press_info), b);
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
622 gtk_object_set_user_data(GTK_OBJECT(button), gtk_object_get_user_data(obj));
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
623 gtk_menu_append(GTK_MENU(menu), button);
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
624 gtk_widget_show(button);
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
625 }
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
626
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
627 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, event->button, event->time);
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
628 return TRUE;
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
629 }
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
630 return TRUE;
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
631 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
632
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 457
diff changeset
633 void add_chat_buddy(struct conversation *b, char *buddy)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
634 {
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
635 char *name = g_strdup(buddy);
612
12bb64b42ad1 [gaim-migrate @ 622]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 604
diff changeset
636 char tmp[BUF_LONG];
1053
864f4aae0b60 [gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
637 GtkWidget *list_item;
1223
96ab3e7b7035 [gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1211
diff changeset
638 int pos;
1303
9c34f99af79e [gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
639 GList *ignored;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
640
1000
91b7377e7b45 [gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 964
diff changeset
641 plugin_event(event_chat_buddy_join, b->gc, b->name, name, 0);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
642 b->in_room = g_list_insert_sorted(b->in_room, name, insertname);
1223
96ab3e7b7035 [gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1211
diff changeset
643 pos = g_list_index(b->in_room, name);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
644
1303
9c34f99af79e [gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
645 ignored = b->ignored;
9c34f99af79e [gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
646 while (ignored) {
2048
3366311426df [gaim-migrate @ 2058]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2017
diff changeset
647 if (!g_strcasecmp(name, ignored->data))
1303
9c34f99af79e [gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
648 break;
9c34f99af79e [gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
649 ignored = ignored->next;
9c34f99af79e [gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
650 }
9c34f99af79e [gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
651
9c34f99af79e [gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
652 if (ignored) {
9c34f99af79e [gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
653 g_snprintf(tmp, sizeof(tmp), "X %s", name);
9c34f99af79e [gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
654 list_item = gtk_list_item_new_with_label(tmp);
9c34f99af79e [gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
655 } else
9c34f99af79e [gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
656 list_item = gtk_list_item_new_with_label(name);
9c34f99af79e [gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
657
1053
864f4aae0b60 [gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
658 gtk_object_set_user_data(GTK_OBJECT(list_item), name);
1398
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
659 gtk_signal_connect(GTK_OBJECT(list_item), "button_press_event",
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1390
diff changeset
660 GTK_SIGNAL_FUNC(right_click_chat), b);
1223
96ab3e7b7035 [gaim-migrate @ 1233]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1211
diff changeset
661 gtk_list_insert_items(GTK_LIST(b->list), g_list_append(NULL, list_item), pos);
1053
864f4aae0b60 [gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
662 gtk_widget_show(list_item);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
663
1390
a437240b9771 [gaim-migrate @ 1400]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1389
diff changeset
664 g_snprintf(tmp, sizeof(tmp), _("%d %s in room"), g_list_length(b->in_room), g_list_length(b->in_room) == 1 ? "person" : "people");
1201
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
665 gtk_label_set_text(GTK_LABEL(b->count), tmp);
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
666
371
9d22acf6db73 [gaim-migrate @ 381]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 368
diff changeset
667 if (b->makesound && (sound_options & OPT_SOUND_CHAT_JOIN))
1006
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1000
diff changeset
668 play_sound(CHAT_JOIN);
612
12bb64b42ad1 [gaim-migrate @ 622]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 604
diff changeset
669
12bb64b42ad1 [gaim-migrate @ 622]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 604
diff changeset
670 if (display_options & OPT_DISP_CHAT_LOGON) {
1735
00f74db70f2d [gaim-migrate @ 1745]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1732
diff changeset
671 g_snprintf(tmp, sizeof(tmp), _("%s entered the room."), name);
1764
1e0613d9526b [gaim-migrate @ 1774]
Rob Flynn <gaim@robflynn.com>
parents: 1757
diff changeset
672 write_to_conv(b, tmp, WFLAG_SYSTEM, NULL, time((time_t)NULL));
612
12bb64b42ad1 [gaim-migrate @ 622]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 604
diff changeset
673 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
674 }
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
1504
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
677 void rename_chat_buddy(struct conversation *b, char *old, char *new)
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
678 {
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
679 GList *names = b->in_room;
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
680 GList *items = GTK_LIST(b->list)->children;
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
681
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
682 char *name = g_strdup(new);
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
683 GtkWidget *list_item;
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
684 int pos;
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
685 GList *ignored = b->ignored;
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
686
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
687 char tmp[BUF_LONG];
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
688
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
689 while (names) {
2048
3366311426df [gaim-migrate @ 2058]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2017
diff changeset
690 if (!g_strcasecmp((char *)names->data, old)) {
1504
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
691 char *tmp2 = names->data;
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
692 b->in_room = g_list_remove(b->in_room, names->data);
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
693 while (items) {
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
694 if (tmp2 == gtk_object_get_user_data(items->data)) {
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
695 gtk_list_remove_items(GTK_LIST(b->list),
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
696 g_list_append(NULL, items->data));
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
697 break;
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
698 }
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
699 items = items->next;
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
700 }
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
701 g_free(tmp2);
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
702 break;
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
703 }
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
704 names = names->next;
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
705 }
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
706
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
707 if (!names)
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
708 return;
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
709
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
710 b->in_room = g_list_insert_sorted(b->in_room, name, insertname);
1505
171c64f70b66 [gaim-migrate @ 1515]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1504
diff changeset
711 pos = g_list_index(b->in_room, name);
1504
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
712
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
713 while (ignored) {
2048
3366311426df [gaim-migrate @ 2058]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2017
diff changeset
714 if (!g_strcasecmp(old, ignored->data))
1504
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
715 break;
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
716 ignored = ignored->next;
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
717 }
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
718
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
719 if (ignored) {
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
720 b->ignored = g_list_remove(b->ignored, ignored->data);
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
721 b->ignored = g_list_append(b->ignored, name);
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
722 g_snprintf(tmp, sizeof(tmp), "X %s", name);
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
723 list_item = gtk_list_item_new_with_label(tmp);
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
724 } else
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
725 list_item = gtk_list_item_new_with_label(name);
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
726
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
727 gtk_object_set_user_data(GTK_OBJECT(list_item), name);
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
728 gtk_signal_connect(GTK_OBJECT(list_item), "button_press_event",
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
729 GTK_SIGNAL_FUNC(right_click_chat), b);
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
730 gtk_list_insert_items(GTK_LIST(b->list), g_list_append(NULL, list_item), pos);
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
731 gtk_widget_show(list_item);
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
732
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
733 if (display_options & OPT_DISP_CHAT_LOGON) {
1735
00f74db70f2d [gaim-migrate @ 1745]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1732
diff changeset
734 g_snprintf(tmp, sizeof(tmp), _("%s is now known as %s"), old, new);
1764
1e0613d9526b [gaim-migrate @ 1774]
Rob Flynn <gaim@robflynn.com>
parents: 1757
diff changeset
735 write_to_conv(b, tmp, WFLAG_SYSTEM, NULL, time((time_t)NULL));
1504
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
736 }
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
737 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
738
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
739
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 457
diff changeset
740 void remove_chat_buddy(struct conversation *b, char *buddy)
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
741 {
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
742 GList *names = b->in_room;
1053
864f4aae0b60 [gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
743 GList *items = GTK_LIST(b->list)->children;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
744
612
12bb64b42ad1 [gaim-migrate @ 622]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 604
diff changeset
745 char tmp[BUF_LONG];
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
746
1000
91b7377e7b45 [gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 964
diff changeset
747 plugin_event(event_chat_buddy_leave, b->gc, b->name, buddy, 0);
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 375
diff changeset
748
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
749 while (names) {
2048
3366311426df [gaim-migrate @ 2058]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2017
diff changeset
750 if (!g_strcasecmp((char *)names->data, buddy)) {
1053
864f4aae0b60 [gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
751 char *tmp = names->data;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
752 b->in_room = g_list_remove(b->in_room, names->data);
1053
864f4aae0b60 [gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
753 while (items) {
864f4aae0b60 [gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
754 if (tmp == gtk_object_get_user_data(items->data)) {
864f4aae0b60 [gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
755 gtk_list_remove_items(GTK_LIST(b->list),
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
756 g_list_append(NULL, items->data));
1053
864f4aae0b60 [gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
757 break;
864f4aae0b60 [gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
758 }
864f4aae0b60 [gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
759 items = items->next;
864f4aae0b60 [gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
760 }
864f4aae0b60 [gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
761 g_free(tmp);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
762 break;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
763 }
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
764 names = names->next;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
765 }
371
9d22acf6db73 [gaim-migrate @ 381]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 368
diff changeset
766
1504
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
767 if (!names)
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
768 return;
cac3efeb4d9c [gaim-migrate @ 1514]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
769
1390
a437240b9771 [gaim-migrate @ 1400]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1389
diff changeset
770 g_snprintf(tmp, sizeof(tmp), _("%d %s in room"), g_list_length(b->in_room), g_list_length(b->in_room) == 1 ? "person" : "people");
1201
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
771 gtk_label_set_text(GTK_LABEL(b->count), tmp);
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
772
1006
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1000
diff changeset
773 if (b->makesound && (sound_options & OPT_SOUND_CHAT_PART))
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1000
diff changeset
774 play_sound(CHAT_LEAVE);
612
12bb64b42ad1 [gaim-migrate @ 622]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 604
diff changeset
775
12bb64b42ad1 [gaim-migrate @ 622]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 604
diff changeset
776 if (display_options & OPT_DISP_CHAT_LOGON) {
1735
00f74db70f2d [gaim-migrate @ 1745]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1732
diff changeset
777 g_snprintf(tmp, sizeof(tmp), _("%s left the room."), buddy);
1764
1e0613d9526b [gaim-migrate @ 1774]
Rob Flynn <gaim@robflynn.com>
parents: 1757
diff changeset
778 write_to_conv(b, tmp, WFLAG_SYSTEM, NULL, time((time_t)NULL));
612
12bb64b42ad1 [gaim-migrate @ 622]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 604
diff changeset
779 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
780 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
781
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
782
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 457
diff changeset
783 void im_callback(GtkWidget *w, struct conversation *b)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
784 {
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
785 char *name;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
786 GList *i;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
787 struct conversation *c;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
788
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
789 i = GTK_LIST(b->list)->selection;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
790 if (i)
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
791 name = (char *)gtk_object_get_user_data(GTK_OBJECT(i->data));
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
792 else
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
793 return;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
794
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
795 c = find_conversation(name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
796
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
797 if (c != NULL) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
798 gdk_window_raise(c->window->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
799 } else {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
800 c = new_conversation(name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
801 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
802
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
803
1
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
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 457
diff changeset
806 void ignore_callback(GtkWidget *w, struct conversation *b)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
807 {
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
808 char *name;
1303
9c34f99af79e [gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
809 GList *i, *ignored;
1053
864f4aae0b60 [gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
810 int pos;
864f4aae0b60 [gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
811 GtkWidget *list_item;
864f4aae0b60 [gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
812 char tmp[80];
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
813
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
814 i = GTK_LIST(b->list)->selection;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
815 if (i)
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
816 name = (char *)gtk_object_get_user_data(GTK_OBJECT(i->data));
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
817 else
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
818 return;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
819
1053
864f4aae0b60 [gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
820 pos = gtk_list_child_position(GTK_LIST(b->list), i->data);
864f4aae0b60 [gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
821
1303
9c34f99af79e [gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
822 ignored = b->ignored;
9c34f99af79e [gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
823 while (ignored) {
2048
3366311426df [gaim-migrate @ 2058]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2017
diff changeset
824 if (!g_strcasecmp(name, ignored->data))
1303
9c34f99af79e [gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
825 break;
9c34f99af79e [gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
826 ignored = ignored->next;
9c34f99af79e [gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
827 }
9c34f99af79e [gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
828
9c34f99af79e [gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
829 if (ignored) {
9c34f99af79e [gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
830 b->ignored = g_list_remove(b->ignored, ignored->data);
9c34f99af79e [gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
831 g_snprintf(tmp, sizeof tmp, "%s", name);
9c34f99af79e [gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
832 } else {
9c34f99af79e [gaim-migrate @ 1313]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
833 b->ignored = g_list_append(b->ignored, g_strdup(name));
1053
864f4aae0b60 [gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
834 g_snprintf(tmp, sizeof tmp, "X %s", name);
864f4aae0b60 [gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
835 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
836
1053
864f4aae0b60 [gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
837 list_item = gtk_list_item_new_with_label(tmp);
864f4aae0b60 [gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
838 gtk_object_set_user_data(GTK_OBJECT(list_item), name);
864f4aae0b60 [gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
839 gtk_list_insert_items(GTK_LIST(b->list), g_list_append(NULL, list_item), pos);
864f4aae0b60 [gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
840 gtk_widget_destroy(i->data);
864f4aae0b60 [gaim-migrate @ 1063]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
841 gtk_widget_show(list_item);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
842 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
843
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
844 static gint delete_all_chats(GtkWidget *w, GdkEventAny *e, gpointer d)
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
845 {
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
846 while (chats) {
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
847 struct conversation *c = chats->data;
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
848 close_callback(c->close, c);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
849 }
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
850 return FALSE;
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
851 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
852
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
853 static void chat_switch(GtkNotebook *notebook, GtkWidget *page, gint page_num, gpointer data)
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
854 {
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
855 GtkWidget *label = gtk_notebook_get_tab_label(GTK_NOTEBOOK(chat_notebook),
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
856 gtk_notebook_get_nth_page(GTK_NOTEBOOK(chat_notebook), page_num));
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
857 GtkStyle *style;
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
858 struct conversation *b = g_list_nth_data(chats, page_num);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
859 if (b && b->window && b->entry)
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
860 gtk_window_set_focus(GTK_WINDOW(b->window), b->entry);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
861 if (!GTK_WIDGET_REALIZED(label))
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
862 return;
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
863 style = gtk_style_new();
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
864 gdk_font_unref(style->font);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
865 style->font = gdk_font_ref(label->style->font);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
866 gtk_widget_set_style(label, style);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
867 gtk_style_unref(style);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
868 b->unseen = FALSE;
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
869 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
870
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 457
diff changeset
871 void show_new_buddy_chat(struct conversation *b)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
872 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
873 GtkWidget *win;
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
874 GtkWidget *cont;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
875 GtkWidget *text;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
876 GtkWidget *send;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
877 GtkWidget *list;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
878 GtkWidget *invite_btn;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
879 GtkWidget *whisper;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
880 GtkWidget *close;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
881 GtkWidget *chatentry;
1201
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
882 GtkWidget *lbox;
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
883 GtkWidget *bbox;
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
884 GtkWidget *bbox2;
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
885 GtkWidget *im, *ignore, *info;
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
886 GtkWidget *sw;
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
887 GtkWidget *sw2;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
888 GtkWidget *vbox;
223
ac05dfb9e762 [gaim-migrate @ 233]
Syd Logan <slogan>
parents: 199
diff changeset
889 GtkWidget *vpaned;
ac05dfb9e762 [gaim-migrate @ 233]
Syd Logan <slogan>
parents: 199
diff changeset
890 GtkWidget *hpaned;
344
2434adbb8703 [gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 338
diff changeset
891 GtkWidget *toolbar;
1380
638af9a58e39 [gaim-migrate @ 1390]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1358
diff changeset
892 char buf[BUF_LONG];
844
fae1d64b0278 [gaim-migrate @ 854]
Rob Flynn <gaim@robflynn.com>
parents: 834
diff changeset
893
1201
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
894 int dispstyle = set_dispstyle(1);
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
895
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
896 if (display_options & OPT_DISP_ONE_CHAT_WINDOW) {
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
897 if (!all_chats) {
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
898 win = all_chats = b->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
899 gtk_window_set_wmclass(GTK_WINDOW(win), "buddy_chat", "Gaim");
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
900 gtk_window_set_policy(GTK_WINDOW(win), TRUE, TRUE, TRUE);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
901 gtk_container_border_width(GTK_CONTAINER(win), 0);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
902 gtk_widget_realize(win);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
903 aol_icon(win->window);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
904 gtk_window_set_title(GTK_WINDOW(win), _("Gaim - Group Chats"));
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
905 gtk_signal_connect(GTK_OBJECT(win), "delete_event",
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
906 GTK_SIGNAL_FUNC(delete_all_chats), NULL);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
907
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
908 chat_notebook = gtk_notebook_new();
1757
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
909 if (display_options & OPT_DISP_CHAT_SIDE_TAB) {
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
910 if (display_options & OPT_DISP_CHAT_BR_TAB) {
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
911 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook),
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
912 GTK_POS_RIGHT);
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
913 } else {
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
914 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook),
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
915 GTK_POS_LEFT);
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
916 }
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
917 } else {
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
918 if (display_options & OPT_DISP_CHAT_BR_TAB) {
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
919 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook),
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
920 GTK_POS_BOTTOM);
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
921 } else {
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
922 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook),
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
923 GTK_POS_TOP);
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
924 }
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
925 }
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
926 gtk_notebook_set_scrollable(GTK_NOTEBOOK(chat_notebook), TRUE);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
927 gtk_notebook_popup_enable(GTK_NOTEBOOK(chat_notebook));
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
928 gtk_container_add(GTK_CONTAINER(win), chat_notebook);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
929 gtk_signal_connect(GTK_OBJECT(chat_notebook), "switch-page",
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
930 GTK_SIGNAL_FUNC(chat_switch), NULL);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
931 gtk_widget_show(chat_notebook);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
932 } else
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
933 win = b->window = all_chats;
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
934
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
935 cont = gtk_vbox_new(FALSE, 5);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
936 gtk_container_set_border_width(GTK_CONTAINER(cont), 5);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
937 gtk_notebook_append_page(GTK_NOTEBOOK(chat_notebook), cont, gtk_label_new(b->name));
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
938 gtk_widget_show(cont);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
939 } else {
1920
5bed3bc833b5 [gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1898
diff changeset
940 win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
941 b->window = win;
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
942 gtk_object_set_user_data(GTK_OBJECT(win), b);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
943 gtk_window_set_wmclass(GTK_WINDOW(win), "buddy_chat", "Gaim");
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
944 gtk_window_set_policy(GTK_WINDOW(win), TRUE, TRUE, TRUE);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
945 gtk_container_border_width(GTK_CONTAINER(win), 10);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
946 gtk_widget_realize(win);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
947 aol_icon(win->window);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
948 g_snprintf(buf, sizeof(buf), "Gaim - %s (chat)", b->name);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
949 gtk_window_set_title(GTK_WINDOW(win), buf);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
950 gtk_signal_connect(GTK_OBJECT(win), "destroy", GTK_SIGNAL_FUNC(close_callback), b);
1920
5bed3bc833b5 [gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1898
diff changeset
951
5bed3bc833b5 [gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1898
diff changeset
952 cont = gtk_vbox_new(FALSE,5);
5bed3bc833b5 [gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1898
diff changeset
953 gtk_container_add(GTK_CONTAINER(win), cont);
5bed3bc833b5 [gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1898
diff changeset
954 gtk_widget_show(cont);
5bed3bc833b5 [gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1898
diff changeset
955 }
5bed3bc833b5 [gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1898
diff changeset
956
5bed3bc833b5 [gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1898
diff changeset
957 if (b->gc->prpl->options & OPT_PROTO_CHAT_TOPIC) {
5bed3bc833b5 [gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1898
diff changeset
958 GtkWidget *hbox;
5bed3bc833b5 [gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1898
diff changeset
959 GtkWidget *label;
5bed3bc833b5 [gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1898
diff changeset
960
5bed3bc833b5 [gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1898
diff changeset
961 hbox = gtk_hbox_new(FALSE, 0);
5bed3bc833b5 [gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1898
diff changeset
962 gtk_box_pack_start(GTK_BOX(cont), hbox, FALSE, FALSE, 5);
5bed3bc833b5 [gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1898
diff changeset
963 gtk_widget_show(hbox);
5bed3bc833b5 [gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1898
diff changeset
964
5bed3bc833b5 [gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1898
diff changeset
965 label = gtk_label_new(_("Topic:"));
5bed3bc833b5 [gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1898
diff changeset
966 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
5bed3bc833b5 [gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1898
diff changeset
967 gtk_widget_show(label);
5bed3bc833b5 [gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1898
diff changeset
968
5bed3bc833b5 [gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1898
diff changeset
969 b->topic_text = gtk_entry_new();
5bed3bc833b5 [gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1898
diff changeset
970 gtk_signal_connect(GTK_OBJECT(b->topic_text), "activate",
5bed3bc833b5 [gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1898
diff changeset
971 GTK_SIGNAL_FUNC(topic_callback), b);
5bed3bc833b5 [gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1898
diff changeset
972 gtk_box_pack_start(GTK_BOX(hbox), b->topic_text, TRUE, TRUE, 5);
5bed3bc833b5 [gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1898
diff changeset
973 gtk_widget_show(b->topic_text);
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
974 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
975
223
ac05dfb9e762 [gaim-migrate @ 233]
Syd Logan <slogan>
parents: 199
diff changeset
976 vpaned = gtk_vpaned_new();
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
977 gtk_paned_set_gutter_size(GTK_PANED(vpaned), 15);
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
978 gtk_container_add(GTK_CONTAINER(cont), vpaned);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
979 gtk_widget_show(vpaned);
223
ac05dfb9e762 [gaim-migrate @ 233]
Syd Logan <slogan>
parents: 199
diff changeset
980
1201
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
981 hpaned = gtk_hpaned_new();
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
982 gtk_paned_set_gutter_size(GTK_PANED(hpaned), 15);
1201
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
983 gtk_paned_pack1(GTK_PANED(vpaned), hpaned, TRUE, FALSE);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
984 gtk_widget_show(hpaned);
26
b9e90a914e20 [gaim-migrate @ 35]
Rob Flynn <gaim@robflynn.com>
parents: 21
diff changeset
985
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
986 sw = gtk_scrolled_window_new(NULL, NULL);
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
987 b->sw = sw;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
988 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
1201
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
989 gtk_paned_pack1(GTK_PANED(hpaned), sw, TRUE, TRUE);
1813
998a6a032874 [gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1807
diff changeset
990 gtk_widget_set_usize(sw, buddy_chat_size.width, buddy_chat_size.height);
1201
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
991 gtk_widget_show(sw);
834
bac7089491c1 [gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 823
diff changeset
992
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1398
diff changeset
993 text = gtk_imhtml_new(NULL, NULL);
1201
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
994 b->text = text;
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
995 gtk_container_add(GTK_CONTAINER(sw), text);
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1398
diff changeset
996 GTK_LAYOUT(text)->hadjustment->step_increment = 10.0;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1398
diff changeset
997 GTK_LAYOUT(text)->vadjustment->step_increment = 10.0;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1398
diff changeset
998 if (display_options & OPT_DISP_SHOW_TIME)
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1398
diff changeset
999 gtk_imhtml_show_comments(GTK_IMHTML(text), TRUE);
1815
f15d449b3167 [gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1813
diff changeset
1000 gaim_setup_imhtml(text);
1201
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1001 gtk_widget_show(text);
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1002
1228
6773043cf9f6 [gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1227
diff changeset
1003 lbox = gtk_vbox_new(FALSE, 5);
1201
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1004 gtk_paned_pack2(GTK_PANED(hpaned), lbox, TRUE, TRUE);
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1005 gtk_widget_show(lbox);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1006
1201
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1007 b->count = gtk_label_new(_("0 people in room"));
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1008 gtk_box_pack_start(GTK_BOX(lbox), b->count, FALSE, FALSE, 0);
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1009 gtk_widget_show(b->count);
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1010
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1011 sw2 = gtk_scrolled_window_new(NULL, NULL);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1012 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw2), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
1201
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1013 gtk_box_pack_start(GTK_BOX(lbox), sw2, TRUE, TRUE, 0);
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1014 gtk_widget_show(sw2);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1015
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1016 list = gtk_list_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1017 b->list = list;
1201
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1018 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw2), list);
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1019 gtk_widget_set_usize(list, 150, -1);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1020 gtk_widget_show(list);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1021
1228
6773043cf9f6 [gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1227
diff changeset
1022 bbox2 = gtk_hbox_new(TRUE, 5);
6773043cf9f6 [gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1227
diff changeset
1023 gtk_box_pack_start(GTK_BOX(lbox), bbox2, FALSE, FALSE, 0);
1201
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1024 gtk_widget_show(bbox2);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1025
1201
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1026 im = picture_button2(win, _("IM"), tmp_send_xpm, FALSE);
1228
6773043cf9f6 [gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1227
diff changeset
1027 gtk_box_pack_start(GTK_BOX(bbox2), im, dispstyle, dispstyle, 0);
1201
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1028 gtk_signal_connect(GTK_OBJECT(im), "clicked", GTK_SIGNAL_FUNC(im_callback), b);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1029
1201
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1030 ignore = picture_button2(win, _("Ignore"), close_xpm, FALSE);
1228
6773043cf9f6 [gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1227
diff changeset
1031 gtk_box_pack_start(GTK_BOX(bbox2), ignore, dispstyle, dispstyle, 0);
1201
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1032 gtk_signal_connect(GTK_OBJECT(ignore), "clicked", GTK_SIGNAL_FUNC(ignore_callback), b);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1033
1201
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1034 info = picture_button2(win, _("Info"), tb_search_xpm, FALSE);
1228
6773043cf9f6 [gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1227
diff changeset
1035 gtk_box_pack_start(GTK_BOX(bbox2), info, dispstyle, dispstyle, 0);
1201
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1036 gtk_signal_connect(GTK_OBJECT(info), "clicked", GTK_SIGNAL_FUNC(info_callback), b);
1343
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1303
diff changeset
1037 b->info = info;
844
fae1d64b0278 [gaim-migrate @ 854]
Rob Flynn <gaim@robflynn.com>
parents: 834
diff changeset
1038
1228
6773043cf9f6 [gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1227
diff changeset
1039 vbox = gtk_vbox_new(FALSE, 5);
1201
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1040 gtk_paned_pack2(GTK_PANED(vpaned), vbox, TRUE, FALSE);
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1041 gtk_widget_show(vbox);
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1042
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1043 chatentry = gtk_text_new(NULL, NULL);
1227
25611364a504 [gaim-migrate @ 1237]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1223
diff changeset
1044 b->entry = chatentry;
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1045 if (!(display_options & OPT_DISP_ONE_CHAT_WINDOW))
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1046 gtk_window_set_focus(GTK_WINDOW(b->window), b->entry);
1227
25611364a504 [gaim-migrate @ 1237]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1223
diff changeset
1047
1201
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1048 toolbar = build_conv_toolbar(b);
1228
6773043cf9f6 [gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1227
diff changeset
1049 gtk_box_pack_start(GTK_BOX(vbox), toolbar, FALSE, FALSE, 0);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1050
1201
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1051 gtk_object_set_user_data(GTK_OBJECT(chatentry), b);
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1052 gtk_text_set_editable(GTK_TEXT(chatentry), TRUE);
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1053 gtk_text_set_word_wrap(GTK_TEXT(chatentry), TRUE);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1054 gtk_signal_connect(GTK_OBJECT(chatentry), "activate", GTK_SIGNAL_FUNC(send_callback), b);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1055 gtk_signal_connect(GTK_OBJECT(chatentry), "key_press_event", GTK_SIGNAL_FUNC(keypress_callback),
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1056 b);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1057 gtk_signal_connect(GTK_OBJECT(chatentry), "key_press_event", GTK_SIGNAL_FUNC(entry_key_pressed),
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1058 chatentry);
1117
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1109
diff changeset
1059 if (general_options & OPT_GEN_CHECK_SPELLING)
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1109
diff changeset
1060 gtkspell_attach(GTK_TEXT(chatentry));
1228
6773043cf9f6 [gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1227
diff changeset
1061 gtk_box_pack_start(GTK_BOX(vbox), chatentry, TRUE, TRUE, 0);
1813
998a6a032874 [gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1807
diff changeset
1062 gtk_widget_set_usize(chatentry, buddy_chat_size.width, buddy_chat_size.entry_height);
1201
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1063 gtk_window_set_focus(GTK_WINDOW(win), chatentry);
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1064 gtk_widget_show(chatentry);
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1065
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1066 bbox = gtk_hbox_new(FALSE, 5);
1228
6773043cf9f6 [gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1227
diff changeset
1067 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1068 gtk_widget_show(bbox);
1201
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1069
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1070 close = picture_button2(win, _("Close"), cancel_xpm, dispstyle);
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1071 b->close = close;
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1072 gtk_object_set_user_data(GTK_OBJECT(close), b);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1073 gtk_signal_connect(GTK_OBJECT(close), "clicked", GTK_SIGNAL_FUNC(close_callback), b);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1074 gtk_box_pack_end(GTK_BOX(bbox), close, dispstyle, dispstyle, 0);
1201
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1075
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1076 invite_btn = picture_button2(win, _("Invite"), join_xpm, dispstyle);
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1077 b->invite = invite_btn;
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1078 gtk_signal_connect(GTK_OBJECT(invite_btn), "clicked", GTK_SIGNAL_FUNC(invite_callback), b);
1228
6773043cf9f6 [gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1227
diff changeset
1079 gtk_box_pack_end(GTK_BOX(bbox), invite_btn, dispstyle, dispstyle, 0);
1201
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1080
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1081 whisper = picture_button2(win, _("Whisper"), tb_forward_xpm, dispstyle);
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1082 b->whisper = whisper;
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1083 gtk_signal_connect(GTK_OBJECT(whisper), "clicked", GTK_SIGNAL_FUNC(whisper_callback), b);
1228
6773043cf9f6 [gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1227
diff changeset
1084 gtk_box_pack_end(GTK_BOX(bbox), whisper, dispstyle, dispstyle, 0);
1201
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1085
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1086 send = picture_button2(win, _("Send"), tmp_send_xpm, dispstyle);
1201
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1117
diff changeset
1087 b->send = send;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1088 gtk_signal_connect(GTK_OBJECT(send), "clicked", GTK_SIGNAL_FUNC(send_callback), b);
1228
6773043cf9f6 [gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1227
diff changeset
1089 gtk_box_pack_end(GTK_BOX(bbox), send, dispstyle, dispstyle, 0);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1090
716
0995382d0c46 [gaim-migrate @ 726]
Todd Kulesza <fflewddur>
parents: 694
diff changeset
1091 b->font_dialog = NULL;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1092 b->fg_color_dialog = NULL;
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1093 b->bg_color_dialog = NULL;
716
0995382d0c46 [gaim-migrate @ 726]
Todd Kulesza <fflewddur>
parents: 694
diff changeset
1094 b->smiley_dialog = NULL;
0995382d0c46 [gaim-migrate @ 726]
Todd Kulesza <fflewddur>
parents: 694
diff changeset
1095 b->link_dialog = NULL;
0995382d0c46 [gaim-migrate @ 726]
Todd Kulesza <fflewddur>
parents: 694
diff changeset
1096 b->log_dialog = NULL;
0995382d0c46 [gaim-migrate @ 726]
Todd Kulesza <fflewddur>
parents: 694
diff changeset
1097 sprintf(b->fontface, "%s", fontface);
0995382d0c46 [gaim-migrate @ 726]
Todd Kulesza <fflewddur>
parents: 694
diff changeset
1098 b->hasfont = 0;
1441
5c67b8794991 [gaim-migrate @ 1451]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1428
diff changeset
1099 b->fontsize = fontsize;
5c67b8794991 [gaim-migrate @ 1451]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1428
diff changeset
1100 b->hassize = 0;
716
0995382d0c46 [gaim-migrate @ 726]
Todd Kulesza <fflewddur>
parents: 694
diff changeset
1101 b->bgcol = bgcolor;
0995382d0c46 [gaim-migrate @ 726]
Todd Kulesza <fflewddur>
parents: 694
diff changeset
1102 b->hasbg = 0;
0995382d0c46 [gaim-migrate @ 726]
Todd Kulesza <fflewddur>
parents: 694
diff changeset
1103 b->fgcol = fgcolor;
0995382d0c46 [gaim-migrate @ 726]
Todd Kulesza <fflewddur>
parents: 694
diff changeset
1104 b->hasfg = 0;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1105
1343
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1303
diff changeset
1106 update_buttons_by_protocol(b);
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1303
diff changeset
1107
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1108 gtk_widget_show(win);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1109 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1110
2017
eee309c0de93 [gaim-migrate @ 2027]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1924
diff changeset
1111 void chat_set_topic(struct conversation *b, char* who, char* topic)
eee309c0de93 [gaim-migrate @ 2027]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1924
diff changeset
1112 {
1920
5bed3bc833b5 [gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1898
diff changeset
1113 gtk_entry_set_text(GTK_ENTRY(b->topic_text), topic);
5bed3bc833b5 [gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1898
diff changeset
1114 }
5bed3bc833b5 [gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1898
diff changeset
1115
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1116
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1117
2017
eee309c0de93 [gaim-migrate @ 2027]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1924
diff changeset
1118 void delete_chat(struct conversation *b)
eee309c0de93 [gaim-migrate @ 2027]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1924
diff changeset
1119 {
eee309c0de93 [gaim-migrate @ 2027]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1924
diff changeset
1120 while (b->in_room) {
eee309c0de93 [gaim-migrate @ 2027]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1924
diff changeset
1121 g_free(b->in_room->data);
eee309c0de93 [gaim-migrate @ 2027]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1924
diff changeset
1122 b->in_room = g_list_remove(b->in_room, b->in_room->data);
eee309c0de93 [gaim-migrate @ 2027]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1924
diff changeset
1123 }
eee309c0de93 [gaim-migrate @ 2027]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1924
diff changeset
1124 while (b->ignored) {
eee309c0de93 [gaim-migrate @ 2027]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1924
diff changeset
1125 g_free(b->ignored->data);
eee309c0de93 [gaim-migrate @ 2027]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1924
diff changeset
1126 b->ignored = g_list_remove(b->ignored, b->ignored->data);
eee309c0de93 [gaim-migrate @ 2027]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1924
diff changeset
1127 }
eee309c0de93 [gaim-migrate @ 2027]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1924
diff changeset
1128 g_string_free(b->history, TRUE);
eee309c0de93 [gaim-migrate @ 2027]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1924
diff changeset
1129 g_free(b);
eee309c0de93 [gaim-migrate @ 2027]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1924
diff changeset
1130 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1131
915
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 909
diff changeset
1132 static GtkWidget *change_text(GtkWidget *win, char *text, GtkWidget *button, char **xpm, int chat)
834
bac7089491c1 [gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 823
diff changeset
1133 {
915
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 909
diff changeset
1134 int dispstyle = set_dispstyle(chat);
834
bac7089491c1 [gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 823
diff changeset
1135 GtkWidget *parent = button->parent;
bac7089491c1 [gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 823
diff changeset
1136 gtk_widget_destroy(button);
bac7089491c1 [gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 823
diff changeset
1137 button = picture_button2(win, text, xpm, dispstyle);
915
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 909
diff changeset
1138 if (chat == 1)
909
9f2afe5faed5 [gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 907
diff changeset
1139 gtk_box_pack_start(GTK_BOX(parent), button, dispstyle, dispstyle, 5);
9f2afe5faed5 [gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 907
diff changeset
1140 else
9f2afe5faed5 [gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 907
diff changeset
1141 gtk_box_pack_end(GTK_BOX(parent), button, dispstyle, dispstyle, 0);
834
bac7089491c1 [gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 823
diff changeset
1142 gtk_widget_show(button);
bac7089491c1 [gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 823
diff changeset
1143 return button;
bac7089491c1 [gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 823
diff changeset
1144 }
bac7089491c1 [gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 823
diff changeset
1145
bac7089491c1 [gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 823
diff changeset
1146 void update_chat_button_pix()
bac7089491c1 [gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 823
diff changeset
1147 {
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
1148 GSList *C = connections;
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
1149 struct gaim_connection *g;
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
1150
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
1151 while (C) {
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
1152 GSList *bcs;
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
1153 struct conversation *c;
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
1154 int opt = 1;
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
1155 g = (struct gaim_connection *)C->data;
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
1156 bcs = g->buddy_chats;
834
bac7089491c1 [gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 823
diff changeset
1157
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
1158 while (bcs) {
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
1159 c = (struct conversation *)bcs->data;
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
1160 c->send = change_text(c->window, _("Send"), c->send, tmp_send_xpm, opt);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1161 c->whisper =
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1162 change_text(c->window, _("Whisper"), c->whisper, tb_forward_xpm, opt);
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
1163 c->invite = change_text(c->window, _("Invite"), c->invite, join_xpm, opt);
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
1164 c->close = change_text(c->window, _("Close"), c->close, cancel_xpm, opt);
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
1165 gtk_object_set_user_data(GTK_OBJECT(c->close), c);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1166 gtk_signal_connect(GTK_OBJECT(c->close), "clicked",
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1167 GTK_SIGNAL_FUNC(close_callback), c);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1168 gtk_signal_connect(GTK_OBJECT(c->send), "clicked",
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1169 GTK_SIGNAL_FUNC(send_callback), c);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1170 gtk_signal_connect(GTK_OBJECT(c->invite), "clicked",
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1171 GTK_SIGNAL_FUNC(invite_callback), c);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1172 gtk_signal_connect(GTK_OBJECT(c->whisper), "clicked",
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1173 GTK_SIGNAL_FUNC(whisper_callback), c);
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
1174 bcs = bcs->next;
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
1175 }
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
1176 C = C->next;
834
bac7089491c1 [gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 823
diff changeset
1177 }
bac7089491c1 [gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 823
diff changeset
1178 }
909
9f2afe5faed5 [gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 907
diff changeset
1179
9f2afe5faed5 [gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 907
diff changeset
1180 void update_im_button_pix()
9f2afe5faed5 [gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 907
diff changeset
1181 {
9f2afe5faed5 [gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 907
diff changeset
1182 GList *bcs = conversations;
9f2afe5faed5 [gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 907
diff changeset
1183 struct conversation *c;
9f2afe5faed5 [gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 907
diff changeset
1184 GtkWidget *parent;
915
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 909
diff changeset
1185 int opt = 0;
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 909
diff changeset
1186 int dispstyle = set_dispstyle(0);
909
9f2afe5faed5 [gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 907
diff changeset
1187
9f2afe5faed5 [gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 907
diff changeset
1188 while (bcs) {
9f2afe5faed5 [gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 907
diff changeset
1189 c = (struct conversation *)bcs->data;
9f2afe5faed5 [gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 907
diff changeset
1190 parent = c->close->parent;
9f2afe5faed5 [gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 907
diff changeset
1191 c->close = change_text(c->window, _("Close"), c->close, cancel_xpm, opt);
9f2afe5faed5 [gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 907
diff changeset
1192 gtk_box_reorder_child(GTK_BOX(parent), c->close, 0);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1193 gtk_box_set_child_packing(GTK_BOX(parent), c->sep1, dispstyle, dispstyle, 0,
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1194 GTK_PACK_END);
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1018
diff changeset
1195 if (find_buddy(c->gc, c->name) == NULL)
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1196 c->add = change_text(c->window, _("Add"), c->add, gnome_add_xpm, opt);
909
9f2afe5faed5 [gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 907
diff changeset
1197 else
9f2afe5faed5 [gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 907
diff changeset
1198 c->add = change_text(c->window, _("Remove"), c->add, gnome_remove_xpm, opt);
9f2afe5faed5 [gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 907
diff changeset
1199 gtk_box_reorder_child(GTK_BOX(parent), c->add, 2);
9f2afe5faed5 [gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 907
diff changeset
1200 c->block = change_text(c->window, _("Block"), c->block, block_xpm, opt);
9f2afe5faed5 [gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 907
diff changeset
1201 gtk_box_reorder_child(GTK_BOX(parent), c->block, 3);
9f2afe5faed5 [gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 907
diff changeset
1202 c->warn = change_text(c->window, _("Warn"), c->warn, warn_xpm, opt);
9f2afe5faed5 [gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 907
diff changeset
1203 gtk_box_reorder_child(GTK_BOX(parent), c->warn, 4);
9f2afe5faed5 [gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 907
diff changeset
1204 c->info = change_text(c->window, _("Info"), c->info, tb_search_xpm, opt);
9f2afe5faed5 [gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 907
diff changeset
1205 gtk_box_reorder_child(GTK_BOX(parent), c->info, 5);
9f2afe5faed5 [gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 907
diff changeset
1206 c->send = change_text(c->window, _("Send"), c->send, tmp_send_xpm, opt);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1207 gtk_box_set_child_packing(GTK_BOX(parent), c->sep2, dispstyle, dispstyle, 0,
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1208 GTK_PACK_END);
909
9f2afe5faed5 [gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 907
diff changeset
1209 gtk_box_reorder_child(GTK_BOX(parent), c->send, 7);
9f2afe5faed5 [gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 907
diff changeset
1210 gtk_object_set_user_data(GTK_OBJECT(c->close), c);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1211 gtk_signal_connect(GTK_OBJECT(c->close), "clicked", GTK_SIGNAL_FUNC(close_callback), c);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1212 gtk_signal_connect(GTK_OBJECT(c->send), "clicked", GTK_SIGNAL_FUNC(send_callback), c);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1213 gtk_signal_connect(GTK_OBJECT(c->add), "clicked", GTK_SIGNAL_FUNC(add_callback), c);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1214 gtk_signal_connect(GTK_OBJECT(c->info), "clicked", GTK_SIGNAL_FUNC(info_callback), c);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1215 gtk_signal_connect(GTK_OBJECT(c->warn), "clicked", GTK_SIGNAL_FUNC(warn_callback), c);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1235
diff changeset
1216 gtk_signal_connect(GTK_OBJECT(c->block), "clicked", GTK_SIGNAL_FUNC(block_callback), c);
909
9f2afe5faed5 [gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 907
diff changeset
1217 bcs = bcs->next;
9f2afe5faed5 [gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 907
diff changeset
1218 }
9f2afe5faed5 [gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 907
diff changeset
1219 }
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1220
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1221 void chat_tabize()
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1222 {
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1223 /* evil, evil i tell you! evil! */
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1224 if (display_options & OPT_DISP_ONE_CHAT_WINDOW) {
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1225 GList *x = chats;
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1226 while (x) {
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1227 struct conversation *c = x->data;
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1228 GtkWidget *imhtml, *win;
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1229
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1230 imhtml = c->text;
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1231 win = c->window;
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1232 show_new_buddy_chat(c);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1233 gtk_widget_destroy(c->text);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1234 gtk_widget_reparent(imhtml, c->sw);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1235 c->text = imhtml;
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1236 gtk_signal_disconnect_by_func(GTK_OBJECT(win),
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1237 GTK_SIGNAL_FUNC(close_callback), c);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1238 gtk_widget_destroy(win);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1239
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1240 x = x->next;
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1241 }
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1242 } else {
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1243 GList *x, *m;
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1244 x = m = chats;
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1245 chats = NULL;
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1246 while (x) {
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1247 struct conversation *c = x->data;
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1248 GtkWidget *imhtml;
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1249
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1250 imhtml = c->text;
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1251 show_new_buddy_chat(c);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1252 gtk_widget_destroy(c->text);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1253 gtk_widget_reparent(imhtml, c->sw);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1254 c->text = imhtml;
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1255
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1256 x = x->next;
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1257 }
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1258 if (all_chats)
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1259 gtk_widget_destroy(all_chats);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1260 all_chats = NULL;
1757
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
1261 chat_notebook = NULL;
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1262 chats = m;
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1263 }
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1505
diff changeset
1264 }