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