Mercurial > pidgin
annotate src/gtkdialogs.c @ 10827:53e7884c549a
[gaim-migrate @ 12492]
this should fix some problems with contact aware conversations, while
possibly introducing new problems, and breaking some plugins.
Someone needs to just remove GaimConvWindows all together.
committer: Tailor Script <tailor@pidgin.im>
author | Tim Ringenbach <marv@pidgin.im> |
---|---|
date | Fri, 15 Apr 2005 22:32:00 +0000 |
parents | c94f40ffcafb |
children | 9d288fd77d3b |
rev | line source |
---|---|
9709 | 1 /* |
10297
ec140184437b
[gaim-migrate @ 11480]
Luke Schierer <lschiere@pidgin.im>
parents:
10266
diff
changeset
|
2 * @file gtkdialogs.c GTK+ Dialogs |
ec140184437b
[gaim-migrate @ 11480]
Luke Schierer <lschiere@pidgin.im>
parents:
10266
diff
changeset
|
3 * @ingroup gtkui |
ec140184437b
[gaim-migrate @ 11480]
Luke Schierer <lschiere@pidgin.im>
parents:
10266
diff
changeset
|
4 * |
9709 | 5 * gaim |
6 * | |
7 * Gaim is the legal property of its developers, whose names are too numerous | |
8 * to list here. Please refer to the COPYRIGHT file distributed with this | |
9 * source distribution. | |
10 * | |
11 * This program is free software; you can redistribute it and/or modify | |
12 * it under the terms of the GNU General Public License as published by | |
13 * the Free Software Foundation; either version 2 of the License, or | |
14 * (at your option) any later version. | |
15 * | |
16 * This program is distributed in the hope that it will be useful, | |
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 * GNU General Public License for more details. | |
20 * | |
21 * You should have received a copy of the GNU General Public License | |
22 * along with this program; if not, write to the Free Software | |
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
24 */ | |
9791 | 25 #include "internal.h" |
26 #include "gtkgaim.h" | |
9709 | 27 |
28 #include "debug.h" | |
29 #include "notify.h" | |
30 #include "prpl.h" | |
31 #include "request.h" | |
32 #include "util.h" | |
33 | |
34 #include "gtkdialogs.h" | |
35 #include "gtkimhtml.h" | |
36 #include "gtkimhtmltoolbar.h" | |
37 #include "gtklog.h" | |
38 #include "gtkutils.h" | |
10297
ec140184437b
[gaim-migrate @ 11480]
Luke Schierer <lschiere@pidgin.im>
parents:
10266
diff
changeset
|
39 #include "gtkstock.h" |
9709 | 40 |
9753 | 41 static GList *dialogwindows = NULL; |
9709 | 42 |
9753 | 43 static GtkWidget *about = NULL; |
9709 | 44 |
45 struct warning { | |
46 GtkWidget *window; | |
47 GtkWidget *anon; | |
48 char *who; | |
49 GaimConnection *gc; | |
50 }; | |
51 | |
9758 | 52 struct developer { |
53 char *name; | |
54 char *role; | |
55 char *email; | |
56 }; | |
57 | |
58 struct translator { | |
59 char *language; | |
60 char *abbr; | |
61 char *name; | |
62 char *email; | |
63 }; | |
64 | |
65 static struct developer developers[] = { | |
66 {"Sean Egan", N_("lead developer"), "sean.egan@binghamton.edu"}, | |
10508
4cc999cc6718
[gaim-migrate @ 11802]
Luke Schierer <lschiere@pidgin.im>
parents:
10493
diff
changeset
|
67 {"Daniel 'datallah' Atallah", N_("developer"), NULL}, |
9758 | 68 {"Christian 'ChipX86' Hammond", N_("developer & webmaster"), NULL}, |
10095
b28f9be379b3
[gaim-migrate @ 11114]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
9991
diff
changeset
|
69 {"Herman Bloggs", N_("win32 port"), "herman@bluedigits.com"}, |
9758 | 70 {"Nathan 'faceprint' Walp", N_("developer"), NULL}, |
71 {"Mark 'KingAnt' Doliner", N_("developer"), NULL}, | |
72 {"Ethan 'Paco-Paco' Blanton", N_("developer"), NULL}, | |
10370
acd5b7af0409
[gaim-migrate @ 11590]
Luke Schierer <lschiere@pidgin.im>
parents:
10369
diff
changeset
|
73 {"Etan 'deryni' Reisner", N_("developer"), NULL}, |
9758 | 74 {"Tim 'marv' Ringenbach", N_("developer"), NULL}, |
10369
584c792dd15c
[gaim-migrate @ 11588]
Luke Schierer <lschiere@pidgin.im>
parents:
10324
diff
changeset
|
75 {"Luke 'LSchiere' Schierer", N_("support"), "lschiere@users.sf.net"}, |
10116 | 76 {"Stu 'nosnilmot' Tomlinson", N_("developer"), NULL}, |
9758 | 77 {NULL, NULL, NULL} |
78 }; | |
79 | |
10372
618a330c0260
[gaim-migrate @ 11595]
Luke Schierer <lschiere@pidgin.im>
parents:
10371
diff
changeset
|
80 static struct developer patch_writers[] = { |
618a330c0260
[gaim-migrate @ 11595]
Luke Schierer <lschiere@pidgin.im>
parents:
10371
diff
changeset
|
81 {"Ka-Hing 'javabsp' Cheung", NULL, NULL}, |
618a330c0260
[gaim-migrate @ 11595]
Luke Schierer <lschiere@pidgin.im>
parents:
10371
diff
changeset
|
82 {"Felipe 'shx' Contreras", NULL, NULL}, |
618a330c0260
[gaim-migrate @ 11595]
Luke Schierer <lschiere@pidgin.im>
parents:
10371
diff
changeset
|
83 {"Decklin Foster", NULL, NULL}, |
618a330c0260
[gaim-migrate @ 11595]
Luke Schierer <lschiere@pidgin.im>
parents:
10371
diff
changeset
|
84 {"Gary 'grim' Kramlich", NULL, NULL}, |
10677
4cfc6bebeb5f
[gaim-migrate @ 12219]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10668
diff
changeset
|
85 {"Richard 'rlaager' Laager", NULL, NULL}, |
10372
618a330c0260
[gaim-migrate @ 11595]
Luke Schierer <lschiere@pidgin.im>
parents:
10371
diff
changeset
|
86 {"Robert 'Robot101' McQueen", NULL, NULL}, |
618a330c0260
[gaim-migrate @ 11595]
Luke Schierer <lschiere@pidgin.im>
parents:
10371
diff
changeset
|
87 {"Benjamin Miller", NULL, NULL}, |
618a330c0260
[gaim-migrate @ 11595]
Luke Schierer <lschiere@pidgin.im>
parents:
10371
diff
changeset
|
88 {"Kevin 'SimGuy' Stange", NULL, NULL}, |
618a330c0260
[gaim-migrate @ 11595]
Luke Schierer <lschiere@pidgin.im>
parents:
10371
diff
changeset
|
89 {NULL, NULL, NULL} |
618a330c0260
[gaim-migrate @ 11595]
Luke Schierer <lschiere@pidgin.im>
parents:
10371
diff
changeset
|
90 }; |
618a330c0260
[gaim-migrate @ 11595]
Luke Schierer <lschiere@pidgin.im>
parents:
10371
diff
changeset
|
91 |
9758 | 92 static struct developer retired_developers[] = { |
10615 | 93 {"Rob Flynn", N_("maintainer"), "gaim@robflynn.com"}, |
10813
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
94 {"Adam Fritzler", N_("libfaim maintainer"), NULL}, |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
95 {"Eric Warmenhoven", N_("lead developer"), "warmenhoven@yahoo.com"}, |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
96 {"Jim Duchek", N_("maintainer"), NULL}, |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
97 {"Jim Seymour", N_("Jabber developer"), NULL}, |
9758 | 98 {"Mark Spencer", N_("original author"), "markster@marko.net"}, |
99 {"Syd Logan", N_("hacker and designated driver [lazy bum]"), NULL}, | |
100 {NULL, NULL, NULL} | |
101 }; | |
102 | |
103 static struct translator current_translators[] = { | |
10813
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
104 {N_("Bulgarian"), "bg", "Vladimira Girginova", "missing@here.is"}, |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
105 {N_("Bulgarian"), "bg", "Vladimir (Kaladan) Petkov", "vpetkov@i-space.org"}, |
10131 | 106 {N_("Catalan"), "ca", "Josep Puigdemont", "tradgnome@softcatala.org"}, |
9758 | 107 {N_("Czech"), "cs", "Miloslav Trmac", "mitr@volny.cz"}, |
108 {N_("Danish"), "da", "Morten Brix Pedersen", "morten@wtf.dk"}, | |
10813
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
109 {N_("German"), "de", "Björn Voigt", "bjoern@cs.tu-berlin.de"}, |
10131 | 110 {N_("Australian English"), "en_AU", "Peter Lawler", "trans@six-by-nine.com.au"}, |
9758 | 111 {N_("British English"), "en_GB", "Luke Ross", "lukeross@sys3175.co.uk"}, |
112 {N_("Canadian English"), "en_CA", "Adam Weinberger", "adamw@gnome.org"}, | |
113 {N_("Spanish"), "es", "Javier Fernández-Sanguino Peña", "jfs@debian.org"}, | |
114 {N_("Finnish"), "fi", "Arto Alakulju", "arto@alakulju.net"}, | |
115 {N_("French"), "fr", "Éric Boumaour", "zongo_fr@users.sourceforge.net"}, | |
116 {N_("Hebrew"), "he", "Pavel Bibergal", "cyberkm203@hotmail.com"}, | |
117 {N_("Hindi"), "hi", "Ravishankar Shrivastava", "raviratlami@yahoo.com"}, | |
118 {N_("Hungarian"), "hu", "Zoltan Sutto", "suttozoltan@chello.hu"}, | |
119 {N_("Italian"), "it", "Claudio Satriano", "satriano@na.infn.it"}, | |
120 {N_("Japanese"), "ja", "Takashi Aihana", "aihana@gnome.gr.jp"}, | |
121 {N_("Lithuanian"), "lt", "Gediminas Čičinskas", "gediminas@parok.lt"}, | |
122 {N_("Korean"), "ko", "Kyung-uk Son", "vvs740@chol.com"}, | |
10813
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
123 {N_("Dutch, Flemish"), "nl", "Vincent van Adrighem", "V.vanAdrighem@dirck.mine.nu"}, |
9758 | 124 {N_("Macedonian"), "mk", "Tomislav Markovski", "herrera@users.sf.net"}, |
125 {N_("Norwegian"), "no", "Petter Johan Olsen", "petter.olsen@cc.uit.no"}, | |
10813
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
126 {N_("Polish"), "pl", "Emil Nowak", "emil5@go2.pl"}, |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
127 {N_("Polish"), "pl", "Krzysztof Foltman", "krzysztof@foltman.com"}, |
9758 | 128 {N_("Portuguese"), "pt", "Duarte Henriques", "duarte_henriques@myrealbox.com"}, |
129 {N_("Portuguese-Brazil"), "pt_BR", "Maurício de Lemos Rodrigues Collares Neto", "mauricioc@gmail.com"}, | |
130 {N_("Romanian"), "ro", "Mişu Moldovan", "dumol@go.ro"}, | |
131 {N_("Russian"), "ru", "Dmitry Beloglazov", "dmaa@users.sf.net"}, | |
132 {N_("Serbian"), "sr", "Danilo Šegan, Aleksandar Urosevic", "dsegan@gmx.net;urke@users.sourceforge.net"}, | |
133 {N_("Slovenian"), "sl", "Matjaz Horvat", "matjaz@owca.info"}, | |
134 {N_("Swedish"), "sv", "Tore Lundqvist", "tlt@mima.x.se"}, | |
135 {N_("Vietnamese"), "vi", N_("T.M.Thanh and the Gnome-Vi Team"), "gnomevi-list@lists.sf.net"}, | |
136 {N_("Simplified Chinese"), "zh_CN", "Funda Wang", "fundawang@linux.net.cn"}, | |
10813
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
137 {N_("Traditional Chinese"), "zh_TW", "Ambrose C. Li", "acli@ada.dhs.org"}, |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
138 {N_("Traditional Chinese"), "zh_TW", "Paladin R. Liu", "paladin@ms1.hinet.net"}, |
9758 | 139 {NULL, NULL, NULL, NULL} |
140 }; | |
141 | |
142 | |
143 static struct translator past_translators[] = { | |
144 {N_("Amharic"), "am", "Daniel Yacob", NULL}, | |
145 {N_("Bulgarian"), "bg", "Hristo Todorov", NULL}, | |
146 {N_("Catalan"), "ca", "JM Pérez Cáncer", NULL}, | |
10131 | 147 {N_("Catalan"), "ca", "Robert Millan", NULL}, |
9758 | 148 {N_("Czech"), "cs", "Honza Král", NULL}, |
149 {N_("German"), "de", "Daniel Seifert, Karsten Weiss", NULL}, | |
150 {N_("Spanish"), "es", "Amaya Rodrigo, Alejandro G Villar, Nicolás Lichtmaier, JM Pérez Cáncer", NULL}, | |
151 {N_("Finnish"), "fi", "Tero Kuusela", NULL}, | |
152 {N_("French"), "fr", "Sébastien François, Stéphane Pontier, Stéphane Wirtel, Loïc Jeannin", NULL}, | |
153 {N_("Italian"), "it", "Salvatore di Maggio", NULL}, | |
154 {N_("Japanese"), "ja", "Ryosuke Kutsuna, Taku Yasui, Junichi Uekawa", NULL}, | |
155 {N_("Korean"), "ko", "Sang-hyun S, A Ho-seok Lee", NULL}, | |
156 {N_("Polish"), "pl", "Przemysław Sułek", NULL}, | |
157 {N_("Russian"), "ru", "Sergey Volozhanin", NULL}, | |
158 {N_("Russian"), "ru", "Alexandre Prokoudine", NULL}, | |
159 {N_("Slovak"), "sk", "Daniel Režný", NULL}, | |
160 {N_("Swedish"), "sv", "Christian Rose", NULL}, | |
10813
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
161 {N_("Simplified Chinese"), "zh_CN", "Hashao, Rocky S. Lee", NULL}, |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
162 {N_("Traditional Chinese"), "zh_TW", "Hashao, Rocky S. Lee", NULL}, |
9758 | 163 {NULL, NULL, NULL, NULL} |
164 }; | |
165 | |
9730 | 166 void |
167 gaim_gtkdialogs_destroy_all() | |
9709 | 168 { |
9753 | 169 while (dialogwindows) { |
170 gtk_widget_destroy(dialogwindows->data); | |
171 dialogwindows = g_list_remove(dialogwindows, dialogwindows->data); | |
172 } | |
173 } | |
174 | |
175 static void destroy_about() | |
176 { | |
177 if (about != NULL) | |
178 gtk_widget_destroy(about); | |
179 about = NULL; | |
180 } | |
181 | |
182 void gaim_gtkdialogs_about(GtkWidget *w, void *data) | |
183 { | |
184 GtkWidget *hbox; | |
185 GtkWidget *vbox; | |
186 GtkWidget *logo; | |
10175 | 187 GtkWidget *frame; |
9753 | 188 GtkWidget *text; |
189 GtkWidget *bbox; | |
190 GtkWidget *button; | |
191 GtkTextIter iter; | |
9758 | 192 GString *str; |
193 int i; | |
10266 | 194 AtkObject *obj; |
9753 | 195 |
196 if (about != NULL) { | |
197 gtk_window_present(GTK_WINDOW(about)); | |
198 return; | |
199 } | |
200 | |
201 GAIM_DIALOG(about); | |
202 gtk_window_set_default_size(GTK_WINDOW(about), 450, -1); | |
203 gtk_window_set_title(GTK_WINDOW(about), _("About Gaim")); | |
204 gtk_window_set_role(GTK_WINDOW(about), "about"); | |
205 gtk_window_set_resizable(GTK_WINDOW(about), TRUE); | |
9778 | 206 gtk_window_set_default_size(GTK_WINDOW(about), 340, 550); /* Golden ratio in da hizzy */ |
9753 | 207 |
208 hbox = gtk_hbox_new(FALSE, 12); | |
209 gtk_container_set_border_width(GTK_CONTAINER(hbox), 12); | |
210 gtk_container_add(GTK_CONTAINER(about), hbox); | |
211 | |
212 vbox = gtk_vbox_new(FALSE, 12); | |
213 gtk_container_add(GTK_CONTAINER(hbox), vbox); | |
214 | |
215 logo = gtk_image_new_from_stock(GAIM_STOCK_LOGO, gtk_icon_size_from_name(GAIM_ICON_SIZE_LOGO)); | |
10266 | 216 obj = gtk_widget_get_accessible(logo); |
217 atk_object_set_description(obj, "Gaim " VERSION); | |
9753 | 218 gtk_box_pack_start(GTK_BOX(vbox), logo, FALSE, FALSE, 0); |
219 | |
10175 | 220 frame = gaim_gtk_create_imhtml(FALSE, &text, NULL); |
10522 | 221 gtk_imhtml_set_format_functions(GTK_IMHTML(text), GTK_IMHTML_ALL ^ GTK_IMHTML_SMILEY); |
10175 | 222 gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0); |
9753 | 223 |
9758 | 224 str = g_string_sized_new(4096); |
9753 | 225 |
10153 | 226 g_string_append(str, |
9758 | 227 _("Gaim is a modular messaging client capable of using " |
228 "AIM, MSN, Yahoo!, Jabber, ICQ, IRC, SILC, " | |
229 "Novell GroupWise, Napster, Zephyr, and Gadu-Gadu " | |
230 "all at once. It is written using " | |
10813
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
231 "GTK+ and is licensed under the GNU GPL.<BR><BR>")); |
9753 | 232 |
9758 | 233 g_string_append(str, "<FONT SIZE=\"4\">URL:</FONT> <A HREF=\"" |
234 GAIM_WEBSITE "\">" GAIM_WEBSITE "</A><BR/><BR/>"); | |
10493 | 235 #ifdef _WIN32 |
236 g_string_append_printf(str, _("<FONT SIZE=\"4\">IRC:</FONT> " | |
237 "#wingaim on irc.freenode.net<BR><BR>")); | |
238 #else | |
9758 | 239 g_string_append_printf(str, _("<FONT SIZE=\"4\">IRC:</FONT> " |
240 "#gaim on irc.freenode.net<BR><BR>")); | |
10493 | 241 #endif |
9753 | 242 |
243 /* Active Developers */ | |
9758 | 244 g_string_append_printf(str, "<FONT SIZE=\"4\">%s:</FONT><BR/>", |
245 _("Active Developers")); | |
246 for (i = 0; developers[i].name != NULL; i++) { | |
247 if (developers[i].email != NULL) { | |
10116 | 248 g_string_append_printf(str, " %s (%s) <<a href=\"mailto:%s\">%s</a>><br/>", |
9758 | 249 developers[i].name, _(developers[i].role), |
250 developers[i].email, developers[i].email); | |
251 } else { | |
252 g_string_append_printf(str, " %s (%s)<br/>", | |
253 developers[i].name, _(developers[i].role)); | |
254 } | |
255 } | |
256 g_string_append(str, "<BR/>"); | |
9709 | 257 |
9753 | 258 /* Crazy Patch Writers */ |
9758 | 259 g_string_append_printf(str, "<FONT SIZE=\"4\">%s:</FONT><BR/>", |
260 _("Crazy Patch Writers")); | |
10372
618a330c0260
[gaim-migrate @ 11595]
Luke Schierer <lschiere@pidgin.im>
parents:
10371
diff
changeset
|
261 for (i = 0; patch_writers[i].name != NULL; i++) { |
618a330c0260
[gaim-migrate @ 11595]
Luke Schierer <lschiere@pidgin.im>
parents:
10371
diff
changeset
|
262 if (patch_writers[i].email != NULL) { |
618a330c0260
[gaim-migrate @ 11595]
Luke Schierer <lschiere@pidgin.im>
parents:
10371
diff
changeset
|
263 g_string_append_printf(str, " %s <<a href=\"mailto:%s\">%s</a>><br/>", |
618a330c0260
[gaim-migrate @ 11595]
Luke Schierer <lschiere@pidgin.im>
parents:
10371
diff
changeset
|
264 patch_writers[i].name, |
618a330c0260
[gaim-migrate @ 11595]
Luke Schierer <lschiere@pidgin.im>
parents:
10371
diff
changeset
|
265 patch_writers[i].email, patch_writers[i].email); |
618a330c0260
[gaim-migrate @ 11595]
Luke Schierer <lschiere@pidgin.im>
parents:
10371
diff
changeset
|
266 } else { |
618a330c0260
[gaim-migrate @ 11595]
Luke Schierer <lschiere@pidgin.im>
parents:
10371
diff
changeset
|
267 g_string_append_printf(str, " %s<br/>", |
618a330c0260
[gaim-migrate @ 11595]
Luke Schierer <lschiere@pidgin.im>
parents:
10371
diff
changeset
|
268 patch_writers[i].name); |
618a330c0260
[gaim-migrate @ 11595]
Luke Schierer <lschiere@pidgin.im>
parents:
10371
diff
changeset
|
269 } |
618a330c0260
[gaim-migrate @ 11595]
Luke Schierer <lschiere@pidgin.im>
parents:
10371
diff
changeset
|
270 } |
618a330c0260
[gaim-migrate @ 11595]
Luke Schierer <lschiere@pidgin.im>
parents:
10371
diff
changeset
|
271 g_string_append(str, "<BR/>"); |
9753 | 272 |
273 /* Retired Developers */ | |
9758 | 274 g_string_append_printf(str, "<FONT SIZE=\"4\">%s:</FONT><BR/>", |
275 _("Retired Developers")); | |
276 for (i = 0; retired_developers[i].name != NULL; i++) { | |
277 if (retired_developers[i].email != NULL) { | |
10116 | 278 g_string_append_printf(str, " %s (%s) <<a href=\"mailto:%s\">%s</a>><br/>", |
9758 | 279 retired_developers[i].name, _(retired_developers[i].role), |
280 retired_developers[i].email, retired_developers[i].email); | |
281 } else { | |
282 g_string_append_printf(str, " %s (%s)<br/>", | |
283 retired_developers[i].name, _(retired_developers[i].role)); | |
284 } | |
285 } | |
286 g_string_append(str, "<BR/>"); | |
9753 | 287 |
288 /* Current Translators */ | |
9758 | 289 g_string_append_printf(str, "<FONT SIZE=\"4\">%s:</FONT><BR/>", |
290 _("Current Translators")); | |
291 for (i = 0; current_translators[i].language != NULL; i++) { | |
292 if (current_translators[i].email != NULL) { | |
10116 | 293 g_string_append_printf(str, " <b>%s (%s)</b> - %s <<a href=\"mailto:%s\">%s</a>><br/>", |
9758 | 294 _(current_translators[i].language), |
295 current_translators[i].abbr, | |
296 _(current_translators[i].name), | |
297 current_translators[i].email, | |
298 current_translators[i].email); | |
299 } else { | |
300 g_string_append_printf(str, " <b>%s (%s)</b> - %s<br/>", | |
301 _(current_translators[i].language), | |
302 current_translators[i].abbr, | |
303 _(current_translators[i].name)); | |
304 } | |
305 } | |
306 g_string_append(str, "<BR/>"); | |
9753 | 307 |
308 /* Past Translators */ | |
9758 | 309 g_string_append_printf(str, "<FONT SIZE=\"4\">%s:</FONT><BR/>", |
310 _("Past Translators")); | |
311 for (i = 0; past_translators[i].language != NULL; i++) { | |
312 if (past_translators[i].email != NULL) { | |
10116 | 313 g_string_append_printf(str, " <b>%s (%s)</b> - %s <<a href=\"mailto:%s\">%s</a>><br/>", |
9758 | 314 _(past_translators[i].language), |
315 past_translators[i].abbr, | |
316 _(past_translators[i].name), | |
317 past_translators[i].email, | |
318 past_translators[i].email); | |
319 } else { | |
320 g_string_append_printf(str, " <b>%s (%s)</b> - %s<br/>", | |
321 _(past_translators[i].language), | |
322 past_translators[i].abbr, | |
323 _(past_translators[i].name)); | |
324 } | |
325 } | |
326 g_string_append(str, "<BR/>"); | |
327 | |
10813
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
328 g_string_append_printf(str, "<FONT SIZE=\"4\">%s</FONT><br/>", _("Debugging Information")); |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
329 |
10411 | 330 /* The following primarly intented for user/developer interaction and thus |
331 ought not be translated */ | |
10813
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
332 |
10411 | 333 #ifdef CONFIG_ARGS /* win32 build doesn't use configure */ |
10813
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
334 g_string_append(str, " <b>Arguments to <i>./configure</i>:</b> " CONFIG_ARGS "<br/>"); |
10411 | 335 #endif |
10813
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
336 |
10411 | 337 #ifdef DEBUG |
10813
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
338 g_string_append(str, " <b>Print debugging messages:</b> Yes<br/>"); |
10411 | 339 #else |
10813
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
340 g_string_append(str, " <b>Print debugging messages:</b> No<br/>"); |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
341 #endif |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
342 |
10411 | 343 #ifdef ENABLE_BINRELOC |
10813
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
344 g_string_append(str, " <b>Binary relocation:</b> Enabled<br/>"); |
10411 | 345 #else |
10813
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
346 g_string_append(str, " <b>Binary relocation:</b> Disabled<br/>"); |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
347 #endif |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
348 |
10411 | 349 #ifdef GAIM_PLUGINS |
10813
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
350 g_string_append(str, " <b>Plugins:</b> Enabled<br/>"); |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
351 #else |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
352 g_string_append(str, " <b>Plugins:</b> Disabled<br/>"); |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
353 #endif |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
354 |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
355 #ifdef HAVE_SSL |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
356 g_string_append(str, " <b>SSL:</b> Gaim was compiled with SSL support.<br/>"); |
10411 | 357 #else |
10813
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
358 g_string_append(str, " <b>SSL:</b> Gaim was <b><i>NOT</i></b> compiled with any SSL support!<br/>"); |
10411 | 359 #endif |
10813
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
360 |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
361 |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
362 g_string_append(str, "<br/> <b>Library Support</b><br/>"); |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
363 |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
364 #if defined(LIBEBOOK_MAJOR_VER) && defined(LIBEBOOK_MINOR_VER) && defined(LIBEBOOK_MICRO_VER) |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
365 g_string_append_printf(str, " <b>Evolution:</b> Enabled (Version %i.%i.%i)<br/>", LIBEBOOK_MAJOR_VER, LIBEBOOK_MINOR_VER, LIBEBOOK_MICRO_VER); |
10411 | 366 #else |
10813
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
367 g_string_append_printf(str, " <b>Evolution:</b> Disabled<br/>"); |
10411 | 368 #endif |
10813
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
369 |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
370 #ifdef USE_GTKSPELL |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
371 g_string_append(str, " <b>GtkSpell:</b> Enabled<br/>"); |
10411 | 372 #else |
10813
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
373 g_string_append(str, " <b>GtkSpell:</b> Disabled<br/>"); |
10411 | 374 #endif |
10813
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
375 |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
376 #ifdef HAVE_GNUTLS |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
377 g_string_append(str, " <b>GnuTLS:</b> Enabled<br/>"); |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
378 #else |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
379 g_string_append(str, " <b>GnuTLS:</b> Disabled<br/>"); |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
380 #endif |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
381 |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
382 #ifdef USE_AO |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
383 g_string_append(str, " <b>libao:</b> Enabled<br/>"); |
10411 | 384 #else |
10813
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
385 g_string_append(str, " <b>libao:</b> Disabled<br/>"); |
10411 | 386 #endif |
10813
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
387 |
10411 | 388 #ifdef USE_NAS_AUDIO |
10813
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
389 g_string_append(str, " <b>Network Audio System (NAS):</b> Enabled<br/>"); |
10411 | 390 #else |
10813
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
391 g_string_append(str, " <b>Network Audio System (NAS):</b> Disabled<br/>"); |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
392 #endif |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
393 |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
394 #ifdef HAVE_NSS |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
395 g_string_append(str, " <b>Network Security Services (NSS):</b> Enabled<br/>"); |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
396 #else |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
397 g_string_append(str, " <b>Network Security Services (NSS):</b> Disabled<br/>"); |
10411 | 398 #endif |
10813
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
399 |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
400 #ifdef HAVE_STARTUP_NOTIFICATION |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
401 g_string_append(str, " <b>Startup Notification:</b> Enabled<br/>"); |
10411 | 402 #else |
10813
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
403 g_string_append(str, " <b>Startup Notification:</b> Disabled<br/>"); |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
404 #endif |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
405 |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
406 #ifdef HAVE_TCL |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
407 g_string_append(str, " <b>Tcl:</b> Enabled<br/>"); |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
408 #else |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
409 g_string_append(str, " <b>Tcl:</b> Disabled<br/>"); |
10411 | 410 #endif |
10813
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
411 |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
412 #ifdef HAVE_TK |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
413 g_string_append(str, " <b>Tk:</b> Enabled<br/>"); |
10411 | 414 #else |
10813
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
415 g_string_append(str, " <b>Tk:</b> Disabled<br/>"); |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
416 #endif |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
417 |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
418 #ifdef USE_SM |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
419 g_string_append(str, " <b>X Session Management:</b> Enabled<br/>"); |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
420 #else |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
421 g_string_append(str, " <b>X Session Management:</b> Disabled<br/>"); |
10411 | 422 #endif |
10813
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
423 |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
424 #ifdef USE_SCREENSAVER |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
425 g_string_append(str, " <b>XScreenSaver:</b> Enabled<br/>"); |
10411 | 426 #else |
10813
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
427 g_string_append(str, " <b>XScreenSaver:</b> Disabled<br/>"); |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
428 #endif |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
429 |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
430 #ifdef LIBZEPHYR_EXT |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
431 g_string_append(str, " <b>Zephyr library (libzephyr):</b> External<br/>"); |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
432 #else |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
433 g_string_append(str, " <b>Zephyr library (libzephyr):</b> Not External<br/>"); |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
434 #endif |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
435 |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
436 #ifdef ZEPHYR_USES_KERBEROS |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
437 g_string_append(str, " <b>Zephyr uses Kerberos:</b> Yes<br/>"); |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
438 #else |
290131d5f626
[gaim-migrate @ 12466]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
439 g_string_append(str, " <b>Zephyr uses Kerberos:</b> No<br/>"); |
10411 | 440 #endif |
441 | |
442 /* End of not to be translated section */ | |
443 | |
9758 | 444 gtk_imhtml_append_text(GTK_IMHTML(text), str->str, GTK_IMHTML_NO_SCROLL); |
445 g_string_free(str, TRUE); | |
9753 | 446 |
447 gtk_text_buffer_get_start_iter(gtk_text_view_get_buffer(GTK_TEXT_VIEW(text)), &iter); | |
448 gtk_text_buffer_place_cursor(gtk_text_view_get_buffer(GTK_TEXT_VIEW(text)), &iter); | |
10153 | 449 |
9753 | 450 /* Close Button */ |
451 bbox = gtk_hbutton_box_new(); | |
452 gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END); | |
453 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0); | |
454 | |
455 button = gtk_button_new_from_stock(GTK_STOCK_CLOSE); | |
456 gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 0); | |
457 | |
458 g_signal_connect_swapped(G_OBJECT(button), "clicked", | |
459 G_CALLBACK(destroy_about), G_OBJECT(about)); | |
460 g_signal_connect(G_OBJECT(about), "destroy", | |
461 G_CALLBACK(destroy_about), G_OBJECT(about)); | |
462 | |
463 /* this makes the sizes not work? */ | |
464 GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); | |
465 gtk_widget_grab_default(button); | |
466 | |
467 /* Let's give'em something to talk about -- woah woah woah */ | |
468 gtk_widget_show_all(about); | |
469 gtk_window_present(GTK_WINDOW(about)); | |
9709 | 470 } |
471 | |
9730 | 472 static void |
473 gaim_gtkdialogs_im_cb(gpointer data, GaimRequestFields *fields) | |
9709 | 474 { |
9730 | 475 GaimAccount *account; |
476 const char *username; | |
9709 | 477 |
9730 | 478 account = gaim_request_fields_get_account(fields, "account"); |
479 username = gaim_request_fields_get_string(fields, "screenname"); | |
9709 | 480 |
9730 | 481 gaim_gtkdialogs_im_with_user(account, username); |
9709 | 482 } |
483 | |
9730 | 484 void |
485 gaim_gtkdialogs_im(void) | |
9709 | 486 { |
9730 | 487 GaimRequestFields *fields; |
488 GaimRequestFieldGroup *group; | |
489 GaimRequestField *field; | |
9709 | 490 |
9730 | 491 fields = gaim_request_fields_new(); |
9709 | 492 |
9730 | 493 group = gaim_request_field_group_new(NULL); |
494 gaim_request_fields_add_group(fields, group); | |
9709 | 495 |
10668 | 496 field = gaim_request_field_string_new("screenname", _("_Name"), NULL, FALSE); |
497 gaim_request_field_set_type_hint(field, "screenname"); | |
9730 | 498 gaim_request_field_set_required(field, TRUE); |
499 gaim_request_field_group_add_field(group, field); | |
9709 | 500 |
9730 | 501 field = gaim_request_field_account_new("account", _("_Account"), NULL); |
10791
2ab4b5acc8d1
[gaim-migrate @ 12433]
Luke Schierer <lschiere@pidgin.im>
parents:
10774
diff
changeset
|
502 gaim_request_field_set_type_hint(field, "account"); |
9730 | 503 gaim_request_field_set_visible(field, |
504 (gaim_connections_get_all() != NULL && | |
505 gaim_connections_get_all()->next != NULL)); | |
506 gaim_request_field_set_required(field, TRUE); | |
507 gaim_request_field_group_add_field(group, field); | |
508 | |
509 gaim_request_fields(gaim_get_blist(), _("New Instant Message"), | |
510 NULL, | |
10668 | 511 _("Please enter the screen name or alias of the person " |
512 "you would like to IM."), | |
9730 | 513 fields, |
514 _("OK"), G_CALLBACK(gaim_gtkdialogs_im_cb), | |
515 _("Cancel"), NULL, | |
516 NULL); | |
9709 | 517 } |
518 | |
9730 | 519 void |
520 gaim_gtkdialogs_im_with_user(GaimAccount *account, const char *username) | |
9709 | 521 { |
9730 | 522 GaimConversation *conv; |
523 GaimConvWindow *win; | |
524 GaimGtkWindow *gtkwin; | |
9709 | 525 |
9753 | 526 g_return_if_fail(account != NULL); |
527 g_return_if_fail(username != NULL); | |
528 | |
10246 | 529 conv = gaim_find_conversation_with_account(GAIM_CONV_IM, username, account); |
9709 | 530 |
9730 | 531 if (conv == NULL) |
532 conv = gaim_conversation_new(GAIM_CONV_IM, account, username); | |
9709 | 533 |
9730 | 534 win = gaim_conversation_get_window(conv); |
535 gtkwin = GAIM_GTK_WINDOW(win); | |
9709 | 536 |
9730 | 537 gtk_window_present(GTK_WINDOW(gtkwin->window)); |
10827 | 538 gaim_conv_window_switch_conversation(win, conv); |
9709 | 539 } |
540 | |
9730 | 541 static gboolean |
542 gaim_gtkdialogs_ee(const char *ee) | |
9709 | 543 { |
544 GtkWidget *window; | |
545 GtkWidget *hbox; | |
546 GtkWidget *label; | |
10219 | 547 GtkWidget *img; |
9709 | 548 gchar *norm = gaim_strreplace(ee, "rocksmyworld", ""); |
549 | |
550 label = gtk_label_new(NULL); | |
551 if (!strcmp(norm, "zilding")) | |
552 gtk_label_set_markup(GTK_LABEL(label), | |
553 "<span weight=\"bold\" size=\"large\" foreground=\"purple\">Amazing! Simply Amazing!</span>"); | |
554 else if (!strcmp(norm, "robflynn")) | |
555 gtk_label_set_markup(GTK_LABEL(label), | |
556 "<span weight=\"bold\" size=\"large\" foreground=\"#1f6bad\">Pimpin\' Penguin Style! *Waddle Waddle*</span>"); | |
557 else if (!strcmp(norm, "flynorange")) | |
558 gtk_label_set_markup(GTK_LABEL(label), | |
10816
c94f40ffcafb
[gaim-migrate @ 12471]
Luke Schierer <lschiere@pidgin.im>
parents:
10813
diff
changeset
|
559 "<span weight=\"bold\" size=\"large\" foreground=\"blue\">You should be me. I'm so cute!</span>"); |
9709 | 560 else if (!strcmp(norm, "ewarmenhoven")) |
561 gtk_label_set_markup(GTK_LABEL(label), | |
562 "<span weight=\"bold\" size=\"large\" foreground=\"orange\">Now that's what I like!</span>"); | |
563 else if (!strcmp(norm, "markster97")) | |
564 gtk_label_set_markup(GTK_LABEL(label), | |
565 "<span weight=\"bold\" size=\"large\" foreground=\"brown\">Ahh, and excellent choice!</span>"); | |
566 else if (!strcmp(norm, "seanegn")) | |
567 gtk_label_set_markup(GTK_LABEL(label), | |
568 "<span weight=\"bold\" size=\"large\" foreground=\"#009900\">Everytime you click my name, an angel gets its wings.</span>"); | |
569 else if (!strcmp(norm, "chipx86")) | |
570 gtk_label_set_markup(GTK_LABEL(label), | |
571 "<span weight=\"bold\" size=\"large\" foreground=\"red\">This sunflower seed taste like pizza.</span>"); | |
572 else if (!strcmp(norm, "markdoliner")) | |
573 gtk_label_set_markup(GTK_LABEL(label), | |
10816
c94f40ffcafb
[gaim-migrate @ 12471]
Luke Schierer <lschiere@pidgin.im>
parents:
10813
diff
changeset
|
574 "<span weight=\"bold\" size=\"large\" foreground=\"#6364B1\">Hey! I was in that tumbleweed!</span>"); |
9709 | 575 else if (!strcmp(norm, "lschiere")) |
576 gtk_label_set_markup(GTK_LABEL(label), | |
577 "<span weight=\"bold\" size=\"large\" foreground=\"gray\">I'm not anything.</span>"); | |
578 g_free(norm); | |
579 | |
580 if (strlen(gtk_label_get_label(GTK_LABEL(label))) <= 0) | |
581 return FALSE; | |
582 | |
583 window = gtk_dialog_new_with_buttons(GAIM_ALERT_TITLE, NULL, 0, GTK_STOCK_CLOSE, GTK_RESPONSE_OK, NULL); | |
584 gtk_dialog_set_default_response (GTK_DIALOG(window), GTK_RESPONSE_OK); | |
585 g_signal_connect(G_OBJECT(window), "response", G_CALLBACK(gtk_widget_destroy), NULL); | |
586 | |
587 gtk_container_set_border_width (GTK_CONTAINER(window), 6); | |
588 gtk_window_set_resizable(GTK_WINDOW(window), FALSE); | |
589 gtk_dialog_set_has_separator(GTK_DIALOG(window), FALSE); | |
590 gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(window)->vbox), 12); | |
591 gtk_container_set_border_width (GTK_CONTAINER(GTK_DIALOG(window)->vbox), 6); | |
592 | |
593 hbox = gtk_hbox_new(FALSE, 12); | |
594 gtk_container_add(GTK_CONTAINER(GTK_DIALOG(window)->vbox), hbox); | |
10219 | 595 img = gtk_image_new_from_stock(GAIM_STOCK_DIALOG_COOL, gtk_icon_size_from_name(GAIM_ICON_SIZE_DIALOG_COOL)); |
9709 | 596 gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0); |
597 | |
598 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); | |
599 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
600 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
601 | |
602 gtk_widget_show_all(window); | |
603 return TRUE; | |
604 } | |
605 | |
606 static void | |
9730 | 607 gaim_gtkdialogs_info_cb(gpointer data, GaimRequestFields *fields) |
9709 | 608 { |
609 char *username; | |
610 gboolean found = FALSE; | |
611 GaimAccount *account; | |
612 | |
613 account = gaim_request_fields_get_account(fields, "account"); | |
614 | |
615 username = g_strdup(gaim_normalize(account, | |
616 gaim_request_fields_get_string(fields, "screenname"))); | |
617 | |
618 if (username != NULL && gaim_str_has_suffix(username, "rocksmyworld")) | |
9730 | 619 found = gaim_gtkdialogs_ee(username); |
9709 | 620 |
621 if (!found && username != NULL && *username != '\0' && account != NULL) | |
622 serv_get_info(gaim_account_get_connection(account), username); | |
623 | |
624 g_free(username); | |
625 } | |
626 | |
627 void | |
9714 | 628 gaim_gtkdialogs_info(void) |
9709 | 629 { |
630 GaimRequestFields *fields; | |
631 GaimRequestFieldGroup *group; | |
632 GaimRequestField *field; | |
633 | |
634 fields = gaim_request_fields_new(); | |
635 | |
636 group = gaim_request_field_group_new(NULL); | |
637 gaim_request_fields_add_group(fields, group); | |
638 | |
10668 | 639 field = gaim_request_field_string_new("screenname", _("_Name"), NULL, FALSE); |
9709 | 640 gaim_request_field_set_type_hint(field, "screenname"); |
641 gaim_request_field_set_required(field, TRUE); | |
642 gaim_request_field_group_add_field(group, field); | |
643 | |
644 field = gaim_request_field_account_new("account", _("_Account"), NULL); | |
10791
2ab4b5acc8d1
[gaim-migrate @ 12433]
Luke Schierer <lschiere@pidgin.im>
parents:
10774
diff
changeset
|
645 gaim_request_field_set_type_hint(field, "account"); |
9709 | 646 gaim_request_field_set_visible(field, |
647 (gaim_connections_get_all() != NULL && | |
648 gaim_connections_get_all()->next != NULL)); | |
649 gaim_request_field_set_required(field, TRUE); | |
650 gaim_request_field_group_add_field(group, field); | |
651 | |
652 gaim_request_fields(gaim_get_blist(), _("Get User Info"), | |
653 NULL, | |
10668 | 654 _("Please enter the screen name or alias of the person " |
655 "whose info you would like to view."), | |
9709 | 656 fields, |
9730 | 657 _("OK"), G_CALLBACK(gaim_gtkdialogs_info_cb), |
9709 | 658 _("Cancel"), NULL, |
659 NULL); | |
660 } | |
661 | |
662 static void | |
9730 | 663 gaim_gtkdialogs_log_cb(gpointer data, GaimRequestFields *fields) |
9709 | 664 { |
665 char *username; | |
666 GaimAccount *account; | |
667 | |
668 account = gaim_request_fields_get_account(fields, "account"); | |
669 | |
670 username = g_strdup(gaim_normalize(account, | |
671 gaim_request_fields_get_string(fields, "screenname"))); | |
672 | |
9917 | 673 if(username != NULL && *username != '\0' && account != NULL ) |
674 gaim_gtk_log_show(GAIM_LOG_IM, username, account); | |
9709 | 675 |
676 g_free(username); | |
677 } | |
678 | |
9991 | 679 /* |
680 * TODO - This needs to deal with logs of all types, not just IM logs. | |
681 */ | |
9709 | 682 void |
9714 | 683 gaim_gtkdialogs_log(void) |
9709 | 684 { |
685 GaimRequestFields *fields; | |
686 GaimRequestFieldGroup *group; | |
687 GaimRequestField *field; | |
688 | |
689 fields = gaim_request_fields_new(); | |
690 | |
691 group = gaim_request_field_group_new(NULL); | |
692 gaim_request_fields_add_group(fields, group); | |
693 | |
10668 | 694 field = gaim_request_field_string_new("screenname", _("_Name"), NULL, FALSE); |
9709 | 695 gaim_request_field_set_type_hint(field, "screenname"); |
696 gaim_request_field_set_required(field, TRUE); | |
697 gaim_request_field_group_add_field(group, field); | |
698 | |
699 field = gaim_request_field_account_new("account", _("_Account"), NULL); | |
10791
2ab4b5acc8d1
[gaim-migrate @ 12433]
Luke Schierer <lschiere@pidgin.im>
parents:
10774
diff
changeset
|
700 gaim_request_field_set_type_hint(field, "account"); |
9709 | 701 gaim_request_field_account_set_show_all(field, TRUE); |
702 gaim_request_field_set_visible(field, | |
703 (gaim_accounts_get_all() != NULL && | |
704 gaim_accounts_get_all()->next != NULL)); | |
705 gaim_request_field_set_required(field, TRUE); | |
706 gaim_request_field_group_add_field(group, field); | |
707 | |
708 gaim_request_fields(gaim_get_blist(), _("Get User Log"), | |
709 NULL, | |
10668 | 710 _("Please enter the screen name or alias of the person " |
711 "whose log you would like to view."), | |
9709 | 712 fields, |
9730 | 713 _("OK"), G_CALLBACK(gaim_gtkdialogs_log_cb), |
9709 | 714 _("Cancel"), NULL, |
715 NULL); | |
716 } | |
717 | |
9730 | 718 static void |
719 gaim_gtkdialogs_warn_cb(GtkWidget *widget, gint resp, struct warning *w) | |
9709 | 720 { |
9730 | 721 if (resp == GTK_RESPONSE_OK) |
9753 | 722 serv_warn(w->gc, w->who, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w->anon))); |
9709 | 723 |
9753 | 724 dialogwindows = g_list_remove(dialogwindows, w->window); |
725 gtk_widget_destroy(w->window); | |
726 | |
9730 | 727 g_free(w->who); |
728 g_free(w); | |
9709 | 729 } |
730 | |
9753 | 731 /* |
9991 | 732 * TODO - Make this use the request API, if possible. |
9753 | 733 */ |
9730 | 734 void |
735 gaim_gtkdialogs_warn(GaimConnection *gc, const char *who) | |
9709 | 736 { |
9753 | 737 gchar *labeltext; |
9730 | 738 GtkWidget *hbox, *vbox; |
9709 | 739 GtkWidget *label; |
9753 | 740 GtkWidget *img; |
741 struct warning *w; | |
9730 | 742 |
9753 | 743 g_return_if_fail(gc != NULL); |
744 g_return_if_fail(who != NULL); | |
745 | |
746 w = g_new0(struct warning, 1); | |
9730 | 747 w->who = g_strdup(who); |
748 w->gc = gc; | |
749 | |
9753 | 750 w->window = gtk_dialog_new_with_buttons(_("Warn User"), NULL, 0, |
9730 | 751 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, |
752 GAIM_STOCK_WARN, GTK_RESPONSE_OK, NULL); | |
753 gtk_dialog_set_default_response (GTK_DIALOG(w->window), GTK_RESPONSE_OK); | |
754 g_signal_connect(G_OBJECT(w->window), "response", G_CALLBACK(gaim_gtkdialogs_warn_cb), w); | |
755 | |
756 gtk_container_set_border_width (GTK_CONTAINER(w->window), 6); | |
757 gtk_window_set_resizable(GTK_WINDOW(w->window), FALSE); | |
758 gtk_dialog_set_has_separator(GTK_DIALOG(w->window), FALSE); | |
759 gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(w->window)->vbox), 12); | |
760 gtk_container_set_border_width (GTK_CONTAINER(GTK_DIALOG(w->window)->vbox), 6); | |
9709 | 761 |
762 hbox = gtk_hbox_new(FALSE, 12); | |
9730 | 763 gtk_container_add(GTK_CONTAINER(GTK_DIALOG(w->window)->vbox), hbox); |
9753 | 764 |
765 img = gtk_image_new_from_stock(GAIM_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_DIALOG); | |
766 gtk_misc_set_alignment(GTK_MISC(img), 0, 0); | |
9730 | 767 gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0); |
9709 | 768 |
9730 | 769 vbox = gtk_vbox_new(FALSE, 0); |
770 gtk_container_add(GTK_CONTAINER(hbox), vbox); | |
771 labeltext = g_strdup_printf(_("<span weight=\"bold\" size=\"larger\">Warn %s?</span>\n\n" | |
772 "This will increase %s's warning level and he or she will be subject to harsher rate limiting.\n"), who, who); | |
773 label = gtk_label_new(NULL); | |
774 gtk_label_set_markup(GTK_LABEL(label), labeltext); | |
775 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); | |
776 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
777 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); | |
778 g_free(labeltext); | |
9709 | 779 |
9730 | 780 w->anon = gtk_check_button_new_with_mnemonic(_("Warn _anonymously?")); |
781 gtk_box_pack_start(GTK_BOX(vbox), w->anon, FALSE, FALSE, 0); | |
782 | |
783 hbox = gtk_hbox_new(FALSE, 6); | |
784 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
785 img = gtk_image_new_from_stock(GTK_STOCK_DIALOG_INFO, GTK_ICON_SIZE_MENU); | |
786 gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0); | |
787 labeltext = _("<b>Anonymous warnings are less severe.</b>"); | |
788 label = gtk_label_new(NULL); | |
789 gtk_label_set_markup(GTK_LABEL(label), labeltext); | |
790 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); | |
9709 | 791 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
792 | |
9730 | 793 dialogwindows = g_list_prepend(dialogwindows, w->window); |
794 gtk_widget_show_all(w->window); | |
9709 | 795 } |
796 | |
797 static void | |
9730 | 798 gaim_gtkdialogs_alias_contact_cb(GaimContact *contact, const char *new_alias) |
799 { | |
800 gaim_contact_set_alias(contact, new_alias); | |
801 } | |
802 | |
803 void | |
804 gaim_gtkdialogs_alias_contact(GaimContact *contact) | |
805 { | |
9753 | 806 g_return_if_fail(contact != NULL); |
807 | |
9730 | 808 gaim_request_input(NULL, _("Alias Contact"), NULL, |
809 _("Enter an alias for this contact."), | |
810 contact->alias, FALSE, FALSE, NULL, | |
811 _("Alias"), G_CALLBACK(gaim_gtkdialogs_alias_contact_cb), | |
812 _("Cancel"), NULL, contact); | |
813 } | |
814 | |
815 static void | |
816 gaim_gtkdialogs_alias_buddy_cb(GaimBuddy *buddy, const char *new_alias) | |
817 { | |
818 gaim_blist_alias_buddy(buddy, new_alias); | |
819 serv_alias_buddy(buddy); | |
820 } | |
821 | |
822 void | |
9753 | 823 gaim_gtkdialogs_alias_buddy(GaimBuddy *buddy) |
9730 | 824 { |
9753 | 825 gchar *secondary; |
826 | |
827 g_return_if_fail(buddy != NULL); | |
828 | |
829 secondary = g_strdup_printf(_("Enter an alias for %s."), buddy->name); | |
9730 | 830 |
831 gaim_request_input(NULL, _("Alias Buddy"), NULL, | |
9753 | 832 secondary, buddy->alias, FALSE, FALSE, NULL, |
9730 | 833 _("Alias"), G_CALLBACK(gaim_gtkdialogs_alias_buddy_cb), |
9753 | 834 _("Cancel"), NULL, buddy); |
9730 | 835 |
836 g_free(secondary); | |
837 } | |
838 | |
839 static void | |
840 gaim_gtkdialogs_alias_chat_cb(GaimChat *chat, const char *new_alias) | |
9709 | 841 { |
842 gaim_blist_alias_chat(chat, new_alias); | |
843 } | |
844 | |
845 void | |
9730 | 846 gaim_gtkdialogs_alias_chat(GaimChat *chat) |
9709 | 847 { |
9753 | 848 g_return_if_fail(chat != NULL); |
849 | |
9709 | 850 gaim_request_input(NULL, _("Alias Chat"), NULL, |
851 _("Enter an alias for this chat."), | |
852 chat->alias, FALSE, FALSE, NULL, | |
9730 | 853 _("Alias"), G_CALLBACK(gaim_gtkdialogs_alias_chat_cb), |
9709 | 854 _("Cancel"), NULL, chat); |
855 } | |
856 | |
857 static void | |
9753 | 858 gaim_gtkdialogs_remove_contact_cb(GaimContact *contact) |
9709 | 859 { |
9730 | 860 GaimBlistNode *bnode, *cnode; |
861 GaimGroup *group; | |
862 | |
863 cnode = (GaimBlistNode *)contact; | |
864 group = (GaimGroup*)cnode->parent; | |
865 for (bnode = cnode->child; bnode; bnode = bnode->next) { | |
866 GaimBuddy *buddy = (GaimBuddy*)bnode; | |
867 if (gaim_account_is_connected(buddy->account)) | |
868 serv_remove_buddy(buddy->account->gc, buddy, group); | |
869 } | |
870 gaim_blist_remove_contact(contact); | |
871 } | |
872 | |
873 void | |
874 gaim_gtkdialogs_remove_contact(GaimContact *contact) | |
875 { | |
876 GaimBuddy *buddy = gaim_contact_get_priority_buddy(contact); | |
877 | |
9753 | 878 g_return_if_fail(contact != NULL); |
879 g_return_if_fail(buddy != NULL); | |
9730 | 880 |
881 if (((GaimBlistNode*)contact)->child == (GaimBlistNode*)buddy && | |
882 !((GaimBlistNode*)buddy)->next) { | |
883 gaim_gtkdialogs_remove_buddy(buddy); | |
884 } else { | |
10324 | 885 gchar *text; |
886 text = g_strdup_printf( | |
887 ngettext( | |
888 "You are about to remove the contact containing %s " | |
10816
c94f40ffcafb
[gaim-migrate @ 12471]
Luke Schierer <lschiere@pidgin.im>
parents:
10813
diff
changeset
|
889 "and %d other buddy from your buddy list. Do you " |
10324 | 890 "want to continue?", |
891 "You are about to remove the contact containing %s " | |
10816
c94f40ffcafb
[gaim-migrate @ 12471]
Luke Schierer <lschiere@pidgin.im>
parents:
10813
diff
changeset
|
892 "and %d other buddies from your buddy list. Do you " |
10324 | 893 "want to continue?", contact->totalsize - 1), |
894 buddy->name, contact->totalsize - 1); | |
9730 | 895 |
10222 | 896 gaim_request_action(contact, NULL, _("Remove Contact"), text, 0, contact, 2, |
9753 | 897 _("Remove Contact"), G_CALLBACK(gaim_gtkdialogs_remove_contact_cb), |
9730 | 898 _("Cancel"), NULL); |
899 | |
900 g_free(text); | |
901 } | |
9709 | 902 } |
903 | |
904 void | |
9753 | 905 gaim_gtkdialogs_remove_group_cb(GaimGroup *group) |
9709 | 906 { |
9730 | 907 GaimBlistNode *cnode, *bnode; |
908 | |
909 cnode = ((GaimBlistNode*)group)->child; | |
910 | |
911 while (cnode) { | |
912 if (GAIM_BLIST_NODE_IS_CONTACT(cnode)) { | |
913 bnode = cnode->child; | |
914 cnode = cnode->next; | |
915 while (bnode) { | |
916 GaimBuddy *buddy; | |
917 if (GAIM_BLIST_NODE_IS_BUDDY(bnode)) { | |
918 GaimConversation *conv; | |
919 buddy = (GaimBuddy*)bnode; | |
920 bnode = bnode->next; | |
10246 | 921 conv = gaim_find_conversation_with_account(GAIM_CONV_IM, |
922 buddy->name, | |
923 buddy->account); | |
9730 | 924 if (gaim_account_is_connected(buddy->account)) { |
925 serv_remove_buddy(buddy->account->gc, buddy, group); | |
926 gaim_blist_remove_buddy(buddy); | |
927 if (conv) | |
928 gaim_conversation_update(conv, | |
929 GAIM_CONV_UPDATE_REMOVE); | |
930 } | |
931 } else { | |
932 bnode = bnode->next; | |
933 } | |
934 } | |
935 } else if (GAIM_BLIST_NODE_IS_CHAT(cnode)) { | |
936 GaimChat *chat = (GaimChat *)cnode; | |
937 cnode = cnode->next; | |
938 if (gaim_account_is_connected(chat->account)) | |
939 gaim_blist_remove_chat(chat); | |
940 } else { | |
941 cnode = cnode->next; | |
942 } | |
943 } | |
944 | |
945 gaim_blist_remove_group(group); | |
946 } | |
947 | |
948 void | |
949 gaim_gtkdialogs_remove_group(GaimGroup *group) | |
950 { | |
9753 | 951 gchar *text; |
952 | |
953 g_return_if_fail(group != NULL); | |
954 | |
10816
c94f40ffcafb
[gaim-migrate @ 12471]
Luke Schierer <lschiere@pidgin.im>
parents:
10813
diff
changeset
|
955 text = g_strdup_printf(_("You are about to remove the group %s and all its members from your buddy list. Do you want to continue?"), |
9753 | 956 group->name); |
9730 | 957 |
10222 | 958 gaim_request_action(group, NULL, _("Remove Group"), text, 0, group, 2, |
9753 | 959 _("Remove Group"), G_CALLBACK(gaim_gtkdialogs_remove_group_cb), |
9730 | 960 _("Cancel"), NULL); |
961 | |
962 g_free(text); | |
9709 | 963 } |
964 | |
10246 | 965 /* XXX - Some of this should be moved into the core, methinks. */ |
9709 | 966 static void |
9753 | 967 gaim_gtkdialogs_remove_buddy_cb(GaimBuddy *buddy) |
9709 | 968 { |
9730 | 969 GaimGroup *group; |
970 GaimConversation *conv; | |
971 gchar *name; | |
972 GaimAccount *account; | |
973 | |
974 group = gaim_find_buddys_group(buddy); | |
975 name = g_strdup(buddy->name); /* b->name is a crasher after remove_buddy */ | |
976 account = buddy->account; | |
977 | |
9753 | 978 gaim_debug_info("blist", "Removing '%s' from buddy list.\n", buddy->name); |
9991 | 979 /* TODO - Should remove from blist first... then call serv_remove_buddy()? */ |
9730 | 980 serv_remove_buddy(buddy->account->gc, buddy, group); |
981 gaim_blist_remove_buddy(buddy); | |
982 | |
10246 | 983 conv = gaim_find_conversation_with_account(GAIM_CONV_IM, name, account); |
9730 | 984 if (conv != NULL) |
985 gaim_conversation_update(conv, GAIM_CONV_UPDATE_REMOVE); | |
986 | |
987 g_free(name); | |
9709 | 988 } |
989 | |
990 void | |
9730 | 991 gaim_gtkdialogs_remove_buddy(GaimBuddy *buddy) |
9709 | 992 { |
9753 | 993 gchar *text; |
9730 | 994 |
9753 | 995 g_return_if_fail(buddy != NULL); |
9730 | 996 |
10816
c94f40ffcafb
[gaim-migrate @ 12471]
Luke Schierer <lschiere@pidgin.im>
parents:
10813
diff
changeset
|
997 text = g_strdup_printf(_("You are about to remove %s from your buddy list. Do you want to continue?"), |
9753 | 998 buddy->name); |
9730 | 999 |
10222 | 1000 gaim_request_action(buddy, NULL, _("Remove Buddy"), text, 0, buddy, 2, |
9753 | 1001 _("Remove Buddy"), G_CALLBACK(gaim_gtkdialogs_remove_buddy_cb), |
9730 | 1002 _("Cancel"), NULL); |
1003 | |
1004 g_free(text); | |
1005 } | |
9709 | 1006 |
9730 | 1007 static void |
9753 | 1008 gaim_gtkdialogs_remove_chat_cb(GaimChat *chat) |
9730 | 1009 { |
9918 | 1010 char *name = NULL; |
10167 | 1011 GaimAccount *account; |
9918 | 1012 GaimConversation *conv = NULL; |
1013 | |
10167 | 1014 account = chat->account; |
1015 | |
1016 if (GAIM_PLUGIN_PROTOCOL_INFO(account->gc->prpl)->get_chat_name != NULL) | |
1017 name = GAIM_PLUGIN_PROTOCOL_INFO(account->gc->prpl)->get_chat_name(chat->components); | |
9918 | 1018 |
9730 | 1019 gaim_blist_remove_chat(chat); |
9918 | 1020 |
1021 if (name != NULL) { | |
10246 | 1022 conv = gaim_find_conversation_with_account(GAIM_CONV_CHAT, name, account); |
9918 | 1023 g_free(name); |
1024 } | |
1025 | |
1026 if (conv != NULL) | |
1027 gaim_conversation_update(conv, GAIM_CONV_UPDATE_REMOVE); | |
9730 | 1028 } |
9709 | 1029 |
9730 | 1030 void |
1031 gaim_gtkdialogs_remove_chat(GaimChat *chat) | |
1032 { | |
10774 | 1033 const gchar *name = gaim_chat_get_name(chat); |
10816
c94f40ffcafb
[gaim-migrate @ 12471]
Luke Schierer <lschiere@pidgin.im>
parents:
10813
diff
changeset
|
1034 gchar *text = g_strdup_printf(_("You are about to remove the chat %s from your buddy list. Do you want to continue?"), name); |
9753 | 1035 |
1036 g_return_if_fail(chat != NULL); | |
9730 | 1037 |
10222 | 1038 gaim_request_action(chat, NULL, _("Remove Chat"), text, 0, chat, 2, |
9753 | 1039 _("Remove Chat"), G_CALLBACK(gaim_gtkdialogs_remove_chat_cb), |
9730 | 1040 _("Cancel"), NULL); |
1041 | |
1042 g_free(text); | |
9709 | 1043 } |