annotate src/conversation.c @ 2895:63cdece2348d

[gaim-migrate @ 2908] thanks Brian Bernas committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sun, 16 Dec 2001 21:50:36 +0000
parents 58baac124b0d
children 019d7462337b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1 /*
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2 * gaim
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3 *
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
4 * Copyright (C) 1998-1999, Mark Spencer <markster@marko.net>
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
5 *
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
6 * This program is free software; you can redistribute it and/or modify
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
7 * it under the terms of the GNU General Public License as published by
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
8 * the Free Software Foundation; either version 2 of the License, or
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
9 * (at your option) any later version.
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
10 *
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
11 * This program is distributed in the hope that it will be useful,
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
14 * GNU General Public License for more details.
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
15 *
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
16 * You should have received a copy of the GNU General Public License
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
17 * along with this program; if not, write to the Free Software
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
19 *
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
20 */
eb2151d7e88a [gaim-migrate @ 76]
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
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
25 #include <string.h>
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
26 #include <sys/time.h>
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
27 #include <sys/types.h>
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
28 #include <sys/stat.h>
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
29 #include <unistd.h>
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
30 #include <stdio.h>
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
31 #include <stdlib.h>
2123
56c4382f2909 [gaim-migrate @ 2133]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2111
diff changeset
32 #include <errno.h>
210
ec0686b3b03f [gaim-migrate @ 220]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 209
diff changeset
33 #include <ctype.h>
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
34 #include <gtk/gtk.h>
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
35 #include "gtkimhtml.h"
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
36 #include <gdk/gdkkeysyms.h>
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
37 #include "convo.h"
1117
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
38 #include "gtkspell.h"
1235
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1228
diff changeset
39 #include "prpl.h"
337
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
40
604
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
41 #include "pixmaps/bold.xpm"
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
42 #include "pixmaps/italic.xpm"
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
43 #include "pixmaps/underline.xpm"
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
44 #include "pixmaps/strike.xpm"
604
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
45 #include "pixmaps/small.xpm"
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
46 #include "pixmaps/normal.xpm"
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
47 #include "pixmaps/big.xpm"
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
48 #include "pixmaps/fontface.xpm"
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
49 #include "pixmaps/fgcolor.xpm"
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
50 #include "pixmaps/bgcolor.xpm"
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
51 #include "pixmaps/link.xpm"
790
9d5e7e987103 [gaim-migrate @ 800]
Rob Flynn <gaim@robflynn.com>
parents: 780
diff changeset
52 #include "pixmaps/smile_icon.xpm"
604
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
53 #include "pixmaps/wood.xpm"
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
54 #include "pixmaps/save_small.xpm"
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
55 #include "pixmaps/speaker.xpm"
604
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
56
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
57 #include "pixmaps/luke03.xpm"
610
cadb51c068cb [gaim-migrate @ 620]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 608
diff changeset
58 #include "pixmaps/oneeye.xpm"
1732
e5ba877f51f2 [gaim-migrate @ 1742]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1709
diff changeset
59 #include "pixmaps/crazy4.xpm"
1965
cfdb6a9d3af8 [gaim-migrate @ 1975]
Rob Flynn <gaim@robflynn.com>
parents: 1918
diff changeset
60 #include "pixmaps/mrt.xpm"
2426
9e6c9461df3d [gaim-migrate @ 2439]
Rob Flynn <gaim@robflynn.com>
parents: 2421
diff changeset
61 #include "pixmaps/download.xpm"
2874
48123cba5a87 [gaim-migrate @ 2887]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2857
diff changeset
62 #include "pixmaps/farted.xpm"
604
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
63
2460
049822b93239 [gaim-migrate @ 2473]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2449
diff changeset
64 static gchar *ispell_cmd[] = { "ispell", "-a", NULL };
049822b93239 [gaim-migrate @ 2473]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2449
diff changeset
65
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
66 int state_lock = 0;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
67
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
68 GdkPixmap *dark_icon_pm = NULL;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
69 GdkBitmap *dark_icon_bm = NULL;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
70
1608
e19a2cb4190c [gaim-migrate @ 1618]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1597
diff changeset
71 GtkWidget *all_convos = NULL;
2843
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
72 GtkWidget *convo_notebook = NULL;
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
73
2763
477a035d81e5 [gaim-migrate @ 2776]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2761
diff changeset
74 char fontface[128] = { 0 };
477a035d81e5 [gaim-migrate @ 2776]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2761
diff changeset
75 char fontxfld[256] = { 0 };
1441
5c67b8794991 [gaim-migrate @ 1451]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1440
diff changeset
76 int fontsize = 3;
885
db5f5c33e83f [gaim-migrate @ 895]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 876
diff changeset
77 extern GdkColor bgcolor;
db5f5c33e83f [gaim-migrate @ 895]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 876
diff changeset
78 extern GdkColor fgcolor;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
79
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
80 void check_everything(GtkWidget *entry);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
81 gboolean keypress_callback(GtkWidget *entry, GdkEventKey * event, struct conversation *c);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
82
2191
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
83 static void update_icon(struct conversation *);
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
84 static void remove_icon(struct conversation *);
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
85
2231
8c4ff1a368bd [gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2227
diff changeset
86 static void update_checkbox(struct conversation *);
8c4ff1a368bd [gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2227
diff changeset
87 static void remove_checkbox(struct conversation *);
8c4ff1a368bd [gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2227
diff changeset
88
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
89 /*------------------------------------------------------------------------*/
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
90 /* Helpers */
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
91 /*------------------------------------------------------------------------*/
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
92
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
93
1815
f15d449b3167 [gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1813
diff changeset
94 void gaim_setup_imhtml(GtkWidget *imhtml)
1780
d7cbedd1d651 [gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1772
diff changeset
95 {
1815
f15d449b3167 [gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1813
diff changeset
96 g_return_if_fail(imhtml != NULL);
f15d449b3167 [gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1813
diff changeset
97 g_return_if_fail(GTK_IS_IMHTML(imhtml));
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2303
diff changeset
98 if (!(convo_options & OPT_CONVO_SHOW_SMILEY))
1780
d7cbedd1d651 [gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1772
diff changeset
99 gtk_imhtml_show_smileys(GTK_IMHTML(imhtml), FALSE);
2827
51999a36c0b1 [gaim-migrate @ 2840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2802
diff changeset
100 gtk_signal_connect(GTK_OBJECT(imhtml), "url_clicked", GTK_SIGNAL_FUNC(open_url), NULL);
1780
d7cbedd1d651 [gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1772
diff changeset
101 gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), "C:)", luke03_xpm);
d7cbedd1d651 [gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1772
diff changeset
102 gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), "C:-)", luke03_xpm);
d7cbedd1d651 [gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1772
diff changeset
103 gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), "O-)", oneeye_xpm);
d7cbedd1d651 [gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1772
diff changeset
104 gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ">:)", crazy4_xpm);
d7cbedd1d651 [gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1772
diff changeset
105 gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ">:-)", crazy4_xpm);
1965
cfdb6a9d3af8 [gaim-migrate @ 1975]
Rob Flynn <gaim@robflynn.com>
parents: 1918
diff changeset
106 gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ":-o)))", mrt_xpm);
cfdb6a9d3af8 [gaim-migrate @ 1975]
Rob Flynn <gaim@robflynn.com>
parents: 1918
diff changeset
107 gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ":-O)))", mrt_xpm);
2426
9e6c9461df3d [gaim-migrate @ 2439]
Rob Flynn <gaim@robflynn.com>
parents: 2421
diff changeset
108 gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), "8-|)", download_xpm);
2877
403dd881dcc4 [gaim-migrate @ 2890]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2874
diff changeset
109 gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ":-]", farted_xpm);
1780
d7cbedd1d651 [gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1772
diff changeset
110 }
d7cbedd1d651 [gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1772
diff changeset
111
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
112 void quiet_set(GtkWidget *tb, int state)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
113 {
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
114 state_lock = 1;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
115 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(tb), state);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
116 state_lock = 0;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
117 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
118
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
119
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
120 void set_state_lock(int i)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
121 {
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
122 state_lock = i;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
123 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
124
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
125 void toggle_sensitive(GtkWidget *widget, GtkWidget *to_toggle)
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
126 {
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
127 gboolean sensitivity = GTK_WIDGET_IS_SENSITIVE(GTK_WIDGET(to_toggle));
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
128
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
129 if (sensitivity == TRUE)
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
130 gtk_widget_set_sensitive(GTK_WIDGET(to_toggle), FALSE);
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
131 else
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
132 gtk_widget_set_sensitive(GTK_WIDGET(to_toggle), TRUE);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
133
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
134 return;
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
135 }
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
136
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
137 struct conversation *new_conversation(char *name)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
138 {
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
139 struct conversation *c;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
140
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
141 c = find_conversation(name);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
142
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
143 if (c != NULL)
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
144 return c;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
145
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
146 c = (struct conversation *)g_new0(struct conversation, 1);
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
147 g_snprintf(c->name, sizeof(c->name), "%s", name);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
148
1525
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1486
diff changeset
149 if ((logging_options & OPT_LOG_ALL) || find_log_info(c->name)) {
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
150 FILE *fd;
70
dead1eb6d654 [gaim-migrate @ 80]
Rob Flynn <gaim@robflynn.com>
parents: 68
diff changeset
151
373
1d29321843b0 [gaim-migrate @ 383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 363
diff changeset
152 fd = open_log_file(c->name);
2004
699ddd727a49 [gaim-migrate @ 2014]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1970
diff changeset
153 if (fd) {
1525
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1486
diff changeset
154 if (!(logging_options & OPT_LOG_STRIP_HTML))
1437
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
155 fprintf(fd,
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
156 "<HR><BR><H3 Align=Center> ---- New Conversation @ %s ----</H3><BR>\n",
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
157 full_date());
1437
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
158 else
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
159 fprintf(fd, " ---- New Conversation @ %s ----\n", full_date());
1034
1d43fda97960 [gaim-migrate @ 1044]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1032
diff changeset
160 fclose(fd);
1d43fda97960 [gaim-migrate @ 1044]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1032
diff changeset
161 } else
1d43fda97960 [gaim-migrate @ 1044]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1032
diff changeset
162 /* do we want to do something here? */ ;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
163 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
164
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
165 if (connections)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
166 c->gc = (struct gaim_connection *)connections->data;
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
167 c->history = g_string_new("");
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
168 conversations = g_list_append(conversations, c);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
169 show_conv(c);
2191
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
170 update_icon(c);
2231
8c4ff1a368bd [gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2227
diff changeset
171 update_checkbox(c);
1000
91b7377e7b45 [gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
172 plugin_event(event_new_conversation, name, 0, 0, 0);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
173 return c;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
174 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
175
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
176
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
177 struct conversation *find_conversation(char *name)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
178 {
2138
cfa83a1b3d49 [gaim-migrate @ 2148]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2124
diff changeset
179 char *cuser = g_malloc(1024);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
180 struct conversation *c;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
181 GList *cnv = conversations;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
182
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
183 strcpy(cuser, normalize(name));
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
184
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
185 while (cnv) {
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
186 c = (struct conversation *)cnv->data;
2048
3366311426df [gaim-migrate @ 2058]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2017
diff changeset
187 if (!g_strcasecmp(cuser, normalize(c->name))) {
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
188 g_free(cuser);
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
189 return c;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
190 }
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
191 cnv = cnv->next;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
192 }
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
193 g_free(cuser);
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
194 return NULL;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
195 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
196
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
197 /* ---------------------------------------------------
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
198 * Function to remove a log file entry
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
199 * ---------------------------------------------------
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
200 */
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
201
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
202 void rm_log(struct log_conversation *a)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
203 {
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
204 struct conversation *cnv = find_conversation(a->name);
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
205
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
206 log_conversations = g_list_remove(log_conversations, a);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
207
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
208 save_prefs();
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
209
2787
feea7103a235 [gaim-migrate @ 2800]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2773
diff changeset
210 if (cnv && !(im_options & OPT_IM_ONE_WINDOW))
feea7103a235 [gaim-migrate @ 2800]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2773
diff changeset
211 set_convo_title(cnv);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
212 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
213
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
214 struct log_conversation *find_log_info(char *name)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
215 {
2138
cfa83a1b3d49 [gaim-migrate @ 2148]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2124
diff changeset
216 char *pname = g_malloc(1024);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
217 GList *lc = log_conversations;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
218 struct log_conversation *l;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
219
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
220
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
221 strcpy(pname, normalize(name));
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
222
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
223 while (lc) {
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
224 l = (struct log_conversation *)lc->data;
2048
3366311426df [gaim-migrate @ 2058]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2017
diff changeset
225 if (!g_strcasecmp(pname, normalize(l->name))) {
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
226 g_free(pname);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
227 return l;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
228 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
229 lc = lc->next;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
230 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
231 g_free(pname);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
232 return NULL;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
233 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
234
625
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
235 void delete_conversation(struct conversation *c)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
236 {
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
237 conversations = g_list_remove(conversations, c);
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
238 if (c->fg_color_dialog)
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
239 gtk_widget_destroy(c->fg_color_dialog);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
240 if (c->bg_color_dialog)
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
241 gtk_widget_destroy(c->bg_color_dialog);
625
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
242 if (c->font_dialog)
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
243 gtk_widget_destroy(c->font_dialog);
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
244 if (c->smiley_dialog)
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
245 gtk_widget_destroy(c->smiley_dialog);
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
246 if (c->link_dialog)
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
247 gtk_widget_destroy(c->link_dialog);
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
248 if (c->log_dialog)
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
249 gtk_widget_destroy(c->log_dialog);
2502
a452084e1636 [gaim-migrate @ 2515]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2499
diff changeset
250 #if USE_PIXBUF
2499
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
251 if (c->save_icon)
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
252 gtk_widget_destroy(c->save_icon);
2502
a452084e1636 [gaim-migrate @ 2515]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2499
diff changeset
253 #endif
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
254 g_string_free(c->history, TRUE);
625
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
255 g_free(c);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
256 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
257
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
258 void update_log_convs()
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
259 {
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
260 GSList *C = connections;
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
261 struct gaim_connection *g;
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
262 GSList *bcs;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
263 GList *cnv = conversations;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
264 struct conversation *c;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
265
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
266 while (cnv) {
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
267 c = (struct conversation *)cnv->data;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
268
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
269 if (c->log_button)
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
270 gtk_widget_set_sensitive(c->log_button,
1525
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1486
diff changeset
271 ((logging_options & OPT_LOG_ALL)) ? FALSE : TRUE);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
272
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
273 cnv = cnv->next;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
274 }
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
275
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
276 while (C) {
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
277 g = (struct gaim_connection *)C->data;
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
278 bcs = g->buddy_chats;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
279 while (bcs) {
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
280 c = (struct conversation *)bcs->data;
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
281
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
282 if (c->log_button)
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
283 gtk_widget_set_sensitive(c->log_button,
1525
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1486
diff changeset
284 ((logging_options & OPT_LOG_ALL)) ? FALSE :
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
285 TRUE);
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
286
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
287 bcs = bcs->next;
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
288 }
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
289 C = C->next;
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
290 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
291 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
292
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
293 void update_font_buttons()
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
294 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
295 GList *cnv = conversations;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
296 struct conversation *c;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
297
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
298 while (cnv) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
299 c = (struct conversation *)cnv->data;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
300
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
301 if (c->bold)
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
302 gtk_widget_set_sensitive(c->bold,
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
303 ((font_options & OPT_FONT_BOLD)) ? FALSE : TRUE);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
304
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
305 if (c->italic)
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
306 gtk_widget_set_sensitive(c->italic,
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
307 ((font_options & OPT_FONT_ITALIC)) ? FALSE : TRUE);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
308
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
309 if (c->underline)
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
310 gtk_widget_set_sensitive(c->underline,
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
311 ((font_options & OPT_FONT_UNDERLINE)) ? FALSE : TRUE);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
312
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
313 if (c->strike)
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
314 gtk_widget_set_sensitive(c->strike,
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
315 ((font_options & OPT_FONT_STRIKE)) ? FALSE : TRUE);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
316
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
317 cnv = cnv->next;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
318 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
319 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
320
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
321 /*
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
322 void update_transparency()
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
323 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
324 GList *cnv = conversations;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
325 struct conversation *c;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
326
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
327 This func should be uncalled!
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
328
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
329 while(cnv) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
330 c = (struct conversation *)cnv->data;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
331
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
332 if (c->text)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
333 gtk_html_set_transparent(GTK_HTML(c->text),
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
334 (transparent) ? TRUE : FALSE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
335
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
336 cnv = cnv->next;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
337 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
338 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
339 */
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
340
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
341
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
342 /*------------------------------------------------------------------------*/
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
343 /* Callbacks */
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
344 /*------------------------------------------------------------------------*/
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
345
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
346 void toggle_loggle(GtkWidget *loggle, struct conversation *c)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
347 {
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
348 if (state_lock)
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
349 return;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
350 if (find_log_info(c->name))
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
351 rm_log(find_log_info(c->name));
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
352 else if (GTK_TOGGLE_BUTTON(loggle)->active)
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
353 show_log_dialog(c);
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
354 else
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
355 cancel_log(NULL, c);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
356 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
357
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
358 static void do_save_convo(GtkObject *obj, GtkWidget *wid)
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
359 {
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
360 struct conversation *c = gtk_object_get_user_data(obj);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
361 char *filename = gtk_file_selection_get_filename(GTK_FILE_SELECTION(wid));
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
362 FILE *f;
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
363 if (file_is_dir(filename, wid))
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
364 return;
2802
f7375f78d0f9 [gaim-migrate @ 2815]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2794
diff changeset
365 if ((!c->is_chat && g_list_find(conversations, c)) ||
f7375f78d0f9 [gaim-migrate @ 2815]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2794
diff changeset
366 (c->is_chat && g_slist_find(connections, c->gc) && g_slist_find(c->gc->buddy_chats, c)))
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
367 filename = g_strdup(filename);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
368 else
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
369 filename = NULL;
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
370 gtk_widget_destroy(wid);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
371 if (!filename)
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
372 return;
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
373 f = fopen(filename, "w+");
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
374 g_free(filename);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
375 if (!f)
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
376 return;
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
377 fprintf(f, "%s", c->history->str);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
378 fclose(f);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
379 }
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
380
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
381 void save_convo(GtkWidget *save, struct conversation *c)
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
382 {
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
383 char buf[BUF_LONG];
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
384 GtkWidget *window = gtk_file_selection_new(_("Gaim - Save Conversation"));
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
385 g_snprintf(buf, sizeof(buf), "%s/%s.log", g_get_home_dir(), normalize(c->name));
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
386 gtk_file_selection_set_filename(GTK_FILE_SELECTION(window), buf);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
387 gtk_object_set_user_data(GTK_OBJECT(GTK_FILE_SELECTION(window)->ok_button), c);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
388 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(window)->ok_button),
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
389 "clicked", GTK_SIGNAL_FUNC(do_save_convo), window);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
390 gtk_signal_connect_object(GTK_OBJECT(GTK_FILE_SELECTION(window)->cancel_button),
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
391 "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), (gpointer)window);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
392 gtk_widget_show(window);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
393 }
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
394
570
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 563
diff changeset
395 void insert_smiley(GtkWidget *smiley, struct conversation *c)
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 551
diff changeset
396 {
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 551
diff changeset
397 if (state_lock)
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 551
diff changeset
398 return;
570
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 563
diff changeset
399 if (GTK_TOGGLE_BUTTON(smiley)->active)
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 563
diff changeset
400 show_smiley_dialog(c, smiley);
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 563
diff changeset
401 else if (c->smiley_dialog)
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 563
diff changeset
402 close_smiley_dialog(smiley, c);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
403
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 551
diff changeset
404 return;
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 551
diff changeset
405 }
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 551
diff changeset
406
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
407 int close_callback(GtkWidget *widget, struct conversation *c)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
408 {
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2303
diff changeset
409 if (c->is_chat && (widget == c->close) && !(chat_options & OPT_CHAT_ONE_WINDOW)) {
814
a636ac51d15b [gaim-migrate @ 824]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 808
diff changeset
410 GtkWidget *tmp = c->window;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1244
diff changeset
411 debug_printf("chat clicked close button\n");
814
a636ac51d15b [gaim-migrate @ 824]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 808
diff changeset
412 c->window = NULL;
a636ac51d15b [gaim-migrate @ 824]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 808
diff changeset
413 gtk_widget_destroy(tmp);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
414 return FALSE;
814
a636ac51d15b [gaim-migrate @ 824]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 808
diff changeset
415 }
a636ac51d15b [gaim-migrate @ 824]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 808
diff changeset
416
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1244
diff changeset
417 debug_printf("conversation close callback\n");
814
a636ac51d15b [gaim-migrate @ 824]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 808
diff changeset
418
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2303
diff changeset
419 if (convo_options & OPT_CONVO_CHECK_SPELLING)
1117
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
420 gtkspell_detach(GTK_TEXT(c->entry));
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
421
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
422 if (!c->is_chat) {
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2245
diff changeset
423 GSList *cn = connections;
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2245
diff changeset
424 while (cn) {
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2245
diff changeset
425 struct gaim_connection *gc = cn->data;
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2245
diff changeset
426 cn = cn->next;
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2245
diff changeset
427 if (gc->prpl->convo_closed)
2662
b0c5770156e1 [gaim-migrate @ 2675]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2631
diff changeset
428 gc->prpl->convo_closed(gc, c->name);
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2245
diff changeset
429 }
2191
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
430 remove_icon(c);
2231
8c4ff1a368bd [gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2227
diff changeset
431 remove_checkbox(c);
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2303
diff changeset
432 if (im_options & OPT_IM_ONE_WINDOW) {
2843
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
433 if ((g_list_length(conversations) > 1) ||
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
434 ((convo_options & OPT_CONVO_COMBINE) &&
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
435 (chat_options & OPT_CHAT_ONE_WINDOW) && chats)) {
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
436 gtk_notebook_remove_page(GTK_NOTEBOOK(convo_notebook),
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
437 g_list_index(conversations, c));
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
438 } else {
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
439 if (c->window)
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
440 gtk_widget_destroy(c->window);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
441 c->window = NULL;
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
442 all_convos = NULL;
1757
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
443 convo_notebook = NULL;
2843
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
444 if (convo_options & OPT_CONVO_COMBINE) {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
445 all_chats = NULL;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
446 chat_notebook = NULL;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
447 }
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
448 }
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
449 } else {
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
450 if (c->window)
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
451 gtk_widget_destroy(c->window);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
452 c->window = NULL;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
453 }
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
454 } else {
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2303
diff changeset
455 if (chat_options & OPT_CHAT_ONE_WINDOW) {
2891
58baac124b0d [gaim-migrate @ 2904]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2877
diff changeset
456 if ((convo_options & OPT_CONVO_COMBINE) && (im_options & OPT_IM_ONE_WINDOW)
58baac124b0d [gaim-migrate @ 2904]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2877
diff changeset
457 && (conversations || chats->next)) {
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
458 gtk_notebook_remove_page(GTK_NOTEBOOK(chat_notebook),
2843
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
459 g_list_index(chats, c) +
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
460 g_list_length(conversations));
2891
58baac124b0d [gaim-migrate @ 2904]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2877
diff changeset
461 } else if (g_list_length(chats) > 1) {
58baac124b0d [gaim-migrate @ 2904]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2877
diff changeset
462 gtk_notebook_remove_page(GTK_NOTEBOOK(chat_notebook),
58baac124b0d [gaim-migrate @ 2904]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2877
diff changeset
463 g_list_index(chats, c));
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
464 } else {
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
465 if (c->window)
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
466 gtk_widget_destroy(c->window);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
467 c->window = NULL;
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
468 all_chats = NULL;
1757
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
469 chat_notebook = NULL;
2843
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
470 if (convo_options & OPT_CONVO_COMBINE) {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
471 all_convos = NULL;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
472 convo_notebook = NULL;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
473 }
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
474 }
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
475 } else {
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
476 if (c->window)
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
477 gtk_widget_destroy(c->window);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
478 c->window = NULL;
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
479 }
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
480 }
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
481
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
482 if (c->fg_color_dialog)
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
483 gtk_widget_destroy(c->fg_color_dialog);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
484 c->fg_color_dialog = NULL;
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
485 if (c->bg_color_dialog)
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
486 gtk_widget_destroy(c->bg_color_dialog);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
487 c->bg_color_dialog = NULL;
625
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
488 if (c->font_dialog)
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
489 gtk_widget_destroy(c->font_dialog);
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
490 c->font_dialog = NULL;
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
491 if (c->smiley_dialog)
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
492 gtk_widget_destroy(c->smiley_dialog);
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
493 c->smiley_dialog = NULL;
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
494 if (c->link_dialog)
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
495 gtk_widget_destroy(c->link_dialog);
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
496 c->link_dialog = NULL;
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
497 if (c->log_dialog)
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
498 gtk_widget_destroy(c->log_dialog);
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
499 c->log_dialog = NULL;
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
500
511
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 502
diff changeset
501 if (c->is_chat) {
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
502 chats = g_list_remove(chats, c);
1063
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1034
diff changeset
503 if (c->gc)
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1034
diff changeset
504 serv_chat_leave(c->gc, c->id);
2017
eee309c0de93 [gaim-migrate @ 2027]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2004
diff changeset
505 else
eee309c0de93 [gaim-migrate @ 2027]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2004
diff changeset
506 delete_chat(c);
511
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 502
diff changeset
507 } else {
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
508 delete_conversation(c);
511
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 502
diff changeset
509 }
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
510
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
511 return TRUE;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
512 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
513
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 661
diff changeset
514 void set_font_face(char *newfont, struct conversation *c)
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
515 {
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 661
diff changeset
516 char *pre_fontface;
2763
477a035d81e5 [gaim-migrate @ 2776]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2761
diff changeset
517 int i, j = 0, k = 0;
477a035d81e5 [gaim-migrate @ 2776]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2761
diff changeset
518
477a035d81e5 [gaim-migrate @ 2776]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2761
diff changeset
519
477a035d81e5 [gaim-migrate @ 2776]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2761
diff changeset
520 sprintf(c->fontxfld, "%s", newfont && *newfont ? newfont : DEFAULT_FONT_XFLD);
477a035d81e5 [gaim-migrate @ 2776]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2761
diff changeset
521 for (i = 0; i < strlen(c->fontxfld); i++) {
477a035d81e5 [gaim-migrate @ 2776]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2761
diff changeset
522 if (c->fontxfld[i] == '-') {
477a035d81e5 [gaim-migrate @ 2776]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2761
diff changeset
523 if (++j > 2)
477a035d81e5 [gaim-migrate @ 2776]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2761
diff changeset
524 break;
477a035d81e5 [gaim-migrate @ 2776]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2761
diff changeset
525 } else if (j == 2)
477a035d81e5 [gaim-migrate @ 2776]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2761
diff changeset
526 c->fontface[k++] = c->fontxfld[i];
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
527 }
2763
477a035d81e5 [gaim-migrate @ 2776]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2761
diff changeset
528 c->fontface[k] = '\0';
688
6b1345121dd3 [gaim-migrate @ 698]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 687
diff changeset
529 c->hasfont = 1;
2763
477a035d81e5 [gaim-migrate @ 2776]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2761
diff changeset
530
477a035d81e5 [gaim-migrate @ 2776]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2761
diff changeset
531 pre_fontface = g_strconcat("<FONT FACE=\"", c->fontface, "\">", NULL);
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
532 surround(c->entry, pre_fontface, "</FONT>");
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
533 gtk_widget_grab_focus(c->entry);
2763
477a035d81e5 [gaim-migrate @ 2776]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2761
diff changeset
534 g_free(pre_fontface);
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
535 }
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
536
2843
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
537 gint delete_all_convo(GtkWidget *w, GdkEventAny *e, gpointer d)
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
538 {
2843
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
539 if (w == all_convos) {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
540 while (conversations) {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
541 struct conversation *c = conversations->data;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
542 close_callback(c->close, c);
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
543 }
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
544 }
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
545 if (w == all_chats) {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
546 while (chats) {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
547 struct conversation *c = chats->data;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
548 close_callback(c->close, c);
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
549 }
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
550 }
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
551 return FALSE;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
552 }
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
553
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
554 static gint delete_event_convo(GtkWidget *w, GdkEventAny *e, struct conversation *c)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
555 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
556 delete_conversation(c);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
557 return FALSE;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
558 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
559
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
560 void add_callback(GtkWidget *widget, struct conversation *c)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
561 {
2681
37d80035e77f [gaim-migrate @ 2694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2662
diff changeset
562 struct buddy *b = find_buddy(c->gc, c->name);
37d80035e77f [gaim-migrate @ 2694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2662
diff changeset
563 if (b) {
2745
0c8de85fee62 [gaim-migrate @ 2758]
Rob Flynn <gaim@robflynn.com>
parents: 2743
diff changeset
564 show_confirm_del(c->gc, c->name);
2681
37d80035e77f [gaim-migrate @ 2694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2662
diff changeset
565 } else if (c->gc)
37d80035e77f [gaim-migrate @ 2694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2662
diff changeset
566 show_add_buddy(c->gc, c->name, NULL, NULL);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
567
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
568 gtk_widget_grab_focus(c->entry);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
569 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
570
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
571
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
572 void block_callback(GtkWidget *widget, struct conversation *c)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
573 {
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
574 if (c->gc)
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
575 show_add_perm(c->gc, c->name, FALSE);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
576 gtk_widget_grab_focus(c->entry);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
577 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
578
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
579 void warn_callback(GtkWidget *widget, struct conversation *c)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
580 {
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
581 show_warn_dialog(c->gc, c->name);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
582 gtk_widget_grab_focus(c->entry);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
583 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
584
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
585 void info_callback(GtkWidget *w, struct conversation *c)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
586 {
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
587 if (c->is_chat) {
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
588 char *name;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
589 GList *i;
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
590
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
591 i = GTK_LIST(c->list)->selection;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
592 if (i) {
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
593 name = (char *)gtk_object_get_user_data(GTK_OBJECT(i->data));
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
594 } else {
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
595 return;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
596 }
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
597
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
598 serv_get_info(c->gc, name);
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
599 } else {
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
600 serv_get_info(c->gc, c->name);
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
601 gtk_widget_grab_focus(c->entry);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
602 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
603 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
604
2843
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
605 static void move_next_tab(GtkNotebook *notebook, gboolean chat)
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
606 {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
607 int currpage = gtk_notebook_get_current_page(notebook);
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
608 int convlen;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
609 GList *cnv;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
610 struct conversation *d = NULL;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
611
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
612 if ((convo_options & OPT_CONVO_COMBINE) &&
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
613 (im_options & OPT_IM_ONE_WINDOW) &&
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
614 (chat_options & OPT_CHAT_ONE_WINDOW))
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
615 convlen = g_list_length(conversations);
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
616 else
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
617 convlen = 0;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
618
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
619 if (chat) {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
620 /* if chat, find next unread chat */
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
621 cnv = g_list_nth(chats, currpage - convlen);
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
622 while (cnv) {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
623 d = cnv->data;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
624 if (d->unseen)
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
625 break;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
626 cnv = cnv->next;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
627 d = NULL;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
628 }
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
629 if (d) {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
630 gtk_notebook_set_page(notebook, convlen + g_list_index(chats, d));
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
631 return;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
632 }
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
633 } else {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
634 /* else find next unread convo */
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
635 cnv = g_list_nth(conversations, currpage);
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
636 while (cnv) {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
637 d = cnv->data;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
638 if (d->unseen)
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
639 break;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
640 cnv = cnv->next;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
641 d = NULL;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
642 }
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
643 if (d) {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
644 gtk_notebook_set_page(notebook, g_list_index(conversations, d));
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
645 return;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
646 }
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
647 }
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
648
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
649 if (convo_options & OPT_CONVO_COMBINE) {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
650 if (chat && (im_options & OPT_IM_ONE_WINDOW)) {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
651 /* if chat find next unread convo */
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
652 cnv = conversations;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
653 while (cnv) {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
654 d = cnv->data;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
655 if (d->unseen)
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
656 break;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
657 cnv = cnv->next;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
658 d = NULL;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
659 }
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
660 if (d) {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
661 gtk_notebook_set_page(notebook, g_list_index(conversations, d));
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
662 return;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
663 }
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
664 } else if (!chat && (chat_options & OPT_CHAT_ONE_WINDOW)) {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
665 /* else find next unread chat */
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
666 cnv = chats;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
667 while (cnv) {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
668 d = cnv->data;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
669 if (d->unseen)
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
670 break;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
671 cnv = cnv->next;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
672 d = NULL;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
673 }
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
674 if (d) {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
675 gtk_notebook_set_page(notebook, convlen + g_list_index(chats, d));
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
676 return;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
677 }
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
678 }
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
679 }
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
680
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
681 if (chat) {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
682 /* if chat find first unread chat */
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
683 cnv = chats;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
684 while (cnv) {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
685 d = cnv->data;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
686 if (d->unseen)
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
687 break;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
688 cnv = cnv->next;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
689 d = NULL;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
690 }
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
691 if (d) {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
692 gtk_notebook_set_page(notebook, convlen + g_list_index(chats, d));
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
693 return;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
694 }
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
695 } else {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
696 /* else find first unread convo */
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
697 cnv = conversations;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
698 while (cnv) {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
699 d = cnv->data;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
700 if (d->unseen)
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
701 break;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
702 cnv = cnv->next;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
703 d = NULL;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
704 }
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
705 if (d) {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
706 gtk_notebook_set_page(notebook, g_list_index(conversations, d));
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
707 return;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
708 }
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
709 }
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
710
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
711 /* go to next page */
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
712 if (currpage + 1 == g_list_length(notebook->children))
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
713 gtk_notebook_set_page(notebook, 0);
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
714 else
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
715 gtk_notebook_next_page(notebook);
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
716 }
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
717
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
718 gboolean keypress_callback(GtkWidget *entry, GdkEventKey * event, struct conversation *c)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
719 {
573
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
720 int pos;
1411
a3e472534370 [gaim-migrate @ 1421]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1403
diff changeset
721 if (event->keyval == GDK_Escape) {
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2303
diff changeset
722 if (convo_options & OPT_CONVO_ESC_CAN_CLOSE) {
1411
a3e472534370 [gaim-migrate @ 1421]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1403
diff changeset
723 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
1464
ae075ecc7c34 [gaim-migrate @ 1474]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1456
diff changeset
724 close_callback(c->close, c);
1411
a3e472534370 [gaim-migrate @ 1421]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1403
diff changeset
725 }
2363
08c66712364c [gaim-migrate @ 2376]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2345
diff changeset
726 } else if (event->keyval == GDK_Page_Up) {
2749
8ff0bd0f7347 [gaim-migrate @ 2762]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2748
diff changeset
727 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
2363
08c66712364c [gaim-migrate @ 2376]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2345
diff changeset
728 gtk_imhtml_page_up(GTK_IMHTML(c->text));
08c66712364c [gaim-migrate @ 2376]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2345
diff changeset
729 } else if (event->keyval == GDK_Page_Down) {
2749
8ff0bd0f7347 [gaim-migrate @ 2762]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2748
diff changeset
730 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
2363
08c66712364c [gaim-migrate @ 2376]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2345
diff changeset
731 gtk_imhtml_page_down(GTK_IMHTML(c->text));
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2303
diff changeset
732 } else if ((event->keyval == GDK_F2) && (convo_options & OPT_CONVO_F2_TOGGLES)) {
1455
d113c7e2c5f1 [gaim-migrate @ 1465]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1453
diff changeset
733 gtk_imhtml_show_comments(GTK_IMHTML(c->text), !GTK_IMHTML(c->text)->comments);
1872
efc899af4912 [gaim-migrate @ 1882]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1867
diff changeset
734 } else if ((event->keyval == GDK_Return) || (event->keyval == GDK_KP_Enter)) {
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2303
diff changeset
735 if ((event->state & GDK_CONTROL_MASK) && (convo_options & OPT_CONVO_CTL_ENTER)) {
573
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
736 gtk_signal_emit_by_name(GTK_OBJECT(entry), "activate", c);
1442
2f4e6269b001 [gaim-migrate @ 1452]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
737 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
2748
497868102c90 [gaim-migrate @ 2761]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2745
diff changeset
738 return TRUE;
2773
a0fd8f91e294 [gaim-migrate @ 2786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2767
diff changeset
739 } else if (!(event->state & (GDK_SHIFT_MASK | GDK_CONTROL_MASK)) && (convo_options & OPT_CONVO_ENTER_SENDS)) {
1442
2f4e6269b001 [gaim-migrate @ 1452]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
740 gtk_signal_emit_by_name(GTK_OBJECT(entry), "activate", c);
573
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
741 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
2748
497868102c90 [gaim-migrate @ 2761]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2745
diff changeset
742 return TRUE;
573
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
743 } else {
2483
e73ca8d8d358 [gaim-migrate @ 2496]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2460
diff changeset
744 int oldpos;
573
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
745 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
2483
e73ca8d8d358 [gaim-migrate @ 2496]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2460
diff changeset
746 oldpos = pos = gtk_editable_get_position(GTK_EDITABLE(entry));
573
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
747 gtk_editable_insert_text(GTK_EDITABLE(entry), "\n", 1, &pos);
2483
e73ca8d8d358 [gaim-migrate @ 2496]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2460
diff changeset
748 if (oldpos == pos)
e73ca8d8d358 [gaim-migrate @ 2496]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2460
diff changeset
749 gtk_editable_set_position(GTK_EDITABLE(entry), pos + 1);
2748
497868102c90 [gaim-migrate @ 2761]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2745
diff changeset
750 return TRUE;
573
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
751 }
2483
e73ca8d8d358 [gaim-migrate @ 2496]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2460
diff changeset
752 } else if ((event->state & GDK_CONTROL_MASK) && (event->keyval == 'm')) {
e73ca8d8d358 [gaim-migrate @ 2496]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2460
diff changeset
753 int oldpos;
e73ca8d8d358 [gaim-migrate @ 2496]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2460
diff changeset
754 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
e73ca8d8d358 [gaim-migrate @ 2496]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2460
diff changeset
755 oldpos = pos = gtk_editable_get_position(GTK_EDITABLE(entry));
e73ca8d8d358 [gaim-migrate @ 2496]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2460
diff changeset
756 gtk_editable_insert_text(GTK_EDITABLE(entry), "\n", 1, &pos);
e73ca8d8d358 [gaim-migrate @ 2496]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2460
diff changeset
757 if (oldpos == pos)
e73ca8d8d358 [gaim-migrate @ 2496]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2460
diff changeset
758 gtk_editable_set_position(GTK_EDITABLE(entry), pos + 1);
830
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
759 } else if (event->state & GDK_CONTROL_MASK) {
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2303
diff changeset
760 if (convo_options & OPT_CONVO_CTL_CHARS) {
830
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
761 switch (event->keyval) {
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
762 case 'i':
1621
cf2071b095ca [gaim-migrate @ 1631]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1617
diff changeset
763 case 'I':
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
764 quiet_set(c->italic,
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
765 !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(c->italic)));
830
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
766 do_italic(c->italic, c->entry);
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
767 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
768 break;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
769 case 'u': /* ctl-u is GDK_Clear, which clears the line */
1621
cf2071b095ca [gaim-migrate @ 1631]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1617
diff changeset
770 case 'U':
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
771 quiet_set(c->underline,
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
772 !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
773 (c->underline)));
830
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
774 do_underline(c->underline, c->entry);
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
775 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
776 break;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
777 case 'b': /* ctl-b is GDK_Left, which moves backwards */
1621
cf2071b095ca [gaim-migrate @ 1631]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1617
diff changeset
778 case 'B':
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
779 quiet_set(c->bold,
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
780 !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(c->bold)));
830
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
781 do_bold(c->bold, c->entry);
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
782 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
783 break;
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
784 case 's':
1621
cf2071b095ca [gaim-migrate @ 1631]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1617
diff changeset
785 case 'S':
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
786 quiet_set(c->strike,
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
787 !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(c->strike)));
830
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
788 do_strike(c->strike, c->entry);
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
789 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
790 break;
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
791 }
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
792 }
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2303
diff changeset
793 if (convo_options & OPT_CONVO_CTL_SMILEYS) {
830
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
794 char buf[7];
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
795 buf[0] = '\0';
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
796 switch (event->keyval) {
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
797 case '1':
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
798 sprintf(buf, ":-)");
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
799 break;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
800 case '2':
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
801 sprintf(buf, ":-(");
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
802 break;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
803 case '3':
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
804 sprintf(buf, ";-)");
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
805 break;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
806 case '4':
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
807 sprintf(buf, ":-P");
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
808 break;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
809 case '5':
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
810 sprintf(buf, "=-O");
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
811 break;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
812 case '6':
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
813 sprintf(buf, ":-*");
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
814 break;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
815 case '7':
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
816 sprintf(buf, ">:o");
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
817 break;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
818 case '8':
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
819 sprintf(buf, "8-)");
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
820 break;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
821 case '!':
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
822 sprintf(buf, ":-$");
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
823 break;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
824 case '@':
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
825 sprintf(buf, ":-!");
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
826 break;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
827 case '#':
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
828 sprintf(buf, ":-[");
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
829 break;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
830 case '$':
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
831 sprintf(buf, "O:-)");
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
832 break;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
833 case '%':
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
834 sprintf(buf, ":-/");
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
835 break;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
836 case '^':
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
837 sprintf(buf, ":'(");
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
838 break;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
839 case '&':
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
840 sprintf(buf, ":-X");
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
841 break;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
842 case '*':
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
843 sprintf(buf, ":-D");
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
844 break;
830
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
845 }
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
846 if (buf[0]) {
2725
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2722
diff changeset
847 if (GTK_OLD_EDITABLE(c->entry)->has_selection) {
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2722
diff changeset
848 int finish = GTK_OLD_EDITABLE(c->entry)->selection_end_pos;
830
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
849 gtk_editable_insert_text(GTK_EDITABLE(c->entry),
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
850 buf, strlen(buf), &finish);
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
851 } else {
2725
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2722
diff changeset
852 pos = GTK_OLD_EDITABLE(c->entry)->current_pos;
830
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
853 gtk_editable_insert_text(GTK_EDITABLE(c->entry),
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
854 buf, strlen(buf), &pos);
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
855 }
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
856 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
857 }
573
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
858 }
2631
a2cf3cac7e66 [gaim-migrate @ 2644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2625
diff changeset
859 if (event->keyval == 'l') {
2340
b16642ac87b2 [gaim-migrate @ 2353]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2335
diff changeset
860 gtk_imhtml_clear(GTK_IMHTML(c->text));
2631
a2cf3cac7e66 [gaim-migrate @ 2644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2625
diff changeset
861 g_string_free(c->history, TRUE);
a2cf3cac7e66 [gaim-migrate @ 2644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2625
diff changeset
862 c->history = g_string_new("");
a2cf3cac7e66 [gaim-migrate @ 2644]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2625
diff changeset
863 }
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2303
diff changeset
864 if ((!c->is_chat && (im_options & OPT_IM_ONE_WINDOW)) ||
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
865 (c->is_chat && (chat_options & OPT_CHAT_ONE_WINDOW))) {
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
866 GtkWidget *notebook = (c->is_chat ? chat_notebook : convo_notebook);
1595
f281f4d94973 [gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1594
diff changeset
867 if (event->keyval == '[') {
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
868 gtk_notebook_prev_page(GTK_NOTEBOOK(notebook));
1587
69a004b5820a [gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1583
diff changeset
869 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
1595
f281f4d94973 [gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1594
diff changeset
870 } else if (event->keyval == ']') {
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
871 gtk_notebook_next_page(GTK_NOTEBOOK(notebook));
1587
69a004b5820a [gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1583
diff changeset
872 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
1595
f281f4d94973 [gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1594
diff changeset
873 } else if (event->keyval == GDK_Tab) {
2843
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
874 move_next_tab(GTK_NOTEBOOK(notebook), c->is_chat);
1587
69a004b5820a [gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1583
diff changeset
875 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
2735
aeae739353d0 [gaim-migrate @ 2748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2725
diff changeset
876 return TRUE;
1587
69a004b5820a [gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1583
diff changeset
877 }
69a004b5820a [gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1583
diff changeset
878 }
2385
bdc74764245c [gaim-migrate @ 2398]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
879 } else if ((event->keyval == GDK_Tab) && c->is_chat && (chat_options & OPT_CHAT_TAB_COMPLETE)) {
bdc74764245c [gaim-migrate @ 2398]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
880 tab_complete(c);
bdc74764245c [gaim-migrate @ 2398]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
881 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
2725
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2722
diff changeset
882 return TRUE;
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2303
diff changeset
883 } else if (((!c->is_chat && (im_options & OPT_IM_ONE_WINDOW)) ||
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
884 (c->is_chat && (chat_options & OPT_CHAT_ONE_WINDOW))) &&
2421
95b4ec08abec [gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2386
diff changeset
885 (event->state & GDK_MOD1_MASK) && (event->keyval > '0') && (event->keyval <= '9')) {
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
886 GtkWidget *notebook = (c->is_chat ? chat_notebook : convo_notebook);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
887 gtk_notebook_set_page(GTK_NOTEBOOK(notebook), event->keyval - '1');
1621
cf2071b095ca [gaim-migrate @ 1631]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1617
diff changeset
888 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
573
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
889 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
890
2725
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2722
diff changeset
891 return FALSE;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
892 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
893
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
894
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
895 void send_callback(GtkWidget *widget, struct conversation *c)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
896 {
2102
899c22dcee42 [gaim-migrate @ 2112]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2094
diff changeset
897 char *buf, *buf2;
1100
f168625b63fe [gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1078
diff changeset
898 int limit;
2123
56c4382f2909 [gaim-migrate @ 2133]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2111
diff changeset
899 int err = 0;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
900
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
901 if (!c->gc)
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
902 return;
1100
f168625b63fe [gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1078
diff changeset
903
f168625b63fe [gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1078
diff changeset
904 buf2 = gtk_editable_get_chars(GTK_EDITABLE(c->entry), 0, -1);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
905 limit = 32 * 1024; /* you shouldn't be sending more than 32k in your messages. that's a book. */
738
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
906 buf = g_malloc(limit);
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
907 g_snprintf(buf, limit, "%s", buf2);
753
cd62f69d187e [gaim-migrate @ 763]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 745
diff changeset
908 g_free(buf2);
796
4783a3b6859d [gaim-migrate @ 806]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 795
diff changeset
909 if (!strlen(buf)) {
4783a3b6859d [gaim-migrate @ 806]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 795
diff changeset
910 g_free(buf);
4783a3b6859d [gaim-migrate @ 806]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 795
diff changeset
911 return;
4783a3b6859d [gaim-migrate @ 806]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 795
diff changeset
912 }
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
913
738
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
914 buf2 = g_malloc(limit);
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
915
2706
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2699
diff changeset
916 if (c->gc->flags & OPT_CONN_HTML) {
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2303
diff changeset
917 if (convo_options & OPT_CONVO_SEND_LINKS)
1889
c81f3dd0e58e [gaim-migrate @ 1899]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1881
diff changeset
918 linkify_text(buf);
c81f3dd0e58e [gaim-migrate @ 1899]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1881
diff changeset
919
1370
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
920 if (font_options & OPT_FONT_BOLD) {
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
921 g_snprintf(buf2, limit, "<B>%s</B>", buf);
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
922 strcpy(buf, buf2);
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
923 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
924
1370
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
925 if (font_options & OPT_FONT_ITALIC) {
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
926 g_snprintf(buf2, limit, "<I>%s</I>", buf);
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
927 strcpy(buf, buf2);
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
928 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
929
1370
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
930 if (font_options & OPT_FONT_UNDERLINE) {
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
931 g_snprintf(buf2, limit, "<U>%s</U>", buf);
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
932 strcpy(buf, buf2);
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
933 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
934
1370
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
935 if (font_options & OPT_FONT_STRIKE) {
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
936 g_snprintf(buf2, limit, "<STRIKE>%s</STRIKE>", buf);
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
937 strcpy(buf, buf2);
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
938 }
101
a9aa982272f9 [gaim-migrate @ 111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 88
diff changeset
939
1370
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
940 if ((font_options & OPT_FONT_FACE) || c->hasfont) {
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
941 g_snprintf(buf2, limit, "<FONT FACE=\"%s\">%s</FONT>", c->fontface, buf);
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
942 strcpy(buf, buf2);
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
943 }
488
0fcb7e7a263c [gaim-migrate @ 498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 474
diff changeset
944
2699
092c5a1ddf72 [gaim-migrate @ 2712]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2681
diff changeset
945 if (font_options & OPT_FONT_SIZE) {
092c5a1ddf72 [gaim-migrate @ 2712]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2681
diff changeset
946 g_snprintf(buf2, limit, "<FONT SIZE=\"%d\">%s</FONT>", fontsize, buf);
1441
5c67b8794991 [gaim-migrate @ 1451]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1440
diff changeset
947 strcpy(buf, buf2);
5c67b8794991 [gaim-migrate @ 1451]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1440
diff changeset
948 }
5c67b8794991 [gaim-migrate @ 1451]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1440
diff changeset
949
1370
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
950 if ((font_options & OPT_FONT_FGCOL) || c->hasfg) {
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
951 g_snprintf(buf2, limit, "<FONT COLOR=\"#%02X%02X%02X\">%s</FONT>", c->fgcol.red,
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
952 c->fgcol.green, c->fgcol.blue, buf);
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
953 strcpy(buf, buf2);
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
954 }
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 661
diff changeset
955
1370
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
956 if ((font_options & OPT_FONT_BGCOL) || c->hasbg) {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
957 g_snprintf(buf2, limit, "<BODY BGCOLOR=\"#%02X%02X%02X\">%s</BODY>",
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
958 c->bgcol.red, c->bgcol.green, c->bgcol.blue, buf);
1370
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
959 strcpy(buf, buf2);
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
960 }
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 661
diff changeset
961 }
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 661
diff changeset
962
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1872
diff changeset
963 quiet_set(c->bold, FALSE);
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1872
diff changeset
964 quiet_set(c->strike, FALSE);
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1872
diff changeset
965 quiet_set(c->italic, FALSE);
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1872
diff changeset
966 quiet_set(c->underline, FALSE);
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1872
diff changeset
967 quiet_set(c->font, FALSE);
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1872
diff changeset
968 quiet_set(c->fgcolorbtn, FALSE);
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1872
diff changeset
969 quiet_set(c->bgcolorbtn, FALSE);
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1872
diff changeset
970 quiet_set(c->link, FALSE);
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1872
diff changeset
971 gtk_widget_grab_focus(c->entry);
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1872
diff changeset
972
101
a9aa982272f9 [gaim-migrate @ 111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 88
diff changeset
973 {
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 389
diff changeset
974 char *buffy = g_strdup(buf);
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
975 enum gaim_event evnt = c->is_chat ? event_chat_send : event_im_send;
2345
a49e8f1afbc4 [gaim-migrate @ 2358]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2340
diff changeset
976 int plugin_return = plugin_event(evnt, c->gc,
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
977 c->is_chat ? (void *)c->id : c->name,
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
978 &buffy, 0);
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 389
diff changeset
979 if (!buffy) {
102
8c301530b2a3 [gaim-migrate @ 112]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 101
diff changeset
980 g_free(buf2);
796
4783a3b6859d [gaim-migrate @ 806]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 795
diff changeset
981 g_free(buf);
102
8c301530b2a3 [gaim-migrate @ 112]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 101
diff changeset
982 return;
8c301530b2a3 [gaim-migrate @ 112]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 101
diff changeset
983 }
1100
f168625b63fe [gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1078
diff changeset
984 if (plugin_return) {
2139
a14e8459c233 [gaim-migrate @ 2149]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2138
diff changeset
985 gtk_editable_delete_text(GTK_EDITABLE(c->entry), 0, -1);
1100
f168625b63fe [gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1078
diff changeset
986 g_free(buffy);
f168625b63fe [gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1078
diff changeset
987 g_free(buf2);
f168625b63fe [gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1078
diff changeset
988 g_free(buf);
f168625b63fe [gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1078
diff changeset
989 return;
f168625b63fe [gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1078
diff changeset
990 }
738
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
991 g_snprintf(buf, limit, "%s", buffy);
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 389
diff changeset
992 g_free(buffy);
101
a9aa982272f9 [gaim-migrate @ 111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 88
diff changeset
993 }
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
994
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
995 if (!c->is_chat) {
2102
899c22dcee42 [gaim-migrate @ 2112]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2094
diff changeset
996 char *buffy;
899c22dcee42 [gaim-migrate @ 2112]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2094
diff changeset
997
899c22dcee42 [gaim-migrate @ 2112]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2094
diff changeset
998 buffy = g_strdup(buf);
2104
0b81421021fd [gaim-migrate @ 2114]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2102
diff changeset
999 plugin_event(event_im_displayed_sent, c->gc, c->name, &buffy, 0);
2102
899c22dcee42 [gaim-migrate @ 2112]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2094
diff changeset
1000 if (buffy) {
2231
8c4ff1a368bd [gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2227
diff changeset
1001 int imflags = 0;
2239
b7ff2ca1d653 [gaim-migrate @ 2249]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2231
diff changeset
1002 if (c->check && gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(c->check)))
2231
8c4ff1a368bd [gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2227
diff changeset
1003 imflags = IM_FLAG_CHECKBOX;
8c4ff1a368bd [gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2227
diff changeset
1004 err = serv_send_im(c->gc, c->name, buffy, imflags);
2102
899c22dcee42 [gaim-migrate @ 2112]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2094
diff changeset
1005 g_free(buffy);
899c22dcee42 [gaim-migrate @ 2112]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2094
diff changeset
1006 }
899c22dcee42 [gaim-migrate @ 2112]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2094
diff changeset
1007
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1008
2303
f5bf315e6104 [gaim-migrate @ 2313]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2270
diff changeset
1009 if (err > 0) {
2856
b1e300a85678 [gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2855
diff changeset
1010 write_to_conv(c, buf, WFLAG_SEND, NULL, time(NULL), -1);
2124
a1922ad52304 [gaim-migrate @ 2134]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2123
diff changeset
1011
a1922ad52304 [gaim-migrate @ 2134]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2123
diff changeset
1012 if (c->makesound && (sound_options & OPT_SOUND_SEND))
a1922ad52304 [gaim-migrate @ 2134]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2123
diff changeset
1013 play_sound(SEND);
2794
2d3f47783a22 [gaim-migrate @ 2807]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2788
diff changeset
1014
2d3f47783a22 [gaim-migrate @ 2807]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2788
diff changeset
1015 if (im_options & OPT_IM_POPDOWN)
2d3f47783a22 [gaim-migrate @ 2807]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2788
diff changeset
1016 gtk_widget_hide(c->window);
2124
a1922ad52304 [gaim-migrate @ 2134]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2123
diff changeset
1017 }
502
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
1018 } else {
2167
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2160
diff changeset
1019 err = serv_chat_send(c->gc, c->id, buf);
502
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
1020
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
1021 /* no sound because we do that when we receive our message */
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1022 }
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1023
2123
56c4382f2909 [gaim-migrate @ 2133]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2111
diff changeset
1024 g_free(buf2);
56c4382f2909 [gaim-migrate @ 2133]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2111
diff changeset
1025 g_free(buf);
56c4382f2909 [gaim-migrate @ 2133]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2111
diff changeset
1026
56c4382f2909 [gaim-migrate @ 2133]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2111
diff changeset
1027 if (err < 0) {
56c4382f2909 [gaim-migrate @ 2133]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2111
diff changeset
1028 if (err == -E2BIG)
56c4382f2909 [gaim-migrate @ 2133]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2111
diff changeset
1029 do_error_dialog(_("Unable to send message: too large"), _("Message Error"));
56c4382f2909 [gaim-migrate @ 2133]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2111
diff changeset
1030 else
56c4382f2909 [gaim-migrate @ 2133]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2111
diff changeset
1031 do_error_dialog(_("Unable to send message: Unknown reason"), _("Message Error"));
2832
e0eeda0a9ab9 [gaim-migrate @ 2845]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2831
diff changeset
1032 } else {
2123
56c4382f2909 [gaim-migrate @ 2133]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2111
diff changeset
1033 gtk_editable_delete_text(GTK_EDITABLE(c->entry), 0, -1);
56c4382f2909 [gaim-migrate @ 2133]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2111
diff changeset
1034
2832
e0eeda0a9ab9 [gaim-migrate @ 2845]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2831
diff changeset
1035 if ((err > 0) && (away_options & OPT_AWAY_BACK_ON_IM)) {
2123
56c4382f2909 [gaim-migrate @ 2133]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2111
diff changeset
1036 if (awaymessage != NULL) {
56c4382f2909 [gaim-migrate @ 2133]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2111
diff changeset
1037 do_im_back();
56c4382f2909 [gaim-migrate @ 2133]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2111
diff changeset
1038 } else if (c->gc->away) {
56c4382f2909 [gaim-migrate @ 2133]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2111
diff changeset
1039 serv_set_away(c->gc, GAIM_AWAY_CUSTOM, NULL);
56c4382f2909 [gaim-migrate @ 2133]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2111
diff changeset
1040 }
1403
c0aa7fdc0a93 [gaim-migrate @ 1413]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1401
diff changeset
1041 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1042 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1043 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1044
907
08d5037c9296 [gaim-migrate @ 917]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
1045 int entry_key_pressed(GtkWidget *w, GtkWidget *entry)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1046 {
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1047 check_everything(w);
2725
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2722
diff changeset
1048 return FALSE;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1049 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1050
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1051 /*------------------------------------------------------------------------*/
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1052 /* HTML-type stuff */
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1053 /*------------------------------------------------------------------------*/
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1054
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1055 int count_tag(GtkWidget *entry, char *s1, char *s2)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1056 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1057 char *p1, *p2;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1058 int res = 0;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1059 char *tmp, *tmpo, h;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1060 tmpo = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1);
2725
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2722
diff changeset
1061 h = tmpo[GTK_OLD_EDITABLE(entry)->current_pos];
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2722
diff changeset
1062 tmpo[GTK_OLD_EDITABLE(entry)->current_pos] = '\0';
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1063 tmp = tmpo;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1064 do {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1065 p1 = strstr(tmp, s1);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1066 p2 = strstr(tmp, s2);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1067 if (p1 && p2) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1068 if (p1 < p2) {
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1069 res = 1;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1070 tmp = p1 + strlen(s1);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1071 } else if (p2 < p1) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1072 res = 0;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1073 tmp = p2 + strlen(s2);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1074 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1075 } else {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1076 if (p1) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1077 res = 1;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1078 tmp = p1 + strlen(s1);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1079 } else if (p2) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1080 res = 0;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1081 tmp = p2 + strlen(s2);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1082 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1083 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1084 } while (p1 || p2);
2725
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2722
diff changeset
1085 tmpo[GTK_OLD_EDITABLE(entry)->current_pos] = h;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1086 g_free(tmpo);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1087 return res;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1088 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1089
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1090
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1091 int invert_tags(GtkWidget *entry, char *s1, char *s2, int really)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1092 {
2725
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2722
diff changeset
1093 int start = GTK_OLD_EDITABLE(entry)->selection_start_pos;
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2722
diff changeset
1094 int finish = GTK_OLD_EDITABLE(entry)->selection_end_pos;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1095 char *s;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1096
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1097 s = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1);
2048
3366311426df [gaim-migrate @ 2058]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2017
diff changeset
1098 if (!g_strncasecmp(&s[start], s1, strlen(s1)) &&
3366311426df [gaim-migrate @ 2058]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2017
diff changeset
1099 !g_strncasecmp(&s[finish - strlen(s2)], s2, strlen(s2))) {
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1100 if (really) {
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1101 gtk_editable_delete_text(GTK_EDITABLE(entry), start, start + strlen(s1));
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1102 gtk_editable_delete_text(GTK_EDITABLE(entry), finish - strlen(s2) - strlen(s1),
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1103 finish - strlen(s1));
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1104 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1105 g_free(s);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1106 return 1;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1107 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1108 g_free(s);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1109 return 0;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1110 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1111
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1112
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1113 void remove_tags(GtkWidget *entry, char *tag)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1114 {
275
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
1115 char *s, *t;
2725
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2722
diff changeset
1116 int start = GTK_OLD_EDITABLE(entry)->selection_start_pos;
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2722
diff changeset
1117 int finish = GTK_OLD_EDITABLE(entry)->selection_end_pos;
275
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
1118 int temp;
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
1119 s = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1120 t = s;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1121
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1122 if (start > finish) {
275
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
1123 temp = start;
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
1124 start = finish;
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
1125 finish = temp;
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
1126 }
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1127
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1128 if (strstr(tag, "<FONT SIZE=")) {
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1129 while ((t = strstr(t, "<FONT SIZE="))) {
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1130 if (((t - s) < finish) && ((t - s) >= start)) {
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1131 gtk_editable_delete_text(GTK_EDITABLE(entry), (t - s),
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1132 (t - s) + strlen(tag));
846
4b05985bae5e [gaim-migrate @ 856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 843
diff changeset
1133 g_free(s);
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
1134 s = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1);
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
1135 t = s;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1136 } else
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1137 t++;
68
03ec647d24e9 [gaim-migrate @ 78]
Rob Flynn <gaim@robflynn.com>
parents: 67
diff changeset
1138 }
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1139 } else {
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1140 while ((t = strstr(t, tag))) {
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1141 if (((t - s) < finish) && ((t - s) >= start)) {
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1142 gtk_editable_delete_text(GTK_EDITABLE(entry), (t - s),
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1143 (t - s) + strlen(tag));
846
4b05985bae5e [gaim-migrate @ 856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 843
diff changeset
1144 g_free(s);
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
1145 s = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1);
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
1146 t = s;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1147 } else
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1148 t++;
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
1149 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1150 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1151 g_free(s);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1152 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1153
1440
6330d0bb309f [gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1439
diff changeset
1154 static char *html_logize(char *p)
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1155 {
1103
7aabbbaae829 [gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1100
diff changeset
1156
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1157 char *temp_p = p;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1158 char *buffer_p;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1159 char *buffer_start;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1160 int num_cr = 0;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1161 int char_len = 0;
1103
7aabbbaae829 [gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1100
diff changeset
1162
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1163 while (*temp_p != '\0') {
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1164 char_len++;
1440
6330d0bb309f [gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1439
diff changeset
1165 if ((*temp_p == '\n') || ((*temp_p == '<') && (*(temp_p + 1) == '!')))
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1166 num_cr++;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1167 ++temp_p;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1168 }
1103
7aabbbaae829 [gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1100
diff changeset
1169
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1170 temp_p = p;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1171 buffer_p = g_malloc(char_len + (4 * num_cr) + 1);
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1172 buffer_start = buffer_p;
1103
7aabbbaae829 [gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1100
diff changeset
1173
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1174 while (*temp_p != '\0') {
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1175 if (*temp_p == '\n') {
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1176 *buffer_p++ = '<';
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1177 *buffer_p++ = 'B';
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1178 *buffer_p++ = 'R';
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1179 *buffer_p++ = '>';
1440
6330d0bb309f [gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1439
diff changeset
1180 *buffer_p++ = '\n';
6330d0bb309f [gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1439
diff changeset
1181 } else if ((*temp_p == '<') && (*(temp_p + 1) == '!')) {
6330d0bb309f [gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1439
diff changeset
1182 *buffer_p++ = '&';
6330d0bb309f [gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1439
diff changeset
1183 *buffer_p++ = 'g';
6330d0bb309f [gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1439
diff changeset
1184 *buffer_p++ = 't';
6330d0bb309f [gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1439
diff changeset
1185 *buffer_p++ = ';';
6330d0bb309f [gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1439
diff changeset
1186 } else
6330d0bb309f [gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1439
diff changeset
1187 *buffer_p++ = *temp_p;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1188 ++temp_p;
1103
7aabbbaae829 [gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1100
diff changeset
1189 }
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1190 *buffer_p = '\0';
1103
7aabbbaae829 [gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1100
diff changeset
1191
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1192 return buffer_start;
1103
7aabbbaae829 [gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1100
diff changeset
1193 }
7aabbbaae829 [gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1100
diff changeset
1194
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1195 void surround(GtkWidget *entry, char *pre, char *post)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1196 {
2725
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2722
diff changeset
1197 int temp, pos = GTK_OLD_EDITABLE(entry)->current_pos;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1198 int dummy;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1199 int start, finish;
1133
0dc7c7b4f8ca [gaim-migrate @ 1143]
Rob Flynn <gaim@robflynn.com>
parents: 1117
diff changeset
1200
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2303
diff changeset
1201 if (convo_options & OPT_CONVO_CHECK_SPELLING) {
1133
0dc7c7b4f8ca [gaim-migrate @ 1143]
Rob Flynn <gaim@robflynn.com>
parents: 1117
diff changeset
1202 gtkspell_detach(GTK_TEXT(entry));
0dc7c7b4f8ca [gaim-migrate @ 1143]
Rob Flynn <gaim@robflynn.com>
parents: 1117
diff changeset
1203 }
0dc7c7b4f8ca [gaim-migrate @ 1143]
Rob Flynn <gaim@robflynn.com>
parents: 1117
diff changeset
1204
2725
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2722
diff changeset
1205 if (GTK_OLD_EDITABLE(entry)->has_selection) {
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1206 remove_tags(entry, pre);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1207 remove_tags(entry, post);
2725
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2722
diff changeset
1208 start = GTK_OLD_EDITABLE(entry)->selection_start_pos;
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2722
diff changeset
1209 finish = GTK_OLD_EDITABLE(entry)->selection_end_pos;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1210 if (start > finish) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1211 dummy = finish;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1212 finish = start;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1213 start = dummy;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1214 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1215 dummy = start;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1216 gtk_editable_insert_text(GTK_EDITABLE(entry), pre, strlen(pre), &dummy);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1217 dummy = finish + strlen(pre);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1218 gtk_editable_insert_text(GTK_EDITABLE(entry), post, strlen(post), &dummy);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1219 gtk_editable_select_region(GTK_EDITABLE(entry), start,
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1220 finish + strlen(pre) + strlen(post));
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1221 } else {
649
779c04b844f4 [gaim-migrate @ 659]
Todd Kulesza <fflewddur>
parents: 648
diff changeset
1222 temp = pos;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1223 gtk_editable_insert_text(GTK_EDITABLE(entry), pre, strlen(pre), &pos);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1224 if (temp == pos) {
649
779c04b844f4 [gaim-migrate @ 659]
Todd Kulesza <fflewddur>
parents: 648
diff changeset
1225 dummy = pos + strlen(pre);
779c04b844f4 [gaim-migrate @ 659]
Todd Kulesza <fflewddur>
parents: 648
diff changeset
1226 gtk_editable_insert_text(GTK_EDITABLE(entry), post, strlen(post), &dummy);
779c04b844f4 [gaim-migrate @ 659]
Todd Kulesza <fflewddur>
parents: 648
diff changeset
1227 gtk_editable_set_position(GTK_EDITABLE(entry), dummy);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1228 } else {
649
779c04b844f4 [gaim-migrate @ 659]
Todd Kulesza <fflewddur>
parents: 648
diff changeset
1229 dummy = pos;
779c04b844f4 [gaim-migrate @ 659]
Todd Kulesza <fflewddur>
parents: 648
diff changeset
1230 gtk_editable_insert_text(GTK_EDITABLE(entry), post, strlen(post), &dummy);
779c04b844f4 [gaim-migrate @ 659]
Todd Kulesza <fflewddur>
parents: 648
diff changeset
1231 gtk_editable_set_position(GTK_EDITABLE(entry), pos);
779c04b844f4 [gaim-migrate @ 659]
Todd Kulesza <fflewddur>
parents: 648
diff changeset
1232 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1233 }
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1234
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2303
diff changeset
1235 if (convo_options & OPT_CONVO_CHECK_SPELLING) {
1133
0dc7c7b4f8ca [gaim-migrate @ 1143]
Rob Flynn <gaim@robflynn.com>
parents: 1117
diff changeset
1236 gtkspell_attach(GTK_TEXT(entry));
0dc7c7b4f8ca [gaim-migrate @ 1143]
Rob Flynn <gaim@robflynn.com>
parents: 1117
diff changeset
1237 }
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1238
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1239 gtk_widget_grab_focus(entry);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1240 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1241
344
2434adbb8703 [gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
1242 void advance_past(GtkWidget *entry, char *pre, char *post)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1243 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1244 char *s, *s2;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1245 int pos;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1246 if (invert_tags(entry, pre, post, 1))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1247 return;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1248 s = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1);
2725
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2722
diff changeset
1249 pos = GTK_OLD_EDITABLE(entry)->current_pos;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1244
diff changeset
1250 debug_printf(_("Currently at %d, "), pos);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1251 s2 = strstr(&s[pos], post);
523
023c3851db0a [gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 520
diff changeset
1252 if (s2) {
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1253 pos = s2 - s + strlen(post);
523
023c3851db0a [gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 520
diff changeset
1254 } else {
023c3851db0a [gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 520
diff changeset
1255 gtk_editable_insert_text(GTK_EDITABLE(entry), post, strlen(post), &pos);
023c3851db0a [gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 520
diff changeset
1256 }
846
4b05985bae5e [gaim-migrate @ 856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 843
diff changeset
1257 g_free(s);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1244
diff changeset
1258 debug_printf(_("Setting position to %d\n"), pos);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1259 gtk_editable_set_position(GTK_EDITABLE(entry), pos);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1260 gtk_widget_grab_focus(entry);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1261 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1262
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
1263 void toggle_fg_color(GtkWidget *color, struct conversation *c)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1264 {
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1265 if (state_lock)
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1266 return;
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1267 if (GTK_TOGGLE_BUTTON(color)->active)
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
1268 show_fgcolor_dialog(c, color);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
1269 else if (c->fg_color_dialog)
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
1270 cancel_fgcolor(color, c);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
1271 else
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1272 advance_past(c->entry, "<FONT COLOR>", "</FONT>");
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
1273 }
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
1274
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
1275 void toggle_bg_color(GtkWidget *color, struct conversation *c)
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
1276 {
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
1277 if (state_lock)
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1278 return;
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
1279 if (GTK_TOGGLE_BUTTON(color)->active)
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
1280 show_bgcolor_dialog(c, color);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
1281 else if (c->bg_color_dialog)
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
1282 cancel_bgcolor(color, c);
189
50dc3db25513 [gaim-migrate @ 199]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 187
diff changeset
1283 else
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1284 advance_past(c->entry, "<BODY BGCOLOR>", "</BODY>");
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1285 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1286
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1287 void toggle_font(GtkWidget *font, struct conversation *c)
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
1288 {
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1289 if (state_lock)
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1290 return;
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1291 if (GTK_TOGGLE_BUTTON(font)->active)
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1292 show_font_dialog(c, font);
563
8d6e2de1fb64 [gaim-migrate @ 573]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 557
diff changeset
1293 else if (c->font_dialog)
8d6e2de1fb64 [gaim-migrate @ 573]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 557
diff changeset
1294 cancel_font(font, c);
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1295 else
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1296 advance_past(c->entry, "<FONT FACE>", "</FONT>");
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
1297 }
611
0f7e5ff95f71 [gaim-migrate @ 621]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 610
diff changeset
1298
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
1299 void toggle_link(GtkWidget *linky, struct conversation *c)
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
1300 {
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
1301 if (state_lock)
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
1302 return;
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
1303 if (GTK_TOGGLE_BUTTON(linky)->active)
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
1304 show_add_link(linky, c);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
1305 else if (c->link_dialog)
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
1306 cancel_link(linky, c);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
1307 else
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
1308 advance_past(c->entry, "<A HREF>", "</A>");
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
1309 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1310
344
2434adbb8703 [gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
1311 void do_strike(GtkWidget *strike, GtkWidget *entry)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1312 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1313 if (state_lock)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1314 return;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1315
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1316 if (GTK_TOGGLE_BUTTON(strike)->active)
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1317 surround(entry, "<STRIKE>", "</STRIKE>");
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1318 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1319 advance_past(entry, "<STRIKE>", "</STRIKE>");
1133
0dc7c7b4f8ca [gaim-migrate @ 1143]
Rob Flynn <gaim@robflynn.com>
parents: 1117
diff changeset
1320
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1321 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1322
344
2434adbb8703 [gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
1323 void do_bold(GtkWidget *bold, GtkWidget *entry)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1324 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1325 if (state_lock)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1326 return;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1327 if (GTK_TOGGLE_BUTTON(bold)->active)
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1328 surround(entry, "<B>", "</B>");
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1329 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1330 advance_past(entry, "<B>", "</B>");
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1331 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1332
344
2434adbb8703 [gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
1333 void do_underline(GtkWidget *underline, GtkWidget *entry)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1334 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1335 if (state_lock)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1336 return;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1337 if (GTK_TOGGLE_BUTTON(underline)->active)
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1338 surround(entry, "<U>", "</U>");
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1339 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1340 advance_past(entry, "<U>", "</U>");
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1341 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1342
344
2434adbb8703 [gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
1343 void do_italic(GtkWidget *italic, GtkWidget *entry)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1344 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1345 if (state_lock)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1346 return;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1347 if (GTK_TOGGLE_BUTTON(italic)->active)
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1348 surround(entry, "<I>", "</I>");
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1349 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1350 advance_past(entry, "<I>", "</I>");
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1351 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1352
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
1353 /* html code to modify font sizes must all be the same length, */
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
1354 /* currently set to 15 chars */
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
1355
344
2434adbb8703 [gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
1356 void do_small(GtkWidget *small, GtkWidget *entry)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1357 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1358 if (state_lock)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1359 return;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1360 surround(entry, "<FONT SIZE=\"1\">", "</FONT>");
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1361 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1362
344
2434adbb8703 [gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
1363 void do_normal(GtkWidget *normal, GtkWidget *entry)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1364 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1365 if (state_lock)
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1366 return;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1367 surround(entry, "<FONT SIZE=\"3\">", "</FONT>");
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1368 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1369
344
2434adbb8703 [gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
1370 void do_big(GtkWidget *big, GtkWidget *entry)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1371 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1372 if (state_lock)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1373 return;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1374 surround(entry, "<FONT SIZE=\"5\">", "</FONT>");
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1375 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1376
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1377 void check_everything(GtkWidget *entry)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1378 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1379 struct conversation *c;
206
610b7ffc4821 [gaim-migrate @ 216]
Rob Flynn <gaim@robflynn.com>
parents: 189
diff changeset
1380
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1381 c = (struct conversation *)gtk_object_get_user_data(GTK_OBJECT(entry));
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1382 if (!c)
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1383 return;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1384 if (invert_tags(entry, "<B>", "</B>", 0))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1385 quiet_set(c->bold, TRUE);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1386 else if (count_tag(entry, "<B>", "</B>"))
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1387 quiet_set(c->bold, TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1388 else
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1389 quiet_set(c->bold, FALSE);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1390 if (invert_tags(entry, "<I>", "</I>", 0))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1391 quiet_set(c->italic, TRUE);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1392 else if (count_tag(entry, "<I>", "</I>"))
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1393 quiet_set(c->italic, TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1394 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1395 quiet_set(c->italic, FALSE);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1396
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1397 if (invert_tags(entry, "<FONT COLOR", "</FONT>", 0))
854
9e2dcad06d3c [gaim-migrate @ 864]
Rob Flynn <gaim@robflynn.com>
parents: 849
diff changeset
1398 quiet_set(c->fgcolorbtn, TRUE);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1399 else if (count_tag(entry, "<FONT COLOR", "</FONT>"))
854
9e2dcad06d3c [gaim-migrate @ 864]
Rob Flynn <gaim@robflynn.com>
parents: 849
diff changeset
1400 quiet_set(c->fgcolorbtn, TRUE);
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1401 else
854
9e2dcad06d3c [gaim-migrate @ 864]
Rob Flynn <gaim@robflynn.com>
parents: 849
diff changeset
1402 quiet_set(c->fgcolorbtn, FALSE);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1403
861
00fb90babcb2 [gaim-migrate @ 871]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 860
diff changeset
1404 if (invert_tags(entry, "<BODY BGCOLOR", "</BODY>", 0))
00fb90babcb2 [gaim-migrate @ 871]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 860
diff changeset
1405 quiet_set(c->bgcolorbtn, TRUE);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1406 else if (count_tag(entry, "<BODY BGCOLOR", "</BODY>"))
861
00fb90babcb2 [gaim-migrate @ 871]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 860
diff changeset
1407 quiet_set(c->bgcolorbtn, TRUE);
00fb90babcb2 [gaim-migrate @ 871]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 860
diff changeset
1408 else
00fb90babcb2 [gaim-migrate @ 871]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 860
diff changeset
1409 quiet_set(c->bgcolorbtn, FALSE);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1410
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1411 if (invert_tags(entry, "<FONT FACE", "</FONT>", 0))
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1412 quiet_set(c->font, TRUE);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1413 else if (count_tag(entry, "<FONT FACE", "</FONT>"))
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1414 quiet_set(c->font, TRUE);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1415 else
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1416 quiet_set(c->font, FALSE);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1417
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1418 if (invert_tags(entry, "<A HREF", "</A>", 0))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1419 quiet_set(c->link, TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1420 else if (count_tag(entry, "<A HREF", "</A>"))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1421 quiet_set(c->link, TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1422 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1423 quiet_set(c->link, FALSE);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1424
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1425 if (invert_tags(entry, "<U>", "</U>", 0))
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1426 quiet_set(c->underline, TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1427 else if (count_tag(entry, "<U>", "</U>"))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1428 quiet_set(c->underline, TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1429 else
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1430 quiet_set(c->underline, FALSE);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1431
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1432 if (invert_tags(entry, "<STRIKE>", "</STRIKE>", 0))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1433 quiet_set(c->strike, TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1434 else if (count_tag(entry, "<STRIKE>", "</STRIKE>"))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1435 quiet_set(c->strike, TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1436 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1437 quiet_set(c->strike, FALSE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1438 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1439
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1440
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1441 /*------------------------------------------------------------------------*/
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1442 /* Takin care of the window.. */
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1443 /*------------------------------------------------------------------------*/
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1444
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1445
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1446 /* this is going to be interesting since the conversation could either be a
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1447 * normal IM conversation or a chat window. but hopefully it won't matter */
2856
b1e300a85678 [gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2855
diff changeset
1448 void write_to_conv(struct conversation *c, char *what, int flags, char *who, time_t mtime, gint length)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1449 {
1735
00f74db70f2d [gaim-migrate @ 1745]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1732
diff changeset
1450 char buf[BUF_LONG];
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1451 char *str;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1452 FILE *fd;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1453 char colour[10];
741
58a6e6e26695 [gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 738
diff changeset
1454 struct buddy *b;
1244
eaa0e2f5ace4 [gaim-migrate @ 1254]
Rob Flynn <gaim@robflynn.com>
parents: 1235
diff changeset
1455 int gtk_font_options = 0;
1440
6330d0bb309f [gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1439
diff changeset
1456 GString *logstr;
1735
00f74db70f2d [gaim-migrate @ 1745]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1732
diff changeset
1457 char buf2[BUF_LONG];
1764
1e0613d9526b [gaim-migrate @ 1774]
Rob Flynn <gaim@robflynn.com>
parents: 1759
diff changeset
1458 char mdate[64];
1e0613d9526b [gaim-migrate @ 1774]
Rob Flynn <gaim@robflynn.com>
parents: 1759
diff changeset
1459
2856
b1e300a85678 [gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2855
diff changeset
1460 if (c->is_chat && (!c->gc || !g_slist_find(c->gc->buddy_chats, c)))
2267
837aa71710c5 [gaim-migrate @ 2277]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2264
diff changeset
1461 return;
837aa71710c5 [gaim-migrate @ 2277]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2264
diff changeset
1462
2447
6bdeb91abe4e [gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2426
diff changeset
1463 if (!c->is_chat && !g_list_find(conversations, c))
6bdeb91abe4e [gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2426
diff changeset
1464 return;
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1465
2794
2d3f47783a22 [gaim-migrate @ 2807]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2788
diff changeset
1466 gtk_widget_show(c->window);
2d3f47783a22 [gaim-migrate @ 2807]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2788
diff changeset
1467
1772
896432d66303 [gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1764
diff changeset
1468 if (!c->is_chat || !(c->gc->prpl->options & OPT_PROTO_UNIQUE_CHATNAME)) {
896432d66303 [gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1764
diff changeset
1469 if (!who) {
896432d66303 [gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1764
diff changeset
1470 if (flags & WFLAG_SEND) {
896432d66303 [gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1764
diff changeset
1471 b = find_buddy(c->gc, c->gc->username);
2213
a226ebf4be47 [gaim-migrate @ 2223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2210
diff changeset
1472 if (b && strcmp(b->name, b->show))
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
1473 who = b->show;
2210
3a6fd1e8f00a [gaim-migrate @ 2220]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2202
diff changeset
1474 else if (c->gc->displayname[0])
3a6fd1e8f00a [gaim-migrate @ 2220]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2202
diff changeset
1475 who = c->gc->displayname;
1772
896432d66303 [gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1764
diff changeset
1476 else
896432d66303 [gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1764
diff changeset
1477 who = c->gc->username;
896432d66303 [gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1764
diff changeset
1478 } else {
896432d66303 [gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1764
diff changeset
1479 b = find_buddy(c->gc, c->name);
896432d66303 [gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1764
diff changeset
1480 if (b)
896432d66303 [gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1764
diff changeset
1481 who = b->show;
896432d66303 [gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1764
diff changeset
1482 else
896432d66303 [gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1764
diff changeset
1483 who = c->name;
896432d66303 [gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1764
diff changeset
1484 }
896432d66303 [gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1764
diff changeset
1485 } else {
896432d66303 [gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1764
diff changeset
1486 b = find_buddy(c->gc, who);
745
d693b83e4933 [gaim-migrate @ 755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 741
diff changeset
1487 if (b)
d693b83e4933 [gaim-migrate @ 755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 741
diff changeset
1488 who = b->show;
741
58a6e6e26695 [gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 738
diff changeset
1489 }
474
7720d0f9da8e [gaim-migrate @ 484]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 473
diff changeset
1490 }
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1491
2447
6bdeb91abe4e [gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2426
diff changeset
1492 strftime(mdate, sizeof(mdate), "%H:%M:%S", localtime(&mtime));
6bdeb91abe4e [gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2426
diff changeset
1493
6bdeb91abe4e [gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2426
diff changeset
1494 gtk_font_options = gtk_font_options ^ GTK_IMHTML_NO_COMMENTS;
6bdeb91abe4e [gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2426
diff changeset
1495
6bdeb91abe4e [gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2426
diff changeset
1496 if (convo_options & OPT_CONVO_IGNORE_COLOUR)
6bdeb91abe4e [gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2426
diff changeset
1497 gtk_font_options = gtk_font_options ^ GTK_IMHTML_NO_COLOURS;
6bdeb91abe4e [gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2426
diff changeset
1498
6bdeb91abe4e [gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2426
diff changeset
1499 if (convo_options & OPT_CONVO_IGNORE_FONTS)
6bdeb91abe4e [gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2426
diff changeset
1500 gtk_font_options = gtk_font_options ^ GTK_IMHTML_NO_FONTS;
6bdeb91abe4e [gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2426
diff changeset
1501
6bdeb91abe4e [gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2426
diff changeset
1502 if (convo_options & OPT_CONVO_IGNORE_SIZES)
6bdeb91abe4e [gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2426
diff changeset
1503 gtk_font_options = gtk_font_options ^ GTK_IMHTML_NO_SIZES;
6bdeb91abe4e [gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2426
diff changeset
1504
6bdeb91abe4e [gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2426
diff changeset
1505 if (!(logging_options & OPT_LOG_STRIP_HTML))
6bdeb91abe4e [gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2426
diff changeset
1506 gtk_font_options = gtk_font_options ^ GTK_IMHTML_RETURN_LOG;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
1507
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1508 if (flags & WFLAG_SYSTEM) {
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2303
diff changeset
1509 if (convo_options & OPT_CONVO_SHOW_TIME)
1764
1e0613d9526b [gaim-migrate @ 1774]
Rob Flynn <gaim@robflynn.com>
parents: 1759
diff changeset
1510 g_snprintf(buf, BUF_LONG, "<FONT SIZE=\"2\">(%s) </FONT><B>%s</B>", mdate, what);
1735
00f74db70f2d [gaim-migrate @ 1745]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1732
diff changeset
1511 else
1815
f15d449b3167 [gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1813
diff changeset
1512 g_snprintf(buf, BUF_LONG, "<B>%s</B>", what);
1735
00f74db70f2d [gaim-migrate @ 1745]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1732
diff changeset
1513 g_snprintf(buf2, sizeof(buf2), "<FONT SIZE=\"2\"><!--(%s) --></FONT><B>%s</B><BR>",
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
1514 mdate, what);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1515
2856
b1e300a85678 [gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2855
diff changeset
1516 gtk_imhtml_append_text(GTK_IMHTML(c->text), buf2, -1, 0);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1517
1525
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1486
diff changeset
1518 if (logging_options & OPT_LOG_STRIP_HTML) {
1735
00f74db70f2d [gaim-migrate @ 1745]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1732
diff changeset
1519 char *t1 = strip_html(buf);
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1520 c->history = g_string_append(c->history, t1);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1521 c->history = g_string_append(c->history, "\n");
1486
b72a33d07ce8 [gaim-migrate @ 1496]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1479
diff changeset
1522 g_free(t1);
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1523 } else {
1735
00f74db70f2d [gaim-migrate @ 1745]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1732
diff changeset
1524 c->history = g_string_append(c->history, buf);
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1525 c->history = g_string_append(c->history, "<BR>\n");
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1526 }
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1527
2385
bdc74764245c [gaim-migrate @ 2398]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
1528 if (!(flags & WFLAG_NOLOG) && ((logging_options & OPT_LOG_ALL) || find_log_info(c->name))) {
1437
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1529 char *t1;
699
f8acdd22065a [gaim-migrate @ 709]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 698
diff changeset
1530 char nm[256];
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1531
1525
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1486
diff changeset
1532 if (logging_options & OPT_LOG_STRIP_HTML) {
1735
00f74db70f2d [gaim-migrate @ 1745]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1732
diff changeset
1533 t1 = strip_html(buf);
1437
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1534 } else {
1735
00f74db70f2d [gaim-migrate @ 1745]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1732
diff changeset
1535 t1 = buf;
1437
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1536 }
699
f8acdd22065a [gaim-migrate @ 709]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 698
diff changeset
1537 if (c->is_chat)
f8acdd22065a [gaim-migrate @ 709]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 698
diff changeset
1538 g_snprintf(nm, 256, "%s.chat", c->name);
f8acdd22065a [gaim-migrate @ 709]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 698
diff changeset
1539 else
f8acdd22065a [gaim-migrate @ 709]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 698
diff changeset
1540 g_snprintf(nm, 256, "%s", c->name);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1541 fd = open_log_file(nm);
2004
699ddd727a49 [gaim-migrate @ 2014]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1970
diff changeset
1542 if (fd) {
1525
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1486
diff changeset
1543 if (logging_options & OPT_LOG_STRIP_HTML) {
1437
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1544 fprintf(fd, "%s\n", t1);
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1545 } else {
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1546 fprintf(fd, "%s<BR>\n", t1);
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1547 }
1067
649199f4730e [gaim-migrate @ 1077]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1063
diff changeset
1548 fclose(fd);
936
311b3f72e7b9 [gaim-migrate @ 946]
Rob Flynn <gaim@robflynn.com>
parents: 915
diff changeset
1549 }
1525
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1486
diff changeset
1550 if (logging_options & OPT_LOG_STRIP_HTML) {
1437
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1551 g_free(t1);
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1552 }
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1553 }
2385
bdc74764245c [gaim-migrate @ 2398]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
1554 } else if (flags & WFLAG_NOLOG) {
bdc74764245c [gaim-migrate @ 2398]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2379
diff changeset
1555 g_snprintf(buf, BUF_LONG, "<B><FONT COLOR=\"#777777\">%s</FONT></B><BR>", what);
2856
b1e300a85678 [gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2855
diff changeset
1556 gtk_imhtml_append_text(GTK_IMHTML(c->text), buf, -1, 0);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1557 } else {
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1558 if (flags & WFLAG_WHISPER) {
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1559 /* if we're whispering, it's not an autoresponse */
2856
b1e300a85678 [gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2855
diff changeset
1560 if (meify(what, length)) {
2138
cfa83a1b3d49 [gaim-migrate @ 2148]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2124
diff changeset
1561 str = g_malloc(1024);
cfa83a1b3d49 [gaim-migrate @ 2148]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2124
diff changeset
1562 g_snprintf(str, 1024, "***%s", who);
2374
9e9385cddcc6 [gaim-migrate @ 2387]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1563 strcpy(colour, "#6C2585");
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1564 } else {
2138
cfa83a1b3d49 [gaim-migrate @ 2148]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2124
diff changeset
1565 str = g_malloc(1024);
cfa83a1b3d49 [gaim-migrate @ 2148]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2124
diff changeset
1566 g_snprintf(str, 1024, "*%s*:", who);
2374
9e9385cddcc6 [gaim-migrate @ 2387]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1567 strcpy(colour, "#00ff00");
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1568 }
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1569 } else {
2856
b1e300a85678 [gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2855
diff changeset
1570 if (meify(what, length)) {
2138
cfa83a1b3d49 [gaim-migrate @ 2148]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2124
diff changeset
1571 str = g_malloc(1024);
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1572 if (flags & WFLAG_AUTO)
2138
cfa83a1b3d49 [gaim-migrate @ 2148]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2124
diff changeset
1573 g_snprintf(str, 1024, "%s ***%s", AUTO_RESPONSE, who);
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1574 else
2138
cfa83a1b3d49 [gaim-migrate @ 2148]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2124
diff changeset
1575 g_snprintf(str, 1024, "***%s", who);
2374
9e9385cddcc6 [gaim-migrate @ 2387]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1576 if (flags & WFLAG_NICK)
2375
09fe1b00d31f [gaim-migrate @ 2388]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2374
diff changeset
1577 strcpy(colour, "#af7f00");
2374
9e9385cddcc6 [gaim-migrate @ 2387]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1578 else
9e9385cddcc6 [gaim-migrate @ 2387]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1579 strcpy(colour, "#062585");
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1580 } else {
2138
cfa83a1b3d49 [gaim-migrate @ 2148]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2124
diff changeset
1581 str = g_malloc(1024);
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1582 if (flags & WFLAG_AUTO)
2138
cfa83a1b3d49 [gaim-migrate @ 2148]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2124
diff changeset
1583 g_snprintf(str, 1024, "%s %s", who, AUTO_RESPONSE);
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1584 else
2138
cfa83a1b3d49 [gaim-migrate @ 2148]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2124
diff changeset
1585 g_snprintf(str, 1024, "%s:", who);
2374
9e9385cddcc6 [gaim-migrate @ 2387]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1586 if (flags & WFLAG_NICK)
2375
09fe1b00d31f [gaim-migrate @ 2388]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2374
diff changeset
1587 strcpy(colour, "#af7f00");
2374
9e9385cddcc6 [gaim-migrate @ 2387]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
1588 else if (flags & WFLAG_RECV)
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1589 strcpy(colour, "#ff0000");
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1590 else if (flags & WFLAG_SEND)
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1591 strcpy(colour, "#0000ff");
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1592 }
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1593 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1594
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2303
diff changeset
1595 if (convo_options & OPT_CONVO_SHOW_TIME)
1437
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1596 g_snprintf(buf, BUF_LONG, "<FONT COLOR=\"%s\"><FONT SIZE=\"2\">(%s) </FONT>"
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
1597 "<B>%s</B></FONT> ", colour, mdate, str);
1437
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1598 else
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1599 g_snprintf(buf, BUF_LONG, "<FONT COLOR=\"%s\"><B>%s</B></FONT> ", colour, str);
1439
06a21ec0e269 [gaim-migrate @ 1449]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1438
diff changeset
1600 g_snprintf(buf2, BUF_LONG, "<FONT COLOR=\"%s\"><FONT SIZE=\"2\"><!--(%s) --></FONT>"
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
1601 "<B>%s</B></FONT> ", colour, mdate, str);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1602
473
f9bb7761c52b [gaim-migrate @ 483]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 472
diff changeset
1603 g_free(str);
f9bb7761c52b [gaim-migrate @ 483]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 472
diff changeset
1604
2856
b1e300a85678 [gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2855
diff changeset
1605 gtk_imhtml_append_text(GTK_IMHTML(c->text), buf2, -1, 0);
b1e300a85678 [gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2855
diff changeset
1606
b1e300a85678 [gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2855
diff changeset
1607 logstr = gtk_imhtml_append_text(GTK_IMHTML(c->text), what, length, gtk_font_options);
b1e300a85678 [gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2855
diff changeset
1608
b1e300a85678 [gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2855
diff changeset
1609 gtk_imhtml_append_text(GTK_IMHTML(c->text), "<BR>", -1, 0);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1610
2857
7a6f33cd6721 [gaim-migrate @ 2870]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2856
diff changeset
1611 /* XXX this needs to be updated for the new length argument */
1525
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1486
diff changeset
1612 if (logging_options & OPT_LOG_STRIP_HTML) {
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1613 char *t1, *t2;
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1614 t1 = strip_html(buf);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1615 t2 = strip_html(what);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1616 c->history = g_string_append(c->history, t1);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1617 c->history = g_string_append(c->history, t2);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1618 c->history = g_string_append(c->history, "\n");
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1619 g_free(t1);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1620 g_free(t2);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1621 } else {
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1622 char *t1, *t2;
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1623 t1 = html_logize(buf);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1624 t2 = html_logize(what);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1625 c->history = g_string_append(c->history, t1);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1626 c->history = g_string_append(c->history, t2);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1627 c->history = g_string_append(c->history, "\n");
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1628 c->history = g_string_append(c->history, logstr->str);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1629 c->history = g_string_append(c->history, "<BR>\n");
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1630 g_free(t1);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1631 g_free(t2);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1632 }
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1633
2857
7a6f33cd6721 [gaim-migrate @ 2870]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2856
diff changeset
1634 /* XXX this needs to be updated for the new length argument */
2386
437ae28a1172 [gaim-migrate @ 2399]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2385
diff changeset
1635 if ((logging_options & OPT_LOG_ALL) || find_log_info(c->name)) {
1437
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1636 char *t1, *t2;
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1637 char *nm = g_malloc(256);
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1638 if (c->is_chat)
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1639 g_snprintf(nm, 256, "%s.chat", c->name);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1640 else
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1641 g_snprintf(nm, 256, "%s", c->name);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1642
1525
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1486
diff changeset
1643 if (logging_options & OPT_LOG_STRIP_HTML) {
1437
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1644 t1 = strip_html(buf);
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1645 t2 = strip_html(what);
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1646 } else {
1440
6330d0bb309f [gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1439
diff changeset
1647 t1 = html_logize(buf);
6330d0bb309f [gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1439
diff changeset
1648 t2 = html_logize(what);
1437
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1649 }
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1650 fd = open_log_file(nm);
2004
699ddd727a49 [gaim-migrate @ 2014]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1970
diff changeset
1651 if (fd) {
1525
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1486
diff changeset
1652 if (logging_options & OPT_LOG_STRIP_HTML) {
1437
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1653 fprintf(fd, "%s%s\n", t1, t2);
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1654 } else {
1440
6330d0bb309f [gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1439
diff changeset
1655 fprintf(fd, "%s%s%s<BR>\n", t1, t2, logstr->str);
6330d0bb309f [gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1439
diff changeset
1656 g_string_free(logstr, TRUE);
1437
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1657 }
1067
649199f4730e [gaim-migrate @ 1077]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1063
diff changeset
1658 fclose(fd);
936
311b3f72e7b9 [gaim-migrate @ 946]
Rob Flynn <gaim@robflynn.com>
parents: 915
diff changeset
1659 }
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1660 g_free(t1);
1437
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1661 g_free(t2);
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1662 g_free(nm);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1663 }
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1664 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1665
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2303
diff changeset
1666 if ((c->is_chat && (chat_options & OPT_CHAT_POPUP)) ||
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2303
diff changeset
1667 (!c->is_chat && (im_options & OPT_IM_POPUP)))
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
1668 gdk_window_show(c->window->window);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1669
2843
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
1670 /* tab highlighting */
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
1671 if (c->is_chat && !(chat_options & OPT_CHAT_ONE_WINDOW)) /* if chat but not tabbed chat */
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
1672 return;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
1673 if (!c->is_chat && !(im_options & OPT_IM_ONE_WINDOW)) /* if convo but not tabbed convo */
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
1674 return;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
1675 if (!(flags & WFLAG_RECV) && !(flags & WFLAG_SYSTEM))
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
1676 return;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
1677 if ((c->unseen == 2) || ((c->unseen == 1) && !(flags & WFLAG_NICK)))
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
1678 return;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
1679
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
1680 if (c->is_chat) {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
1681 int offs;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
1682 if ((convo_options & OPT_CONVO_COMBINE) && (im_options & OPT_IM_ONE_WINDOW))
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
1683 offs = g_list_length(conversations);
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
1684 else
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
1685 offs = 0;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
1686 if (gtk_notebook_get_current_page(GTK_NOTEBOOK(chat_notebook)) ==
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
1687 g_list_index(chats, c) + offs)
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
1688 return;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
1689 } else {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
1690 if (gtk_notebook_get_current_page(GTK_NOTEBOOK(convo_notebook)) ==
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
1691 g_list_index(conversations, c))
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
1692 return;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
1693 }
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
1694
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
1695 {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
1696 GtkNotebook *notebook = GTK_NOTEBOOK(c->is_chat ? chat_notebook : convo_notebook);
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
1697 int offs = ((convo_options & OPT_CONVO_COMBINE) &&
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
1698 (im_options & OPT_IM_ONE_WINDOW) && c->is_chat) ?
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
1699 g_list_length(conversations) : 0;
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
1700 GList *ws = (c->is_chat ? chats : conversations);
2843
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
1701 GtkWidget *label = gtk_notebook_get_tab_label(notebook,
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
1702 gtk_notebook_get_nth_page(notebook,
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
1703 offs + g_list_index(ws, c)));
2625
d8d2df2bdf01 [gaim-migrate @ 2638]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2619
diff changeset
1704 GtkStyle *style;
d8d2df2bdf01 [gaim-migrate @ 2638]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2619
diff changeset
1705 style = gtk_style_new();
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
1706 if (!GTK_WIDGET_REALIZED(label))
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
1707 gtk_widget_realize(label);
2725
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2722
diff changeset
1708 gdk_font_unref(gtk_style_get_font(style));
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2722
diff changeset
1709 gtk_style_set_font(style, gdk_font_ref(gtk_style_get_font(label->style)));
2625
d8d2df2bdf01 [gaim-migrate @ 2638]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2619
diff changeset
1710 if (flags & WFLAG_NICK) {
d8d2df2bdf01 [gaim-migrate @ 2638]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2619
diff changeset
1711 style->fg[0].red = 0x0000;
d8d2df2bdf01 [gaim-migrate @ 2638]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2619
diff changeset
1712 style->fg[0].green = 0x0000;
d8d2df2bdf01 [gaim-migrate @ 2638]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2619
diff changeset
1713 style->fg[0].blue = 0xcccc;
d8d2df2bdf01 [gaim-migrate @ 2638]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2619
diff changeset
1714 c->unseen = 2;
d8d2df2bdf01 [gaim-migrate @ 2638]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2619
diff changeset
1715 } else {
d8d2df2bdf01 [gaim-migrate @ 2638]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2619
diff changeset
1716 style->fg[0].red = 0xcccc;
d8d2df2bdf01 [gaim-migrate @ 2638]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2619
diff changeset
1717 style->fg[0].green = 0x0000;
d8d2df2bdf01 [gaim-migrate @ 2638]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2619
diff changeset
1718 style->fg[0].blue = 0x0000;
d8d2df2bdf01 [gaim-migrate @ 2638]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2619
diff changeset
1719 c->unseen = 1;
d8d2df2bdf01 [gaim-migrate @ 2638]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2619
diff changeset
1720 }
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
1721 gtk_widget_set_style(label, style);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
1722 gtk_style_unref(style);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
1723 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1724 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1725
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1726
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1727
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1728 GtkWidget *build_conv_toolbar(struct conversation *c)
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1729 {
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1730 GdkPixmap *strike_i, *small_i, *normal_i, *big_i, *bold_i, *italic_i, *underline_i, *speaker_i,
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1731 *wood_i, *fgcolor_i, *bgcolor_i, *link_i, *font_i, *smiley_i, *save_i;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1732 GtkWidget *strike_p, *small_p, *normal_p, *big_p, *bold_p, *italic_p, *underline_p, *speaker_p,
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1733 *wood_p, *fgcolor_p, *bgcolor_p, *link_p, *font_p, *smiley_p, *save_p;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1734 GtkWidget *strike, *small, *normal, *big, *bold, *italic, *underline, *speaker, *wood,
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1735 *fgcolorbtn, *bgcolorbtn, *link, *font, *smiley, *save;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1736 GdkBitmap *mask;
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1737 GtkWidget *toolbar;
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1738 GtkWidget *win;
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1739 GtkWidget *entry;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1740
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1741 toolbar = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_ICONS);
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1742 win = c->window;
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1743 entry = c->entry;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1744
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1745 bold_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, bold_xpm);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1746 bold_p = gtk_pixmap_new(bold_i, mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1747 gtk_widget_show(bold_p);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1748 gdk_bitmap_unref(mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1749
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1750 italic_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, italic_xpm);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1751 italic_p = gtk_pixmap_new(italic_i, mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1752 gtk_widget_show(italic_p);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1753 gdk_bitmap_unref(mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1754
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1755 underline_i = gdk_pixmap_create_from_xpm_d(win->window, &mask,
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1756 &win->style->white, underline_xpm);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1757 underline_p = gtk_pixmap_new(underline_i, mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1758 gtk_widget_show(underline_p);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1759 gdk_bitmap_unref(mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1760
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1761 strike_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, strike_xpm);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1762 strike_p = gtk_pixmap_new(strike_i, mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1763 gtk_widget_show(strike_p);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1764 gdk_bitmap_unref(mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1765
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1766 small_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, small_xpm);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1767 small_p = gtk_pixmap_new(small_i, mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1768 gtk_widget_show(small_p);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1769 gdk_bitmap_unref(mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1770
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1771 normal_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, normal_xpm);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1772 normal_p = gtk_pixmap_new(normal_i, mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1773 gtk_widget_show(normal_p);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1774 gdk_bitmap_unref(mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1775
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1776 big_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, big_xpm);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1777 big_p = gtk_pixmap_new(big_i, mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1778 gtk_widget_show(big_p);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1779 gdk_bitmap_unref(mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1780
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1781 font_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, fontface_xpm);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1782 font_p = gtk_pixmap_new(font_i, mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1783 gtk_widget_show(font_p);
804
17def2bb9720 [gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 801
diff changeset
1784 gdk_bitmap_unref(mask);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1785
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1786 fgcolor_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, fgcolor_xpm);
854
9e2dcad06d3c [gaim-migrate @ 864]
Rob Flynn <gaim@robflynn.com>
parents: 849
diff changeset
1787 fgcolor_p = gtk_pixmap_new(fgcolor_i, mask);
9e2dcad06d3c [gaim-migrate @ 864]
Rob Flynn <gaim@robflynn.com>
parents: 849
diff changeset
1788 gtk_widget_show(fgcolor_p);
9e2dcad06d3c [gaim-migrate @ 864]
Rob Flynn <gaim@robflynn.com>
parents: 849
diff changeset
1789 gdk_bitmap_unref(mask);
9e2dcad06d3c [gaim-migrate @ 864]
Rob Flynn <gaim@robflynn.com>
parents: 849
diff changeset
1790
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1791 bgcolor_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, bgcolor_xpm);
854
9e2dcad06d3c [gaim-migrate @ 864]
Rob Flynn <gaim@robflynn.com>
parents: 849
diff changeset
1792 bgcolor_p = gtk_pixmap_new(bgcolor_i, mask);
9e2dcad06d3c [gaim-migrate @ 864]
Rob Flynn <gaim@robflynn.com>
parents: 849
diff changeset
1793 gtk_widget_show(bgcolor_p);
804
17def2bb9720 [gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 801
diff changeset
1794 gdk_bitmap_unref(mask);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1795
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1796 link_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, link_xpm);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1797 link_p = gtk_pixmap_new(link_i, mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1798 gtk_widget_show(link_p);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1799 gdk_bitmap_unref(mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1800
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1801 smiley_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, smile_icon_xpm);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1802 smiley_p = gtk_pixmap_new(smiley_i, mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1803 gtk_widget_show(smiley_p);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1804 gdk_bitmap_unref(mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1805
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1806 wood_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, wood_xpm);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1807 wood_p = gtk_pixmap_new(wood_i, mask);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1808 gtk_widget_show(wood_p);
804
17def2bb9720 [gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 801
diff changeset
1809 gdk_bitmap_unref(mask);
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1810
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1811 save_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, save_small_xpm);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1812 save_p = gtk_pixmap_new(save_i, mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1813 gtk_widget_show(save_p);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1814 gdk_bitmap_unref(mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1815
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1816 speaker_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, speaker_xpm);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1817 speaker_p = gtk_pixmap_new(speaker_i, mask);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1818 gtk_widget_show(speaker_p);
804
17def2bb9720 [gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 801
diff changeset
1819 gdk_bitmap_unref(mask);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1820 c->makesound = 1;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1821
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1822 bold = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1823 GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL,
1970
43a55969523f [gaim-migrate @ 1980]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1965
diff changeset
1824 NULL, _("Bold Text"), _("Bold"), bold_p,
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1825 GTK_SIGNAL_FUNC(do_bold), entry);
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1826 italic = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1827 GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
1970
43a55969523f [gaim-migrate @ 1980]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1965
diff changeset
1828 NULL, NULL, _("Italics Text"),
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1829 _("Italics"), italic_p, GTK_SIGNAL_FUNC(do_italic), entry);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1830 underline = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1831 GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
1970
43a55969523f [gaim-migrate @ 1980]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1965
diff changeset
1832 NULL, NULL, _("Underline Text"),
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1833 _("Underline"), underline_p,
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1834 GTK_SIGNAL_FUNC(do_underline), entry);
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1835 strike =
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1836 gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL,
1970
43a55969523f [gaim-migrate @ 1980]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1965
diff changeset
1837 NULL, _("Strike through Text"), _("Strike"), strike_p,
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1838 GTK_SIGNAL_FUNC(do_strike), entry);
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1839
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1840 gtk_toolbar_append_space(GTK_TOOLBAR(toolbar));
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1841
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1842 small = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar),
1970
43a55969523f [gaim-migrate @ 1980]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1965
diff changeset
1843 NULL, _("Decrease font size"), _("Small"),
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1844 small_p, GTK_SIGNAL_FUNC(do_small), entry);
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1845 normal = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar),
1970
43a55969523f [gaim-migrate @ 1980]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1965
diff changeset
1846 NULL, _("Normal font size"), _("Normal"),
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1847 normal_p, GTK_SIGNAL_FUNC(do_normal), entry);
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1848 big = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar),
1970
43a55969523f [gaim-migrate @ 1980]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1965
diff changeset
1849 NULL, _("Increase font size"), _("Big"),
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1850 big_p, GTK_SIGNAL_FUNC(do_big), entry);
862
2ee4e61832a4 [gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 861
diff changeset
1851
2ee4e61832a4 [gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 861
diff changeset
1852 gtk_toolbar_append_space(GTK_TOOLBAR(toolbar));
2ee4e61832a4 [gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 861
diff changeset
1853
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1854 font = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1855 GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
1970
43a55969523f [gaim-migrate @ 1980]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1965
diff changeset
1856 NULL, NULL, _("Select Font"),
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1857 _("Font"), font_p, GTK_SIGNAL_FUNC(toggle_font), c);
862
2ee4e61832a4 [gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 861
diff changeset
1858 fgcolorbtn = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1859 GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
1970
43a55969523f [gaim-migrate @ 1980]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1965
diff changeset
1860 NULL, NULL, _("Text Color"),
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1861 _("Color"), fgcolor_p, GTK_SIGNAL_FUNC(toggle_fg_color),
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1862 c);
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1863 bgcolorbtn =
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1864 gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL,
1970
43a55969523f [gaim-migrate @ 1980]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1965
diff changeset
1865 NULL, _("Background Color"), _("Color"), bgcolor_p,
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1866 GTK_SIGNAL_FUNC(toggle_bg_color), c);
862
2ee4e61832a4 [gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 861
diff changeset
1867
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1868 gtk_toolbar_append_space(GTK_TOOLBAR(toolbar));
862
2ee4e61832a4 [gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 861
diff changeset
1869
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1870 link = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1871 GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
1970
43a55969523f [gaim-migrate @ 1980]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1965
diff changeset
1872 NULL, NULL, _("Insert Link"),
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1873 _("Link"), link_p, GTK_SIGNAL_FUNC(toggle_link), c);
862
2ee4e61832a4 [gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 861
diff changeset
1874 smiley = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1875 GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
1970
43a55969523f [gaim-migrate @ 1980]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1965
diff changeset
1876 NULL, NULL, _("Insert smiley face"), _("Smiley"),
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1877 smiley_p, GTK_SIGNAL_FUNC(insert_smiley), c);
862
2ee4e61832a4 [gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 861
diff changeset
1878
2ee4e61832a4 [gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 861
diff changeset
1879 gtk_toolbar_append_space(GTK_TOOLBAR(toolbar));
2ee4e61832a4 [gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 861
diff changeset
1880
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1881 wood = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1882 GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
1970
43a55969523f [gaim-migrate @ 1980]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1965
diff changeset
1883 NULL, NULL, _("Enable logging"),
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1884 _("Logging"), wood_p, GTK_SIGNAL_FUNC(toggle_loggle), c);
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1885 state_lock = 1;
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1886 if (find_log_info(c->name))
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1887 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(wood), TRUE);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1888 else
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1889 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(wood), FALSE);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1890 state_lock = 0;
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1891
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
1892 save = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
1893 NULL, _("Save Conversation"),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
1894 _("Save"), save_p, GTK_SIGNAL_FUNC(save_convo), c);
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1895
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1896 speaker = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1897 GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
1970
43a55969523f [gaim-migrate @ 1980]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1965
diff changeset
1898 NULL, NULL, _("Enable sounds"),
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1899 _("Sound"), speaker_p, GTK_SIGNAL_FUNC(set_option),
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1900 &c->makesound);
1709
11d0deb44a36 [gaim-migrate @ 1719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1705
diff changeset
1901 c->makesound = 0;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1902 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(speaker), TRUE);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1903
535
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
1904 /* use a slicker look if the user wants to */
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2303
diff changeset
1905 if (misc_options & OPT_MISC_COOL_LOOK) {
535
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
1906 gtk_button_set_relief(GTK_BUTTON(bold), GTK_RELIEF_NONE);
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
1907 gtk_button_set_relief(GTK_BUTTON(italic), GTK_RELIEF_NONE);
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
1908 gtk_button_set_relief(GTK_BUTTON(underline), GTK_RELIEF_NONE);
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1909 gtk_button_set_relief(GTK_BUTTON(strike), GTK_RELIEF_NONE);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1910 gtk_button_set_relief(GTK_BUTTON(small), GTK_RELIEF_NONE);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1911 gtk_button_set_relief(GTK_BUTTON(normal), GTK_RELIEF_NONE);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1912 gtk_button_set_relief(GTK_BUTTON(big), GTK_RELIEF_NONE);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1913 gtk_button_set_relief(GTK_BUTTON(font), GTK_RELIEF_NONE);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1914 gtk_button_set_relief(GTK_BUTTON(fgcolorbtn), GTK_RELIEF_NONE);
854
9e2dcad06d3c [gaim-migrate @ 864]
Rob Flynn <gaim@robflynn.com>
parents: 849
diff changeset
1915 gtk_button_set_relief(GTK_BUTTON(bgcolorbtn), GTK_RELIEF_NONE);
535
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
1916 gtk_button_set_relief(GTK_BUTTON(link), GTK_RELIEF_NONE);
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 551
diff changeset
1917 gtk_button_set_relief(GTK_BUTTON(smiley), GTK_RELIEF_NONE);
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1918 gtk_button_set_relief(GTK_BUTTON(wood), GTK_RELIEF_NONE);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1919 gtk_button_set_relief(GTK_BUTTON(save), GTK_RELIEF_NONE);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1920 gtk_button_set_relief(GTK_BUTTON(speaker), GTK_RELIEF_NONE);
535
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
1921 }
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1922
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1923 gtk_widget_show(toolbar);
644
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 636
diff changeset
1924
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 636
diff changeset
1925 gdk_pixmap_unref(bold_i);
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 636
diff changeset
1926 gdk_pixmap_unref(italic_i);
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 636
diff changeset
1927 gdk_pixmap_unref(underline_i);
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1928 gdk_pixmap_unref(strike_i);
644
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 636
diff changeset
1929 gdk_pixmap_unref(small_i);
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 636
diff changeset
1930 gdk_pixmap_unref(normal_i);
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 636
diff changeset
1931 gdk_pixmap_unref(big_i);
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 636
diff changeset
1932 gdk_pixmap_unref(font_i);
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1933 gdk_pixmap_unref(fgcolor_i);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1934 gdk_pixmap_unref(bgcolor_i);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1935 gdk_pixmap_unref(link_i);
644
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 636
diff changeset
1936 gdk_pixmap_unref(smiley_i);
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1937 gdk_pixmap_unref(wood_i);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1938 gdk_pixmap_unref(save_i);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1939 gdk_pixmap_unref(speaker_i);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1940
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1941 c->bold = bold;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1942 c->strike = strike;
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1943 c->italic = italic;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1944 c->underline = underline;
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1945 c->log_button = wood;
854
9e2dcad06d3c [gaim-migrate @ 864]
Rob Flynn <gaim@robflynn.com>
parents: 849
diff changeset
1946 c->fgcolorbtn = fgcolorbtn;
9e2dcad06d3c [gaim-migrate @ 864]
Rob Flynn <gaim@robflynn.com>
parents: 849
diff changeset
1947 c->bgcolorbtn = bgcolorbtn;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1948 c->link = link;
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
1949 c->wood = wood;
308
e5fa88351dc8 [gaim-migrate @ 318]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 283
diff changeset
1950 c->font = font;
570
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 563
diff changeset
1951 c->smiley = smiley;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1952
1525
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1486
diff changeset
1953 gtk_widget_set_sensitive(c->log_button, ((logging_options & OPT_LOG_ALL)) ? FALSE : TRUE);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1954
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1955 gtk_widget_set_sensitive(c->bold, ((font_options & OPT_FONT_BOLD)) ? FALSE : TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1956 gtk_widget_set_sensitive(c->italic, ((font_options & OPT_FONT_ITALIC)) ? FALSE : TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1957 gtk_widget_set_sensitive(c->underline, ((font_options & OPT_FONT_UNDERLINE)) ? FALSE : TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1958 gtk_widget_set_sensitive(c->strike, ((font_options & OPT_FONT_STRIKE)) ? FALSE : TRUE);
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1959
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1960 return toolbar;
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1961 }
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1962
1898
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1963 static void convo_sel_send(GtkObject *m, struct gaim_connection *c)
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1964 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1965 struct conversation *cnv = gtk_object_get_user_data(m);
1898
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1966
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1967 if (cnv->gc == c)
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1968 return;
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1969
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1970 cnv->gc = c;
1340
1526caa87138 [gaim-migrate @ 1350]
Rob Flynn <gaim@robflynn.com>
parents: 1253
diff changeset
1971
2787
feea7103a235 [gaim-migrate @ 2800]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2773
diff changeset
1972 set_convo_title(cnv);
feea7103a235 [gaim-migrate @ 2800]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2773
diff changeset
1973
1342
84aef77f0add [gaim-migrate @ 1352]
Rob Flynn <gaim@robflynn.com>
parents: 1341
diff changeset
1974 update_buttons_by_protocol(cnv);
1898
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1975
2191
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
1976 update_icon(cnv);
2231
8c4ff1a368bd [gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2227
diff changeset
1977 update_checkbox(cnv);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1978 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1979
2379
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2375
diff changeset
1980 int set_dispstyle(int chat)
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2375
diff changeset
1981 {
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2375
diff changeset
1982 int dispstyle;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2375
diff changeset
1983
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2375
diff changeset
1984 if (chat) {
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2375
diff changeset
1985 switch (chat_options & (OPT_CHAT_BUTTON_TEXT | OPT_CHAT_BUTTON_XPM)) {
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2375
diff changeset
1986 case OPT_CHAT_BUTTON_TEXT:
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2375
diff changeset
1987 dispstyle = 1;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2375
diff changeset
1988 break;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2375
diff changeset
1989 case OPT_CHAT_BUTTON_XPM:
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2375
diff changeset
1990 dispstyle = 0;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2375
diff changeset
1991 break;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2375
diff changeset
1992 default: /* both or neither */
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2375
diff changeset
1993 dispstyle = 2;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2375
diff changeset
1994 break;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2375
diff changeset
1995 }
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2375
diff changeset
1996 } else {
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2375
diff changeset
1997 switch (im_options & (OPT_IM_BUTTON_TEXT | OPT_IM_BUTTON_XPM)) {
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2375
diff changeset
1998 case OPT_IM_BUTTON_TEXT:
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2375
diff changeset
1999 dispstyle = 1;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2375
diff changeset
2000 break;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2375
diff changeset
2001 case OPT_IM_BUTTON_XPM:
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2375
diff changeset
2002 dispstyle = 0;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2375
diff changeset
2003 break;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2375
diff changeset
2004 default: /* both or neither */
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2375
diff changeset
2005 dispstyle = 2;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2375
diff changeset
2006 break;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2375
diff changeset
2007 }
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2375
diff changeset
2008 }
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2375
diff changeset
2009 return dispstyle;
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2375
diff changeset
2010 }
cacaf7ace3a5 [gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2375
diff changeset
2011
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2012 void update_convo_add_button(struct conversation *c)
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2013 {
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2014 int dispstyle = set_dispstyle(0);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2015 GtkWidget *parent = c->add->parent;
1663
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
2016 gboolean rebuild = FALSE;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
2017
1352
2e8213567278 [gaim-migrate @ 1362]
Rob Flynn <gaim@robflynn.com>
parents: 1343
diff changeset
2018 if (find_buddy(c->gc, c->name)) {
1663
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
2019 if (!gtk_object_get_user_data(GTK_OBJECT(c->add))) {
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
2020 gtk_widget_destroy(c->add);
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
2021 c->add = picture_button2(c->window, _("Remove"), gnome_remove_xpm, dispstyle);
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
2022 rebuild = TRUE;
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
2023 }
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
2024 if (c->gc) {
1352
2e8213567278 [gaim-migrate @ 1362]
Rob Flynn <gaim@robflynn.com>
parents: 1343
diff changeset
2025 if (c->gc->prpl->remove_buddy == NULL)
2e8213567278 [gaim-migrate @ 1362]
Rob Flynn <gaim@robflynn.com>
parents: 1343
diff changeset
2026 gtk_widget_set_sensitive(c->add, FALSE);
2e8213567278 [gaim-migrate @ 1362]
Rob Flynn <gaim@robflynn.com>
parents: 1343
diff changeset
2027 else
2e8213567278 [gaim-migrate @ 1362]
Rob Flynn <gaim@robflynn.com>
parents: 1343
diff changeset
2028 gtk_widget_set_sensitive(c->add, TRUE);
1663
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
2029 } else
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
2030 gtk_widget_set_sensitive(c->add, FALSE);
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
2031 gtk_object_set_user_data(GTK_OBJECT(c->add), c);
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2032 } else {
1663
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
2033 if (gtk_object_get_user_data(GTK_OBJECT(c->add))) {
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
2034 gtk_widget_destroy(c->add);
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
2035 c->add = picture_button2(c->window, _("Add"), gnome_add_xpm, dispstyle);
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
2036 rebuild = TRUE;
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
2037 }
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
2038 if (c->gc) {
1352
2e8213567278 [gaim-migrate @ 1362]
Rob Flynn <gaim@robflynn.com>
parents: 1343
diff changeset
2039 if (c->gc->prpl->add_buddy == NULL)
2e8213567278 [gaim-migrate @ 1362]
Rob Flynn <gaim@robflynn.com>
parents: 1343
diff changeset
2040 gtk_widget_set_sensitive(c->add, FALSE);
2e8213567278 [gaim-migrate @ 1362]
Rob Flynn <gaim@robflynn.com>
parents: 1343
diff changeset
2041 else
2e8213567278 [gaim-migrate @ 1362]
Rob Flynn <gaim@robflynn.com>
parents: 1343
diff changeset
2042 gtk_widget_set_sensitive(c->add, TRUE);
1663
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
2043 } else
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
2044 gtk_widget_set_sensitive(c->add, FALSE);
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2045 }
1352
2e8213567278 [gaim-migrate @ 1362]
Rob Flynn <gaim@robflynn.com>
parents: 1343
diff changeset
2046
1663
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
2047 if (rebuild) {
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
2048 gtk_signal_connect(GTK_OBJECT(c->add), "clicked", GTK_SIGNAL_FUNC(add_callback), c);
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
2049 gtk_box_pack_end(GTK_BOX(parent), c->add, dispstyle, dispstyle, 0);
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
2050 gtk_box_reorder_child(GTK_BOX(parent), c->add, 2);
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
2051 gtk_widget_show(c->add);
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
2052 }
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2053 }
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2054
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2055 static void create_convo_menu(struct conversation *cnv)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2056 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2057 GtkWidget *menu, *opt;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2058 GSList *g = connections;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2059 struct gaim_connection *c;
1235
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1228
diff changeset
2060 char buf[2048];
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2061
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2062 if (g_slist_length(g) < 2)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2063 gtk_widget_hide(cnv->menu->parent);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2064 else {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2065 menu = gtk_menu_new();
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2066
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2067 while (g) {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2068 c = (struct gaim_connection *)g->data;
2662
b0c5770156e1 [gaim-migrate @ 2675]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2631
diff changeset
2069 g_snprintf(buf, sizeof buf, "%s (%s)", c->username, c->prpl->name());
1235
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1228
diff changeset
2070 opt = gtk_menu_item_new_with_label(buf);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2071 gtk_object_set_user_data(GTK_OBJECT(opt), cnv);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2072 gtk_signal_connect(GTK_OBJECT(opt), "activate",
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2073 GTK_SIGNAL_FUNC(convo_sel_send), c);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2074 gtk_widget_show(opt);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2075 gtk_menu_append(GTK_MENU(menu), opt);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2076 g = g->next;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2077 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2078
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2079 gtk_option_menu_remove_menu(GTK_OPTION_MENU(cnv->menu));
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2080 gtk_option_menu_set_menu(GTK_OPTION_MENU(cnv->menu), menu);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2081 gtk_option_menu_set_history(GTK_OPTION_MENU(cnv->menu), 0);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2082
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2083 gtk_widget_show(cnv->menu);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2084 gtk_widget_show(cnv->menu->parent);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2085 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2086 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2087
2111
109669b3887e [gaim-migrate @ 2121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2109
diff changeset
2088 void redo_convo_menus()
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2089 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2090 GList *c = conversations;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2091 struct conversation *C;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2092
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2093 while (c) {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2094 C = (struct conversation *)c->data;
1898
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
2095 c = c->next;
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
2096
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2097 create_convo_menu(C);
993
eacd93d0089a [gaim-migrate @ 1003]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2098
2111
109669b3887e [gaim-migrate @ 2121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2109
diff changeset
2099 if (g_slist_find(connections, C->gc))
2487
43a75ca5b909 [gaim-migrate @ 2500]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2483
diff changeset
2100 set_convo_gc(C, C->gc);
43a75ca5b909 [gaim-migrate @ 2500]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2483
diff changeset
2101 else
43a75ca5b909 [gaim-migrate @ 2500]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2483
diff changeset
2102 set_convo_gc(C, connections ? connections->data : NULL);
2111
109669b3887e [gaim-migrate @ 2121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2109
diff changeset
2103 }
109669b3887e [gaim-migrate @ 2121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2109
diff changeset
2104 }
109669b3887e [gaim-migrate @ 2121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2109
diff changeset
2105
109669b3887e [gaim-migrate @ 2121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2109
diff changeset
2106 void convo_menu_remove(struct gaim_connection *gc)
109669b3887e [gaim-migrate @ 2121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2109
diff changeset
2107 {
109669b3887e [gaim-migrate @ 2121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2109
diff changeset
2108 GList *c = conversations;
109669b3887e [gaim-migrate @ 2121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2109
diff changeset
2109 struct conversation *C;
109669b3887e [gaim-migrate @ 2121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2109
diff changeset
2110
109669b3887e [gaim-migrate @ 2121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2109
diff changeset
2111 while (c) {
109669b3887e [gaim-migrate @ 2121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2109
diff changeset
2112 C = (struct conversation *)c->data;
109669b3887e [gaim-migrate @ 2121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2109
diff changeset
2113 c = c->next;
2109
3110ea142888 [gaim-migrate @ 2119]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2104
diff changeset
2114
2191
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2115 remove_icon(C);
2231
8c4ff1a368bd [gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2227
diff changeset
2116 remove_checkbox(C);
1898
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
2117 }
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
2118 }
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
2119
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
2120 void set_convo_gc(struct conversation *c, struct gaim_connection *gc)
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
2121 {
2722
abecab600451 [gaim-migrate @ 2735]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2706
diff changeset
2122 if (gc)
abecab600451 [gaim-migrate @ 2735]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2706
diff changeset
2123 gtk_option_menu_set_history(GTK_OPTION_MENU(c->menu), g_slist_index(connections, gc));
abecab600451 [gaim-migrate @ 2735]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2706
diff changeset
2124
1898
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
2125 if (c->gc == gc)
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
2126 return;
993
eacd93d0089a [gaim-migrate @ 1003]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2127
1898
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
2128 c->gc = gc;
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
2129
2787
feea7103a235 [gaim-migrate @ 2800]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2773
diff changeset
2130 set_convo_title(c);
feea7103a235 [gaim-migrate @ 2800]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2773
diff changeset
2131
1898
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
2132 update_buttons_by_protocol(c);
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
2133
2191
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2134 update_icon(c);
2231
8c4ff1a368bd [gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2227
diff changeset
2135 update_checkbox(c);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2136 }
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
2137
1340
1526caa87138 [gaim-migrate @ 1350]
Rob Flynn <gaim@robflynn.com>
parents: 1253
diff changeset
2138 void update_buttons_by_protocol(struct conversation *c)
1526caa87138 [gaim-migrate @ 1350]
Rob Flynn <gaim@robflynn.com>
parents: 1253
diff changeset
2139 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2140 if (!c->gc) {
2619
536198196dc6 [gaim-migrate @ 2632]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2582
diff changeset
2141 if (c->info)
536198196dc6 [gaim-migrate @ 2632]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2582
diff changeset
2142 gtk_widget_set_sensitive(c->info, FALSE);
536198196dc6 [gaim-migrate @ 2632]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2582
diff changeset
2143 if (c->send)
536198196dc6 [gaim-migrate @ 2632]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2582
diff changeset
2144 gtk_widget_set_sensitive(c->send, FALSE);
536198196dc6 [gaim-migrate @ 2632]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2582
diff changeset
2145 if (c->warn)
536198196dc6 [gaim-migrate @ 2632]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2582
diff changeset
2146 gtk_widget_set_sensitive(c->warn, FALSE);
536198196dc6 [gaim-migrate @ 2632]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2582
diff changeset
2147 if (c->block)
536198196dc6 [gaim-migrate @ 2632]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2582
diff changeset
2148 gtk_widget_set_sensitive(c->block, FALSE);
536198196dc6 [gaim-migrate @ 2632]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2582
diff changeset
2149 if (c->add)
536198196dc6 [gaim-migrate @ 2632]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2582
diff changeset
2150 gtk_widget_set_sensitive(c->add, FALSE);
2546
d392e9b867e9 [gaim-migrate @ 2559]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2541
diff changeset
2151 if (c->whisper)
d392e9b867e9 [gaim-migrate @ 2559]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2541
diff changeset
2152 gtk_widget_set_sensitive(c->whisper, FALSE);
d392e9b867e9 [gaim-migrate @ 2559]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2541
diff changeset
2153 if (c->invite)
d392e9b867e9 [gaim-migrate @ 2559]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2541
diff changeset
2154 gtk_widget_set_sensitive(c->invite, FALSE);
d392e9b867e9 [gaim-migrate @ 2559]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2541
diff changeset
2155
1352
2e8213567278 [gaim-migrate @ 1362]
Rob Flynn <gaim@robflynn.com>
parents: 1343
diff changeset
2156 return;
2e8213567278 [gaim-migrate @ 1362]
Rob Flynn <gaim@robflynn.com>
parents: 1343
diff changeset
2157 }
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2158
1532
249a770bebd7 [gaim-migrate @ 1542]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
2159 if (c->gc->prpl->get_info == NULL && c->info)
1340
1526caa87138 [gaim-migrate @ 1350]
Rob Flynn <gaim@robflynn.com>
parents: 1253
diff changeset
2160 gtk_widget_set_sensitive(c->info, FALSE);
1398
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1370
diff changeset
2161 else if (c->info)
1340
1526caa87138 [gaim-migrate @ 1350]
Rob Flynn <gaim@robflynn.com>
parents: 1253
diff changeset
2162 gtk_widget_set_sensitive(c->info, TRUE);
1341
6ec45c45157c [gaim-migrate @ 1351]
Rob Flynn <gaim@robflynn.com>
parents: 1340
diff changeset
2163
2094
be10a1243ed7 [gaim-migrate @ 2104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2090
diff changeset
2164 if (c->is_chat) {
be10a1243ed7 [gaim-migrate @ 2104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2090
diff changeset
2165 if (c->gc->prpl->chat_send == NULL && c->send)
be10a1243ed7 [gaim-migrate @ 2104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2090
diff changeset
2166 gtk_widget_set_sensitive(c->send, FALSE);
be10a1243ed7 [gaim-migrate @ 2104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2090
diff changeset
2167 else
be10a1243ed7 [gaim-migrate @ 2104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2090
diff changeset
2168 gtk_widget_set_sensitive(c->send, TRUE);
be10a1243ed7 [gaim-migrate @ 2104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2090
diff changeset
2169 } else {
be10a1243ed7 [gaim-migrate @ 2104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2090
diff changeset
2170 if (c->gc->prpl->send_im == NULL && c->send)
be10a1243ed7 [gaim-migrate @ 2104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2090
diff changeset
2171 gtk_widget_set_sensitive(c->send, FALSE);
be10a1243ed7 [gaim-migrate @ 2104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2090
diff changeset
2172 else
be10a1243ed7 [gaim-migrate @ 2104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2090
diff changeset
2173 gtk_widget_set_sensitive(c->send, TRUE);
be10a1243ed7 [gaim-migrate @ 2104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2090
diff changeset
2174 }
1341
6ec45c45157c [gaim-migrate @ 1351]
Rob Flynn <gaim@robflynn.com>
parents: 1340
diff changeset
2175
1343
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1342
diff changeset
2176 if (c->gc->prpl->warn == NULL && c->warn)
1341
6ec45c45157c [gaim-migrate @ 1351]
Rob Flynn <gaim@robflynn.com>
parents: 1340
diff changeset
2177 gtk_widget_set_sensitive(c->warn, FALSE);
1398
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1370
diff changeset
2178 else if (c->warn)
1341
6ec45c45157c [gaim-migrate @ 1351]
Rob Flynn <gaim@robflynn.com>
parents: 1340
diff changeset
2179 gtk_widget_set_sensitive(c->warn, TRUE);
6ec45c45157c [gaim-migrate @ 1351]
Rob Flynn <gaim@robflynn.com>
parents: 1340
diff changeset
2180
1343
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1342
diff changeset
2181 if (c->gc->prpl->add_permit == NULL && c->block)
1341
6ec45c45157c [gaim-migrate @ 1351]
Rob Flynn <gaim@robflynn.com>
parents: 1340
diff changeset
2182 gtk_widget_set_sensitive(c->block, FALSE);
1398
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1370
diff changeset
2183 else if (c->block)
1341
6ec45c45157c [gaim-migrate @ 1351]
Rob Flynn <gaim@robflynn.com>
parents: 1340
diff changeset
2184 gtk_widget_set_sensitive(c->block, TRUE);
6ec45c45157c [gaim-migrate @ 1351]
Rob Flynn <gaim@robflynn.com>
parents: 1340
diff changeset
2185
1343
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1342
diff changeset
2186 if (c->add)
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1342
diff changeset
2187 update_convo_add_button(c);
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1342
diff changeset
2188
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2189 if (c->whisper) {
1343
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1342
diff changeset
2190 if (c->gc->prpl->chat_whisper == NULL)
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1342
diff changeset
2191 gtk_widget_set_sensitive(c->whisper, FALSE);
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1342
diff changeset
2192 else
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1342
diff changeset
2193 gtk_widget_set_sensitive(c->whisper, TRUE);
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1342
diff changeset
2194 }
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1342
diff changeset
2195
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2196 if (c->invite) {
1343
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1342
diff changeset
2197 if (c->gc->prpl->chat_invite == NULL)
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1342
diff changeset
2198 gtk_widget_set_sensitive(c->invite, FALSE);
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1342
diff changeset
2199 else
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1342
diff changeset
2200 gtk_widget_set_sensitive(c->invite, TRUE);
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1342
diff changeset
2201 }
1340
1526caa87138 [gaim-migrate @ 1350]
Rob Flynn <gaim@robflynn.com>
parents: 1253
diff changeset
2202 }
1526caa87138 [gaim-migrate @ 1350]
Rob Flynn <gaim@robflynn.com>
parents: 1253
diff changeset
2203
2843
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2204 void convo_switch(GtkNotebook *notebook, GtkWidget *page, gint page_num, gpointer data)
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2205 {
2843
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2206 GtkWidget *label = gtk_notebook_get_tab_label(notebook,
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2207 gtk_notebook_get_nth_page(notebook, page_num));
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2208 GtkStyle *style;
2843
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2209 struct conversation *c;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2210 if ((convo_options & OPT_CONVO_COMBINE) &&
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2211 (im_options & OPT_IM_ONE_WINDOW) &&
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2212 (chat_options & OPT_CHAT_ONE_WINDOW)) {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2213 int len = g_list_length(conversations);
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2214 if (page_num < len)
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2215 c = g_list_nth_data(conversations, page_num);
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2216 else
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2217 c = g_list_nth_data(chats, page_num - len);
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2218 } else if (GTK_WIDGET(notebook) == convo_notebook)
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2219 c = g_list_nth_data(conversations, page_num);
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2220 else
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2221 c = g_list_nth_data(chats, page_num);
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2222 if (c && c->window && c->entry)
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2223 gtk_window_set_focus(GTK_WINDOW(c->window), c->entry);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2224 if (!GTK_WIDGET_REALIZED(label))
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2225 return;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2226 style = gtk_style_new();
2725
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2722
diff changeset
2227 gdk_font_unref(gtk_style_get_font(style));
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2722
diff changeset
2228 gtk_style_set_font(style, gdk_font_ref(gtk_style_get_font(label->style)));
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2229 gtk_widget_set_style(label, style);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2230 gtk_style_unref(style);
2843
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2231 if (c)
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2232 c->unseen = 0;
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2233 }
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2234
1340
1526caa87138 [gaim-migrate @ 1350]
Rob Flynn <gaim@robflynn.com>
parents: 1253
diff changeset
2235
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
2236 void show_conv(struct conversation *c)
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
2237 {
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
2238 GtkWidget *win;
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2239 GtkWidget *cont;
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
2240 GtkWidget *text;
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
2241 GtkWidget *sw;
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
2242 GtkWidget *send;
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
2243 GtkWidget *info;
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
2244 GtkWidget *warn;
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
2245 GtkWidget *block;
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
2246 GtkWidget *close;
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
2247 GtkWidget *entry;
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
2248 GtkWidget *bbox;
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
2249 GtkWidget *vbox;
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
2250 GtkWidget *vbox2;
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
2251 GtkWidget *paned;
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
2252 GtkWidget *add;
623
83b0caceea9a [gaim-migrate @ 633]
Rob Flynn <gaim@robflynn.com>
parents: 615
diff changeset
2253 GtkWidget *toolbar;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2254 GtkWidget *hbox;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2255 GtkWidget *label;
1219
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2256 int dispstyle = set_dispstyle(0);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
2257
1219
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2258 c->font_dialog = NULL;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
2259 c->fg_color_dialog = NULL;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
2260 c->bg_color_dialog = NULL;
1219
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2261 c->smiley_dialog = NULL;
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2262 c->link_dialog = NULL;
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2263 c->log_dialog = NULL;
2763
477a035d81e5 [gaim-migrate @ 2776]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2761
diff changeset
2264 sprintf(c->fontxfld, "%s", fontxfld);
1219
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2265 sprintf(c->fontface, "%s", fontface);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2266 c->hasfont = 0;
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2267 c->bgcol = bgcolor;
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2268 c->hasbg = 0;
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2269 c->fgcol = fgcolor;
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2270 c->hasfg = 0;
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2271
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2303
diff changeset
2272 if (im_options & OPT_IM_ONE_WINDOW) {
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2273 if (!all_convos) {
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2274 win = all_convos = c->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
2843
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2275 if ((convo_options & OPT_CONVO_COMBINE) && (chat_options & OPT_CHAT_ONE_WINDOW))
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2276 all_chats = all_convos;
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2277 gtk_window_set_wmclass(GTK_WINDOW(win), "conversation", "Gaim");
2335
2c595fc5f1f8 [gaim-migrate @ 2348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2334
diff changeset
2278 gtk_window_set_policy(GTK_WINDOW(win), TRUE, TRUE, FALSE);
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2279 gtk_container_border_width(GTK_CONTAINER(win), 0);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2280 gtk_widget_realize(win);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2281 aol_icon(win->window);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2282 gtk_window_set_title(GTK_WINDOW(win), _("Gaim - Conversations"));
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2283 gtk_signal_connect(GTK_OBJECT(win), "delete_event",
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2284 GTK_SIGNAL_FUNC(delete_all_convo), NULL);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2285
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2286 convo_notebook = gtk_notebook_new();
2843
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2287 if ((convo_options & OPT_CONVO_COMBINE) && (chat_options & OPT_CHAT_ONE_WINDOW))
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2288 chat_notebook = convo_notebook;
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2303
diff changeset
2289 if (im_options & OPT_IM_SIDE_TAB) {
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2303
diff changeset
2290 if (im_options & OPT_IM_BR_TAB) {
1757
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2291 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook),
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2292 GTK_POS_RIGHT);
1757
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2293 } else {
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2294 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook),
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2295 GTK_POS_LEFT);
1757
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2296 }
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2297 } else {
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2303
diff changeset
2298 if (im_options & OPT_IM_BR_TAB) {
1757
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2299 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook),
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2300 GTK_POS_BOTTOM);
1757
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2301 } else {
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2302 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook),
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2303 GTK_POS_TOP);
1757
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2304 }
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2305 }
1596
f5845007e3bc [gaim-migrate @ 1606]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1595
diff changeset
2306 gtk_notebook_set_scrollable(GTK_NOTEBOOK(convo_notebook), TRUE);
1597
c1a8a7c40424 [gaim-migrate @ 1607]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1596
diff changeset
2307 gtk_notebook_popup_enable(GTK_NOTEBOOK(convo_notebook));
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2308 gtk_container_add(GTK_CONTAINER(win), convo_notebook);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2309 gtk_signal_connect(GTK_OBJECT(convo_notebook), "switch-page",
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2310 GTK_SIGNAL_FUNC(convo_switch), NULL);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2311 gtk_widget_show(convo_notebook);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2312 } else
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2313 win = c->window = all_convos;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2314
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2315 cont = gtk_vbox_new(FALSE, 5);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2316 gtk_container_set_border_width(GTK_CONTAINER(cont), 5);
2843
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2317 /* this doesn't matter since we're resetting the name once we're out of the if */
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2318 gtk_notebook_insert_page(GTK_NOTEBOOK(convo_notebook), cont, gtk_label_new(c->name),
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2319 g_list_index(conversations, c));
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2320 gtk_widget_show(cont);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2321 } else {
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2322 cont = win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2323 c->window = win;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2324 gtk_object_set_user_data(GTK_OBJECT(win), c);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2325 gtk_window_set_wmclass(GTK_WINDOW(win), "conversation", "Gaim");
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2326 gtk_window_set_policy(GTK_WINDOW(win), TRUE, TRUE, TRUE);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2327 gtk_container_border_width(GTK_CONTAINER(win), 10);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2328 gtk_widget_realize(win);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2329 aol_icon(win->window);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2330 gtk_signal_connect(GTK_OBJECT(win), "delete_event",
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2331 GTK_SIGNAL_FUNC(delete_event_convo), c);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2332 }
2787
feea7103a235 [gaim-migrate @ 2800]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2773
diff changeset
2333 set_convo_title(c);
623
83b0caceea9a [gaim-migrate @ 633]
Rob Flynn <gaim@robflynn.com>
parents: 615
diff changeset
2334
1219
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2335 paned = gtk_vpaned_new();
1228
6773043cf9f6 [gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1227
diff changeset
2336 gtk_paned_set_gutter_size(GTK_PANED(paned), 15);
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2337 gtk_container_add(GTK_CONTAINER(cont), paned);
1219
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2338 gtk_widget_show(paned);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2339
1228
6773043cf9f6 [gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1227
diff changeset
2340 vbox = gtk_vbox_new(FALSE, 5);
1219
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2341 gtk_paned_pack1(GTK_PANED(paned), vbox, FALSE, TRUE);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2342 gtk_widget_show(vbox);
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
2343
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
2344 sw = gtk_scrolled_window_new(NULL, NULL);
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2345 c->sw = sw;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
2346 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
1228
6773043cf9f6 [gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1227
diff changeset
2347 gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0);
1813
998a6a032874 [gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1780
diff changeset
2348 gtk_widget_set_usize(sw, conv_size.width, conv_size.height);
1219
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2349 gtk_widget_show(sw);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2350
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2351 text = gtk_imhtml_new(NULL, NULL);
1219
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2352 c->text = text;
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2353 gtk_container_add(GTK_CONTAINER(sw), text);
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2354 GTK_LAYOUT(text)->hadjustment->step_increment = 10.0;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2355 GTK_LAYOUT(text)->vadjustment->step_increment = 10.0;
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2303
diff changeset
2356 if (convo_options & OPT_CONVO_SHOW_TIME)
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2357 gtk_imhtml_show_comments(GTK_IMHTML(text), TRUE);
1815
f15d449b3167 [gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1813
diff changeset
2358 gaim_setup_imhtml(text);
1219
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2359 gtk_widget_show(text);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2360
1228
6773043cf9f6 [gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1227
diff changeset
2361 vbox2 = gtk_vbox_new(FALSE, 5);
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
2362 gtk_paned_pack2(GTK_PANED(paned), vbox2, FALSE, FALSE);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
2363 gtk_widget_show(vbox2);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2364
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2365 hbox = gtk_hbox_new(FALSE, 0);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2366 gtk_box_pack_start(GTK_BOX(vbox2), hbox, FALSE, FALSE, 0);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2367 gtk_widget_show(hbox);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2368
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2369 label = gtk_label_new(_("Send message as: "));
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2370 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2371 gtk_widget_show(label);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2372
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2373 c->menu = gtk_option_menu_new();
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2374 gtk_box_pack_start(GTK_BOX(hbox), c->menu, FALSE, FALSE, 5);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2375 gtk_widget_show(c->menu);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2376
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2377 create_convo_menu(c);
1219
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2378
1898
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
2379 c->lbox = gtk_hbox_new(FALSE, 0);
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
2380 gtk_box_pack_start(GTK_BOX(vbox2), c->lbox, FALSE, FALSE, 0);
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
2381 gtk_widget_show(c->lbox);
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
2382
1227
25611364a504 [gaim-migrate @ 1237]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1219
diff changeset
2383 entry = gtk_text_new(NULL, NULL);
25611364a504 [gaim-migrate @ 1237]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1219
diff changeset
2384 c->entry = entry;
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2303
diff changeset
2385 if (!(im_options & OPT_IM_ONE_WINDOW))
1594
ac8eddd16e89 [gaim-migrate @ 1604]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1592
diff changeset
2386 gtk_window_set_focus(GTK_WINDOW(c->window), c->entry);
1227
25611364a504 [gaim-migrate @ 1237]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1219
diff changeset
2387
1219
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2388 toolbar = build_conv_toolbar(c);
1228
6773043cf9f6 [gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1227
diff changeset
2389 gtk_box_pack_start(GTK_BOX(vbox2), toolbar, FALSE, FALSE, 0);
1219
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2390
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2391 gtk_object_set_user_data(GTK_OBJECT(entry), c);
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
2392 gtk_text_set_editable(GTK_TEXT(entry), TRUE);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
2393 gtk_text_set_word_wrap(GTK_TEXT(entry), TRUE);
1813
998a6a032874 [gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1780
diff changeset
2394 gtk_widget_set_usize(entry, conv_size.width - 20, conv_size.entry_height);
998a6a032874 [gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1780
diff changeset
2395
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
2396 gtk_signal_connect(GTK_OBJECT(entry), "activate", GTK_SIGNAL_FUNC(send_callback), c);
1219
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2397 gtk_signal_connect(GTK_OBJECT(entry), "key_press_event", GTK_SIGNAL_FUNC(keypress_callback), c);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
2398 gtk_signal_connect(GTK_OBJECT(entry), "key_press_event", GTK_SIGNAL_FUNC(entry_key_pressed),
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
2399 entry);
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2303
diff changeset
2400 if (convo_options & OPT_CONVO_CHECK_SPELLING)
1117
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2401 gtkspell_attach(GTK_TEXT(c->entry));
1228
6773043cf9f6 [gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1227
diff changeset
2402 gtk_box_pack_start(GTK_BOX(vbox2), entry, TRUE, TRUE, 0);
1219
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2403 gtk_widget_show(entry);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2404
1898
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
2405 c->bbox = bbox = gtk_hbox_new(FALSE, 5);
1228
6773043cf9f6 [gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1227
diff changeset
2406 gtk_box_pack_start(GTK_BOX(vbox2), bbox, FALSE, FALSE, 0);
1219
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2407 gtk_widget_show(bbox);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2408
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2409 close = picture_button2(win, _("Close"), cancel_xpm, dispstyle);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2410 c->close = close;
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2411 gtk_object_set_user_data(GTK_OBJECT(close), c);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2412 gtk_signal_connect(GTK_OBJECT(close), "clicked", GTK_SIGNAL_FUNC(close_callback), c);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2413 gtk_box_pack_end(GTK_BOX(bbox), close, dispstyle, dispstyle, 0);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
2414 gtk_widget_show(close);
1219
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2415
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2416 c->sep1 = gtk_vseparator_new();
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2417 gtk_box_pack_end(GTK_BOX(bbox), c->sep1, dispstyle, dispstyle, 0);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2418 gtk_widget_show(c->sep1);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2419
1663
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
2420 if (c->gc && find_buddy(c->gc, c->name) != NULL) {
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
2421 add = picture_button2(win, _("Remove"), gnome_remove_xpm, dispstyle);
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
2422 gtk_object_set_user_data(GTK_OBJECT(add), c);
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
2423 } else
1219
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2424 add = picture_button2(win, _("Add"), gnome_add_xpm, dispstyle);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2425 c->add = add;
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2426 gtk_signal_connect(GTK_OBJECT(add), "clicked", GTK_SIGNAL_FUNC(add_callback), c);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2427 gtk_box_pack_end(GTK_BOX(bbox), add, dispstyle, dispstyle, 0);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2428 gtk_widget_show(add);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2429
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2430 block = picture_button2(win, _("Block"), block_xpm, dispstyle);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2431 c->block = block;
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2432 gtk_signal_connect(GTK_OBJECT(block), "clicked", GTK_SIGNAL_FUNC(block_callback), c);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2433 gtk_box_pack_end(GTK_BOX(bbox), block, dispstyle, dispstyle, 0);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2434 gtk_widget_show(block);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2435
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2436 warn = picture_button2(win, _("Warn"), warn_xpm, dispstyle);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2437 c->warn = warn;
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2438 gtk_signal_connect(GTK_OBJECT(warn), "clicked", GTK_SIGNAL_FUNC(warn_callback), c);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2439 gtk_box_pack_end(GTK_BOX(bbox), warn, dispstyle, dispstyle, 0);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2440 gtk_widget_show(warn);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2441
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2442 info = picture_button2(win, _("Info"), tb_search_xpm, dispstyle);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2443 c->info = info;
1340
1526caa87138 [gaim-migrate @ 1350]
Rob Flynn <gaim@robflynn.com>
parents: 1253
diff changeset
2444
1219
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2445 gtk_signal_connect(GTK_OBJECT(info), "clicked", GTK_SIGNAL_FUNC(info_callback), c);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2446 gtk_box_pack_end(GTK_BOX(bbox), info, dispstyle, dispstyle, 0);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2447 gtk_widget_show(info);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2448
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2449 c->sep2 = gtk_vseparator_new();
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2450 gtk_box_pack_end(GTK_BOX(bbox), c->sep2, dispstyle, dispstyle, 0);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2451 gtk_widget_show(c->sep2);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2452
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2453 send = picture_button2(win, _("Send"), tmp_send_xpm, dispstyle);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2454 c->send = send;
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2455 gtk_signal_connect(GTK_OBJECT(send), "clicked", GTK_SIGNAL_FUNC(send_callback), c);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2456 gtk_box_pack_end(GTK_BOX(bbox), send, dispstyle, dispstyle, 0);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2457 gtk_widget_show(send);
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 661
diff changeset
2458
1340
1526caa87138 [gaim-migrate @ 1350]
Rob Flynn <gaim@robflynn.com>
parents: 1253
diff changeset
2459 update_buttons_by_protocol(c);
1526caa87138 [gaim-migrate @ 1350]
Rob Flynn <gaim@robflynn.com>
parents: 1253
diff changeset
2460
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2461 gtk_widget_show(win);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2462 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2463
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2464
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
2465 void toggle_spellchk()
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
2466 {
1117
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2467 GList *cnv = conversations;
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2468 GSList *cht;
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2469 struct conversation *c;
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2470 GSList *con = connections;
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2471 struct gaim_connection *gc;
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2472
2460
049822b93239 [gaim-migrate @ 2473]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2449
diff changeset
2473 if (convo_options & OPT_CONVO_CHECK_SPELLING)
049822b93239 [gaim-migrate @ 2473]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2449
diff changeset
2474 gtkspell_start(NULL, ispell_cmd);
049822b93239 [gaim-migrate @ 2473]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2449
diff changeset
2475
1117
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2476 while (cnv) {
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2477 c = (struct conversation *)cnv->data;
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2303
diff changeset
2478 if (convo_options & OPT_CONVO_CHECK_SPELLING)
1117
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2479 gtkspell_attach(GTK_TEXT(c->entry));
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2480 else
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2481 gtkspell_detach(GTK_TEXT(c->entry));
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2482 cnv = cnv->next;
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2483 }
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2484
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2485 while (con) {
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2486 gc = (struct gaim_connection *)con->data;
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2487 cht = gc->buddy_chats;
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2488 while (cht) {
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2489 c = (struct conversation *)cht->data;
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2303
diff changeset
2490 if (convo_options & OPT_CONVO_CHECK_SPELLING)
1117
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2491 gtkspell_attach(GTK_TEXT(c->entry));
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2492 else
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2493 gtkspell_detach(GTK_TEXT(c->entry));
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2494 cht = cht->next;
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2495 }
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2496 con = con->next;
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2497 }
2460
049822b93239 [gaim-migrate @ 2473]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2449
diff changeset
2498
049822b93239 [gaim-migrate @ 2473]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2449
diff changeset
2499 if (!(convo_options & OPT_CONVO_CHECK_SPELLING))
049822b93239 [gaim-migrate @ 2473]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2449
diff changeset
2500 gtkspell_stop();
1117
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2501 }
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2502
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2503 void toggle_timestamps()
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2504 {
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2505 GList *cnv = conversations;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2506 GSList *cht;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2507 struct conversation *c;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2508 GSList *con = connections;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2509 struct gaim_connection *gc;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2510
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2511 while (cnv) {
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2512 c = (struct conversation *)cnv->data;
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2303
diff changeset
2513 if (convo_options & OPT_CONVO_SHOW_TIME)
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2514 gtk_imhtml_show_comments(GTK_IMHTML(c->text), TRUE);
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2515 else
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2516 gtk_imhtml_show_comments(GTK_IMHTML(c->text), FALSE);
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2517 cnv = cnv->next;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2518 }
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2519
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2520 while (con) {
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2521 gc = (struct gaim_connection *)con->data;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2522 cht = gc->buddy_chats;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2523 while (cht) {
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2524 c = (struct conversation *)cht->data;
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2303
diff changeset
2525 if (convo_options & OPT_CONVO_SHOW_TIME)
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2526 gtk_imhtml_show_comments(GTK_IMHTML(c->text), TRUE);
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2527 else
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2528 gtk_imhtml_show_comments(GTK_IMHTML(c->text), FALSE);
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2529 cht = cht->next;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2530 }
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2531 con = con->next;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2532 }
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2533 }
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2534
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2535 void toggle_smileys()
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2536 {
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2537 GList *cnv = conversations;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2538 GSList *cht;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2539 struct conversation *c;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2540 GSList *con = connections;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2541 struct gaim_connection *gc;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2542
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2543 while (cnv) {
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2544 c = (struct conversation *)cnv->data;
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2303
diff changeset
2545 if (convo_options & OPT_CONVO_SHOW_SMILEY)
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2546 gtk_imhtml_show_smileys(GTK_IMHTML(c->text), TRUE);
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2547 else
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2548 gtk_imhtml_show_smileys(GTK_IMHTML(c->text), FALSE);
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2549 cnv = cnv->next;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2550 }
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2551
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2552 while (con) {
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2553 gc = (struct gaim_connection *)con->data;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2554 cht = gc->buddy_chats;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2555 while (cht) {
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2556 c = (struct conversation *)cht->data;
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2303
diff changeset
2557 if (convo_options & OPT_CONVO_SHOW_SMILEY)
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2558 gtk_imhtml_show_smileys(GTK_IMHTML(c->text), TRUE);
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2559 else
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2560 gtk_imhtml_show_smileys(GTK_IMHTML(c->text), FALSE);
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2561 cht = cht->next;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2562 }
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2563 con = con->next;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2564 }
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2565 }
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2566
2843
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2567 void im_tabize()
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2568 {
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2569 /* evil, evil i tell you! evil! */
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2303
diff changeset
2570 if (im_options & OPT_IM_ONE_WINDOW) {
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2571 GList *x = conversations;
2843
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2572 if ((convo_options & OPT_CONVO_COMBINE) && (chat_options & OPT_CHAT_ONE_WINDOW)) {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2573 all_convos = all_chats;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2574 convo_notebook = chat_notebook;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2575 }
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2576 while (x) {
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2577 struct conversation *c = x->data;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2578 GtkWidget *imhtml, *win;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2579
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2580 imhtml = c->text;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2581 win = c->window;
2191
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2582 remove_icon(c);
2231
8c4ff1a368bd [gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2227
diff changeset
2583 remove_checkbox(c);
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2584 show_conv(c);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2585 gtk_widget_destroy(c->text);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2586 gtk_widget_reparent(imhtml, c->sw);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2587 c->text = imhtml;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2588 gtk_widget_destroy(win);
2191
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2589 update_icon(c);
2231
8c4ff1a368bd [gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2227
diff changeset
2590 update_checkbox(c);
2843
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2591 set_convo_title(c);
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2592
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2593 x = x->next;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2594 }
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2595 } else {
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2596 GList *x, *m;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2597 x = m = conversations;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2598 conversations = NULL;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2599 while (x) {
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2600 struct conversation *c = x->data;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2601 GtkWidget *imhtml;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2602
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2603 imhtml = c->text;
2191
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2604 remove_icon(c);
2231
8c4ff1a368bd [gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2227
diff changeset
2605 remove_checkbox(c);
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2606 show_conv(c);
2843
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2607 gtk_container_remove(GTK_CONTAINER(c->sw), c->text);
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2608 gtk_widget_reparent(imhtml, c->sw);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2609 c->text = imhtml;
2191
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2610 update_icon(c);
2231
8c4ff1a368bd [gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2227
diff changeset
2611 update_checkbox(c);
2843
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2612 set_convo_title(c);
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2613
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2614 x = x->next;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2615 }
2843
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2616 conversations = m;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2617 if ((convo_options & OPT_CONVO_COMBINE) && (chat_options & OPT_CHAT_ONE_WINDOW)) {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2618 if (chats) {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2619 struct conversation *c;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2620 while (m) {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2621 gtk_notebook_remove_page(GTK_NOTEBOOK(chat_notebook), 0);
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2622 m = m->next;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2623 }
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2624 c = chats->data;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2625 gtk_window_set_focus(GTK_WINDOW(c->window), c->entry);
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2626 } else {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2627 if (all_convos)
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2628 gtk_widget_destroy(all_convos);
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2629 all_chats = NULL;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2630 chat_notebook = NULL;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2631 }
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2632 } else if (all_convos)
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2633 gtk_widget_destroy(all_convos);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2634 all_convos = NULL;
1757
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2635 convo_notebook = NULL;
2843
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2636 }
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2637 }
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2638
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2639 void convo_tabize()
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2640 {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2641 GList *x, *m;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2642 GtkWidget *tmp;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2643
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2644 if (!chats && !conversations)
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2645 return;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2646
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2647 if (convo_options & OPT_CONVO_COMBINE) {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2648 if (!chats) {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2649 all_chats = all_convos;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2650 chat_notebook = convo_notebook;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2651 return;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2652 } else if (!conversations) {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2653 all_convos = all_chats;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2654 convo_notebook = chat_notebook;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2655 return;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2656 }
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2657 } else {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2658 if (!chats) {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2659 all_chats = NULL;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2660 chat_notebook = NULL;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2661 return;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2662 } else if (!conversations) {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2663 all_convos = NULL;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2664 convo_notebook = NULL;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2665 return;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2666 }
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2667 }
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2668
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2669 tmp = all_convos;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2670 if (convo_options & OPT_CONVO_COMBINE) {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2671 all_convos = all_chats;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2672 convo_notebook = chat_notebook;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2673 } else {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2674 all_convos = NULL;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2675 convo_notebook = NULL;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2676 }
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2677 x = m = conversations;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2678 while (x) {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2679 struct conversation *c = x->data;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2680 GtkWidget *imhtml;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2681
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2682 imhtml = c->text;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2683 remove_icon(c);
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2684 remove_checkbox(c);
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2685 show_conv(c);
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2686 gtk_container_remove(GTK_CONTAINER(c->sw), c->text);
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2687 gtk_widget_reparent(imhtml, c->sw);
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2688 c->text = imhtml;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2689 update_icon(c);
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2690 update_checkbox(c);
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2691
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2692 x = x->next;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2693 }
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2694
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2695 conversations = m;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2696 if (convo_options & OPT_CONVO_COMBINE) {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2697 if (tmp)
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2698 gtk_widget_destroy(tmp);
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2699 } else {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2700 while (m) {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2701 gtk_notebook_remove_page(GTK_NOTEBOOK(chat_notebook), 0);
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2702 m = m->next;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2703 }
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2704 }
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2705 m = conversations;
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2706 while (m) {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2707 set_convo_title(m->data);
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2708 m = m->next;
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2709 }
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2710 }
1587
69a004b5820a [gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1583
diff changeset
2711
2787
feea7103a235 [gaim-migrate @ 2800]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2773
diff changeset
2712 void set_convo_title(struct conversation *c)
1587
69a004b5820a [gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1583
diff changeset
2713 {
2787
feea7103a235 [gaim-migrate @ 2800]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2773
diff changeset
2714 struct buddy *b;
feea7103a235 [gaim-migrate @ 2800]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2773
diff changeset
2715 char *text;
feea7103a235 [gaim-migrate @ 2800]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2773
diff changeset
2716 int index;
feea7103a235 [gaim-migrate @ 2800]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2773
diff changeset
2717 GtkNotebook *nb;
feea7103a235 [gaim-migrate @ 2800]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2773
diff changeset
2718
feea7103a235 [gaim-migrate @ 2800]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2773
diff changeset
2719 if ((im_options & OPT_IM_ALIAS_TAB) && c->gc && ((b = find_buddy(c->gc, c->name)) != NULL))
feea7103a235 [gaim-migrate @ 2800]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2773
diff changeset
2720 text = b->show;
feea7103a235 [gaim-migrate @ 2800]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2773
diff changeset
2721 else
feea7103a235 [gaim-migrate @ 2800]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2773
diff changeset
2722 text = c->name;
feea7103a235 [gaim-migrate @ 2800]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2773
diff changeset
2723
2843
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2724 if (im_options & OPT_IM_ONE_WINDOW) {
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2725 nb = GTK_NOTEBOOK(convo_notebook);
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2726 index = g_list_index(conversations, c);
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2727 gtk_notebook_set_tab_label_text(nb, gtk_notebook_get_nth_page(nb, index), text);
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2834
diff changeset
2728 } else {
2834
66b1112d948f [gaim-migrate @ 2847]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2832
diff changeset
2729 char buf[256];
66b1112d948f [gaim-migrate @ 2847]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2832
diff changeset
2730 if ((find_log_info(c->name)) || (logging_options & OPT_LOG_ALL))
66b1112d948f [gaim-migrate @ 2847]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2832
diff changeset
2731 g_snprintf(buf, sizeof(buf), LOG_CONVERSATION_TITLE, text);
66b1112d948f [gaim-migrate @ 2847]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2832
diff changeset
2732 else
66b1112d948f [gaim-migrate @ 2847]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2832
diff changeset
2733 g_snprintf(buf, sizeof(buf), CONVERSATION_TITLE, text);
66b1112d948f [gaim-migrate @ 2847]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2832
diff changeset
2734 gtk_window_set_title(GTK_WINDOW(c->window), buf);
66b1112d948f [gaim-migrate @ 2847]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2832
diff changeset
2735 }
2787
feea7103a235 [gaim-migrate @ 2800]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2773
diff changeset
2736 }
feea7103a235 [gaim-migrate @ 2800]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2773
diff changeset
2737
feea7103a235 [gaim-migrate @ 2800]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2773
diff changeset
2738 void set_convo_titles()
feea7103a235 [gaim-migrate @ 2800]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2773
diff changeset
2739 {
feea7103a235 [gaim-migrate @ 2800]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2773
diff changeset
2740 GList *c = conversations;
feea7103a235 [gaim-migrate @ 2800]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2773
diff changeset
2741 while (c) {
feea7103a235 [gaim-migrate @ 2800]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2773
diff changeset
2742 set_convo_title(c->data);
feea7103a235 [gaim-migrate @ 2800]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2773
diff changeset
2743 c = c->next;
feea7103a235 [gaim-migrate @ 2800]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2773
diff changeset
2744 }
1587
69a004b5820a [gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1583
diff changeset
2745 }
1590
b4e54a752676 [gaim-migrate @ 1600]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1587
diff changeset
2746
b4e54a752676 [gaim-migrate @ 1600]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1587
diff changeset
2747 void raise_convo_tab(struct conversation *c)
b4e54a752676 [gaim-migrate @ 1600]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1587
diff changeset
2748 {
b4e54a752676 [gaim-migrate @ 1600]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1587
diff changeset
2749 gtk_notebook_set_page(GTK_NOTEBOOK(convo_notebook), g_list_index(conversations, c));
1617
f30f719e5933 [gaim-migrate @ 1627]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1608
diff changeset
2750 gdk_window_show(c->window->window);
1590
b4e54a752676 [gaim-migrate @ 1600]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1587
diff changeset
2751 }
1757
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2752
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2753 void update_im_tabs()
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2754 {
1757
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2755 if (!convo_notebook || !all_convos)
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2756 return;
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2303
diff changeset
2757 if (im_options & OPT_IM_SIDE_TAB) {
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2303
diff changeset
2758 if (im_options & OPT_IM_BR_TAB) {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2759 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook), GTK_POS_RIGHT);
1757
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2760 } else {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2761 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook), GTK_POS_LEFT);
1757
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2762 }
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2763 } else {
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2303
diff changeset
2764 if (im_options & OPT_IM_BR_TAB) {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2765 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook), GTK_POS_BOTTOM);
1757
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2766 } else {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2767 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook), GTK_POS_TOP);
1757
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2768 }
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2769 }
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2770 }
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2771
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2772 void update_chat_tabs()
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2773 {
1757
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2774 if (!chat_notebook || !all_chats)
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2775 return;
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2303
diff changeset
2776 if (chat_options & OPT_CHAT_SIDE_TAB) {
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2303
diff changeset
2777 if (chat_options & OPT_CHAT_BR_TAB) {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2778 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook), GTK_POS_RIGHT);
1757
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2779 } else {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2780 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook), GTK_POS_LEFT);
1757
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2781 }
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2782 } else {
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2303
diff changeset
2783 if (chat_options & OPT_CHAT_BR_TAB) {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2784 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook), GTK_POS_BOTTOM);
1757
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2785 } else {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2786 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook), GTK_POS_TOP);
1757
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2787 }
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2788 }
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2789 }
1759
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2790
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2791 void update_convo_color(gboolean fg)
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2792 {
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2793 GList *c = conversations;
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2794 struct conversation *b;
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2795
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2796 while (c) {
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2797 b = c->data;
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2798 c = c->next;
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2799 if (fg) {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2800 if (b->hasfg)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2801 continue;
1759
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2802 b->fgcol = fgcolor;
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2803 } else {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2804 if (b->hasbg)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2805 continue;
1759
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2806 b->bgcol = bgcolor;
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2807 }
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2808 }
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2809 }
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2810
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2811 void update_convo_font()
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2812 {
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2813 GList *c = conversations;
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2814 struct conversation *b;
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2815
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2816 while (c) {
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2817 b = c->data;
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2818 c = c->next;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2819 if (b->hasfont)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2820 continue;
1759
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2821 sprintf(b->fontface, "%s", fontface);
2763
477a035d81e5 [gaim-migrate @ 2776]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2761
diff changeset
2822 sprintf(b->fontxfld, "%s", fontxfld);
1759
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2823 }
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2824 }
2191
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2825
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2826 #if USE_PIXBUF
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2827 #include <gdk-pixbuf/gdk-pixbuf.h>
2227
a93a6fe22330 [gaim-migrate @ 2237]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2213
diff changeset
2828
a93a6fe22330 [gaim-migrate @ 2237]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2213
diff changeset
2829 #define SCALE(x) ((gdk_pixbuf_animation_get_width(x) <= 48 && gdk_pixbuf_animation_get_height(x) <= 48) \
a93a6fe22330 [gaim-migrate @ 2237]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2213
diff changeset
2830 ? 48 : 50)
2191
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2831
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2832 static gboolean redraw_icon(gpointer data)
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2833 {
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2834 struct conversation *c = data;
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2835
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2836 GList *frames;
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2837 GdkPixbufFrame *frame;
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2838 GdkPixbuf *buf;
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2839 GdkPixbuf *scale;
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2840 GdkPixmap *src;
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2841 GdkPixmap *pm;
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2842 GdkBitmap *bm;
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2843 GdkGC *gc;
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2844 gint delay;
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2845
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2846 if (!g_list_find(conversations, c)) {
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2847 debug_printf("I think this is a bug.\n");
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2848 return FALSE;
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2849 }
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2850
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2851 frames = gdk_pixbuf_animation_get_frames(c->anim);
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2852 frame = g_list_nth_data(frames, c->frame);
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2853 switch (gdk_pixbuf_frame_get_action(frame)) {
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2854 case GDK_PIXBUF_FRAME_RETAIN:
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2855 buf = gdk_pixbuf_frame_get_pixbuf(frame);
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2856 scale = gdk_pixbuf_scale_simple(buf,
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2857 MAX(gdk_pixbuf_get_width(buf) * SCALE(c->anim) /
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2858 gdk_pixbuf_animation_get_width(c->anim), 1),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2859 MAX(gdk_pixbuf_get_height(buf) * SCALE(c->anim) /
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2860 gdk_pixbuf_animation_get_height(c->anim), 1),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2861 GDK_INTERP_NEAREST);
2191
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2862 gdk_pixbuf_render_pixmap_and_mask(scale, &src, NULL, 0);
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2863 gdk_pixbuf_unref(scale);
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2864 gtk_pixmap_get(GTK_PIXMAP(c->icon), &pm, &bm);
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2865 gc = gdk_gc_new(pm);
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2866 gdk_draw_pixmap(pm, gc, src, 0, 0,
2227
a93a6fe22330 [gaim-migrate @ 2237]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2213
diff changeset
2867 MAX(gdk_pixbuf_frame_get_x_offset(frame) * SCALE(c->anim) /
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2868 gdk_pixbuf_animation_get_width(c->anim), 1),
2227
a93a6fe22330 [gaim-migrate @ 2237]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2213
diff changeset
2869 MAX(gdk_pixbuf_frame_get_y_offset(frame) * SCALE(c->anim) /
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2870 gdk_pixbuf_animation_get_height(c->anim), 1), -1, -1);
2191
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2871 gdk_pixmap_unref(src);
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2872 gtk_widget_queue_draw(c->icon);
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2873 gdk_gc_unref(gc);
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2874 break;
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2875 case GDK_PIXBUF_FRAME_DISPOSE:
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2876 buf = gdk_pixbuf_frame_get_pixbuf(frame);
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2877 scale = gdk_pixbuf_scale_simple(buf,
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2878 MAX(gdk_pixbuf_get_width(buf) * SCALE(c->anim) /
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2879 gdk_pixbuf_animation_get_width(c->anim), 1),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2880 MAX(gdk_pixbuf_get_height(buf) * SCALE(c->anim) /
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2881 gdk_pixbuf_animation_get_height(c->anim), 1),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2882 GDK_INTERP_NEAREST);
2191
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2883 gdk_pixbuf_render_pixmap_and_mask(scale, &pm, &bm, 0);
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2884 gdk_pixbuf_unref(scale);
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2885 gtk_pixmap_set(GTK_PIXMAP(c->icon), pm, bm);
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2886 gdk_pixmap_unref(pm);
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2887 if (bm)
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2888 gdk_bitmap_unref(bm);
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2889 break;
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2890 case GDK_PIXBUF_FRAME_REVERT:
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2891 frame = frames->data;
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2892 buf = gdk_pixbuf_frame_get_pixbuf(frame);
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2893 scale = gdk_pixbuf_scale_simple(buf,
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2894 MAX(gdk_pixbuf_get_width(buf) * SCALE(c->anim) /
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2895 gdk_pixbuf_animation_get_width(c->anim), 1),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2896 MAX(gdk_pixbuf_get_height(buf) * SCALE(c->anim) /
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2897 gdk_pixbuf_animation_get_height(c->anim), 1),
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2363
diff changeset
2898 GDK_INTERP_NEAREST);
2191
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2899 gdk_pixbuf_render_pixmap_and_mask(scale, &pm, &bm, 0);
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2900 gdk_pixbuf_unref(scale);
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2901 gtk_pixmap_set(GTK_PIXMAP(c->icon), pm, bm);
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2902 gdk_pixmap_unref(pm);
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2903 if (bm)
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2904 gdk_bitmap_unref(bm);
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2905 break;
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2906 }
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2907
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2908 c->frame = (c->frame + 1) % g_list_length(frames);
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2909 delay = MAX(gdk_pixbuf_frame_get_delay_time(frame), 13);
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2910 c->icon_timer = gtk_timeout_add(delay * 10, redraw_icon, c);
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2911
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2912 return FALSE;
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
2913 }
2499
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2914
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2915 static void stop_anim(GtkObject *obj, struct conversation *c)
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2916 {
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2917 if (c->icon_timer)
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2918 gtk_timeout_remove(c->icon_timer);
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2919 c->icon_timer = 0;
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2920 }
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2921
2513
6e52448f352a [gaim-migrate @ 2526]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2502
diff changeset
2922 static void start_anim(GtkObject *obj, struct conversation *c)
6e52448f352a [gaim-migrate @ 2526]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2502
diff changeset
2923 {
6e52448f352a [gaim-migrate @ 2526]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2502
diff changeset
2924 GList *frames;
6e52448f352a [gaim-migrate @ 2526]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2502
diff changeset
2925 GdkPixbufFrame *frame;
6e52448f352a [gaim-migrate @ 2526]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2502
diff changeset
2926 int delay;
6e52448f352a [gaim-migrate @ 2526]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2502
diff changeset
2927
6e52448f352a [gaim-migrate @ 2526]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2502
diff changeset
2928 frames = gdk_pixbuf_animation_get_frames(c->anim);
6e52448f352a [gaim-migrate @ 2526]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2502
diff changeset
2929 frame = g_list_nth_data(frames, c->frame);
6e52448f352a [gaim-migrate @ 2526]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2502
diff changeset
2930 delay = MAX(gdk_pixbuf_frame_get_delay_time(frame), 13);
6e52448f352a [gaim-migrate @ 2526]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2502
diff changeset
2931 c->icon_timer = gtk_timeout_add(delay * 10, redraw_icon, c);
6e52448f352a [gaim-migrate @ 2526]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2502
diff changeset
2932 }
6e52448f352a [gaim-migrate @ 2526]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2502
diff changeset
2933
2499
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2934 static int des_save_icon(GtkObject *obj, GdkEvent *e, struct conversation *c)
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2935 {
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2936 gtk_widget_destroy(c->save_icon);
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2937 c->save_icon = NULL;
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2938 return TRUE;
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2939 }
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2940
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2941 static void do_save_icon(GtkObject *obj, struct conversation *c)
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2942 {
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2943 FILE *file;
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2944 char *f = gtk_file_selection_get_filename(GTK_FILE_SELECTION(c->save_icon));
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2945 if (file_is_dir(f, c->save_icon))
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2946 return;
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2947
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2948 file = fopen(f, "w");
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2949 if (file) {
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2950 int len;
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2951 void *data = get_icon_data(c->gc, normalize(c->name), &len);
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2952 if (data)
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2953 fwrite(data, 1, len, file);
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2954 fclose(file);
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2955 } else {
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2956 do_error_dialog("Can't open file for writing", "Error");
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2957 }
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2958
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2959 gtk_widget_destroy(c->save_icon);
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2960 c->save_icon = NULL;
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2961 }
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2962
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2963 static void cancel_save_icon(GtkObject *obj, struct conversation *c)
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2964 {
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2965 gtk_widget_destroy(c->save_icon);
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2966 c->save_icon = NULL;
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2967 }
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2968
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2969 static void save_icon(GtkObject *obj, struct conversation *c)
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2970 {
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2971 char buf[BUF_LEN];
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2972
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2973 if (c->save_icon) {
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2974 gdk_window_raise(c->save_icon->window);
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2975 return;
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2976 }
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2977
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2978 c->save_icon = gtk_file_selection_new(_("Gaim - Save Icon"));
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2979 gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(c->save_icon));
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2980 g_snprintf(buf, BUF_LEN - 1, "%s/%s.icon", g_get_home_dir(), c->name);
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2981 gtk_file_selection_set_filename(GTK_FILE_SELECTION(c->save_icon), buf);
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2982 gtk_signal_connect(GTK_OBJECT(c->save_icon), "delete_event",
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2983 GTK_SIGNAL_FUNC(des_save_icon), c);
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2984 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(c->save_icon)->ok_button), "clicked",
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2985 GTK_SIGNAL_FUNC(do_save_icon), c);
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2986 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(c->save_icon)->cancel_button), "clicked",
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2987 GTK_SIGNAL_FUNC(cancel_save_icon), c);
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2988
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2989 gtk_widget_show(c->save_icon);
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2990 }
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2991
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2992 static gboolean icon_menu(GtkObject *obj, GdkEventButton *e, struct conversation *c)
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2993 {
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2994 GtkWidget *menu;
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2995 GtkWidget *button;
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2996
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2997 if (e->button != 3)
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2998 return FALSE;
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
2999 if (e->type != GDK_BUTTON_PRESS)
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
3000 return FALSE;
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
3001
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
3002 menu = gtk_menu_new();
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
3003
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
3004 if (c->icon_timer) {
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
3005 button = gtk_menu_item_new_with_label(_("Disable Animation"));
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
3006 gtk_signal_connect(GTK_OBJECT(button), "activate", GTK_SIGNAL_FUNC(stop_anim), c);
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
3007 gtk_menu_append(GTK_MENU(menu), button);
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
3008 gtk_widget_show(button);
2767
e5e78d42e49e [gaim-migrate @ 2780]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2763
diff changeset
3009 } else if (c->anim && (gdk_pixbuf_animation_get_num_frames(c->anim) > 1)) {
2513
6e52448f352a [gaim-migrate @ 2526]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2502
diff changeset
3010 button = gtk_menu_item_new_with_label(_("Enable Animation"));
6e52448f352a [gaim-migrate @ 2526]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2502
diff changeset
3011 gtk_signal_connect(GTK_OBJECT(button), "activate", GTK_SIGNAL_FUNC(start_anim), c);
6e52448f352a [gaim-migrate @ 2526]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2502
diff changeset
3012 gtk_menu_append(GTK_MENU(menu), button);
6e52448f352a [gaim-migrate @ 2526]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2502
diff changeset
3013 gtk_widget_show(button);
2499
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
3014 }
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
3015
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
3016 button = gtk_menu_item_new_with_label(_("Hide Icon"));
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
3017 gtk_signal_connect_object(GTK_OBJECT(button), "activate",
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
3018 GTK_SIGNAL_FUNC(remove_icon), (void *)c);
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
3019 gtk_menu_append(GTK_MENU(menu), button);
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
3020 gtk_widget_show(button);
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
3021
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
3022 button = gtk_menu_item_new_with_label(_("Save Icon As..."));
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
3023 gtk_signal_connect(GTK_OBJECT(button), "activate", GTK_SIGNAL_FUNC(save_icon), c);
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
3024 gtk_menu_append(GTK_MENU(menu), button);
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
3025 gtk_widget_show(button);
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
3026
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
3027 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, e->button, e->time);
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
3028
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
3029 return TRUE;
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
3030 }
2191
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3031 #endif
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3032
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3033 void remove_icon(struct conversation *c)
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3034 {
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3035 #if USE_PIXBUF
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3036 if (c->icon)
2895
63cdece2348d [gaim-migrate @ 2908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2891
diff changeset
3037 gtk_container_remove(GTK_CONTAINER(c->bbox), c->icon->parent->parent);
2191
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3038 c->icon = NULL;
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3039 if (c->anim)
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3040 gdk_pixbuf_animation_unref(c->anim);
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3041 c->anim = NULL;
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3042 if (c->icon_timer)
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3043 gtk_timeout_remove(c->icon_timer);
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3044 c->icon_timer = 0;
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3045 c->frame = 0;
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3046 #endif
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3047 }
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3048
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3049 void update_icon(struct conversation *c)
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3050 {
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3051 #if USE_PIXBUF
2521
f42fceb6a9ea [gaim-migrate @ 2534]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2513
diff changeset
3052 char filename[256];
f42fceb6a9ea [gaim-migrate @ 2534]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2513
diff changeset
3053 FILE *file;
f42fceb6a9ea [gaim-migrate @ 2534]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2513
diff changeset
3054
2191
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3055 void *data;
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3056 int len;
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3057
2521
f42fceb6a9ea [gaim-migrate @ 2534]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2513
diff changeset
3058 GList *frames;
f42fceb6a9ea [gaim-migrate @ 2534]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2513
diff changeset
3059 GdkPixbuf *buf;
f42fceb6a9ea [gaim-migrate @ 2534]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2513
diff changeset
3060
2499
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
3061 GtkWidget *event;
2895
63cdece2348d [gaim-migrate @ 2908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2891
diff changeset
3062 GtkWidget *frame;
2191
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3063 GdkPixbuf *scale;
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3064 GdkPixmap *pm;
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3065 GdkBitmap *bm;
2264
2993b6091a53 [gaim-migrate @ 2274]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2246
diff changeset
3066 int sf = 0;
2191
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3067
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3068 if (!c)
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3069 return;
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3070
2231
8c4ff1a368bd [gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2227
diff changeset
3071 remove_icon(c);
8c4ff1a368bd [gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2227
diff changeset
3072
2323
bde2481bb4db [gaim-migrate @ 2333]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2313
diff changeset
3073 if (im_options & OPT_IM_HIDE_ICONS)
bde2481bb4db [gaim-migrate @ 2333]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2313
diff changeset
3074 return;
bde2481bb4db [gaim-migrate @ 2333]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2313
diff changeset
3075
2191
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3076 if (!c->gc)
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3077 return;
2195
d615f7e2d8c4 [gaim-migrate @ 2205]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2191
diff changeset
3078
2191
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3079 data = get_icon_data(c->gc, normalize(c->name), &len);
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3080 if (!data)
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3081 return;
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3082
2521
f42fceb6a9ea [gaim-migrate @ 2534]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2513
diff changeset
3083 /* this is such an evil hack, i don't know why i'm even considering it.
f42fceb6a9ea [gaim-migrate @ 2534]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2513
diff changeset
3084 * we'll do it differently when gdk-pixbuf-loader isn't leaky anymore. */
f42fceb6a9ea [gaim-migrate @ 2534]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2513
diff changeset
3085 g_snprintf(filename, sizeof(filename), "%s/gaimicon-%s.%d", g_get_tmp_dir(), c->name, getpid());
f42fceb6a9ea [gaim-migrate @ 2534]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2513
diff changeset
3086 file = fopen(filename, "w");
f42fceb6a9ea [gaim-migrate @ 2534]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2513
diff changeset
3087 if (!file)
f42fceb6a9ea [gaim-migrate @ 2534]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2513
diff changeset
3088 return;
f42fceb6a9ea [gaim-migrate @ 2534]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2513
diff changeset
3089 fwrite(data, 1, len, file);
f42fceb6a9ea [gaim-migrate @ 2534]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2513
diff changeset
3090 fclose(file);
f42fceb6a9ea [gaim-migrate @ 2534]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2513
diff changeset
3091
f42fceb6a9ea [gaim-migrate @ 2534]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2513
diff changeset
3092 c->anim = gdk_pixbuf_animation_new_from_file(filename);
f42fceb6a9ea [gaim-migrate @ 2534]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2513
diff changeset
3093 /* make sure we remove the file as soon as possible */
f42fceb6a9ea [gaim-migrate @ 2534]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2513
diff changeset
3094 unlink(filename);
f42fceb6a9ea [gaim-migrate @ 2534]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2513
diff changeset
3095
f42fceb6a9ea [gaim-migrate @ 2534]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2513
diff changeset
3096 if (!c->anim)
f42fceb6a9ea [gaim-migrate @ 2534]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2513
diff changeset
3097 return;
f42fceb6a9ea [gaim-migrate @ 2534]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2513
diff changeset
3098
f42fceb6a9ea [gaim-migrate @ 2534]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2513
diff changeset
3099 frames = gdk_pixbuf_animation_get_frames(c->anim);
f42fceb6a9ea [gaim-migrate @ 2534]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2513
diff changeset
3100 buf = gdk_pixbuf_frame_get_pixbuf(frames->data);
f42fceb6a9ea [gaim-migrate @ 2534]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2513
diff changeset
3101 sf = SCALE(c->anim);
f42fceb6a9ea [gaim-migrate @ 2534]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2513
diff changeset
3102 scale = gdk_pixbuf_scale_simple(buf,
f42fceb6a9ea [gaim-migrate @ 2534]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2513
diff changeset
3103 MAX(gdk_pixbuf_get_width(buf) * sf /
f42fceb6a9ea [gaim-migrate @ 2534]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2513
diff changeset
3104 gdk_pixbuf_animation_get_width(c->anim), 1),
f42fceb6a9ea [gaim-migrate @ 2534]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2513
diff changeset
3105 MAX(gdk_pixbuf_get_height(buf) * sf /
f42fceb6a9ea [gaim-migrate @ 2534]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2513
diff changeset
3106 gdk_pixbuf_animation_get_height(c->anim), 1),
f42fceb6a9ea [gaim-migrate @ 2534]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2513
diff changeset
3107 GDK_INTERP_NEAREST);
f42fceb6a9ea [gaim-migrate @ 2534]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2513
diff changeset
3108
f42fceb6a9ea [gaim-migrate @ 2534]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2513
diff changeset
3109 if (gdk_pixbuf_animation_get_num_frames(c->anim) > 1) {
f42fceb6a9ea [gaim-migrate @ 2534]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2513
diff changeset
3110 int delay = MAX(gdk_pixbuf_frame_get_delay_time(frames->data), 13);
f42fceb6a9ea [gaim-migrate @ 2534]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2513
diff changeset
3111 c->frame = 1;
f42fceb6a9ea [gaim-migrate @ 2534]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2513
diff changeset
3112 c->icon_timer = gtk_timeout_add(delay * 10, redraw_icon, c);
2191
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3113 }
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3114
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3115 gdk_pixbuf_render_pixmap_and_mask(scale, &pm, &bm, 0);
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3116 gdk_pixbuf_unref(scale);
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3117
2895
63cdece2348d [gaim-migrate @ 2908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2891
diff changeset
3118 frame = gtk_frame_new(NULL);
63cdece2348d [gaim-migrate @ 2908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2891
diff changeset
3119 gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN);
63cdece2348d [gaim-migrate @ 2908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2891
diff changeset
3120 gtk_box_pack_start(GTK_BOX(c->bbox), frame, FALSE, FALSE, 5);
63cdece2348d [gaim-migrate @ 2908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2891
diff changeset
3121 gtk_widget_show(frame);
63cdece2348d [gaim-migrate @ 2908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2891
diff changeset
3122
2499
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
3123 event = gtk_event_box_new();
2895
63cdece2348d [gaim-migrate @ 2908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2891
diff changeset
3124 gtk_container_add(GTK_CONTAINER(frame), event);
2499
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
3125 gtk_signal_connect(GTK_OBJECT(event), "button-press-event", GTK_SIGNAL_FUNC(icon_menu), c);
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
3126 gtk_widget_show(event);
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
3127
2191
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3128 c->icon = gtk_pixmap_new(pm, bm);
2264
2993b6091a53 [gaim-migrate @ 2274]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2246
diff changeset
3129 gtk_widget_set_usize(c->icon, sf, sf);
2499
933e139fd0d3 [gaim-migrate @ 2512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2487
diff changeset
3130 gtk_container_add(GTK_CONTAINER(event), c->icon);
2191
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3131 gtk_widget_show(c->icon);
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3132 gdk_pixmap_unref(pm);
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3133 if (bm)
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3134 gdk_bitmap_unref(bm);
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3135 #endif
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3136 }
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3137
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3138 void got_new_icon(struct gaim_connection *gc, char *who)
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3139 {
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3140 struct conversation *c = find_conversation(who);
2245
31157c54fe6e [gaim-migrate @ 2255]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2239
diff changeset
3141 if (c && (c->gc == gc))
2191
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3142 update_icon(c);
657dbe515608 [gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
3143 }
2231
8c4ff1a368bd [gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2227
diff changeset
3144
2323
bde2481bb4db [gaim-migrate @ 2333]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2313
diff changeset
3145 void set_hide_icons()
bde2481bb4db [gaim-migrate @ 2333]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2313
diff changeset
3146 {
bde2481bb4db [gaim-migrate @ 2333]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2313
diff changeset
3147 GList *c = conversations;
bde2481bb4db [gaim-migrate @ 2333]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2313
diff changeset
3148 while (c) {
bde2481bb4db [gaim-migrate @ 2333]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2313
diff changeset
3149 update_icon(c->data);
bde2481bb4db [gaim-migrate @ 2333]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2313
diff changeset
3150 c = c->next;
bde2481bb4db [gaim-migrate @ 2333]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2313
diff changeset
3151 }
bde2481bb4db [gaim-migrate @ 2333]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2313
diff changeset
3152 }
bde2481bb4db [gaim-migrate @ 2333]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2313
diff changeset
3153
2231
8c4ff1a368bd [gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2227
diff changeset
3154 static void remove_checkbox(struct conversation *c)
8c4ff1a368bd [gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2227
diff changeset
3155 {
8c4ff1a368bd [gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2227
diff changeset
3156 if (c->check)
8c4ff1a368bd [gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2227
diff changeset
3157 gtk_container_remove(GTK_CONTAINER(c->lbox), c->check);
8c4ff1a368bd [gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2227
diff changeset
3158 c->check = NULL;
8c4ff1a368bd [gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2227
diff changeset
3159 }
8c4ff1a368bd [gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2227
diff changeset
3160
8c4ff1a368bd [gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2227
diff changeset
3161 static void update_checkbox(struct conversation *c)
8c4ff1a368bd [gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2227
diff changeset
3162 {
8c4ff1a368bd [gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2227
diff changeset
3163 if (!c)
8c4ff1a368bd [gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2227
diff changeset
3164 return;
8c4ff1a368bd [gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2227
diff changeset
3165
8c4ff1a368bd [gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2227
diff changeset
3166 remove_checkbox(c);
8c4ff1a368bd [gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2227
diff changeset
3167
8c4ff1a368bd [gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2227
diff changeset
3168 if (!c->gc)
8c4ff1a368bd [gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2227
diff changeset
3169 return;
8c4ff1a368bd [gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2227
diff changeset
3170
2706
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2699
diff changeset
3171 if (!c->gc->checkbox)
2231
8c4ff1a368bd [gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2227
diff changeset
3172 return;
8c4ff1a368bd [gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2227
diff changeset
3173
2706
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2699
diff changeset
3174 c->check = gtk_check_button_new_with_label(c->gc->checkbox);
2231
8c4ff1a368bd [gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2227
diff changeset
3175 gtk_box_pack_start(GTK_BOX(c->lbox), c->check, FALSE, FALSE, 5);
8c4ff1a368bd [gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2227
diff changeset
3176 gtk_widget_show(c->check);
8c4ff1a368bd [gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2227
diff changeset
3177 }