annotate src/conversation.c @ 1970:43a55969523f

[gaim-migrate @ 1980] this doesn't change anything, this just helps with gtk2 stuff. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Thu, 07 Jun 2001 03:12:45 +0000
parents cfdb6a9d3af8
children 699ddd727a49
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
b402a23f35df [gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 344
diff changeset
23 #include "../config.h"
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>
210
ec0686b3b03f [gaim-migrate @ 220]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 209
diff changeset
32 #include <ctype.h>
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
33 #include <gtk/gtk.h>
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
34 #include "gtkimhtml.h"
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
35 #include <gdk/gdkkeysyms.h>
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
36 #include "convo.h"
1117
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
37 #include "gtkspell.h"
1235
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1228
diff changeset
38 #include "prpl.h"
337
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
39
604
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
40 #include "pixmaps/bold.xpm"
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
41 #include "pixmaps/italic.xpm"
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
42 #include "pixmaps/underline.xpm"
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
43 #include "pixmaps/strike.xpm"
604
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
44 #include "pixmaps/small.xpm"
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
45 #include "pixmaps/normal.xpm"
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
46 #include "pixmaps/big.xpm"
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
47 #include "pixmaps/fontface.xpm"
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
48 #include "pixmaps/fgcolor.xpm"
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
49 #include "pixmaps/bgcolor.xpm"
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
50 #include "pixmaps/link.xpm"
790
9d5e7e987103 [gaim-migrate @ 800]
Rob Flynn <gaim@robflynn.com>
parents: 780
diff changeset
51 #include "pixmaps/smile_icon.xpm"
604
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
52 #include "pixmaps/wood.xpm"
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
53 #include "pixmaps/save_small.xpm"
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
54 #include "pixmaps/speaker.xpm"
604
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
55
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
56 #include "pixmaps/luke03.xpm"
610
cadb51c068cb [gaim-migrate @ 620]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 608
diff changeset
57 #include "pixmaps/oneeye.xpm"
1732
e5ba877f51f2 [gaim-migrate @ 1742]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1709
diff changeset
58 #include "pixmaps/crazy4.xpm"
1965
cfdb6a9d3af8 [gaim-migrate @ 1975]
Rob Flynn <gaim@robflynn.com>
parents: 1918
diff changeset
59 #include "pixmaps/mrt.xpm"
604
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 602
diff changeset
60
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
61 int state_lock = 0;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
62
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
63 GdkPixmap *dark_icon_pm = NULL;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
64 GdkBitmap *dark_icon_bm = NULL;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
65
1608
e19a2cb4190c [gaim-migrate @ 1618]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1597
diff changeset
66 GtkWidget *all_convos = NULL;
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
67 static GtkWidget *convo_notebook = NULL;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
68
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 661
diff changeset
69 char fontface[64];
1441
5c67b8794991 [gaim-migrate @ 1451]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1440
diff changeset
70 int fontsize = 3;
885
db5f5c33e83f [gaim-migrate @ 895]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 876
diff changeset
71 extern GdkColor bgcolor;
db5f5c33e83f [gaim-migrate @ 895]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 876
diff changeset
72 extern GdkColor fgcolor;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
73
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
74 void check_everything(GtkWidget *entry);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
75 gboolean keypress_callback(GtkWidget *entry, GdkEventKey * event, struct conversation *c);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
76
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
77 /*------------------------------------------------------------------------*/
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
78 /* Helpers */
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
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
81
1815
f15d449b3167 [gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1813
diff changeset
82 void gaim_setup_imhtml(GtkWidget *imhtml)
1780
d7cbedd1d651 [gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1772
diff changeset
83 {
1815
f15d449b3167 [gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1813
diff changeset
84 g_return_if_fail(imhtml != NULL);
f15d449b3167 [gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1813
diff changeset
85 g_return_if_fail(GTK_IS_IMHTML(imhtml));
1780
d7cbedd1d651 [gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1772
diff changeset
86 if (!(display_options & OPT_DISP_SHOW_SMILEY))
d7cbedd1d651 [gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1772
diff changeset
87 gtk_imhtml_show_smileys(GTK_IMHTML(imhtml), FALSE);
d7cbedd1d651 [gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1772
diff changeset
88 gtk_signal_connect(GTK_OBJECT(imhtml), "url_clicked", GTK_SIGNAL_FUNC(open_url_nw), NULL);
d7cbedd1d651 [gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1772
diff changeset
89 gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), "C:)", luke03_xpm);
d7cbedd1d651 [gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1772
diff changeset
90 gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), "C:-)", luke03_xpm);
d7cbedd1d651 [gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1772
diff changeset
91 gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), "O-)", oneeye_xpm);
d7cbedd1d651 [gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1772
diff changeset
92 gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ">:)", crazy4_xpm);
d7cbedd1d651 [gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1772
diff changeset
93 gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ">:-)", crazy4_xpm);
1965
cfdb6a9d3af8 [gaim-migrate @ 1975]
Rob Flynn <gaim@robflynn.com>
parents: 1918
diff changeset
94 gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ":-o)))", mrt_xpm);
cfdb6a9d3af8 [gaim-migrate @ 1975]
Rob Flynn <gaim@robflynn.com>
parents: 1918
diff changeset
95 gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ":-O)))", mrt_xpm);
1780
d7cbedd1d651 [gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1772
diff changeset
96 }
d7cbedd1d651 [gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1772
diff changeset
97
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
98 void quiet_set(GtkWidget *tb, int state)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
99 {
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
100 state_lock = 1;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
101 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(tb), state);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
102 state_lock = 0;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
103 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
104
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
105
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
106 void set_state_lock(int i)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
107 {
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
108 state_lock = i;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
109 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
110
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
111 void toggle_sensitive(GtkWidget *widget, GtkWidget *to_toggle)
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
112 {
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
113 gboolean sensitivity = GTK_WIDGET_IS_SENSITIVE(GTK_WIDGET(to_toggle));
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
114
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
115 if (sensitivity == TRUE)
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
116 gtk_widget_set_sensitive(GTK_WIDGET(to_toggle), FALSE);
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
117 else
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
118 gtk_widget_set_sensitive(GTK_WIDGET(to_toggle), TRUE);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
119
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
120 return;
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
121 }
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
122
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
123 struct conversation *new_conversation(char *name)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
124 {
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
125 struct conversation *c;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
126
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
127 c = find_conversation(name);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
128
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
129 if (c != NULL)
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
130 return c;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
131
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
132 c = (struct conversation *)g_new0(struct conversation, 1);
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
133 g_snprintf(c->name, sizeof(c->name), "%s", name);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
134
1525
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1486
diff changeset
135 if ((logging_options & OPT_LOG_ALL) || find_log_info(c->name)) {
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
136 FILE *fd;
70
dead1eb6d654 [gaim-migrate @ 80]
Rob Flynn <gaim@robflynn.com>
parents: 68
diff changeset
137
373
1d29321843b0 [gaim-migrate @ 383]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 363
diff changeset
138 fd = open_log_file(c->name);
1034
1d43fda97960 [gaim-migrate @ 1044]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1032
diff changeset
139 if (fd > 0) {
1525
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1486
diff changeset
140 if (!(logging_options & OPT_LOG_STRIP_HTML))
1437
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
141 fprintf(fd,
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
142 "<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
143 full_date());
1437
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
144 else
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
145 fprintf(fd, " ---- New Conversation @ %s ----\n", full_date());
1034
1d43fda97960 [gaim-migrate @ 1044]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1032
diff changeset
146 fclose(fd);
1d43fda97960 [gaim-migrate @ 1044]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1032
diff changeset
147 } else
1d43fda97960 [gaim-migrate @ 1044]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1032
diff changeset
148 /* do we want to do something here? */ ;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
149 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
150
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
151 if (connections)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
152 c->gc = (struct gaim_connection *)connections->data;
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
153 c->history = g_string_new("");
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
154 conversations = g_list_append(conversations, c);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
155 show_conv(c);
1898
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
156 if (c->gc && c->gc->prpl && c->gc->prpl->insert_convo)
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
157 (*c->gc->prpl->insert_convo)(c->gc, c);
1000
91b7377e7b45 [gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
158 plugin_event(event_new_conversation, name, 0, 0, 0);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
159 return c;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
160 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
161
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
162
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
163 struct conversation *find_conversation(char *name)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
164 {
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
165 char *cuser = g_malloc(64);
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
166 struct conversation *c;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
167 GList *cnv = conversations;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
168
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
169 strcpy(cuser, normalize(name));
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
170
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
171 while (cnv) {
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
172 c = (struct conversation *)cnv->data;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
173 if (!strcasecmp(cuser, normalize(c->name))) {
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
174 g_free(cuser);
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
175 return c;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
176 }
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
177 cnv = cnv->next;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
178 }
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
179 g_free(cuser);
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
180 return NULL;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
181 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
182
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
183 /* ---------------------------------------------------
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
184 * Function to remove a log file entry
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
185 * ---------------------------------------------------
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
186 */
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
187
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
188 void rm_log(struct log_conversation *a)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
189 {
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
190 struct conversation *cnv = find_conversation(a->name);
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
191 char buf[128];
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 log_conversations = g_list_remove(log_conversations, a);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
194
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
195 save_prefs();
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
196
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
197 if (cnv) {
1525
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1486
diff changeset
198 if (!(logging_options & OPT_LOG_ALL))
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
199 g_snprintf(buf, sizeof(buf), CONVERSATION_TITLE, cnv->name);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
200 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
201 g_snprintf(buf, sizeof(buf), LOG_CONVERSATION_TITLE, cnv->name);
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
202 if (!(display_options & OPT_DISP_ONE_WINDOW))
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
203 gtk_window_set_title(GTK_WINDOW(cnv->window), buf);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
204 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
205 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
206
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
207 struct log_conversation *find_log_info(char *name)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
208 {
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
209 char *pname = g_malloc(64);
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
210 GList *lc = log_conversations;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
211 struct log_conversation *l;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
212
66
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 strcpy(pname, normalize(name));
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
215
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
216 while (lc) {
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
217 l = (struct log_conversation *)lc->data;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
218 if (!strcasecmp(pname, normalize(l->name))) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
219 g_free(pname);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
220 return l;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
221 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
222 lc = lc->next;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
223 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
224 g_free(pname);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
225 return NULL;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
226 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
227
625
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
228 void delete_conversation(struct conversation *c)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
229 {
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
230 conversations = g_list_remove(conversations, c);
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
231 if (c->fg_color_dialog)
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
232 gtk_widget_destroy(c->fg_color_dialog);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
233 if (c->bg_color_dialog)
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
234 gtk_widget_destroy(c->bg_color_dialog);
625
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
235 if (c->font_dialog)
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
236 gtk_widget_destroy(c->font_dialog);
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
237 if (c->smiley_dialog)
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
238 gtk_widget_destroy(c->smiley_dialog);
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
239 if (c->link_dialog)
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
240 gtk_widget_destroy(c->link_dialog);
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
241 if (c->log_dialog)
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
242 gtk_widget_destroy(c->log_dialog);
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
243 g_string_free(c->history, TRUE);
625
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
244 g_free(c);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
245 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
246
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
247 void update_log_convs()
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
248 {
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
249 GSList *C = connections;
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
250 struct gaim_connection *g;
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
251 GSList *bcs;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
252 GList *cnv = conversations;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
253 struct conversation *c;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
254
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
255 while (cnv) {
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
256 c = (struct conversation *)cnv->data;
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 if (c->log_button)
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
259 gtk_widget_set_sensitive(c->log_button,
1525
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1486
diff changeset
260 ((logging_options & OPT_LOG_ALL)) ? FALSE : TRUE);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
261
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
262 cnv = cnv->next;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
263 }
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
264
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
265 while (C) {
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
266 g = (struct gaim_connection *)C->data;
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
267 bcs = g->buddy_chats;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
268 while (bcs) {
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
269 c = (struct conversation *)bcs->data;
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
270
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
271 if (c->log_button)
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
272 gtk_widget_set_sensitive(c->log_button,
1525
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1486
diff changeset
273 ((logging_options & OPT_LOG_ALL)) ? FALSE :
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
274 TRUE);
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 bcs = bcs->next;
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
277 }
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
278 C = C->next;
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
279 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
280 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
281
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
282 void update_font_buttons()
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
283 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
284 GList *cnv = conversations;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
285 struct conversation *c;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
286
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
287 while (cnv) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
288 c = (struct conversation *)cnv->data;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
289
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
290 if (c->bold)
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
291 gtk_widget_set_sensitive(c->bold,
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
292 ((font_options & OPT_FONT_BOLD)) ? FALSE : TRUE);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
293
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
294 if (c->italic)
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
295 gtk_widget_set_sensitive(c->italic,
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
296 ((font_options & OPT_FONT_ITALIC)) ? FALSE : TRUE);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
297
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
298 if (c->underline)
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
299 gtk_widget_set_sensitive(c->underline,
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
300 ((font_options & OPT_FONT_UNDERLINE)) ? FALSE : TRUE);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
301
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
302 if (c->strike)
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
303 gtk_widget_set_sensitive(c->strike,
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
304 ((font_options & OPT_FONT_STRIKE)) ? FALSE : TRUE);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
305
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
306 cnv = cnv->next;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
307 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
308 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
309
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
310 /*
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
311 void update_transparency()
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
312 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
313 GList *cnv = conversations;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
314 struct conversation *c;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
315
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
316 This func should be uncalled!
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
317
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
318 while(cnv) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
319 c = (struct conversation *)cnv->data;
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 if (c->text)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
322 gtk_html_set_transparent(GTK_HTML(c->text),
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
323 (transparent) ? TRUE : FALSE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
324
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
325 cnv = cnv->next;
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 }
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
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
330
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 /* Callbacks */
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
333 /*------------------------------------------------------------------------*/
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
334
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
335 void toggle_loggle(GtkWidget *loggle, struct conversation *c)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
336 {
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
337 if (state_lock)
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
338 return;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
339 if (find_log_info(c->name))
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
340 rm_log(find_log_info(c->name));
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
341 else if (GTK_TOGGLE_BUTTON(loggle)->active)
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
342 show_log_dialog(c);
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
343 else
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
344 cancel_log(NULL, c);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
345 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
346
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
347 static void do_save_convo(GtkObject *obj, GtkWidget *wid)
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
348 {
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
349 struct conversation *c = gtk_object_get_user_data(obj);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
350 char *filename = gtk_file_selection_get_filename(GTK_FILE_SELECTION(wid));
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
351 FILE *f;
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
352 if (file_is_dir(filename, wid))
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
353 return;
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
354 if (g_list_find(conversations, c))
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
355 filename = g_strdup(filename);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
356 else
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
357 filename = NULL;
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
358 gtk_widget_destroy(wid);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
359 if (!filename)
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
360 return;
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
361 f = fopen(filename, "w+");
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
362 g_free(filename);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
363 if (!f)
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
364 return;
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
365 fprintf(f, "%s", c->history->str);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
366 fclose(f);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
367 }
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
368
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
369 void save_convo(GtkWidget *save, struct conversation *c)
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
370 {
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
371 char buf[BUF_LONG];
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
372 GtkWidget *window = gtk_file_selection_new(_("Gaim - Save Conversation"));
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
373 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
374 gtk_file_selection_set_filename(GTK_FILE_SELECTION(window), buf);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
375 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
376 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(window)->ok_button),
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
377 "clicked", GTK_SIGNAL_FUNC(do_save_convo), window);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
378 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
379 "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), (gpointer)window);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
380 gtk_widget_show(window);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
381 }
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
382
570
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 563
diff changeset
383 void insert_smiley(GtkWidget *smiley, struct conversation *c)
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 551
diff changeset
384 {
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 551
diff changeset
385 if (state_lock)
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 551
diff changeset
386 return;
570
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 563
diff changeset
387 if (GTK_TOGGLE_BUTTON(smiley)->active)
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 563
diff changeset
388 show_smiley_dialog(c, smiley);
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 563
diff changeset
389 else if (c->smiley_dialog)
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 563
diff changeset
390 close_smiley_dialog(smiley, c);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
391
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 551
diff changeset
392 return;
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 551
diff changeset
393 }
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 551
diff changeset
394
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
395 int close_callback(GtkWidget *widget, struct conversation *c)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
396 {
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
397 if (c->is_chat && (widget == c->close) && !(display_options & OPT_DISP_ONE_CHAT_WINDOW)) {
814
a636ac51d15b [gaim-migrate @ 824]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 808
diff changeset
398 GtkWidget *tmp = c->window;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1244
diff changeset
399 debug_printf("chat clicked close button\n");
814
a636ac51d15b [gaim-migrate @ 824]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 808
diff changeset
400 c->window = NULL;
a636ac51d15b [gaim-migrate @ 824]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 808
diff changeset
401 gtk_widget_destroy(tmp);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
402 return FALSE;
814
a636ac51d15b [gaim-migrate @ 824]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 808
diff changeset
403 }
a636ac51d15b [gaim-migrate @ 824]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 808
diff changeset
404
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1244
diff changeset
405 debug_printf("conversation close callback\n");
814
a636ac51d15b [gaim-migrate @ 824]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 808
diff changeset
406
1117
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
407 if (general_options & OPT_GEN_CHECK_SPELLING)
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
408 gtkspell_detach(GTK_TEXT(c->entry));
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
409
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
410 if (!c->is_chat) {
1902
9aa7cd7f5948 [gaim-migrate @ 1912]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1898
diff changeset
411 if (c->gc && c->gc->prpl && c->gc->prpl->remove_convo)
9aa7cd7f5948 [gaim-migrate @ 1912]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1898
diff changeset
412 (*c->gc->prpl->remove_convo)(c->gc, c);
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
413 if (display_options & OPT_DISP_ONE_WINDOW) {
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
414 if (g_list_length(conversations) > 1) {
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
415 gtk_notebook_remove_page(GTK_NOTEBOOK(convo_notebook),
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
416 g_list_index(conversations, c));
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
417 } else {
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
418 if (c->window)
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
419 gtk_widget_destroy(c->window);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
420 c->window = NULL;
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
421 all_convos = NULL;
1757
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
422 convo_notebook = NULL;
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
423 }
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
424 } else {
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
425 if (c->window)
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
426 gtk_widget_destroy(c->window);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
427 c->window = NULL;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
428 }
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
429 } else {
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
430 if (display_options & OPT_DISP_ONE_CHAT_WINDOW) {
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
431 if (g_list_length(chats) > 1) {
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
432 gtk_notebook_remove_page(GTK_NOTEBOOK(chat_notebook),
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
433 g_list_index(chats, c));
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
434 } else {
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
435 if (c->window)
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
436 gtk_widget_destroy(c->window);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
437 c->window = NULL;
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
438 all_chats = NULL;
1757
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
439 chat_notebook = NULL;
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
440 }
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
441 } else {
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
442 if (c->window)
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
443 gtk_widget_destroy(c->window);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
444 c->window = NULL;
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
445 }
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
446 }
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
447
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
448 if (c->fg_color_dialog)
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
449 gtk_widget_destroy(c->fg_color_dialog);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
450 c->fg_color_dialog = NULL;
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
451 if (c->bg_color_dialog)
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
452 gtk_widget_destroy(c->bg_color_dialog);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
453 c->bg_color_dialog = NULL;
625
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
454 if (c->font_dialog)
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
455 gtk_widget_destroy(c->font_dialog);
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
456 c->font_dialog = NULL;
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
457 if (c->smiley_dialog)
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
458 gtk_widget_destroy(c->smiley_dialog);
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
459 c->smiley_dialog = NULL;
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
460 if (c->link_dialog)
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
461 gtk_widget_destroy(c->link_dialog);
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
462 c->link_dialog = NULL;
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
463 if (c->log_dialog)
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
464 gtk_widget_destroy(c->log_dialog);
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
465 c->log_dialog = NULL;
ea41ca1658b5 [gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 624
diff changeset
466
511
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 502
diff changeset
467 if (c->is_chat) {
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
468 chats = g_list_remove(chats, c);
1063
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1034
diff changeset
469 if (c->gc)
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1034
diff changeset
470 serv_chat_leave(c->gc, c->id);
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1034
diff changeset
471 else {
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1034
diff changeset
472 /* bah */
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1034
diff changeset
473 while (c->in_room) {
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1034
diff changeset
474 char *tmp = c->in_room->data;
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1034
diff changeset
475 c->in_room = g_list_remove(c->in_room, tmp);
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1034
diff changeset
476 g_free(tmp);
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1034
diff changeset
477 }
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1034
diff changeset
478 g_free(c);
e1408fb04c36 [gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1034
diff changeset
479 }
511
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 502
diff changeset
480 } else {
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
481 delete_conversation(c);
511
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 502
diff changeset
482 }
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
483
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
484 return TRUE;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
485 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
486
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 661
diff changeset
487 void set_font_face(char *newfont, struct conversation *c)
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
488 {
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 661
diff changeset
489 char *pre_fontface;
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 661
diff changeset
490 int alloc = 1;
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
491
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 661
diff changeset
492 pre_fontface = g_strconcat("<FONT FACE=\"", newfont, "\">", '\0');
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
493
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
494 if (!strcmp(pre_fontface, "<FONT FACE=\"\">")) {
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
495 g_free(pre_fontface);
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
496 alloc--;
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
497 pre_fontface = "<FONT FACE=\"Helvetica\">";
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
498 }
275
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
499
687
02ef523db170 [gaim-migrate @ 697]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 666
diff changeset
500 sprintf(c->fontface, "%s", newfont ? (newfont[0] ? newfont : "Helvetica") : "Helvetica");
688
6b1345121dd3 [gaim-migrate @ 698]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 687
diff changeset
501 c->hasfont = 1;
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
502 surround(c->entry, pre_fontface, "</FONT>");
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
503 gtk_widget_grab_focus(c->entry);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
504
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
505 if (alloc)
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
506 g_free(pre_fontface);
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
507 }
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
508
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
509 static gint delete_all_convo(GtkWidget *w, GdkEventAny *e, gpointer d)
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
510 {
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
511 while (conversations) {
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
512 struct conversation *c = conversations->data;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
513 close_callback(c->close, c);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
514 }
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
515 return FALSE;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
516 }
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
517
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
518 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
519 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
520 delete_conversation(c);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
521 return FALSE;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
522 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
523
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
524 void add_callback(GtkWidget *widget, struct conversation *c)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
525 {
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
526 if (c->gc && find_buddy(c->gc, c->name) != NULL) {
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1244
diff changeset
527 debug_printf(_("Removing '%s' from buddylist.\n"), c->name);
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
528 remove_buddy(c->gc, find_group_by_buddy(c->gc, c->name), find_buddy(c->gc, c->name));
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
529 build_edit_tree();
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
530 update_convo_add_button(c);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
531 } else {
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
532 if (c->gc)
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
533 show_add_buddy(c->gc, c->name, NULL);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
534 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
535
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
536 gtk_widget_grab_focus(c->entry);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
537 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
538
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
539
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
540 void block_callback(GtkWidget *widget, struct conversation *c)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
541 {
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
542 if (c->gc)
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
543 show_add_perm(c->gc, c->name, FALSE);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
544 gtk_widget_grab_focus(c->entry);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
545 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
546
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
547 void warn_callback(GtkWidget *widget, struct conversation *c)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
548 {
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
549 show_warn_dialog(c->gc, c->name);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
550 gtk_widget_grab_focus(c->entry);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
551 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
552
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
553 void info_callback(GtkWidget *w, struct conversation *c)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
554 {
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
555 if (c->is_chat) {
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
556 char *name;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
557 GList *i;
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
558
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
559 i = GTK_LIST(c->list)->selection;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
560 if (i)
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
561 name = (char *)gtk_object_get_user_data(GTK_OBJECT(i->data));
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
562 else
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
563 return;
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
564
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
565 serv_get_info(c->gc, name);
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
566 } else {
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
567 serv_get_info(c->gc, c->name);
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
568 gtk_widget_grab_focus(c->entry);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
569 }
66
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
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
572 gboolean keypress_callback(GtkWidget *entry, GdkEventKey * event, struct conversation *c)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
573 {
573
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
574 int pos;
1411
a3e472534370 [gaim-migrate @ 1421]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1403
diff changeset
575 if (event->keyval == GDK_Escape) {
a3e472534370 [gaim-migrate @ 1421]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1403
diff changeset
576 if (general_options & OPT_GEN_ESC_CAN_CLOSE) {
a3e472534370 [gaim-migrate @ 1421]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1403
diff changeset
577 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
578 close_callback(c->close, c);
1411
a3e472534370 [gaim-migrate @ 1421]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1403
diff changeset
579 }
1455
d113c7e2c5f1 [gaim-migrate @ 1465]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1453
diff changeset
580 } else if ((event->keyval == GDK_F2) && (general_options & OPT_GEN_F2_TOGGLES)) {
d113c7e2c5f1 [gaim-migrate @ 1465]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1453
diff changeset
581 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
582 } else if ((event->keyval == GDK_Return) || (event->keyval == GDK_KP_Enter)) {
1442
2f4e6269b001 [gaim-migrate @ 1452]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
583 if ((event->state & GDK_CONTROL_MASK) && (general_options & OPT_GEN_CTL_ENTER)) {
573
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
584 gtk_signal_emit_by_name(GTK_OBJECT(entry), "activate", c);
1442
2f4e6269b001 [gaim-migrate @ 1452]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
585 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
2f4e6269b001 [gaim-migrate @ 1452]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
586 } else if (!(event->state & GDK_SHIFT_MASK) && (general_options & OPT_GEN_ENTER_SENDS)) {
2f4e6269b001 [gaim-migrate @ 1452]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1441
diff changeset
587 gtk_signal_emit_by_name(GTK_OBJECT(entry), "activate", c);
573
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
588 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
589 } else {
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
590 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
591 pos = gtk_editable_get_position(GTK_EDITABLE(entry));
573
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
592 gtk_editable_insert_text(GTK_EDITABLE(entry), "\n", 1, &pos);
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
593 }
830
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
594 } else if (event->state & GDK_CONTROL_MASK) {
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
595 if (general_options & OPT_GEN_CTL_CHARS) {
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
596 switch (event->keyval) {
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
597 case 'i':
1621
cf2071b095ca [gaim-migrate @ 1631]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1617
diff changeset
598 case 'I':
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
599 quiet_set(c->italic,
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
600 !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(c->italic)));
830
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
601 do_italic(c->italic, c->entry);
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
602 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
603 break;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
604 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
605 case 'U':
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
606 quiet_set(c->underline,
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
607 !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
608 (c->underline)));
830
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
609 do_underline(c->underline, c->entry);
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
610 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
611 break;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
612 case 'b': /* ctl-b is GDK_Left, which moves backwards */
1621
cf2071b095ca [gaim-migrate @ 1631]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1617
diff changeset
613 case 'B':
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
614 quiet_set(c->bold,
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
615 !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(c->bold)));
830
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
616 do_bold(c->bold, c->entry);
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
617 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
618 break;
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
619 case 's':
1621
cf2071b095ca [gaim-migrate @ 1631]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1617
diff changeset
620 case 'S':
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
621 quiet_set(c->strike,
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
622 !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(c->strike)));
830
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
623 do_strike(c->strike, c->entry);
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
624 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
625 break;
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
626 }
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
627 }
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
628 if (general_options & OPT_GEN_CTL_SMILEYS) {
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
629 char buf[7];
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
630 buf[0] = '\0';
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
631 switch (event->keyval) {
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
632 case '1':
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
633 sprintf(buf, ":-)");
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
634 break;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
635 case '2':
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
636 sprintf(buf, ":-(");
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
637 break;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
638 case '3':
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
639 sprintf(buf, ";-)");
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
640 break;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
641 case '4':
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
642 sprintf(buf, ":-P");
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
643 break;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
644 case '5':
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
645 sprintf(buf, "=-O");
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
646 break;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
647 case '6':
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
648 sprintf(buf, ":-*");
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
649 break;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
650 case '7':
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
651 sprintf(buf, ">:o");
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
652 break;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
653 case '8':
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
654 sprintf(buf, "8-)");
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
655 break;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
656 case '!':
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
657 sprintf(buf, ":-$");
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
658 break;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
659 case '@':
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
660 sprintf(buf, ":-!");
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
661 break;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
662 case '#':
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
663 sprintf(buf, ":-[");
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
664 break;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
665 case '$':
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
666 sprintf(buf, "O:-)");
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
667 break;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
668 case '%':
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
669 sprintf(buf, ":-/");
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
670 break;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
671 case '^':
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
672 sprintf(buf, ":'(");
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
673 break;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
674 case '&':
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
675 sprintf(buf, ":-X");
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
676 break;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
677 case '*':
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
678 sprintf(buf, ":-D");
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
679 break;
830
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
680 }
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
681 if (buf[0]) {
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
682 if (GTK_EDITABLE(c->entry)->has_selection) {
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
683 int finish = GTK_EDITABLE(c->entry)->selection_end_pos;
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
684 gtk_editable_insert_text(GTK_EDITABLE(c->entry),
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
685 buf, strlen(buf), &finish);
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
686 } else {
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
687 pos = GTK_EDITABLE(c->entry)->current_pos;
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
688 gtk_editable_insert_text(GTK_EDITABLE(c->entry),
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
689 buf, strlen(buf), &pos);
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
690 }
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
691 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
692 }
573
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
693 }
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
694 if ((!c->is_chat && (display_options & OPT_DISP_ONE_WINDOW)) ||
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
695 ( c->is_chat && (display_options & OPT_DISP_ONE_CHAT_WINDOW))) {
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
696 GtkWidget *notebook = (c->is_chat ? chat_notebook : convo_notebook);
1595
f281f4d94973 [gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1594
diff changeset
697 if (event->keyval == '[') {
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
698 gtk_notebook_prev_page(GTK_NOTEBOOK(notebook));
1587
69a004b5820a [gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1583
diff changeset
699 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
700 } else if (event->keyval == ']') {
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
701 gtk_notebook_next_page(GTK_NOTEBOOK(notebook));
1587
69a004b5820a [gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1583
diff changeset
702 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
703 } else if (event->keyval == GDK_Tab) {
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
704 GList *ws = (c->is_chat ? chats : conversations);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
705 GList *cnv = g_list_nth(ws,
1595
f281f4d94973 [gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1594
diff changeset
706 gtk_notebook_get_current_page(
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
707 GTK_NOTEBOOK(notebook)));
1815
f15d449b3167 [gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1813
diff changeset
708 struct conversation *d = NULL;
1587
69a004b5820a [gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1583
diff changeset
709 while (cnv) {
1595
f281f4d94973 [gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1594
diff changeset
710 d = cnv->data;
f281f4d94973 [gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1594
diff changeset
711 if (d->unseen)
1587
69a004b5820a [gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1583
diff changeset
712 break;
69a004b5820a [gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1583
diff changeset
713 cnv = cnv->next;
1595
f281f4d94973 [gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1594
diff changeset
714 d = NULL;
1587
69a004b5820a [gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1583
diff changeset
715 }
1595
f281f4d94973 [gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1594
diff changeset
716 if (d) {
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
717 gtk_notebook_set_page(GTK_NOTEBOOK(notebook),
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
718 g_list_index(ws, d));
1595
f281f4d94973 [gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1594
diff changeset
719 } else {
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
720 cnv = ws;
1595
f281f4d94973 [gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1594
diff changeset
721 while (cnv) {
f281f4d94973 [gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1594
diff changeset
722 d = cnv->data;
f281f4d94973 [gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1594
diff changeset
723 if (d->unseen)
f281f4d94973 [gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1594
diff changeset
724 break;
f281f4d94973 [gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1594
diff changeset
725 cnv = cnv->next;
f281f4d94973 [gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1594
diff changeset
726 d = NULL;
f281f4d94973 [gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1594
diff changeset
727 }
f281f4d94973 [gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1594
diff changeset
728 if (d) {
f281f4d94973 [gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1594
diff changeset
729 gtk_notebook_set_page(
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
730 GTK_NOTEBOOK(notebook),
1702
70f9d7cdb127 [gaim-migrate @ 1712]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1692
diff changeset
731 g_list_index(ws, d));
1595
f281f4d94973 [gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1594
diff changeset
732 } else {
1702
70f9d7cdb127 [gaim-migrate @ 1712]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1692
diff changeset
733 cnv = g_list_last(ws);
1595
f281f4d94973 [gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1594
diff changeset
734 if (c == cnv->data)
f281f4d94973 [gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1594
diff changeset
735 gtk_notebook_set_page(
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
736 GTK_NOTEBOOK(notebook), 0);
1595
f281f4d94973 [gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1594
diff changeset
737 else
f281f4d94973 [gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1594
diff changeset
738 gtk_notebook_next_page(
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
739 GTK_NOTEBOOK(notebook));
1595
f281f4d94973 [gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1594
diff changeset
740 }
1587
69a004b5820a [gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1583
diff changeset
741 }
69a004b5820a [gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1583
diff changeset
742 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event");
69a004b5820a [gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1583
diff changeset
743 }
69a004b5820a [gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1583
diff changeset
744 }
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
745 } else if (((!c->is_chat && (display_options & OPT_DISP_ONE_WINDOW)) ||
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
746 ( c->is_chat && (display_options & OPT_DISP_ONE_CHAT_WINDOW))) &&
1625
8c92ea5d854f [gaim-migrate @ 1635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1621
diff changeset
747 (event->state & GDK_MOD1_MASK) && isdigit(event->keyval) &&
8c92ea5d854f [gaim-migrate @ 1635]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1621
diff changeset
748 (event->keyval > '0')) {
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
749 GtkWidget *notebook = (c->is_chat ? chat_notebook : convo_notebook);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
750 gtk_notebook_set_page(GTK_NOTEBOOK(notebook), event->keyval - '1');
1621
cf2071b095ca [gaim-migrate @ 1631]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1617
diff changeset
751 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
752 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
753
573
9566a53cde23 [gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
754 return TRUE;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
755 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
756
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
757
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
758 void send_callback(GtkWidget *widget, struct conversation *c)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
759 {
738
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
760 char *buf, *buf2, *buf3;
1100
f168625b63fe [gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1078
diff changeset
761 int limit;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
762
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
763 if (!c->gc)
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
764 return;
1100
f168625b63fe [gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1078
diff changeset
765
f168625b63fe [gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1078
diff changeset
766 buf2 = gtk_editable_get_chars(GTK_EDITABLE(c->entry), 0, -1);
f168625b63fe [gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1078
diff changeset
767 /* uncomment this if you want no limit on outgoing messages.
f168625b63fe [gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1078
diff changeset
768 * if you uncomment this, you'll probably get kicked off if
f168625b63fe [gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1078
diff changeset
769 * you send one that's too big.
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
770 limit = strlen(buf2) * 2;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
771 */
1002
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1000
diff changeset
772 limit = 7985 << 2;
738
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
773 buf = g_malloc(limit);
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
774 g_snprintf(buf, limit, "%s", buf2);
753
cd62f69d187e [gaim-migrate @ 763]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 745
diff changeset
775 g_free(buf2);
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
776 gtk_editable_delete_text(GTK_EDITABLE(c->entry), 0, -1);
796
4783a3b6859d [gaim-migrate @ 806]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 795
diff changeset
777 if (!strlen(buf)) {
4783a3b6859d [gaim-migrate @ 806]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 795
diff changeset
778 g_free(buf);
4783a3b6859d [gaim-migrate @ 806]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 795
diff changeset
779 return;
4783a3b6859d [gaim-migrate @ 806]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 795
diff changeset
780 }
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
781
738
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
782 buf2 = g_malloc(limit);
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
783
1370
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
784 if (c->gc->prpl->options & OPT_PROTO_HTML) {
1889
c81f3dd0e58e [gaim-migrate @ 1899]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1881
diff changeset
785 if (general_options & OPT_GEN_SEND_LINKS)
c81f3dd0e58e [gaim-migrate @ 1899]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1881
diff changeset
786 linkify_text(buf);
c81f3dd0e58e [gaim-migrate @ 1899]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1881
diff changeset
787
1370
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
788 if (font_options & OPT_FONT_BOLD) {
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
789 g_snprintf(buf2, limit, "<B>%s</B>", buf);
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
790 strcpy(buf, buf2);
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
791 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
792
1370
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
793 if (font_options & OPT_FONT_ITALIC) {
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
794 g_snprintf(buf2, limit, "<I>%s</I>", buf);
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
795 strcpy(buf, buf2);
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
796 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
797
1370
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
798 if (font_options & OPT_FONT_UNDERLINE) {
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
799 g_snprintf(buf2, limit, "<U>%s</U>", buf);
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
800 strcpy(buf, buf2);
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
801 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
802
1370
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
803 if (font_options & OPT_FONT_STRIKE) {
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
804 g_snprintf(buf2, limit, "<STRIKE>%s</STRIKE>", buf);
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
805 strcpy(buf, buf2);
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
806 }
101
a9aa982272f9 [gaim-migrate @ 111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 88
diff changeset
807
1370
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
808 if ((font_options & OPT_FONT_FACE) || c->hasfont) {
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
809 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
810 strcpy(buf, buf2);
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
811 }
488
0fcb7e7a263c [gaim-migrate @ 498]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 474
diff changeset
812
1441
5c67b8794991 [gaim-migrate @ 1451]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1440
diff changeset
813 if ((font_options & OPT_FONT_SIZE) || c->hassize) {
5c67b8794991 [gaim-migrate @ 1451]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1440
diff changeset
814 g_snprintf(buf2, limit, "<FONT SIZE=\"%d\">%s</FONT>", c->fontsize, buf);
5c67b8794991 [gaim-migrate @ 1451]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1440
diff changeset
815 strcpy(buf, buf2);
5c67b8794991 [gaim-migrate @ 1451]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1440
diff changeset
816 }
5c67b8794991 [gaim-migrate @ 1451]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1440
diff changeset
817
1370
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
818 if ((font_options & OPT_FONT_FGCOL) || c->hasfg) {
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
819 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
820 c->fgcol.green, c->fgcol.blue, buf);
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
821 strcpy(buf, buf2);
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
822 }
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 661
diff changeset
823
1370
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
824 if ((font_options & OPT_FONT_BGCOL) || c->hasbg) {
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
825 g_snprintf(buf2, limit, "<BODY BGCOLOR=\"#%02X%02X%02X\">%s</BODY>", c->bgcol.red,
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
826 c->bgcol.green, c->bgcol.blue, buf);
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
827 strcpy(buf, buf2);
776bb4c6c0b8 [gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1352
diff changeset
828 }
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 661
diff changeset
829 }
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 661
diff changeset
830
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1872
diff changeset
831 quiet_set(c->bold, FALSE);
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1872
diff changeset
832 quiet_set(c->strike, FALSE);
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1872
diff changeset
833 quiet_set(c->italic, FALSE);
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1872
diff changeset
834 quiet_set(c->underline, FALSE);
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1872
diff changeset
835 quiet_set(c->font, FALSE);
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1872
diff changeset
836 quiet_set(c->fgcolorbtn, FALSE);
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1872
diff changeset
837 quiet_set(c->bgcolorbtn, FALSE);
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1872
diff changeset
838 quiet_set(c->link, FALSE);
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1872
diff changeset
839 gtk_widget_grab_focus(c->entry);
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1872
diff changeset
840
101
a9aa982272f9 [gaim-migrate @ 111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 88
diff changeset
841 {
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 389
diff changeset
842 char *buffy = g_strdup(buf);
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
843 enum gaim_event evnt = c->is_chat ? event_chat_send : event_im_send;
1100
f168625b63fe [gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1078
diff changeset
844 int plugin_return = plugin_event(evnt, c->gc, c->name, &buffy, 0);
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 389
diff changeset
845 if (!buffy) {
102
8c301530b2a3 [gaim-migrate @ 112]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 101
diff changeset
846 g_free(buf2);
796
4783a3b6859d [gaim-migrate @ 806]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 795
diff changeset
847 g_free(buf);
102
8c301530b2a3 [gaim-migrate @ 112]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 101
diff changeset
848 return;
8c301530b2a3 [gaim-migrate @ 112]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 101
diff changeset
849 }
1100
f168625b63fe [gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1078
diff changeset
850 if (plugin_return) {
f168625b63fe [gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1078
diff changeset
851 g_free(buffy);
f168625b63fe [gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1078
diff changeset
852 g_free(buf2);
f168625b63fe [gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1078
diff changeset
853 g_free(buf);
f168625b63fe [gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1078
diff changeset
854 return;
f168625b63fe [gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1078
diff changeset
855 }
738
97c7b2f61cb5 [gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 700
diff changeset
856 g_snprintf(buf, limit, "%s", buffy);
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 389
diff changeset
857 g_free(buffy);
101
a9aa982272f9 [gaim-migrate @ 111]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 88
diff changeset
858 }
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
859
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
860 if (!c->is_chat) {
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
861 buf3 = g_strdup(buf);
1764
1e0613d9526b [gaim-migrate @ 1774]
Rob Flynn <gaim@robflynn.com>
parents: 1759
diff changeset
862 write_to_conv(c, buf3, WFLAG_SEND, NULL, time((time_t)NULL));
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
863 g_free(buf3);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
864
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
865 serv_send_im(c->gc, c->name, buf, 0);
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
866
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
867 if (c->makesound && (sound_options & OPT_SOUND_SEND))
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
868 play_sound(SEND);
502
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
869 } else {
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
870 serv_chat_send(c->gc, c->id, buf);
502
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
871
4d1e39112cbd [gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 494
diff changeset
872 /* 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
873 }
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
874
1403
c0aa7fdc0a93 [gaim-migrate @ 1413]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1401
diff changeset
875 if (general_options & OPT_GEN_BACK_ON_IM) {
c0aa7fdc0a93 [gaim-migrate @ 1413]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1401
diff changeset
876 if (awaymessage != NULL) {
c0aa7fdc0a93 [gaim-migrate @ 1413]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1401
diff changeset
877 do_im_back();
1431
0137bacd63c8 [gaim-migrate @ 1441]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1428
diff changeset
878 } else if (c->gc->away) {
1403
c0aa7fdc0a93 [gaim-migrate @ 1413]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1401
diff changeset
879 serv_set_away(c->gc, GAIM_AWAY_CUSTOM, NULL);
c0aa7fdc0a93 [gaim-migrate @ 1413]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1401
diff changeset
880 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
881 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
882
796
4783a3b6859d [gaim-migrate @ 806]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 795
diff changeset
883 g_free(buf2);
4783a3b6859d [gaim-migrate @ 806]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 795
diff changeset
884 g_free(buf);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
885 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
886
907
08d5037c9296 [gaim-migrate @ 917]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
887 int entry_key_pressed(GtkWidget *w, GtkWidget *entry)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
888 {
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
889 check_everything(w);
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
890 return TRUE;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
891 }
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 /* HTML-type stuff */
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
895 /*------------------------------------------------------------------------*/
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
896
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
897 int count_tag(GtkWidget *entry, char *s1, char *s2)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
898 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
899 char *p1, *p2;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
900 int res = 0;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
901 char *tmp, *tmpo, h;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
902 tmpo = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
903 h = tmpo[GTK_EDITABLE(entry)->current_pos];
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
904 tmpo[GTK_EDITABLE(entry)->current_pos] = '\0';
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
905 tmp = tmpo;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
906 do {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
907 p1 = strstr(tmp, s1);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
908 p2 = strstr(tmp, s2);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
909 if (p1 && p2) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
910 if (p1 < p2) {
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
911 res = 1;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
912 tmp = p1 + strlen(s1);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
913 } else if (p2 < p1) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
914 res = 0;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
915 tmp = p2 + strlen(s2);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
916 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
917 } else {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
918 if (p1) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
919 res = 1;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
920 tmp = p1 + strlen(s1);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
921 } else if (p2) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
922 res = 0;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
923 tmp = p2 + strlen(s2);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
924 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
925 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
926 } while (p1 || p2);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
927 tmpo[GTK_EDITABLE(entry)->current_pos] = h;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
928 g_free(tmpo);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
929 return res;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
930 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
931
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
932
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
933 int invert_tags(GtkWidget *entry, char *s1, char *s2, int really)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
934 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
935 int start = GTK_EDITABLE(entry)->selection_start_pos;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
936 int finish = GTK_EDITABLE(entry)->selection_end_pos;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
937 char *s;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
938
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
939 s = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
940 if (!strncasecmp(&s[start], s1, strlen(s1)) &&
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
941 !strncasecmp(&s[finish - strlen(s2)], s2, strlen(s2))) {
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
942 if (really) {
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
943 gtk_editable_delete_text(GTK_EDITABLE(entry), start, start + strlen(s1));
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
944 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
945 finish - strlen(s1));
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
946 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
947 g_free(s);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
948 return 1;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
949 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
950 g_free(s);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
951 return 0;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
952 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
953
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
954
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
955 void remove_tags(GtkWidget *entry, char *tag)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
956 {
275
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
957 char *s, *t;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
958 int start = GTK_EDITABLE(entry)->selection_start_pos;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
959 int finish = GTK_EDITABLE(entry)->selection_end_pos;
275
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
960 int temp;
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
961 s = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
962 t = s;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
963
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
964 if (start > finish) {
275
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
965 temp = start;
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
966 start = finish;
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
967 finish = temp;
f9eb3eb9ffde [gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 234
diff changeset
968 }
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
969
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
970 if (strstr(tag, "<FONT SIZE=")) {
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
971 while ((t = strstr(t, "<FONT SIZE="))) {
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
972 if (((t - s) < finish) && ((t - s) >= start)) {
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
973 gtk_editable_delete_text(GTK_EDITABLE(entry), (t - s),
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
974 (t - s) + strlen(tag));
846
4b05985bae5e [gaim-migrate @ 856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 843
diff changeset
975 g_free(s);
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
976 s = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1);
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
977 t = s;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
978 } else
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
979 t++;
68
03ec647d24e9 [gaim-migrate @ 78]
Rob Flynn <gaim@robflynn.com>
parents: 67
diff changeset
980 }
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
981 } else {
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
982 while ((t = strstr(t, tag))) {
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
983 if (((t - s) < finish) && ((t - s) >= start)) {
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
984 gtk_editable_delete_text(GTK_EDITABLE(entry), (t - s),
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
985 (t - s) + strlen(tag));
846
4b05985bae5e [gaim-migrate @ 856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 843
diff changeset
986 g_free(s);
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
987 s = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1);
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
988 t = s;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
989 } else
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
990 t++;
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
991 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
992 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
993 g_free(s);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
994 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
995
1440
6330d0bb309f [gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1439
diff changeset
996 static char *html_logize(char *p)
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
997 {
1103
7aabbbaae829 [gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1100
diff changeset
998
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
999 char *temp_p = p;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1000 char *buffer_p;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1001 char *buffer_start;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1002 int num_cr = 0;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1003 int char_len = 0;
1103
7aabbbaae829 [gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1100
diff changeset
1004
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1005 while (*temp_p != '\0') {
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1006 char_len++;
1440
6330d0bb309f [gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1439
diff changeset
1007 if ((*temp_p == '\n') || ((*temp_p == '<') && (*(temp_p + 1) == '!')))
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1008 num_cr++;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1009 ++temp_p;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1010 }
1103
7aabbbaae829 [gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1100
diff changeset
1011
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1012 temp_p = p;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1013 buffer_p = g_malloc(char_len + (4 * num_cr) + 1);
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1014 buffer_start = buffer_p;
1103
7aabbbaae829 [gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1100
diff changeset
1015
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1016 while (*temp_p != '\0') {
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1017 if (*temp_p == '\n') {
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1018 *buffer_p++ = '<';
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1019 *buffer_p++ = 'B';
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1020 *buffer_p++ = 'R';
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1021 *buffer_p++ = '>';
1440
6330d0bb309f [gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1439
diff changeset
1022 *buffer_p++ = '\n';
6330d0bb309f [gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1439
diff changeset
1023 } else if ((*temp_p == '<') && (*(temp_p + 1) == '!')) {
6330d0bb309f [gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1439
diff changeset
1024 *buffer_p++ = '&';
6330d0bb309f [gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1439
diff changeset
1025 *buffer_p++ = 'g';
6330d0bb309f [gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1439
diff changeset
1026 *buffer_p++ = 't';
6330d0bb309f [gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1439
diff changeset
1027 *buffer_p++ = ';';
6330d0bb309f [gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1439
diff changeset
1028 } else
6330d0bb309f [gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1439
diff changeset
1029 *buffer_p++ = *temp_p;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1030 ++temp_p;
1103
7aabbbaae829 [gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1100
diff changeset
1031 }
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1032 *buffer_p = '\0';
1103
7aabbbaae829 [gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1100
diff changeset
1033
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1034 return buffer_start;
1103
7aabbbaae829 [gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1100
diff changeset
1035 }
7aabbbaae829 [gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1100
diff changeset
1036
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1037 void surround(GtkWidget *entry, char *pre, char *post)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1038 {
649
779c04b844f4 [gaim-migrate @ 659]
Todd Kulesza <fflewddur>
parents: 648
diff changeset
1039 int temp, pos = GTK_EDITABLE(entry)->current_pos;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1040 int dummy;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1041 int start, finish;
1133
0dc7c7b4f8ca [gaim-migrate @ 1143]
Rob Flynn <gaim@robflynn.com>
parents: 1117
diff changeset
1042
0dc7c7b4f8ca [gaim-migrate @ 1143]
Rob Flynn <gaim@robflynn.com>
parents: 1117
diff changeset
1043 if (general_options & OPT_GEN_CHECK_SPELLING) {
0dc7c7b4f8ca [gaim-migrate @ 1143]
Rob Flynn <gaim@robflynn.com>
parents: 1117
diff changeset
1044 gtkspell_detach(GTK_TEXT(entry));
0dc7c7b4f8ca [gaim-migrate @ 1143]
Rob Flynn <gaim@robflynn.com>
parents: 1117
diff changeset
1045 }
0dc7c7b4f8ca [gaim-migrate @ 1143]
Rob Flynn <gaim@robflynn.com>
parents: 1117
diff changeset
1046
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1047 if (GTK_EDITABLE(entry)->has_selection) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1048 remove_tags(entry, pre);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1049 remove_tags(entry, post);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1050 start = GTK_EDITABLE(entry)->selection_start_pos;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1051 finish = GTK_EDITABLE(entry)->selection_end_pos;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1052 if (start > finish) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1053 dummy = finish;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1054 finish = start;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1055 start = dummy;
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 dummy = start;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1058 gtk_editable_insert_text(GTK_EDITABLE(entry), pre, strlen(pre), &dummy);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1059 dummy = finish + strlen(pre);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1060 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
1061 gtk_editable_select_region(GTK_EDITABLE(entry), start,
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1062 finish + strlen(pre) + strlen(post));
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1063 } else {
649
779c04b844f4 [gaim-migrate @ 659]
Todd Kulesza <fflewddur>
parents: 648
diff changeset
1064 temp = pos;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1065 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
1066 if (temp == pos) {
649
779c04b844f4 [gaim-migrate @ 659]
Todd Kulesza <fflewddur>
parents: 648
diff changeset
1067 dummy = pos + strlen(pre);
779c04b844f4 [gaim-migrate @ 659]
Todd Kulesza <fflewddur>
parents: 648
diff changeset
1068 gtk_editable_insert_text(GTK_EDITABLE(entry), post, strlen(post), &dummy);
779c04b844f4 [gaim-migrate @ 659]
Todd Kulesza <fflewddur>
parents: 648
diff changeset
1069 gtk_editable_set_position(GTK_EDITABLE(entry), dummy);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1070 } else {
649
779c04b844f4 [gaim-migrate @ 659]
Todd Kulesza <fflewddur>
parents: 648
diff changeset
1071 dummy = pos;
779c04b844f4 [gaim-migrate @ 659]
Todd Kulesza <fflewddur>
parents: 648
diff changeset
1072 gtk_editable_insert_text(GTK_EDITABLE(entry), post, strlen(post), &dummy);
779c04b844f4 [gaim-migrate @ 659]
Todd Kulesza <fflewddur>
parents: 648
diff changeset
1073 gtk_editable_set_position(GTK_EDITABLE(entry), pos);
779c04b844f4 [gaim-migrate @ 659]
Todd Kulesza <fflewddur>
parents: 648
diff changeset
1074 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1075 }
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1076
1133
0dc7c7b4f8ca [gaim-migrate @ 1143]
Rob Flynn <gaim@robflynn.com>
parents: 1117
diff changeset
1077 if (general_options & OPT_GEN_CHECK_SPELLING) {
0dc7c7b4f8ca [gaim-migrate @ 1143]
Rob Flynn <gaim@robflynn.com>
parents: 1117
diff changeset
1078 gtkspell_attach(GTK_TEXT(entry));
0dc7c7b4f8ca [gaim-migrate @ 1143]
Rob Flynn <gaim@robflynn.com>
parents: 1117
diff changeset
1079 }
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1080
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1081 gtk_widget_grab_focus(entry);
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
344
2434adbb8703 [gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
1084 void advance_past(GtkWidget *entry, char *pre, char *post)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1085 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1086 char *s, *s2;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1087 int pos;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1088 if (invert_tags(entry, pre, post, 1))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1089 return;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1090 s = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1091 pos = GTK_EDITABLE(entry)->current_pos;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1244
diff changeset
1092 debug_printf(_("Currently at %d, "), pos);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1093 s2 = strstr(&s[pos], post);
523
023c3851db0a [gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 520
diff changeset
1094 if (s2) {
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1095 pos = s2 - s + strlen(post);
523
023c3851db0a [gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 520
diff changeset
1096 } else {
023c3851db0a [gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 520
diff changeset
1097 gtk_editable_insert_text(GTK_EDITABLE(entry), post, strlen(post), &pos);
023c3851db0a [gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 520
diff changeset
1098 }
846
4b05985bae5e [gaim-migrate @ 856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 843
diff changeset
1099 g_free(s);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1244
diff changeset
1100 debug_printf(_("Setting position to %d\n"), pos);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1101 gtk_editable_set_position(GTK_EDITABLE(entry), pos);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1102 gtk_widget_grab_focus(entry);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1103 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1104
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
1105 void toggle_fg_color(GtkWidget *color, struct conversation *c)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1106 {
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1107 if (state_lock)
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1108 return;
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1109 if (GTK_TOGGLE_BUTTON(color)->active)
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
1110 show_fgcolor_dialog(c, color);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
1111 else if (c->fg_color_dialog)
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
1112 cancel_fgcolor(color, c);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
1113 else
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1114 advance_past(c->entry, "<FONT COLOR>", "</FONT>");
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
1115 }
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
1116
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
1117 void toggle_bg_color(GtkWidget *color, struct conversation *c)
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
1118 {
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
1119 if (state_lock)
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1120 return;
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
1121 if (GTK_TOGGLE_BUTTON(color)->active)
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
1122 show_bgcolor_dialog(c, color);
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
1123 else if (c->bg_color_dialog)
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 856
diff changeset
1124 cancel_bgcolor(color, c);
189
50dc3db25513 [gaim-migrate @ 199]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 187
diff changeset
1125 else
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1126 advance_past(c->entry, "<BODY BGCOLOR>", "</BODY>");
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1127 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1128
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1129 void toggle_font(GtkWidget *font, struct conversation *c)
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
1130 {
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1131 if (state_lock)
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1132 return;
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1133 if (GTK_TOGGLE_BUTTON(font)->active)
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1134 show_font_dialog(c, font);
563
8d6e2de1fb64 [gaim-migrate @ 573]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 557
diff changeset
1135 else if (c->font_dialog)
8d6e2de1fb64 [gaim-migrate @ 573]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 557
diff changeset
1136 cancel_font(font, c);
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1137 else
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1138 advance_past(c->entry, "<FONT FACE>", "</FONT>");
234
985635758c33 [gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 230
diff changeset
1139 }
611
0f7e5ff95f71 [gaim-migrate @ 621]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 610
diff changeset
1140
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
1141 void toggle_link(GtkWidget *linky, struct conversation *c)
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
1142 {
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
1143 if (state_lock)
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
1144 return;
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
1145 if (GTK_TOGGLE_BUTTON(linky)->active)
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
1146 show_add_link(linky, c);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
1147 else if (c->link_dialog)
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
1148 cancel_link(linky, c);
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
1149 else
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
1150 advance_past(c->entry, "<A HREF>", "</A>");
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
1151 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1152
344
2434adbb8703 [gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
1153 void do_strike(GtkWidget *strike, GtkWidget *entry)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1154 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1155 if (state_lock)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1156 return;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1157
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1158 if (GTK_TOGGLE_BUTTON(strike)->active)
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1159 surround(entry, "<STRIKE>", "</STRIKE>");
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1160 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1161 advance_past(entry, "<STRIKE>", "</STRIKE>");
1133
0dc7c7b4f8ca [gaim-migrate @ 1143]
Rob Flynn <gaim@robflynn.com>
parents: 1117
diff changeset
1162
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1163 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1164
344
2434adbb8703 [gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
1165 void do_bold(GtkWidget *bold, GtkWidget *entry)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1166 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1167 if (state_lock)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1168 return;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1169 if (GTK_TOGGLE_BUTTON(bold)->active)
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1170 surround(entry, "<B>", "</B>");
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1171 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1172 advance_past(entry, "<B>", "</B>");
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1173 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1174
344
2434adbb8703 [gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
1175 void do_underline(GtkWidget *underline, GtkWidget *entry)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1176 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1177 if (state_lock)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1178 return;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1179 if (GTK_TOGGLE_BUTTON(underline)->active)
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1180 surround(entry, "<U>", "</U>");
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1181 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1182 advance_past(entry, "<U>", "</U>");
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1183 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1184
344
2434adbb8703 [gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
1185 void do_italic(GtkWidget *italic, GtkWidget *entry)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1186 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1187 if (state_lock)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1188 return;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1189 if (GTK_TOGGLE_BUTTON(italic)->active)
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1190 surround(entry, "<I>", "</I>");
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1191 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1192 advance_past(entry, "<I>", "</I>");
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1193 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1194
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
1195 /* 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
1196 /* currently set to 15 chars */
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 210
diff changeset
1197
344
2434adbb8703 [gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
1198 void do_small(GtkWidget *small, GtkWidget *entry)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1199 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1200 if (state_lock)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1201 return;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1202 surround(entry, "<FONT SIZE=\"1\">", "</FONT>");
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1203 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1204
344
2434adbb8703 [gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
1205 void do_normal(GtkWidget *normal, GtkWidget *entry)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1206 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1207 if (state_lock)
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1208 return;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1209 surround(entry, "<FONT SIZE=\"3\">", "</FONT>");
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1210 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1211
344
2434adbb8703 [gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
1212 void do_big(GtkWidget *big, GtkWidget *entry)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1213 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1214 if (state_lock)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1215 return;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1216 surround(entry, "<FONT SIZE=\"5\">", "</FONT>");
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1217 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1218
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1219 void check_everything(GtkWidget *entry)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1220 {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1221 struct conversation *c;
206
610b7ffc4821 [gaim-migrate @ 216]
Rob Flynn <gaim@robflynn.com>
parents: 189
diff changeset
1222
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1223 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
1224 if (!c)
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1225 return;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1226 if (invert_tags(entry, "<B>", "</B>", 0))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1227 quiet_set(c->bold, TRUE);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1228 else if (count_tag(entry, "<B>", "</B>"))
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1229 quiet_set(c->bold, TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1230 else
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1231 quiet_set(c->bold, FALSE);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1232 if (invert_tags(entry, "<I>", "</I>", 0))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1233 quiet_set(c->italic, TRUE);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1234 else if (count_tag(entry, "<I>", "</I>"))
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1235 quiet_set(c->italic, TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1236 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1237 quiet_set(c->italic, FALSE);
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 if (invert_tags(entry, "<FONT COLOR", "</FONT>", 0))
854
9e2dcad06d3c [gaim-migrate @ 864]
Rob Flynn <gaim@robflynn.com>
parents: 849
diff changeset
1240 quiet_set(c->fgcolorbtn, TRUE);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1241 else if (count_tag(entry, "<FONT COLOR", "</FONT>"))
854
9e2dcad06d3c [gaim-migrate @ 864]
Rob Flynn <gaim@robflynn.com>
parents: 849
diff changeset
1242 quiet_set(c->fgcolorbtn, TRUE);
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1243 else
854
9e2dcad06d3c [gaim-migrate @ 864]
Rob Flynn <gaim@robflynn.com>
parents: 849
diff changeset
1244 quiet_set(c->fgcolorbtn, FALSE);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1245
861
00fb90babcb2 [gaim-migrate @ 871]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 860
diff changeset
1246 if (invert_tags(entry, "<BODY BGCOLOR", "</BODY>", 0))
00fb90babcb2 [gaim-migrate @ 871]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 860
diff changeset
1247 quiet_set(c->bgcolorbtn, TRUE);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1248 else if (count_tag(entry, "<BODY BGCOLOR", "</BODY>"))
861
00fb90babcb2 [gaim-migrate @ 871]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 860
diff changeset
1249 quiet_set(c->bgcolorbtn, TRUE);
00fb90babcb2 [gaim-migrate @ 871]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 860
diff changeset
1250 else
00fb90babcb2 [gaim-migrate @ 871]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 860
diff changeset
1251 quiet_set(c->bgcolorbtn, FALSE);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1252
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1253 if (invert_tags(entry, "<FONT FACE", "</FONT>", 0))
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1254 quiet_set(c->font, TRUE);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1255 else if (count_tag(entry, "<FONT FACE", "</FONT>"))
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1256 quiet_set(c->font, TRUE);
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1257 else
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1258 quiet_set(c->font, FALSE);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1259
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1260 if (invert_tags(entry, "<A HREF", "</A>", 0))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1261 quiet_set(c->link, TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1262 else if (count_tag(entry, "<A HREF", "</A>"))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1263 quiet_set(c->link, TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1264 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1265 quiet_set(c->link, FALSE);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1266
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1267 if (invert_tags(entry, "<U>", "</U>", 0))
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1268 quiet_set(c->underline, TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1269 else if (count_tag(entry, "<U>", "</U>"))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1270 quiet_set(c->underline, TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1271 else
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1272 quiet_set(c->underline, FALSE);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1273
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1274 if (invert_tags(entry, "<STRIKE>", "</STRIKE>", 0))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1275 quiet_set(c->strike, TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1276 else if (count_tag(entry, "<STRIKE>", "</STRIKE>"))
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1277 quiet_set(c->strike, TRUE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1278 else
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1279 quiet_set(c->strike, FALSE);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1280 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1281
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1282
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1283 /*------------------------------------------------------------------------*/
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1284 /* Takin care of the window.. */
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
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1287
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1288 /* 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
1289 * normal IM conversation or a chat window. but hopefully it won't matter */
1764
1e0613d9526b [gaim-migrate @ 1774]
Rob Flynn <gaim@robflynn.com>
parents: 1759
diff changeset
1290 void write_to_conv(struct conversation *c, char *what, int flags, char *who, time_t mtime)
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1291 {
1735
00f74db70f2d [gaim-migrate @ 1745]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1732
diff changeset
1292 char buf[BUF_LONG];
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1293 char *str;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1294 FILE *fd;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1295 char colour[10];
741
58a6e6e26695 [gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 738
diff changeset
1296 struct buddy *b;
1244
eaa0e2f5ace4 [gaim-migrate @ 1254]
Rob Flynn <gaim@robflynn.com>
parents: 1235
diff changeset
1297 int gtk_font_options = 0;
1440
6330d0bb309f [gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1439
diff changeset
1298 GString *logstr;
1735
00f74db70f2d [gaim-migrate @ 1745]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1732
diff changeset
1299 char buf2[BUF_LONG];
1764
1e0613d9526b [gaim-migrate @ 1774]
Rob Flynn <gaim@robflynn.com>
parents: 1759
diff changeset
1300 char mdate[64];
1e0613d9526b [gaim-migrate @ 1774]
Rob Flynn <gaim@robflynn.com>
parents: 1759
diff changeset
1301
1e0613d9526b [gaim-migrate @ 1774]
Rob Flynn <gaim@robflynn.com>
parents: 1759
diff changeset
1302 strftime(mdate, sizeof(mdate), "%H:%M:%S", localtime(&mtime));
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1303
1453
ecf700f23852 [gaim-migrate @ 1463]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1442
diff changeset
1304 gtk_font_options = gtk_font_options ^ GTK_IMHTML_NO_COMMENTS;
ecf700f23852 [gaim-migrate @ 1463]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1442
diff changeset
1305
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1306 if (display_options & OPT_DISP_IGNORE_COLOUR)
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
1307 gtk_font_options = gtk_font_options ^ GTK_IMHTML_NO_COLOURS;
1244
eaa0e2f5ace4 [gaim-migrate @ 1254]
Rob Flynn <gaim@robflynn.com>
parents: 1235
diff changeset
1308
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1309 if (display_options & OPT_DISP_IGNORE_FONTS)
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
1310 gtk_font_options = gtk_font_options ^ GTK_IMHTML_NO_FONTS;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
1311
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
1312 if (display_options & OPT_DISP_IGNORE_SIZES)
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
1313 gtk_font_options = gtk_font_options ^ GTK_IMHTML_NO_SIZES;
1244
eaa0e2f5ace4 [gaim-migrate @ 1254]
Rob Flynn <gaim@robflynn.com>
parents: 1235
diff changeset
1314
1525
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1486
diff changeset
1315 if (!(logging_options & OPT_LOG_STRIP_HTML))
1440
6330d0bb309f [gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1439
diff changeset
1316 gtk_font_options = gtk_font_options ^ GTK_IMHTML_RETURN_LOG;
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1317
1772
896432d66303 [gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1764
diff changeset
1318 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
1319 if (!who) {
896432d66303 [gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1764
diff changeset
1320 if (flags & WFLAG_SEND) {
896432d66303 [gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1764
diff changeset
1321 b = find_buddy(c->gc, c->gc->username);
896432d66303 [gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1764
diff changeset
1322 if (b)
896432d66303 [gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1764
diff changeset
1323 who = b->show;
896432d66303 [gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1764
diff changeset
1324 else
896432d66303 [gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1764
diff changeset
1325 who = c->gc->username;
896432d66303 [gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1764
diff changeset
1326 } else {
896432d66303 [gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1764
diff changeset
1327 b = find_buddy(c->gc, c->name);
896432d66303 [gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1764
diff changeset
1328 if (b)
896432d66303 [gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1764
diff changeset
1329 who = b->show;
896432d66303 [gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1764
diff changeset
1330 else
896432d66303 [gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1764
diff changeset
1331 who = c->name;
896432d66303 [gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1764
diff changeset
1332 }
896432d66303 [gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1764
diff changeset
1333 } else {
896432d66303 [gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1764
diff changeset
1334 b = find_buddy(c->gc, who);
745
d693b83e4933 [gaim-migrate @ 755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 741
diff changeset
1335 if (b)
d693b83e4933 [gaim-migrate @ 755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 741
diff changeset
1336 who = b->show;
741
58a6e6e26695 [gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 738
diff changeset
1337 }
474
7720d0f9da8e [gaim-migrate @ 484]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 473
diff changeset
1338 }
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1339
1764
1e0613d9526b [gaim-migrate @ 1774]
Rob Flynn <gaim@robflynn.com>
parents: 1759
diff changeset
1340
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1341 if (flags & WFLAG_SYSTEM) {
1735
00f74db70f2d [gaim-migrate @ 1745]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1732
diff changeset
1342 if (general_options & OPT_DISP_SHOW_TIME)
1764
1e0613d9526b [gaim-migrate @ 1774]
Rob Flynn <gaim@robflynn.com>
parents: 1759
diff changeset
1343 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
1344 else
1815
f15d449b3167 [gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1813
diff changeset
1345 g_snprintf(buf, BUF_LONG, "<B>%s</B>", what);
1735
00f74db70f2d [gaim-migrate @ 1745]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1732
diff changeset
1346 g_snprintf(buf2, sizeof(buf2), "<FONT SIZE=\"2\"><!--(%s) --></FONT><B>%s</B><BR>",
1764
1e0613d9526b [gaim-migrate @ 1774]
Rob Flynn <gaim@robflynn.com>
parents: 1759
diff changeset
1347 mdate, what);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1348
1735
00f74db70f2d [gaim-migrate @ 1745]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1732
diff changeset
1349 gtk_imhtml_append_text(GTK_IMHTML(c->text), buf2, 0);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1350
1525
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1486
diff changeset
1351 if (logging_options & OPT_LOG_STRIP_HTML) {
1735
00f74db70f2d [gaim-migrate @ 1745]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1732
diff changeset
1352 char *t1 = strip_html(buf);
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1353 c->history = g_string_append(c->history, t1);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1354 c->history = g_string_append(c->history, "\n");
1486
b72a33d07ce8 [gaim-migrate @ 1496]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1479
diff changeset
1355 g_free(t1);
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1356 } else {
1735
00f74db70f2d [gaim-migrate @ 1745]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1732
diff changeset
1357 c->history = g_string_append(c->history, buf);
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1358 c->history = g_string_append(c->history, "<BR>\n");
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1359 }
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1360
1525
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1486
diff changeset
1361 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
1362 char *t1;
699
f8acdd22065a [gaim-migrate @ 709]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 698
diff changeset
1363 char nm[256];
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1364
1525
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1486
diff changeset
1365 if (logging_options & OPT_LOG_STRIP_HTML) {
1735
00f74db70f2d [gaim-migrate @ 1745]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1732
diff changeset
1366 t1 = strip_html(buf);
1437
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1367 } else {
1735
00f74db70f2d [gaim-migrate @ 1745]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1732
diff changeset
1368 t1 = buf;
1437
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1369 }
699
f8acdd22065a [gaim-migrate @ 709]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 698
diff changeset
1370 if (c->is_chat)
f8acdd22065a [gaim-migrate @ 709]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 698
diff changeset
1371 g_snprintf(nm, 256, "%s.chat", c->name);
f8acdd22065a [gaim-migrate @ 709]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 698
diff changeset
1372 else
f8acdd22065a [gaim-migrate @ 709]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 698
diff changeset
1373 g_snprintf(nm, 256, "%s", c->name);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1374 fd = open_log_file(nm);
1067
649199f4730e [gaim-migrate @ 1077]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1063
diff changeset
1375 if (fd > 0) {
1525
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1486
diff changeset
1376 if (logging_options & OPT_LOG_STRIP_HTML) {
1437
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1377 fprintf(fd, "%s\n", t1);
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1378 } else {
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1379 fprintf(fd, "%s<BR>\n", t1);
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1380 }
1067
649199f4730e [gaim-migrate @ 1077]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1063
diff changeset
1381 fclose(fd);
936
311b3f72e7b9 [gaim-migrate @ 946]
Rob Flynn <gaim@robflynn.com>
parents: 915
diff changeset
1382 }
1525
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1486
diff changeset
1383 if (logging_options & OPT_LOG_STRIP_HTML) {
1437
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1384 g_free(t1);
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1385 }
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1386 }
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1387
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1388 } else {
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1389 if (flags & WFLAG_WHISPER) {
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1390 /* if we're whispering, it's not an autoresponse */
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1391 if (meify(what)) {
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1392 str = g_malloc(64);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1393 g_snprintf(str, 62, "***%s", who);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1394 strcpy(colour, "#6C2585\0");
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1395 } else {
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1396 str = g_malloc(64);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1397 g_snprintf(str, 62, "*%s*:", who);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1398 strcpy(colour, "#00ff00\0");
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1399 }
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1400 } else {
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1401 if (meify(what)) {
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1402 str = g_malloc(64);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1403 if (flags & WFLAG_AUTO)
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1404 g_snprintf(str, 62, "%s ***%s", AUTO_RESPONSE, who);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1405 else
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1406 g_snprintf(str, 62, "***%s", who);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1407 strcpy(colour, "#062585\0");
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1408 } else {
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1409 str = g_malloc(64);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1410 if (flags & WFLAG_AUTO)
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1411 g_snprintf(str, 62, "%s %s", who, AUTO_RESPONSE);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1412 else
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1413 g_snprintf(str, 62, "%s:", who);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1414 if (flags & WFLAG_RECV)
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1415 strcpy(colour, "#ff0000");
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1416 else if (flags & WFLAG_SEND)
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1417 strcpy(colour, "#0000ff");
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1418 }
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1419 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1420
1437
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1421 if (general_options & OPT_DISP_SHOW_TIME)
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1422 g_snprintf(buf, BUF_LONG, "<FONT COLOR=\"%s\"><FONT SIZE=\"2\">(%s) </FONT>"
1764
1e0613d9526b [gaim-migrate @ 1774]
Rob Flynn <gaim@robflynn.com>
parents: 1759
diff changeset
1423 "<B>%s</B></FONT> ", colour, mdate, str);
1437
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1424 else
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1425 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
1426 g_snprintf(buf2, BUF_LONG, "<FONT COLOR=\"%s\"><FONT SIZE=\"2\"><!--(%s) --></FONT>"
1764
1e0613d9526b [gaim-migrate @ 1774]
Rob Flynn <gaim@robflynn.com>
parents: 1759
diff changeset
1427 "<B>%s</B></FONT> ", colour, mdate, str);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1428
473
f9bb7761c52b [gaim-migrate @ 483]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 472
diff changeset
1429 g_free(str);
f9bb7761c52b [gaim-migrate @ 483]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 472
diff changeset
1430
1439
06a21ec0e269 [gaim-migrate @ 1449]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1438
diff changeset
1431 gtk_imhtml_append_text(GTK_IMHTML(c->text), buf2, 0);
337
f5b199e20d12 [gaim-migrate @ 347]
Rob Flynn <gaim@robflynn.com>
parents: 315
diff changeset
1432
1440
6330d0bb309f [gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1439
diff changeset
1433 logstr = gtk_imhtml_append_text(GTK_IMHTML(c->text), what, gtk_font_options);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1434
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
1435 gtk_imhtml_append_text(GTK_IMHTML(c->text), "<BR>", 0);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1436
1525
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1486
diff changeset
1437 if (logging_options & OPT_LOG_STRIP_HTML) {
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1438 char *t1, *t2;
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1439 t1 = strip_html(buf);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1440 t2 = strip_html(what);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1441 c->history = g_string_append(c->history, t1);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1442 c->history = g_string_append(c->history, t2);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1443 c->history = g_string_append(c->history, "\n");
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1444 g_free(t1);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1445 g_free(t2);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1446 } else {
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1447 char *t1, *t2;
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1448 t1 = html_logize(buf);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1449 t2 = html_logize(what);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1450 c->history = g_string_append(c->history, t1);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1451 c->history = g_string_append(c->history, t2);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1452 c->history = g_string_append(c->history, "\n");
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1453 c->history = g_string_append(c->history, logstr->str);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1454 c->history = g_string_append(c->history, "<BR>\n");
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1455 g_free(t1);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1456 g_free(t2);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1457 }
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1458
1525
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1486
diff changeset
1459 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
1460 char *t1, *t2;
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1461 char *nm = g_malloc(256);
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1462 if (c->is_chat)
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1463 g_snprintf(nm, 256, "%s.chat", c->name);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1464 else
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1465 g_snprintf(nm, 256, "%s", c->name);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1466
1525
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1486
diff changeset
1467 if (logging_options & OPT_LOG_STRIP_HTML) {
1437
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1468 t1 = strip_html(buf);
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1469 t2 = strip_html(what);
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1470 } else {
1440
6330d0bb309f [gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1439
diff changeset
1471 t1 = html_logize(buf);
6330d0bb309f [gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1439
diff changeset
1472 t2 = html_logize(what);
1437
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1473 }
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1474 fd = open_log_file(nm);
1067
649199f4730e [gaim-migrate @ 1077]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1063
diff changeset
1475 if (fd > 0) {
1525
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1486
diff changeset
1476 if (logging_options & OPT_LOG_STRIP_HTML) {
1437
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1477 fprintf(fd, "%s%s\n", t1, t2);
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1478 } else {
1440
6330d0bb309f [gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1439
diff changeset
1479 fprintf(fd, "%s%s%s<BR>\n", t1, t2, logstr->str);
6330d0bb309f [gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1439
diff changeset
1480 g_string_free(logstr, TRUE);
1437
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1481 }
1067
649199f4730e [gaim-migrate @ 1077]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1063
diff changeset
1482 fclose(fd);
936
311b3f72e7b9 [gaim-migrate @ 946]
Rob Flynn <gaim@robflynn.com>
parents: 915
diff changeset
1483 }
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1484 g_free(t1);
1437
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1485 g_free(t2);
1f0660a2c893 [gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1434
diff changeset
1486 g_free(nm);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1487 }
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1488 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1489
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1490 /* if (!GTK_WIDGET_MAPPED(c->window)) {
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1491
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1492 if (dark_icon_pm == NULL)
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1493 dark_icon_pm = gdk_pixmap_create_from_xpm_d(c->window->window, &dark_icon_bm,
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1494 NULL, (gchar **)aimicon2_xpm);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1495 gdk_window_set_icon(c->window->window, NULL, dark_icon_pm, dark_icon_bm);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1496 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1497 */
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1498
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1499 if ((c->is_chat && (general_options & OPT_GEN_POPUP_CHAT)) ||
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1500 (!c->is_chat && (general_options & OPT_GEN_POPUP_WINDOWS)))
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1501 gdk_window_show(c->window->window);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1502
1692
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
1503 if (((flags & WFLAG_RECV) || (flags & WFLAG_SYSTEM)) &&
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
1504 ((!c->is_chat && (display_options & OPT_DISP_ONE_WINDOW) &&
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
1505 (gtk_notebook_get_current_page(GTK_NOTEBOOK(convo_notebook))
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
1506 != g_list_index(conversations, c))) ||
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
1507 ( c->is_chat && (display_options & OPT_DISP_ONE_CHAT_WINDOW) &&
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
1508 (gtk_notebook_get_current_page(GTK_NOTEBOOK(chat_notebook))
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
1509 != g_list_index(chats, c))))) {
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
1510 GtkWidget *notebook = (c->is_chat ? chat_notebook : convo_notebook);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
1511 GList *ws = (c->is_chat ? chats : conversations);
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
1512 GtkWidget *label = gtk_notebook_get_tab_label(GTK_NOTEBOOK(notebook),
a312d64a995d [gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1663
diff changeset
1513 gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook), g_list_index(ws, c)));
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
1514 GtkStyle *style = gtk_style_new();
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
1515 if (!GTK_WIDGET_REALIZED(label))
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
1516 gtk_widget_realize(label);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
1517 gdk_font_unref(style->font);
1587
69a004b5820a [gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1583
diff changeset
1518 style->font = gdk_font_ref(label->style->font);
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
1519 style->fg[0].red = 0xcccc;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
1520 style->fg[0].green = 0x0000;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
1521 style->fg[0].blue = 0x0000;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
1522 gtk_widget_set_style(label, style);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
1523 gtk_style_unref(style);
1587
69a004b5820a [gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1583
diff changeset
1524 c->unseen = TRUE;
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
1525 }
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1526 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1527
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1528
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1529
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1530 GtkWidget *build_conv_toolbar(struct conversation *c)
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1531 {
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1532 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
1533 *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
1534 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
1535 *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
1536 GtkWidget *strike, *small, *normal, *big, *bold, *italic, *underline, *speaker, *wood,
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1537 *fgcolorbtn, *bgcolorbtn, *link, *font, *smiley, *save;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1538 GdkBitmap *mask;
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1539 GtkWidget *toolbar;
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1540 GtkWidget *win;
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1541 GtkWidget *entry;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1542
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1543 toolbar = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_ICONS);
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1544 win = c->window;
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1545 entry = c->entry;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1546
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1547 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
1548 bold_p = gtk_pixmap_new(bold_i, mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1549 gtk_widget_show(bold_p);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1550 gdk_bitmap_unref(mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1551
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1552 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
1553 italic_p = gtk_pixmap_new(italic_i, mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1554 gtk_widget_show(italic_p);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1555 gdk_bitmap_unref(mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1556
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1557 underline_i = gdk_pixmap_create_from_xpm_d(win->window, &mask,
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1558 &win->style->white, underline_xpm);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1559 underline_p = gtk_pixmap_new(underline_i, mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1560 gtk_widget_show(underline_p);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1561 gdk_bitmap_unref(mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1562
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1563 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
1564 strike_p = gtk_pixmap_new(strike_i, mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1565 gtk_widget_show(strike_p);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1566 gdk_bitmap_unref(mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1567
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1568 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
1569 small_p = gtk_pixmap_new(small_i, mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1570 gtk_widget_show(small_p);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1571 gdk_bitmap_unref(mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1572
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1573 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
1574 normal_p = gtk_pixmap_new(normal_i, mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1575 gtk_widget_show(normal_p);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1576 gdk_bitmap_unref(mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1577
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1578 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
1579 big_p = gtk_pixmap_new(big_i, mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1580 gtk_widget_show(big_p);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1581 gdk_bitmap_unref(mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1582
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1583 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
1584 font_p = gtk_pixmap_new(font_i, mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1585 gtk_widget_show(font_p);
804
17def2bb9720 [gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 801
diff changeset
1586 gdk_bitmap_unref(mask);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1587
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1588 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
1589 fgcolor_p = gtk_pixmap_new(fgcolor_i, mask);
9e2dcad06d3c [gaim-migrate @ 864]
Rob Flynn <gaim@robflynn.com>
parents: 849
diff changeset
1590 gtk_widget_show(fgcolor_p);
9e2dcad06d3c [gaim-migrate @ 864]
Rob Flynn <gaim@robflynn.com>
parents: 849
diff changeset
1591 gdk_bitmap_unref(mask);
9e2dcad06d3c [gaim-migrate @ 864]
Rob Flynn <gaim@robflynn.com>
parents: 849
diff changeset
1592
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1593 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
1594 bgcolor_p = gtk_pixmap_new(bgcolor_i, mask);
9e2dcad06d3c [gaim-migrate @ 864]
Rob Flynn <gaim@robflynn.com>
parents: 849
diff changeset
1595 gtk_widget_show(bgcolor_p);
804
17def2bb9720 [gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 801
diff changeset
1596 gdk_bitmap_unref(mask);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1597
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1598 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
1599 link_p = gtk_pixmap_new(link_i, mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1600 gtk_widget_show(link_p);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1601 gdk_bitmap_unref(mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1602
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1603 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
1604 smiley_p = gtk_pixmap_new(smiley_i, mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1605 gtk_widget_show(smiley_p);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1606 gdk_bitmap_unref(mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1607
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1608 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
1609 wood_p = gtk_pixmap_new(wood_i, mask);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1610 gtk_widget_show(wood_p);
804
17def2bb9720 [gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 801
diff changeset
1611 gdk_bitmap_unref(mask);
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1612
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1613 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
1614 save_p = gtk_pixmap_new(save_i, mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1615 gtk_widget_show(save_p);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1616 gdk_bitmap_unref(mask);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1617
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1618 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
1619 speaker_p = gtk_pixmap_new(speaker_i, mask);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1620 gtk_widget_show(speaker_p);
804
17def2bb9720 [gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 801
diff changeset
1621 gdk_bitmap_unref(mask);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1622 c->makesound = 1;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1623
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1624 bold = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1625 GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL,
1970
43a55969523f [gaim-migrate @ 1980]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1965
diff changeset
1626 NULL, _("Bold Text"), _("Bold"), bold_p,
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1627 GTK_SIGNAL_FUNC(do_bold), entry);
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1628 italic = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1629 GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
1970
43a55969523f [gaim-migrate @ 1980]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1965
diff changeset
1630 NULL, NULL, _("Italics Text"),
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
1631 _("Italics"), italic_p, GTK_SIGNAL_FUNC(do_italic), entry);
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1632 underline = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1633 GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
1970
43a55969523f [gaim-migrate @ 1980]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1965
diff changeset
1634 NULL, NULL, _("Underline Text"),
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1635 _("Underline"), underline_p,
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1636 GTK_SIGNAL_FUNC(do_underline), entry);
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1637 strike =
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1638 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
1639 NULL, _("Strike through Text"), _("Strike"), strike_p,
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1640 GTK_SIGNAL_FUNC(do_strike), entry);
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1641
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1642 gtk_toolbar_append_space(GTK_TOOLBAR(toolbar));
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1643
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1644 small = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar),
1970
43a55969523f [gaim-migrate @ 1980]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1965
diff changeset
1645 NULL, _("Decrease font size"), _("Small"),
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1646 small_p, GTK_SIGNAL_FUNC(do_small), entry);
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1647 normal = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar),
1970
43a55969523f [gaim-migrate @ 1980]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1965
diff changeset
1648 NULL, _("Normal font size"), _("Normal"),
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1649 normal_p, GTK_SIGNAL_FUNC(do_normal), entry);
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1650 big = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar),
1970
43a55969523f [gaim-migrate @ 1980]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1965
diff changeset
1651 NULL, _("Increase font size"), _("Big"),
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1652 big_p, GTK_SIGNAL_FUNC(do_big), entry);
862
2ee4e61832a4 [gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 861
diff changeset
1653
2ee4e61832a4 [gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 861
diff changeset
1654 gtk_toolbar_append_space(GTK_TOOLBAR(toolbar));
2ee4e61832a4 [gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 861
diff changeset
1655
311
0a8b4edc4732 [gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 309
diff changeset
1656 font = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1657 GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
1970
43a55969523f [gaim-migrate @ 1980]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1965
diff changeset
1658 NULL, NULL, _("Select Font"),
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1659 _("Font"), font_p, GTK_SIGNAL_FUNC(toggle_font), c);
862
2ee4e61832a4 [gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 861
diff changeset
1660 fgcolorbtn = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1661 GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
1970
43a55969523f [gaim-migrate @ 1980]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1965
diff changeset
1662 NULL, NULL, _("Text Color"),
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1663 _("Color"), fgcolor_p, GTK_SIGNAL_FUNC(toggle_fg_color),
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1664 c);
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1665 bgcolorbtn =
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1666 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
1667 NULL, _("Background Color"), _("Color"), bgcolor_p,
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1668 GTK_SIGNAL_FUNC(toggle_bg_color), c);
862
2ee4e61832a4 [gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 861
diff changeset
1669
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1670 gtk_toolbar_append_space(GTK_TOOLBAR(toolbar));
862
2ee4e61832a4 [gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 861
diff changeset
1671
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1672 link = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1673 GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
1970
43a55969523f [gaim-migrate @ 1980]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1965
diff changeset
1674 NULL, NULL, _("Insert Link"),
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1675 _("Link"), link_p, GTK_SIGNAL_FUNC(toggle_link), c);
862
2ee4e61832a4 [gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 861
diff changeset
1676 smiley = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1677 GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
1970
43a55969523f [gaim-migrate @ 1980]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1965
diff changeset
1678 NULL, NULL, _("Insert smiley face"), _("Smiley"),
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1679 smiley_p, GTK_SIGNAL_FUNC(insert_smiley), c);
862
2ee4e61832a4 [gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 861
diff changeset
1680
2ee4e61832a4 [gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 861
diff changeset
1681 gtk_toolbar_append_space(GTK_TOOLBAR(toolbar));
2ee4e61832a4 [gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 861
diff changeset
1682
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1683 wood = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1684 GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
1970
43a55969523f [gaim-migrate @ 1980]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1965
diff changeset
1685 NULL, NULL, _("Enable logging"),
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1686 _("Logging"), wood_p, GTK_SIGNAL_FUNC(toggle_loggle), c);
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1687 state_lock = 1;
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1688 if (find_log_info(c->name))
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1689 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(wood), TRUE);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1690 else
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1691 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(wood), FALSE);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1692 state_lock = 0;
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1693
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1694 save = gtk_toolbar_append_item (GTK_TOOLBAR(toolbar),
1970
43a55969523f [gaim-migrate @ 1980]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1965
diff changeset
1695 NULL, _("Save Conversation"),
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1696 _("Save"), save_p, GTK_SIGNAL_FUNC(save_convo), c);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1697
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1698 speaker = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1699 GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
1970
43a55969523f [gaim-migrate @ 1980]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1965
diff changeset
1700 NULL, NULL, _("Enable sounds"),
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1701 _("Sound"), speaker_p, GTK_SIGNAL_FUNC(set_option),
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1702 &c->makesound);
1709
11d0deb44a36 [gaim-migrate @ 1719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1705
diff changeset
1703 c->makesound = 0;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1704 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(speaker), TRUE);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1705
535
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
1706 /* use a slicker look if the user wants to */
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1707 if (display_options & OPT_DISP_COOL_LOOK) {
535
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
1708 gtk_button_set_relief(GTK_BUTTON(bold), GTK_RELIEF_NONE);
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
1709 gtk_button_set_relief(GTK_BUTTON(italic), GTK_RELIEF_NONE);
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
1710 gtk_button_set_relief(GTK_BUTTON(underline), GTK_RELIEF_NONE);
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1711 gtk_button_set_relief(GTK_BUTTON(strike), GTK_RELIEF_NONE);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1712 gtk_button_set_relief(GTK_BUTTON(small), GTK_RELIEF_NONE);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1713 gtk_button_set_relief(GTK_BUTTON(normal), GTK_RELIEF_NONE);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1714 gtk_button_set_relief(GTK_BUTTON(big), GTK_RELIEF_NONE);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1715 gtk_button_set_relief(GTK_BUTTON(font), GTK_RELIEF_NONE);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1716 gtk_button_set_relief(GTK_BUTTON(fgcolorbtn), GTK_RELIEF_NONE);
854
9e2dcad06d3c [gaim-migrate @ 864]
Rob Flynn <gaim@robflynn.com>
parents: 849
diff changeset
1717 gtk_button_set_relief(GTK_BUTTON(bgcolorbtn), GTK_RELIEF_NONE);
535
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
1718 gtk_button_set_relief(GTK_BUTTON(link), GTK_RELIEF_NONE);
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 551
diff changeset
1719 gtk_button_set_relief(GTK_BUTTON(smiley), GTK_RELIEF_NONE);
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1720 gtk_button_set_relief(GTK_BUTTON(wood), GTK_RELIEF_NONE);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1721 gtk_button_set_relief(GTK_BUTTON(save), GTK_RELIEF_NONE);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1722 gtk_button_set_relief(GTK_BUTTON(speaker), GTK_RELIEF_NONE);
535
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
1723 }
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1724
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1725 gtk_widget_show(toolbar);
644
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 636
diff changeset
1726
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 636
diff changeset
1727 gdk_pixmap_unref(bold_i);
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 636
diff changeset
1728 gdk_pixmap_unref(italic_i);
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 636
diff changeset
1729 gdk_pixmap_unref(underline_i);
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1730 gdk_pixmap_unref(strike_i);
644
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 636
diff changeset
1731 gdk_pixmap_unref(small_i);
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 636
diff changeset
1732 gdk_pixmap_unref(normal_i);
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 636
diff changeset
1733 gdk_pixmap_unref(big_i);
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 636
diff changeset
1734 gdk_pixmap_unref(font_i);
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1735 gdk_pixmap_unref(fgcolor_i);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1736 gdk_pixmap_unref(bgcolor_i);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1737 gdk_pixmap_unref(link_i);
644
b3900e312d8e [gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 636
diff changeset
1738 gdk_pixmap_unref(smiley_i);
1479
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1739 gdk_pixmap_unref(wood_i);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1740 gdk_pixmap_unref(save_i);
4c62ead808a2 [gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1464
diff changeset
1741 gdk_pixmap_unref(speaker_i);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1742
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1743 c->bold = bold;
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1744 c->strike = strike;
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1745 c->italic = italic;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1746 c->underline = underline;
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1747 c->log_button = wood;
854
9e2dcad06d3c [gaim-migrate @ 864]
Rob Flynn <gaim@robflynn.com>
parents: 849
diff changeset
1748 c->fgcolorbtn = fgcolorbtn;
9e2dcad06d3c [gaim-migrate @ 864]
Rob Flynn <gaim@robflynn.com>
parents: 849
diff changeset
1749 c->bgcolorbtn = bgcolorbtn;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1750 c->link = link;
608
e33dfed611c9 [gaim-migrate @ 618]
Todd Kulesza <fflewddur>
parents: 604
diff changeset
1751 c->wood = wood;
308
e5fa88351dc8 [gaim-migrate @ 318]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 283
diff changeset
1752 c->font = font;
570
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 563
diff changeset
1753 c->smiley = smiley;
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1754
1525
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1486
diff changeset
1755 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
1756
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1757 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
1758 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
1759 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
1760 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
1761
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1762 return toolbar;
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1763 }
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1764
1898
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1765 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
1766 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1767 struct conversation *cnv = gtk_object_get_user_data(m);
1898
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1768
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1769 if (cnv->gc == c)
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1770 return;
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1771
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1772 if (cnv->gc && cnv->gc->prpl && cnv->gc->prpl->remove_convo)
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1773 (*cnv->gc->prpl->remove_convo)(cnv->gc, cnv);
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1774
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1775 cnv->gc = c;
1340
1526caa87138 [gaim-migrate @ 1350]
Rob Flynn <gaim@robflynn.com>
parents: 1253
diff changeset
1776
1342
84aef77f0add [gaim-migrate @ 1352]
Rob Flynn <gaim@robflynn.com>
parents: 1341
diff changeset
1777 update_buttons_by_protocol(cnv);
1898
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1778
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1779 if (cnv->gc && cnv->gc->prpl && cnv->gc->prpl->insert_convo)
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1780 (*cnv->gc->prpl->insert_convo)(cnv->gc, cnv);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1781 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1782
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1783 void update_convo_add_button(struct conversation *c)
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1784 {
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1785 int dispstyle = set_dispstyle(0);
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1786 GtkWidget *parent = c->add->parent;
1663
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
1787 gboolean rebuild = FALSE;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1788
1352
2e8213567278 [gaim-migrate @ 1362]
Rob Flynn <gaim@robflynn.com>
parents: 1343
diff changeset
1789 if (find_buddy(c->gc, c->name)) {
1663
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
1790 if (!gtk_object_get_user_data(GTK_OBJECT(c->add))) {
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
1791 gtk_widget_destroy(c->add);
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
1792 c->add = picture_button2(c->window, _("Remove"), gnome_remove_xpm, dispstyle);
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
1793 rebuild = TRUE;
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
1794 }
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
1795 if (c->gc) {
1352
2e8213567278 [gaim-migrate @ 1362]
Rob Flynn <gaim@robflynn.com>
parents: 1343
diff changeset
1796 if (c->gc->prpl->remove_buddy == NULL)
2e8213567278 [gaim-migrate @ 1362]
Rob Flynn <gaim@robflynn.com>
parents: 1343
diff changeset
1797 gtk_widget_set_sensitive(c->add, FALSE);
2e8213567278 [gaim-migrate @ 1362]
Rob Flynn <gaim@robflynn.com>
parents: 1343
diff changeset
1798 else
2e8213567278 [gaim-migrate @ 1362]
Rob Flynn <gaim@robflynn.com>
parents: 1343
diff changeset
1799 gtk_widget_set_sensitive(c->add, TRUE);
1663
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
1800 } else
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
1801 gtk_widget_set_sensitive(c->add, FALSE);
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
1802 gtk_object_set_user_data(GTK_OBJECT(c->add), c);
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1803 } else {
1663
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
1804 if (gtk_object_get_user_data(GTK_OBJECT(c->add))) {
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
1805 gtk_widget_destroy(c->add);
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
1806 c->add = picture_button2(c->window, _("Add"), gnome_add_xpm, dispstyle);
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
1807 rebuild = TRUE;
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
1808 }
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
1809 if (c->gc) {
1352
2e8213567278 [gaim-migrate @ 1362]
Rob Flynn <gaim@robflynn.com>
parents: 1343
diff changeset
1810 if (c->gc->prpl->add_buddy == NULL)
2e8213567278 [gaim-migrate @ 1362]
Rob Flynn <gaim@robflynn.com>
parents: 1343
diff changeset
1811 gtk_widget_set_sensitive(c->add, FALSE);
2e8213567278 [gaim-migrate @ 1362]
Rob Flynn <gaim@robflynn.com>
parents: 1343
diff changeset
1812 else
2e8213567278 [gaim-migrate @ 1362]
Rob Flynn <gaim@robflynn.com>
parents: 1343
diff changeset
1813 gtk_widget_set_sensitive(c->add, TRUE);
1663
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
1814 } else
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
1815 gtk_widget_set_sensitive(c->add, FALSE);
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1816 }
1352
2e8213567278 [gaim-migrate @ 1362]
Rob Flynn <gaim@robflynn.com>
parents: 1343
diff changeset
1817
1663
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
1818 if (rebuild) {
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
1819 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
1820 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
1821 gtk_box_reorder_child(GTK_BOX(parent), c->add, 2);
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
1822 gtk_widget_show(c->add);
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
1823 }
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1824 }
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1825
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1826 static void create_convo_menu(struct conversation *cnv)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1827 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1828 GtkWidget *menu, *opt;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1829 GSList *g = connections;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1830 struct gaim_connection *c;
1235
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1228
diff changeset
1831 char buf[2048];
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1832
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1833 if (g_slist_length(g) < 2)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1834 gtk_widget_hide(cnv->menu->parent);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1835 else {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1836 menu = gtk_menu_new();
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1837
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1838 while (g) {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1839 c = (struct gaim_connection *)g->data;
1235
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1228
diff changeset
1840 g_snprintf(buf, sizeof buf, "%s (%s)", c->username, (*c->prpl->name)());
a9cf2f61a7b1 [gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1228
diff changeset
1841 opt = gtk_menu_item_new_with_label(buf);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1842 gtk_object_set_user_data(GTK_OBJECT(opt), cnv);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1843 gtk_signal_connect(GTK_OBJECT(opt), "activate",
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1844 GTK_SIGNAL_FUNC(convo_sel_send), c);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1845 gtk_widget_show(opt);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1846 gtk_menu_append(GTK_MENU(menu), opt);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1847 g = g->next;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1848 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1849
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1850 gtk_option_menu_remove_menu(GTK_OPTION_MENU(cnv->menu));
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1851 gtk_option_menu_set_menu(GTK_OPTION_MENU(cnv->menu), menu);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1852 gtk_option_menu_set_history(GTK_OPTION_MENU(cnv->menu), 0);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1853
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1854 gtk_widget_show(cnv->menu);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1855 gtk_widget_show(cnv->menu->parent);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1856 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1857 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1858
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1859 void redo_convo_menus()
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1860 {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1861 GList *c = conversations;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1862 struct conversation *C;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1863
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1864 while (c) {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1865 C = (struct conversation *)c->data;
1898
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1866 c = c->next;
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1867
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1868 create_convo_menu(C);
993
eacd93d0089a [gaim-migrate @ 1003]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1869
1918
fe79493094e7 [gaim-migrate @ 1928]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1902
diff changeset
1870 if (g_slist_index(connections, C->gc) >= 0)
1898
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1871 continue;
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1872
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1873 set_convo_gc(C, connections ? connections->data : NULL);
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1874 }
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1875 }
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1876
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1877 void set_convo_gc(struct conversation *c, struct gaim_connection *gc)
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1878 {
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1879 if (c->gc == gc)
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1880 return;
993
eacd93d0089a [gaim-migrate @ 1003]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1881
1918
fe79493094e7 [gaim-migrate @ 1928]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1902
diff changeset
1882 if (c->gc && g_slist_find(connections, c->gc) && c->gc->prpl && c->gc->prpl->remove_convo)
1898
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1883 (*c->gc->prpl->remove_convo)(c->gc, c);
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1884
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1885 c->gc = gc;
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1886
1898
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1887 if (gc)
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1888 gtk_option_menu_set_history(GTK_OPTION_MENU(c->menu), g_slist_index(connections, gc));
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1889
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1890 update_buttons_by_protocol(c);
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1891
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1892 if (c->gc && c->gc->prpl && c->gc->prpl->insert_convo)
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
1893 (*c->gc->prpl->insert_convo)(c->gc, c);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1894 }
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1895
1340
1526caa87138 [gaim-migrate @ 1350]
Rob Flynn <gaim@robflynn.com>
parents: 1253
diff changeset
1896 void update_buttons_by_protocol(struct conversation *c)
1526caa87138 [gaim-migrate @ 1350]
Rob Flynn <gaim@robflynn.com>
parents: 1253
diff changeset
1897 {
1352
2e8213567278 [gaim-migrate @ 1362]
Rob Flynn <gaim@robflynn.com>
parents: 1343
diff changeset
1898 if (!c->gc)
2e8213567278 [gaim-migrate @ 1362]
Rob Flynn <gaim@robflynn.com>
parents: 1343
diff changeset
1899 {
2e8213567278 [gaim-migrate @ 1362]
Rob Flynn <gaim@robflynn.com>
parents: 1343
diff changeset
1900 gtk_widget_set_sensitive(c->info, FALSE);
2e8213567278 [gaim-migrate @ 1362]
Rob Flynn <gaim@robflynn.com>
parents: 1343
diff changeset
1901 gtk_widget_set_sensitive(c->send, FALSE);
2e8213567278 [gaim-migrate @ 1362]
Rob Flynn <gaim@robflynn.com>
parents: 1343
diff changeset
1902 gtk_widget_set_sensitive(c->warn, FALSE);
2e8213567278 [gaim-migrate @ 1362]
Rob Flynn <gaim@robflynn.com>
parents: 1343
diff changeset
1903 gtk_widget_set_sensitive(c->block, FALSE);
2e8213567278 [gaim-migrate @ 1362]
Rob Flynn <gaim@robflynn.com>
parents: 1343
diff changeset
1904 gtk_widget_set_sensitive(c->add, FALSE);
2e8213567278 [gaim-migrate @ 1362]
Rob Flynn <gaim@robflynn.com>
parents: 1343
diff changeset
1905
2e8213567278 [gaim-migrate @ 1362]
Rob Flynn <gaim@robflynn.com>
parents: 1343
diff changeset
1906 return;
2e8213567278 [gaim-migrate @ 1362]
Rob Flynn <gaim@robflynn.com>
parents: 1343
diff changeset
1907 }
2e8213567278 [gaim-migrate @ 1362]
Rob Flynn <gaim@robflynn.com>
parents: 1343
diff changeset
1908
1532
249a770bebd7 [gaim-migrate @ 1542]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1525
diff changeset
1909 if (c->gc->prpl->get_info == NULL && c->info)
1340
1526caa87138 [gaim-migrate @ 1350]
Rob Flynn <gaim@robflynn.com>
parents: 1253
diff changeset
1910 gtk_widget_set_sensitive(c->info, FALSE);
1398
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1370
diff changeset
1911 else if (c->info)
1340
1526caa87138 [gaim-migrate @ 1350]
Rob Flynn <gaim@robflynn.com>
parents: 1253
diff changeset
1912 gtk_widget_set_sensitive(c->info, TRUE);
1341
6ec45c45157c [gaim-migrate @ 1351]
Rob Flynn <gaim@robflynn.com>
parents: 1340
diff changeset
1913
1343
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1342
diff changeset
1914 if (c->gc->prpl->send_im == NULL && c->send)
1341
6ec45c45157c [gaim-migrate @ 1351]
Rob Flynn <gaim@robflynn.com>
parents: 1340
diff changeset
1915 gtk_widget_set_sensitive(c->send, FALSE);
6ec45c45157c [gaim-migrate @ 1351]
Rob Flynn <gaim@robflynn.com>
parents: 1340
diff changeset
1916 else
6ec45c45157c [gaim-migrate @ 1351]
Rob Flynn <gaim@robflynn.com>
parents: 1340
diff changeset
1917 gtk_widget_set_sensitive(c->send, TRUE);
6ec45c45157c [gaim-migrate @ 1351]
Rob Flynn <gaim@robflynn.com>
parents: 1340
diff changeset
1918
1343
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1342
diff changeset
1919 if (c->gc->prpl->warn == NULL && c->warn)
1341
6ec45c45157c [gaim-migrate @ 1351]
Rob Flynn <gaim@robflynn.com>
parents: 1340
diff changeset
1920 gtk_widget_set_sensitive(c->warn, FALSE);
1398
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1370
diff changeset
1921 else if (c->warn)
1341
6ec45c45157c [gaim-migrate @ 1351]
Rob Flynn <gaim@robflynn.com>
parents: 1340
diff changeset
1922 gtk_widget_set_sensitive(c->warn, TRUE);
6ec45c45157c [gaim-migrate @ 1351]
Rob Flynn <gaim@robflynn.com>
parents: 1340
diff changeset
1923
1343
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1342
diff changeset
1924 if (c->gc->prpl->add_permit == NULL && c->block)
1341
6ec45c45157c [gaim-migrate @ 1351]
Rob Flynn <gaim@robflynn.com>
parents: 1340
diff changeset
1925 gtk_widget_set_sensitive(c->block, FALSE);
1398
f6b0cf1f4c3b [gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1370
diff changeset
1926 else if (c->block)
1341
6ec45c45157c [gaim-migrate @ 1351]
Rob Flynn <gaim@robflynn.com>
parents: 1340
diff changeset
1927 gtk_widget_set_sensitive(c->block, TRUE);
6ec45c45157c [gaim-migrate @ 1351]
Rob Flynn <gaim@robflynn.com>
parents: 1340
diff changeset
1928
1343
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1342
diff changeset
1929 if (c->add)
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1342
diff changeset
1930 update_convo_add_button(c);
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1342
diff changeset
1931
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1342
diff changeset
1932 if (c->whisper)
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1342
diff changeset
1933 {
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1342
diff changeset
1934 if (c->gc->prpl->chat_whisper == NULL)
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1342
diff changeset
1935 gtk_widget_set_sensitive(c->whisper, FALSE);
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1342
diff changeset
1936 else
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1342
diff changeset
1937 gtk_widget_set_sensitive(c->whisper, TRUE);
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1342
diff changeset
1938 }
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1342
diff changeset
1939
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1342
diff changeset
1940 if (c->invite)
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1342
diff changeset
1941 {
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1342
diff changeset
1942 if (c->gc->prpl->chat_invite == NULL)
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1342
diff changeset
1943 gtk_widget_set_sensitive(c->invite, FALSE);
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1342
diff changeset
1944 else
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1342
diff changeset
1945 gtk_widget_set_sensitive(c->invite, TRUE);
a0d89bdc733e [gaim-migrate @ 1353]
Rob Flynn <gaim@robflynn.com>
parents: 1342
diff changeset
1946 }
1340
1526caa87138 [gaim-migrate @ 1350]
Rob Flynn <gaim@robflynn.com>
parents: 1253
diff changeset
1947 }
1526caa87138 [gaim-migrate @ 1350]
Rob Flynn <gaim@robflynn.com>
parents: 1253
diff changeset
1948
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
1949 static void convo_switch(GtkNotebook *notebook, GtkWidget *page, gint page_num, gpointer data)
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
1950 {
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
1951 GtkWidget *label = gtk_notebook_get_tab_label(GTK_NOTEBOOK(convo_notebook),
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
1952 gtk_notebook_get_nth_page(GTK_NOTEBOOK(convo_notebook), page_num));
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
1953 GtkStyle *style;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
1954 struct conversation *c = g_list_nth_data(conversations, page_num);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
1955 if (c && c->window && c->entry)
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
1956 gtk_window_set_focus(GTK_WINDOW(c->window), c->entry);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
1957 if (!GTK_WIDGET_REALIZED(label))
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
1958 return;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
1959 style = gtk_style_new();
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
1960 gdk_font_unref(style->font);
1587
69a004b5820a [gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1583
diff changeset
1961 style->font = gdk_font_ref(label->style->font);
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
1962 gtk_widget_set_style(label, style);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
1963 gtk_style_unref(style);
1587
69a004b5820a [gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1583
diff changeset
1964 c->unseen = FALSE;
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
1965 }
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
1966
1340
1526caa87138 [gaim-migrate @ 1350]
Rob Flynn <gaim@robflynn.com>
parents: 1253
diff changeset
1967
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1968 void show_conv(struct conversation *c)
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1969 {
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1970 GtkWidget *win;
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
1971 GtkWidget *cont;
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1972 char buf[256];
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1973 GtkWidget *text;
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1974 GtkWidget *sw;
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1975 GtkWidget *send;
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1976 GtkWidget *info;
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1977 GtkWidget *warn;
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1978 GtkWidget *block;
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1979 GtkWidget *close;
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1980 GtkWidget *entry;
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1981 GtkWidget *bbox;
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1982 GtkWidget *vbox;
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1983 GtkWidget *vbox2;
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
1984 GtkWidget *paned;
615
9f168ba28ac2 [gaim-migrate @ 625]
Todd Kulesza <fflewddur>
parents: 611
diff changeset
1985 GtkWidget *add;
623
83b0caceea9a [gaim-migrate @ 633]
Rob Flynn <gaim@robflynn.com>
parents: 615
diff changeset
1986 GtkWidget *toolbar;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1987 GtkWidget *hbox;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
1988 GtkWidget *label;
1647
23b734cf1161 [gaim-migrate @ 1657]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
1989 GtkStyle *style;
1219
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
1990 int dispstyle = set_dispstyle(0);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1991
1219
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
1992 c->font_dialog = NULL;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1993 c->fg_color_dialog = NULL;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1994 c->bg_color_dialog = NULL;
1219
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
1995 c->smiley_dialog = NULL;
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
1996 c->link_dialog = NULL;
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
1997 c->log_dialog = NULL;
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
1998 sprintf(c->fontface, "%s", fontface);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
1999 c->hasfont = 0;
1441
5c67b8794991 [gaim-migrate @ 1451]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1440
diff changeset
2000 c->fontsize = fontsize;
5c67b8794991 [gaim-migrate @ 1451]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1440
diff changeset
2001 c->hassize = 0;
1219
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2002 c->bgcol = bgcolor;
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2003 c->hasbg = 0;
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2004 c->fgcol = fgcolor;
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2005 c->hasfg = 0;
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2006
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2007 if (display_options & OPT_DISP_ONE_WINDOW) {
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2008 if (!all_convos) {
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2009 win = all_convos = c->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2010 gtk_window_set_wmclass(GTK_WINDOW(win), "conversation", "Gaim");
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2011 gtk_window_set_policy(GTK_WINDOW(win), TRUE, TRUE, TRUE);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2012 gtk_container_border_width(GTK_CONTAINER(win), 0);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2013 gtk_widget_realize(win);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2014 aol_icon(win->window);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2015 gtk_window_set_title(GTK_WINDOW(win), _("Gaim - Conversations"));
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2016 gtk_signal_connect(GTK_OBJECT(win), "delete_event",
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2017 GTK_SIGNAL_FUNC(delete_all_convo), NULL);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2018
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2019 convo_notebook = gtk_notebook_new();
1757
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2020 if (display_options & OPT_DISP_CONV_SIDE_TAB) {
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2021 if (display_options & OPT_DISP_CONV_BR_TAB) {
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2022 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook),
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2023 GTK_POS_RIGHT);
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2024 } else {
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2025 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook),
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2026 GTK_POS_LEFT);
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2027 }
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2028 } else {
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2029 if (display_options & OPT_DISP_CONV_BR_TAB) {
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2030 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook),
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2031 GTK_POS_BOTTOM);
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2032 } else {
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2033 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook),
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2034 GTK_POS_TOP);
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2035 }
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2036 }
1596
f5845007e3bc [gaim-migrate @ 1606]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1595
diff changeset
2037 gtk_notebook_set_scrollable(GTK_NOTEBOOK(convo_notebook), TRUE);
1597
c1a8a7c40424 [gaim-migrate @ 1607]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1596
diff changeset
2038 gtk_notebook_popup_enable(GTK_NOTEBOOK(convo_notebook));
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2039 gtk_container_add(GTK_CONTAINER(win), convo_notebook);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2040 gtk_signal_connect(GTK_OBJECT(convo_notebook), "switch-page",
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2041 GTK_SIGNAL_FUNC(convo_switch), NULL);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2042 gtk_widget_show(convo_notebook);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2043 } else
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2044 win = c->window = all_convos;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2045
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2046 cont = gtk_vbox_new(FALSE, 5);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2047 gtk_container_set_border_width(GTK_CONTAINER(cont), 5);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2048 gtk_notebook_append_page(GTK_NOTEBOOK(convo_notebook), cont, gtk_label_new(c->name));
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2049 gtk_widget_show(cont);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2050 } else {
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2051 cont = win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2052 c->window = win;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2053 gtk_object_set_user_data(GTK_OBJECT(win), c);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2054 gtk_window_set_wmclass(GTK_WINDOW(win), "conversation", "Gaim");
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2055 gtk_window_set_policy(GTK_WINDOW(win), TRUE, TRUE, TRUE);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2056 gtk_container_border_width(GTK_CONTAINER(win), 10);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2057 gtk_widget_realize(win);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2058 aol_icon(win->window);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2059 if ((find_log_info(c->name)) || ((logging_options & OPT_LOG_ALL)))
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2060 g_snprintf(buf, sizeof(buf), LOG_CONVERSATION_TITLE, c->name);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2061 else
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2062 g_snprintf(buf, sizeof(buf), CONVERSATION_TITLE, c->name);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2063 gtk_window_set_title(GTK_WINDOW(win), buf);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2064 gtk_signal_connect(GTK_OBJECT(win), "delete_event",
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2065 GTK_SIGNAL_FUNC(delete_event_convo), c);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2066 }
623
83b0caceea9a [gaim-migrate @ 633]
Rob Flynn <gaim@robflynn.com>
parents: 615
diff changeset
2067
1219
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2068 paned = gtk_vpaned_new();
1228
6773043cf9f6 [gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1227
diff changeset
2069 gtk_paned_set_gutter_size(GTK_PANED(paned), 15);
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2070 gtk_container_add(GTK_CONTAINER(cont), paned);
1219
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2071 gtk_widget_show(paned);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2072
1228
6773043cf9f6 [gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1227
diff changeset
2073 vbox = gtk_vbox_new(FALSE, 5);
1219
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2074 gtk_paned_pack1(GTK_PANED(paned), vbox, FALSE, TRUE);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2075 gtk_widget_show(vbox);
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
2076
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
2077 sw = gtk_scrolled_window_new(NULL, NULL);
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2078 c->sw = sw;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
2079 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
2080 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
2081 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
2082 gtk_widget_show(sw);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2083
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2084 text = gtk_imhtml_new(NULL, NULL);
1219
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2085 c->text = text;
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2086 gtk_container_add(GTK_CONTAINER(sw), text);
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2087 GTK_LAYOUT(text)->hadjustment->step_increment = 10.0;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2088 GTK_LAYOUT(text)->vadjustment->step_increment = 10.0;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2089 if (display_options & OPT_DISP_SHOW_TIME)
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2090 gtk_imhtml_show_comments(GTK_IMHTML(text), TRUE);
1815
f15d449b3167 [gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1813
diff changeset
2091 gaim_setup_imhtml(text);
1219
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2092 gtk_widget_show(text);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2093
1228
6773043cf9f6 [gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1227
diff changeset
2094 vbox2 = gtk_vbox_new(FALSE, 5);
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
2095 gtk_paned_pack2(GTK_PANED(paned), vbox2, FALSE, FALSE);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
2096 gtk_widget_show(vbox2);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2097
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2098 hbox = gtk_hbox_new(FALSE, 0);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2099 gtk_box_pack_start(GTK_BOX(vbox2), hbox, FALSE, FALSE, 0);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2100 gtk_widget_show(hbox);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2101
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2102 label = gtk_label_new(_("Send message as: "));
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2103 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2104 gtk_widget_show(label);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2105
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2106 c->menu = gtk_option_menu_new();
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2107 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
2108 gtk_widget_show(c->menu);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2109
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 936
diff changeset
2110 create_convo_menu(c);
1219
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2111
1898
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
2112 c->lbox = gtk_hbox_new(FALSE, 0);
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
2113 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
2114 gtk_widget_show(c->lbox);
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
2115
1227
25611364a504 [gaim-migrate @ 1237]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1219
diff changeset
2116 entry = gtk_text_new(NULL, NULL);
25611364a504 [gaim-migrate @ 1237]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1219
diff changeset
2117 c->entry = entry;
1594
ac8eddd16e89 [gaim-migrate @ 1604]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1592
diff changeset
2118 if (!(display_options & OPT_DISP_ONE_WINDOW))
ac8eddd16e89 [gaim-migrate @ 1604]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1592
diff changeset
2119 gtk_window_set_focus(GTK_WINDOW(c->window), c->entry);
1227
25611364a504 [gaim-migrate @ 1237]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1219
diff changeset
2120
1219
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2121 toolbar = build_conv_toolbar(c);
1228
6773043cf9f6 [gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1227
diff changeset
2122 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
2123
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2124 gtk_object_set_user_data(GTK_OBJECT(entry), c);
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
2125 gtk_text_set_editable(GTK_TEXT(entry), TRUE);
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
2126 gtk_text_set_word_wrap(GTK_TEXT(entry), TRUE);
1813
998a6a032874 [gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1780
diff changeset
2127 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
2128
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
2129 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
2130 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
2131 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
2132 entry);
1117
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2133 if (general_options & OPT_GEN_CHECK_SPELLING)
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2134 gtkspell_attach(GTK_TEXT(c->entry));
1228
6773043cf9f6 [gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1227
diff changeset
2135 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
2136 gtk_widget_show(entry);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2137
1898
73d73939f698 [gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1889
diff changeset
2138 c->bbox = bbox = gtk_hbox_new(FALSE, 5);
1228
6773043cf9f6 [gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1227
diff changeset
2139 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
2140 gtk_widget_show(bbox);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2141
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2142 close = picture_button2(win, _("Close"), cancel_xpm, dispstyle);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2143 c->close = close;
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2144 gtk_object_set_user_data(GTK_OBJECT(close), c);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2145 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
2146 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
2147 gtk_widget_show(close);
1219
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2148
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2149 c->sep1 = gtk_vseparator_new();
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2150 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
2151 gtk_widget_show(c->sep1);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2152
1663
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
2153 if (c->gc && find_buddy(c->gc, c->name) != NULL) {
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
2154 add = picture_button2(win, _("Remove"), gnome_remove_xpm, dispstyle);
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
2155 gtk_object_set_user_data(GTK_OBJECT(add), c);
0f7d2284296f [gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1647
diff changeset
2156 } else
1219
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2157 add = picture_button2(win, _("Add"), gnome_add_xpm, dispstyle);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2158 c->add = add;
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2159 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
2160 gtk_box_pack_end(GTK_BOX(bbox), add, dispstyle, dispstyle, 0);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2161 gtk_widget_show(add);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2162
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2163 block = picture_button2(win, _("Block"), block_xpm, dispstyle);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2164 c->block = block;
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2165 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
2166 gtk_box_pack_end(GTK_BOX(bbox), block, dispstyle, dispstyle, 0);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2167 gtk_widget_show(block);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2168
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2169 warn = picture_button2(win, _("Warn"), warn_xpm, dispstyle);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2170 c->warn = warn;
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2171 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
2172 gtk_box_pack_end(GTK_BOX(bbox), warn, dispstyle, dispstyle, 0);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2173 gtk_widget_show(warn);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2174
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2175 info = picture_button2(win, _("Info"), tb_search_xpm, dispstyle);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2176 c->info = info;
1340
1526caa87138 [gaim-migrate @ 1350]
Rob Flynn <gaim@robflynn.com>
parents: 1253
diff changeset
2177
1219
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2178 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
2179 gtk_box_pack_end(GTK_BOX(bbox), info, dispstyle, dispstyle, 0);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2180 gtk_widget_show(info);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2181
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2182 c->sep2 = gtk_vseparator_new();
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2183 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
2184 gtk_widget_show(c->sep2);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2185
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2186 send = picture_button2(win, _("Send"), tmp_send_xpm, dispstyle);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2187 c->send = send;
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2188 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
2189 gtk_box_pack_end(GTK_BOX(bbox), send, dispstyle, dispstyle, 0);
2528fc35aa32 [gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1215
diff changeset
2190 gtk_widget_show(send);
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 661
diff changeset
2191
1340
1526caa87138 [gaim-migrate @ 1350]
Rob Flynn <gaim@robflynn.com>
parents: 1253
diff changeset
2192 update_buttons_by_protocol(c);
1526caa87138 [gaim-migrate @ 1350]
Rob Flynn <gaim@robflynn.com>
parents: 1253
diff changeset
2193
1647
23b734cf1161 [gaim-migrate @ 1657]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2194 style = gtk_widget_get_style(GTK_WIDGET(entry));
23b734cf1161 [gaim-migrate @ 1657]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2195 gtk_imhtml_set_defaults(GTK_IMHTML(text), 0, &style->fg[GTK_STATE_NORMAL],
23b734cf1161 [gaim-migrate @ 1657]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2196 &style->base[GTK_STATE_NORMAL]);
23b734cf1161 [gaim-migrate @ 1657]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1625
diff changeset
2197
66
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2198 gtk_widget_show(win);
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2199 }
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2200
eb2151d7e88a [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2201
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
2202 void toggle_spellchk()
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
2203 {
1117
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2204 GList *cnv = conversations;
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2205 GSList *cht;
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2206 struct conversation *c;
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2207 GSList *con = connections;
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2208 struct gaim_connection *gc;
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2209
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2210 while (cnv) {
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2211 c = (struct conversation *)cnv->data;
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2212 if (general_options & OPT_GEN_CHECK_SPELLING)
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2213 gtkspell_attach(GTK_TEXT(c->entry));
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2214 else
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2215 gtkspell_detach(GTK_TEXT(c->entry));
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2216 cnv = cnv->next;
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2217 }
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2218
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2219 while (con) {
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2220 gc = (struct gaim_connection *)con->data;
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2221 cht = gc->buddy_chats;
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2222 while (cht) {
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2223 c = (struct conversation *)cht->data;
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2224 if (general_options & OPT_GEN_CHECK_SPELLING)
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2225 gtkspell_attach(GTK_TEXT(c->entry));
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2226 else
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2227 gtkspell_detach(GTK_TEXT(c->entry));
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2228 cht = cht->next;
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2229 }
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2230 con = con->next;
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2231 }
f3e0f41beddb [gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1103
diff changeset
2232 }
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2233
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2234 void toggle_timestamps()
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2235 {
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2236 GList *cnv = conversations;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2237 GSList *cht;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2238 struct conversation *c;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2239 GSList *con = connections;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2240 struct gaim_connection *gc;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2241
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2242 while (cnv) {
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2243 c = (struct conversation *)cnv->data;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2244 if (display_options & OPT_DISP_SHOW_TIME)
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2245 gtk_imhtml_show_comments(GTK_IMHTML(c->text), TRUE);
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2246 else
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2247 gtk_imhtml_show_comments(GTK_IMHTML(c->text), FALSE);
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2248 cnv = cnv->next;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2249 }
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2250
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2251 while (con) {
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2252 gc = (struct gaim_connection *)con->data;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2253 cht = gc->buddy_chats;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2254 while (cht) {
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2255 c = (struct conversation *)cht->data;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2256 if (display_options & OPT_DISP_SHOW_TIME)
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2257 gtk_imhtml_show_comments(GTK_IMHTML(c->text), TRUE);
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2258 else
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2259 gtk_imhtml_show_comments(GTK_IMHTML(c->text), FALSE);
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2260 cht = cht->next;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2261 }
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2262 con = con->next;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2263 }
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2264 }
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2265
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2266 void toggle_smileys()
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2267 {
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2268 GList *cnv = conversations;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2269 GSList *cht;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2270 struct conversation *c;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2271 GSList *con = connections;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2272 struct gaim_connection *gc;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2273
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2274 while (cnv) {
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2275 c = (struct conversation *)cnv->data;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2276 if (display_options & OPT_DISP_SHOW_SMILEY)
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2277 gtk_imhtml_show_smileys(GTK_IMHTML(c->text), TRUE);
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2278 else
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2279 gtk_imhtml_show_smileys(GTK_IMHTML(c->text), FALSE);
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2280 cnv = cnv->next;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2281 }
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2282
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2283 while (con) {
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2284 gc = (struct gaim_connection *)con->data;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2285 cht = gc->buddy_chats;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2286 while (cht) {
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2287 c = (struct conversation *)cht->data;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2288 if (display_options & OPT_DISP_SHOW_SMILEY)
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2289 gtk_imhtml_show_smileys(GTK_IMHTML(c->text), TRUE);
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2290 else
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2291 gtk_imhtml_show_smileys(GTK_IMHTML(c->text), FALSE);
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2292 cht = cht->next;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2293 }
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2294 con = con->next;
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2295 }
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1414
diff changeset
2296 }
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2297
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2298 void tabize()
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2299 {
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2300 /* evil, evil i tell you! evil! */
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2301 if (display_options & OPT_DISP_ONE_WINDOW) {
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2302 GList *x = conversations;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2303 while (x) {
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2304 struct conversation *c = x->data;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2305 GtkWidget *imhtml, *win;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2306
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2307 imhtml = c->text;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2308 win = c->window;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2309 show_conv(c);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2310 gtk_widget_destroy(c->text);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2311 gtk_widget_reparent(imhtml, c->sw);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2312 c->text = imhtml;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2313 gtk_widget_destroy(win);
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 x = x->next;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2316 }
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2317 } else {
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2318 GList *x, *m;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2319 x = m = conversations;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2320 conversations = NULL;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2321 while (x) {
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2322 struct conversation *c = x->data;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2323 GtkWidget *imhtml;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2324
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2325 imhtml = c->text;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2326 show_conv(c);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2327 gtk_widget_destroy(c->text);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2328 gtk_widget_reparent(imhtml, c->sw);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2329 c->text = imhtml;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2330
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2331 x = x->next;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2332 }
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2333 if (all_convos)
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2334 gtk_widget_destroy(all_convos);
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2335 all_convos = NULL;
1757
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2336 convo_notebook = NULL;
1573
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2337 conversations = m;
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2338 }
3a8bd72f431f [gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1532
diff changeset
2339 }
1587
69a004b5820a [gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1583
diff changeset
2340
69a004b5820a [gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1583
diff changeset
2341 void set_convo_tab_label(struct conversation *c, char *text)
69a004b5820a [gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1583
diff changeset
2342 {
69a004b5820a [gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1583
diff changeset
2343 gtk_label_set_text(GTK_LABEL(gtk_notebook_get_tab_label(GTK_NOTEBOOK(convo_notebook),
69a004b5820a [gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1583
diff changeset
2344 gtk_notebook_get_nth_page(GTK_NOTEBOOK(convo_notebook),
69a004b5820a [gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1583
diff changeset
2345 g_list_index(conversations, c)))), text);
69a004b5820a [gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1583
diff changeset
2346 }
1590
b4e54a752676 [gaim-migrate @ 1600]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1587
diff changeset
2347
b4e54a752676 [gaim-migrate @ 1600]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1587
diff changeset
2348 void raise_convo_tab(struct conversation *c)
b4e54a752676 [gaim-migrate @ 1600]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1587
diff changeset
2349 {
b4e54a752676 [gaim-migrate @ 1600]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1587
diff changeset
2350 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
2351 gdk_window_show(c->window->window);
1590
b4e54a752676 [gaim-migrate @ 1600]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1587
diff changeset
2352 }
1757
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2353
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2354 void update_im_tabs() {
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2355 if (!convo_notebook || !all_convos)
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2356 return;
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2357 if (display_options & OPT_DISP_CONV_SIDE_TAB) {
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2358 if (display_options & OPT_DISP_CONV_BR_TAB) {
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2359 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook),
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2360 GTK_POS_RIGHT);
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2361 } else {
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2362 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook),
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2363 GTK_POS_LEFT);
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2364 }
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2365 } else {
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2366 if (display_options & OPT_DISP_CONV_BR_TAB) {
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2367 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook),
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2368 GTK_POS_BOTTOM);
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2369 } else {
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2370 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook),
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2371 GTK_POS_TOP);
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2372 }
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2373 }
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2374 }
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2375
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2376 void update_chat_tabs() {
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2377 if (!chat_notebook || !all_chats)
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2378 return;
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2379 if (display_options & OPT_DISP_CHAT_SIDE_TAB) {
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2380 if (display_options & OPT_DISP_CHAT_BR_TAB) {
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2381 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook),
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2382 GTK_POS_RIGHT);
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2383 } else {
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2384 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook),
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2385 GTK_POS_LEFT);
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2386 }
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2387 } else {
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2388 if (display_options & OPT_DISP_CHAT_BR_TAB) {
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2389 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook),
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2390 GTK_POS_BOTTOM);
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2391 } else {
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2392 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook),
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2393 GTK_POS_TOP);
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2394 }
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2395 }
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2396 }
1759
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2397
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2398 void update_convo_color(gboolean fg)
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2399 {
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2400 GList *c = conversations;
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2401 struct conversation *b;
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2402
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2403 while (c) {
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2404 b = c->data;
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2405 c = c->next;
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2406 if (fg) {
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2407 if (b->hasfg) continue;
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2408 b->fgcol = fgcolor;
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2409 } else {
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2410 if (b->hasbg) continue;
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2411 b->bgcol = bgcolor;
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2412 }
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2413 }
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2414 }
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2415
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2416 void update_convo_font()
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2417 {
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2418 GList *c = conversations;
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2419 struct conversation *b;
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2420
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2421 while (c) {
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2422 b = c->data;
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2423 c = c->next;
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2424 if (b->hasfont) continue;
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2425 sprintf(b->fontface, "%s", fontface);
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2426 }
e0f936b4c91a [gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1757
diff changeset
2427 }