annotate src/gtkdialogs.c @ 10369:584c792dd15c

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