annotate src/dialogs.c @ 8940:b875f5d57b81

[gaim-migrate @ 9710] Gray out the Join a Chat menu item when no online accounts support chats. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 16 May 2004 00:06:25 +0000
parents 7cbdbed9d329
children 269f576d61ac
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1 /*
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2 * gaim
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3 *
8046
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 7988
diff changeset
4 * Gaim is the legal property of its developers, whose names are too numerous
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 7988
diff changeset
5 * to list here. Please refer to the COPYRIGHT file distributed with this
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 7988
diff changeset
6 * source distribution.
6465
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6431
diff changeset
7 *
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
8 * This program is free software; you can redistribute it and/or modify
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
9 * it under the terms of the GNU General Public License as published by
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
11 * (at your option) any later version.
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
12 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
16 * GNU General Public License for more details.
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
17 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
19 * along with this program; if not, write to the Free Software
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
21 */
6371
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 6352
diff changeset
22 #include "gtkinternal.h"
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5717
diff changeset
23
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5717
diff changeset
24 #include "debug.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5717
diff changeset
25 #include "log.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5717
diff changeset
26 #include "multi.h"
5436
ad445074d239 [gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents: 5411
diff changeset
27 #include "notify.h"
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5498
diff changeset
28 #include "prefs.h"
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5717
diff changeset
29 #include "prpl.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5717
diff changeset
30 #include "request.h"
6065
3a40666c08b4 [gaim-migrate @ 6515]
Sean Egan <seanegan@gmail.com>
parents: 6059
diff changeset
31 #include "status.h"
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5717
diff changeset
32 #include "util.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5717
diff changeset
33
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5717
diff changeset
34 #include "gtkblist.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5717
diff changeset
35 #include "gtkconv.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5717
diff changeset
36 #include "gtkimhtml.h"
8317
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
37 #include "gtkimhtmltoolbar.h"
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5717
diff changeset
38 #include "gtkprefs.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5717
diff changeset
39 #include "gtkutils.h"
8911
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
40 #include "gtklog.h"
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5717
diff changeset
41 #include "stock.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5717
diff changeset
42
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5717
diff changeset
43 #include "ui.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5717
diff changeset
44
6646
b89d98f0bf79 [gaim-migrate @ 7171]
Christian Hammond <chipx86@chipx86.com>
parents: 6640
diff changeset
45 /* XXX */
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5717
diff changeset
46 #include "gaim.h"
1035
80a47e3b1bca [gaim-migrate @ 1045]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1032
diff changeset
47
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
48 static GList *dialogwindows = NULL;
5560
b7319c094153 [gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents: 5551
diff changeset
49 static GtkWidget *fontseld = NULL;
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
50
2743
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
51 struct confirm_del {
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
52 GtkWidget *window;
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
53 GtkWidget *label;
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
54 GtkWidget *ok;
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
55 GtkWidget *cancel;
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
56 char name[1024];
5563
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
57 GaimConnection *gc;
2743
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
58 };
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
59
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
60 struct create_away {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
61 GtkWidget *window;
8317
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
62 GtkWidget *toolbar;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
63 GtkWidget *entry;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
64 GtkWidget *text;
832
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 825
diff changeset
65 struct away_message *mess;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
66 };
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
67
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
68 struct warning {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
69 GtkWidget *window;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
70 GtkWidget *anon;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
71 char *who;
5563
9eb5b13fd412 [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5560
diff changeset
72 GaimConnection *gc;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
73 };
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
74
3197
389ed797f396 [gaim-migrate @ 3214]
Sean Egan <seanegan@gmail.com>
parents: 3159
diff changeset
75 struct getuserinfo {
389ed797f396 [gaim-migrate @ 3214]
Sean Egan <seanegan@gmail.com>
parents: 3159
diff changeset
76 GtkWidget *window;
389ed797f396 [gaim-migrate @ 3214]
Sean Egan <seanegan@gmail.com>
parents: 3159
diff changeset
77 GtkWidget *entry;
389ed797f396 [gaim-migrate @ 3214]
Sean Egan <seanegan@gmail.com>
parents: 3159
diff changeset
78 GtkWidget *account;
6465
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6431
diff changeset
79 GaimConnection *gc;
3197
389ed797f396 [gaim-migrate @ 3214]
Sean Egan <seanegan@gmail.com>
parents: 3159
diff changeset
80 };
389ed797f396 [gaim-migrate @ 3214]
Sean Egan <seanegan@gmail.com>
parents: 3159
diff changeset
81
2621
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
82 struct view_log {
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
83 long offset;
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
84 int options;
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
85 char *name;
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
86 GtkWidget *bbox;
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
87 GtkWidget *window;
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
88 GtkWidget *layout;
7330
5500f20a4331 [gaim-migrate @ 7918]
Mark Doliner <mark@kingant.net>
parents: 7261
diff changeset
89 void *clear_handle;
2621
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
90 };
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
91
4119
a6825994ab3a [gaim-migrate @ 4336]
Luke Schierer <lschiere@pidgin.im>
parents: 4118
diff changeset
92 /* Wrapper to get all the text from a GtkTextView */
a6825994ab3a [gaim-migrate @ 4336]
Luke Schierer <lschiere@pidgin.im>
parents: 4118
diff changeset
93 gchar* gtk_text_view_get_text(GtkTextView *text, gboolean include_hidden_chars)
a6825994ab3a [gaim-migrate @ 4336]
Luke Schierer <lschiere@pidgin.im>
parents: 4118
diff changeset
94 {
a6825994ab3a [gaim-migrate @ 4336]
Luke Schierer <lschiere@pidgin.im>
parents: 4118
diff changeset
95 GtkTextBuffer *buffer;
a6825994ab3a [gaim-migrate @ 4336]
Luke Schierer <lschiere@pidgin.im>
parents: 4118
diff changeset
96 GtkTextIter start, end;
a6825994ab3a [gaim-migrate @ 4336]
Luke Schierer <lschiere@pidgin.im>
parents: 4118
diff changeset
97
a6825994ab3a [gaim-migrate @ 4336]
Luke Schierer <lschiere@pidgin.im>
parents: 4118
diff changeset
98 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text));
a6825994ab3a [gaim-migrate @ 4336]
Luke Schierer <lschiere@pidgin.im>
parents: 4118
diff changeset
99 gtk_text_buffer_get_start_iter(buffer, &start);
a6825994ab3a [gaim-migrate @ 4336]
Luke Schierer <lschiere@pidgin.im>
parents: 4118
diff changeset
100 gtk_text_buffer_get_end_iter(buffer, &end);
a6825994ab3a [gaim-migrate @ 4336]
Luke Schierer <lschiere@pidgin.im>
parents: 4118
diff changeset
101
a6825994ab3a [gaim-migrate @ 4336]
Luke Schierer <lschiere@pidgin.im>
parents: 4118
diff changeset
102 return gtk_text_buffer_get_text(buffer, &start, &end, include_hidden_chars);
a6825994ab3a [gaim-migrate @ 4336]
Luke Schierer <lschiere@pidgin.im>
parents: 4118
diff changeset
103 }
a6825994ab3a [gaim-migrate @ 4336]
Luke Schierer <lschiere@pidgin.im>
parents: 4118
diff changeset
104
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
105 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
106 /* Destroys */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
107 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
108
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
109 static void destroy_dialog(GtkWidget *w, GtkWidget *w2)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
110 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
111 GtkWidget *dest;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
112
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
113 if (!GTK_IS_WIDGET(w2))
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
114 dest = w;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
115 else
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
116 dest = w2;
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
117
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
118 dialogwindows = g_list_remove(dialogwindows, dest);
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
119 gtk_widget_destroy(dest);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
120 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
121
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
122 void destroy_all_dialogs()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
123 {
2621
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
124 while (dialogwindows)
f8b02cf4af94 [gaim-migrate @ 2634]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2613
diff changeset
125 destroy_dialog(NULL, dialogwindows->data);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
126
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
127 if (awaymessage)
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
128 do_im_back(NULL, NULL);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
129 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
130
3757
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
131 static void do_warn(GtkWidget *widget, gint resp, struct warning *w)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
132 {
3757
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
133 if (resp == GTK_RESPONSE_OK)
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
134 serv_warn(w->gc, w->who, (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w->anon))) ? 1 : 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
135
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
136 destroy_dialog(NULL, w->window);
7879
f9df510460d7 [gaim-migrate @ 8533]
Mark Doliner <mark@kingant.net>
parents: 7853
diff changeset
137 g_free(w->who);
1288
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
138 g_free(w);
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
139 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
140
7879
f9df510460d7 [gaim-migrate @ 8533]
Mark Doliner <mark@kingant.net>
parents: 7853
diff changeset
141 void show_warn_dialog(GaimConnection *gc, const char *who)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
142 {
3757
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
143 char *labeltext;
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
144 GtkWidget *hbox, *vbox;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
145 GtkWidget *label;
5024
8e55a4d362a3 [gaim-migrate @ 5361]
Sean Egan <seanegan@gmail.com>
parents: 4978
diff changeset
146 GtkWidget *img = gtk_image_new_from_stock(GAIM_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_DIALOG);
6640
314111e7b601 [gaim-migrate @ 7165]
Christian Hammond <chipx86@chipx86.com>
parents: 6623
diff changeset
147 GaimConversation *c = gaim_find_conversation_with_account(who, gc->account);
441
995b0fc981a3 [gaim-migrate @ 451]
Rob Flynn <gaim@robflynn.com>
parents: 440
diff changeset
148
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
149 struct warning *w = g_new0(struct warning, 1);
7879
f9df510460d7 [gaim-migrate @ 8533]
Mark Doliner <mark@kingant.net>
parents: 7853
diff changeset
150 w->who = g_strdup(who);
1288
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
151 w->gc = gc;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
152
3757
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
153 gtk_misc_set_alignment(GTK_MISC(img), 0, 0);
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
154
6112
a22c151463e1 [gaim-migrate @ 6574]
Nathan Walp <nwalp@pidgin.im>
parents: 6105
diff changeset
155 w->window = gtk_dialog_new_with_buttons(_("Warn User"),
a22c151463e1 [gaim-migrate @ 6574]
Nathan Walp <nwalp@pidgin.im>
parents: 6105
diff changeset
156 GTK_WINDOW(GAIM_GTK_WINDOW(c->window)->window), 0,
a22c151463e1 [gaim-migrate @ 6574]
Nathan Walp <nwalp@pidgin.im>
parents: 6105
diff changeset
157 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
8300
0f5cb0d93b11 [gaim-migrate @ 9024]
Christian Hammond <chipx86@chipx86.com>
parents: 8293
diff changeset
158 GAIM_STOCK_WARN, GTK_RESPONSE_OK, NULL);
4118
02b415cbba3a [gaim-migrate @ 4335]
Luke Schierer <lschiere@pidgin.im>
parents: 4117
diff changeset
159 gtk_dialog_set_default_response (GTK_DIALOG(w->window), GTK_RESPONSE_OK);
3757
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
160 g_signal_connect(G_OBJECT(w->window), "response", G_CALLBACK(do_warn), w);
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
161
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
162 gtk_container_set_border_width (GTK_CONTAINER(w->window), 6);
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
163 gtk_window_set_resizable(GTK_WINDOW(w->window), FALSE);
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
164 gtk_dialog_set_has_separator(GTK_DIALOG(w->window), FALSE);
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
165 gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(w->window)->vbox), 12);
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
166 gtk_container_set_border_width (GTK_CONTAINER(GTK_DIALOG(w->window)->vbox), 6);
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
167
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
168 hbox = gtk_hbox_new(FALSE, 12);
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
169 gtk_container_add(GTK_CONTAINER(GTK_DIALOG(w->window)->vbox), hbox);
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
170 gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0);
6465
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6431
diff changeset
171
3757
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
172 vbox = gtk_vbox_new(FALSE, 0);
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
173 gtk_container_add(GTK_CONTAINER(hbox), vbox);
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
174 labeltext = g_strdup_printf(_("<span weight=\"bold\" size=\"larger\">Warn %s?</span>\n\n"
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
175 "This will increase %s's warning level and he or she will be subject to harsher rate limiting.\n"), who, who);
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
176 label = gtk_label_new(NULL);
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
177 gtk_label_set_markup(GTK_LABEL(label), labeltext);
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
178 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
179 gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
180 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
181 g_free(labeltext);
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
182
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
183 w->anon = gtk_check_button_new_with_mnemonic(_("Warn _anonymously?"));
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
184 gtk_box_pack_start(GTK_BOX(vbox), w->anon, FALSE, FALSE, 0);
6465
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6431
diff changeset
185
3757
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
186 hbox = gtk_hbox_new(FALSE, 6);
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
187 gtk_container_add(GTK_CONTAINER(vbox), hbox);
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
188 img = gtk_image_new_from_stock(GTK_STOCK_DIALOG_INFO, GTK_ICON_SIZE_MENU);
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
189 gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0);
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
190 labeltext = _("<b>Anonymous warnings are less severe.</b>");
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
191 label = gtk_label_new(NULL);
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
192 gtk_label_set_markup(GTK_LABEL(label), labeltext);
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
193 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
194 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
195
1288
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1272
diff changeset
196 dialogwindows = g_list_prepend(dialogwindows, w->window);
3757
262ce45f5ae8 [gaim-migrate @ 3896]
Sean Egan <seanegan@gmail.com>
parents: 3753
diff changeset
197 gtk_widget_show_all(w->window);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
198 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
199
6334
930708df05dd [gaim-migrate @ 6833]
Christian Hammond <chipx86@chipx86.com>
parents: 6331
diff changeset
200 static void
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7108
diff changeset
201 do_remove_chat(GaimChat *chat)
5234
890b29f00b68 [gaim-migrate @ 5604]
Nathan Walp <nwalp@pidgin.im>
parents: 5228
diff changeset
202 {
890b29f00b68 [gaim-migrate @ 5604]
Nathan Walp <nwalp@pidgin.im>
parents: 5228
diff changeset
203 gaim_blist_remove_chat(chat);
890b29f00b68 [gaim-migrate @ 5604]
Nathan Walp <nwalp@pidgin.im>
parents: 5228
diff changeset
204 gaim_blist_save();
890b29f00b68 [gaim-migrate @ 5604]
Nathan Walp <nwalp@pidgin.im>
parents: 5228
diff changeset
205 }
890b29f00b68 [gaim-migrate @ 5604]
Nathan Walp <nwalp@pidgin.im>
parents: 5228
diff changeset
206
6334
930708df05dd [gaim-migrate @ 6833]
Christian Hammond <chipx86@chipx86.com>
parents: 6331
diff changeset
207 static void
6695
0c5637b5462e [gaim-migrate @ 7221]
Nathan Walp <nwalp@pidgin.im>
parents: 6646
diff changeset
208 do_remove_buddy(GaimBuddy *b)
2743
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
209 {
6695
0c5637b5462e [gaim-migrate @ 7221]
Nathan Walp <nwalp@pidgin.im>
parents: 6646
diff changeset
210 GaimGroup *g;
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5593
diff changeset
211 GaimConversation *c;
4918
553d96cb9b26 [gaim-migrate @ 5252]
Christian Hammond <chipx86@chipx86.com>
parents: 4916
diff changeset
212 gchar *name;
6640
314111e7b601 [gaim-migrate @ 7165]
Christian Hammond <chipx86@chipx86.com>
parents: 6623
diff changeset
213 GaimAccount *account;
2743
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
214
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
215 if (!b)
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
216 return;
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
217
4687
283fb289c510 [gaim-migrate @ 4998]
Sean Egan <seanegan@gmail.com>
parents: 4685
diff changeset
218 g = gaim_find_buddys_group(b);
6640
314111e7b601 [gaim-migrate @ 7165]
Christian Hammond <chipx86@chipx86.com>
parents: 6623
diff changeset
219 name = g_strdup(b->name); /* b->name is a crasher after remove_buddy */
314111e7b601 [gaim-migrate @ 7165]
Christian Hammond <chipx86@chipx86.com>
parents: 6623
diff changeset
220 account = b->account;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4350
diff changeset
221
5213
1cf4eb75e3ee [gaim-migrate @ 5583]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
222 gaim_debug(GAIM_DEBUG_INFO, "blist",
1cf4eb75e3ee [gaim-migrate @ 5583]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
223 "Removing '%s' from buddy list.\n", b->name);
4491
3196d9044a45 [gaim-migrate @ 4766]
Nathan Walp <nwalp@pidgin.im>
parents: 4476
diff changeset
224 serv_remove_buddy(b->account->gc, name, g->name);
4687
283fb289c510 [gaim-migrate @ 4998]
Sean Egan <seanegan@gmail.com>
parents: 4685
diff changeset
225 gaim_blist_remove_buddy(b);
4349
0c68d402f59f [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
226 gaim_blist_save();
2743
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
227
6640
314111e7b601 [gaim-migrate @ 7165]
Christian Hammond <chipx86@chipx86.com>
parents: 6623
diff changeset
228 c = gaim_find_conversation_with_account(name, account);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4350
diff changeset
229
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4350
diff changeset
230 if (c != NULL)
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4350
diff changeset
231 gaim_conversation_update(c, GAIM_CONV_UPDATE_REMOVE);
4397
ce3a0eba91ef [gaim-migrate @ 4666]
Christian Hammond <chipx86@chipx86.com>
parents: 4372
diff changeset
232
ce3a0eba91ef [gaim-migrate @ 4666]
Christian Hammond <chipx86@chipx86.com>
parents: 4372
diff changeset
233 g_free(name);
2743
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
234 }
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
235
6742
d93c6a1fadf2 [gaim-migrate @ 7274]
Nathan Walp <nwalp@pidgin.im>
parents: 6695
diff changeset
236 static void do_remove_contact(GaimContact *c)
d93c6a1fadf2 [gaim-migrate @ 7274]
Nathan Walp <nwalp@pidgin.im>
parents: 6695
diff changeset
237 {
d93c6a1fadf2 [gaim-migrate @ 7274]
Nathan Walp <nwalp@pidgin.im>
parents: 6695
diff changeset
238 GaimBlistNode *bnode, *cnode;
d93c6a1fadf2 [gaim-migrate @ 7274]
Nathan Walp <nwalp@pidgin.im>
parents: 6695
diff changeset
239 GaimGroup *g;
d93c6a1fadf2 [gaim-migrate @ 7274]
Nathan Walp <nwalp@pidgin.im>
parents: 6695
diff changeset
240
d93c6a1fadf2 [gaim-migrate @ 7274]
Nathan Walp <nwalp@pidgin.im>
parents: 6695
diff changeset
241 if(!c)
d93c6a1fadf2 [gaim-migrate @ 7274]
Nathan Walp <nwalp@pidgin.im>
parents: 6695
diff changeset
242 return;
d93c6a1fadf2 [gaim-migrate @ 7274]
Nathan Walp <nwalp@pidgin.im>
parents: 6695
diff changeset
243
d93c6a1fadf2 [gaim-migrate @ 7274]
Nathan Walp <nwalp@pidgin.im>
parents: 6695
diff changeset
244 cnode = (GaimBlistNode *)c;
d93c6a1fadf2 [gaim-migrate @ 7274]
Nathan Walp <nwalp@pidgin.im>
parents: 6695
diff changeset
245 g = (GaimGroup*)cnode->parent;
d93c6a1fadf2 [gaim-migrate @ 7274]
Nathan Walp <nwalp@pidgin.im>
parents: 6695
diff changeset
246 for(bnode = cnode->child; bnode; bnode = bnode->next) {
d93c6a1fadf2 [gaim-migrate @ 7274]
Nathan Walp <nwalp@pidgin.im>
parents: 6695
diff changeset
247 GaimBuddy *b = (GaimBuddy*)bnode;
d93c6a1fadf2 [gaim-migrate @ 7274]
Nathan Walp <nwalp@pidgin.im>
parents: 6695
diff changeset
248 if(b->account->gc)
d93c6a1fadf2 [gaim-migrate @ 7274]
Nathan Walp <nwalp@pidgin.im>
parents: 6695
diff changeset
249 serv_remove_buddy(b->account->gc, b->name, g->name);
d93c6a1fadf2 [gaim-migrate @ 7274]
Nathan Walp <nwalp@pidgin.im>
parents: 6695
diff changeset
250 }
d93c6a1fadf2 [gaim-migrate @ 7274]
Nathan Walp <nwalp@pidgin.im>
parents: 6695
diff changeset
251 gaim_blist_remove_contact(c);
d93c6a1fadf2 [gaim-migrate @ 7274]
Nathan Walp <nwalp@pidgin.im>
parents: 6695
diff changeset
252 }
d93c6a1fadf2 [gaim-migrate @ 7274]
Nathan Walp <nwalp@pidgin.im>
parents: 6695
diff changeset
253
6695
0c5637b5462e [gaim-migrate @ 7221]
Nathan Walp <nwalp@pidgin.im>
parents: 6646
diff changeset
254 void do_remove_group(GaimGroup *g)
4916
d9b6b5ae34e4 [gaim-migrate @ 5250]
Sean Egan <seanegan@gmail.com>
parents: 4874
diff changeset
255 {
6695
0c5637b5462e [gaim-migrate @ 7221]
Nathan Walp <nwalp@pidgin.im>
parents: 6646
diff changeset
256 GaimBlistNode *cnode, *bnode;
6885
66dd420d3d23 [gaim-migrate @ 7431]
Christian Hammond <chipx86@chipx86.com>
parents: 6878
diff changeset
257
6695
0c5637b5462e [gaim-migrate @ 7221]
Nathan Walp <nwalp@pidgin.im>
parents: 6646
diff changeset
258 cnode = ((GaimBlistNode*)g)->child;
6885
66dd420d3d23 [gaim-migrate @ 7431]
Christian Hammond <chipx86@chipx86.com>
parents: 6878
diff changeset
259
6695
0c5637b5462e [gaim-migrate @ 7221]
Nathan Walp <nwalp@pidgin.im>
parents: 6646
diff changeset
260 while(cnode) {
0c5637b5462e [gaim-migrate @ 7221]
Nathan Walp <nwalp@pidgin.im>
parents: 6646
diff changeset
261 if(GAIM_BLIST_NODE_IS_CONTACT(cnode)) {
0c5637b5462e [gaim-migrate @ 7221]
Nathan Walp <nwalp@pidgin.im>
parents: 6646
diff changeset
262 bnode = cnode->child;
0c5637b5462e [gaim-migrate @ 7221]
Nathan Walp <nwalp@pidgin.im>
parents: 6646
diff changeset
263 cnode = cnode->next;
0c5637b5462e [gaim-migrate @ 7221]
Nathan Walp <nwalp@pidgin.im>
parents: 6646
diff changeset
264 while(bnode) {
0c5637b5462e [gaim-migrate @ 7221]
Nathan Walp <nwalp@pidgin.im>
parents: 6646
diff changeset
265 GaimBuddy *b;
0c5637b5462e [gaim-migrate @ 7221]
Nathan Walp <nwalp@pidgin.im>
parents: 6646
diff changeset
266 if(GAIM_BLIST_NODE_IS_BUDDY(bnode)) {
6745
57a24492434b [gaim-migrate @ 7277]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6742
diff changeset
267 GaimConversation *c;
57a24492434b [gaim-migrate @ 7277]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6742
diff changeset
268 b = (GaimBuddy*)bnode;
6695
0c5637b5462e [gaim-migrate @ 7221]
Nathan Walp <nwalp@pidgin.im>
parents: 6646
diff changeset
269 bnode = bnode->next;
6745
57a24492434b [gaim-migrate @ 7277]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6742
diff changeset
270 c = gaim_find_conversation_with_account(b->name, b->account);
6695
0c5637b5462e [gaim-migrate @ 7221]
Nathan Walp <nwalp@pidgin.im>
parents: 6646
diff changeset
271 if(gaim_account_is_connected(b->account)) {
0c5637b5462e [gaim-migrate @ 7221]
Nathan Walp <nwalp@pidgin.im>
parents: 6646
diff changeset
272 serv_remove_buddy(b->account->gc, b->name, g->name);
0c5637b5462e [gaim-migrate @ 7221]
Nathan Walp <nwalp@pidgin.im>
parents: 6646
diff changeset
273 gaim_blist_remove_buddy(b);
0c5637b5462e [gaim-migrate @ 7221]
Nathan Walp <nwalp@pidgin.im>
parents: 6646
diff changeset
274 if(c)
0c5637b5462e [gaim-migrate @ 7221]
Nathan Walp <nwalp@pidgin.im>
parents: 6646
diff changeset
275 gaim_conversation_update(c,
0c5637b5462e [gaim-migrate @ 7221]
Nathan Walp <nwalp@pidgin.im>
parents: 6646
diff changeset
276 GAIM_CONV_UPDATE_REMOVE);
0c5637b5462e [gaim-migrate @ 7221]
Nathan Walp <nwalp@pidgin.im>
parents: 6646
diff changeset
277 }
0c5637b5462e [gaim-migrate @ 7221]
Nathan Walp <nwalp@pidgin.im>
parents: 6646
diff changeset
278 } else {
0c5637b5462e [gaim-migrate @ 7221]
Nathan Walp <nwalp@pidgin.im>
parents: 6646
diff changeset
279 bnode = bnode->next;
0c5637b5462e [gaim-migrate @ 7221]
Nathan Walp <nwalp@pidgin.im>
parents: 6646
diff changeset
280 }
5234
890b29f00b68 [gaim-migrate @ 5604]
Nathan Walp <nwalp@pidgin.im>
parents: 5228
diff changeset
281 }
6695
0c5637b5462e [gaim-migrate @ 7221]
Nathan Walp <nwalp@pidgin.im>
parents: 6646
diff changeset
282 } else if(GAIM_BLIST_NODE_IS_CHAT(cnode)) {
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7108
diff changeset
283 GaimChat *chat = (GaimChat *)cnode;
6695
0c5637b5462e [gaim-migrate @ 7221]
Nathan Walp <nwalp@pidgin.im>
parents: 6646
diff changeset
284 cnode = cnode->next;
0c5637b5462e [gaim-migrate @ 7221]
Nathan Walp <nwalp@pidgin.im>
parents: 6646
diff changeset
285 if(gaim_account_is_connected(chat->account))
6088
4314e6be74c4 [gaim-migrate @ 6547]
Mark Doliner <mark@kingant.net>
parents: 6065
diff changeset
286 gaim_blist_remove_chat(chat);
6695
0c5637b5462e [gaim-migrate @ 7221]
Nathan Walp <nwalp@pidgin.im>
parents: 6646
diff changeset
287 } else {
0c5637b5462e [gaim-migrate @ 7221]
Nathan Walp <nwalp@pidgin.im>
parents: 6646
diff changeset
288 cnode = cnode->next;
4938
461e8c89514f [gaim-migrate @ 5272]
Nathan Walp <nwalp@pidgin.im>
parents: 4936
diff changeset
289 }
4916
d9b6b5ae34e4 [gaim-migrate @ 5250]
Sean Egan <seanegan@gmail.com>
parents: 4874
diff changeset
290 }
6885
66dd420d3d23 [gaim-migrate @ 7431]
Christian Hammond <chipx86@chipx86.com>
parents: 6878
diff changeset
291
4916
d9b6b5ae34e4 [gaim-migrate @ 5250]
Sean Egan <seanegan@gmail.com>
parents: 4874
diff changeset
292 gaim_blist_remove_group(g);
d9b6b5ae34e4 [gaim-migrate @ 5250]
Sean Egan <seanegan@gmail.com>
parents: 4874
diff changeset
293 gaim_blist_save();
d9b6b5ae34e4 [gaim-migrate @ 5250]
Sean Egan <seanegan@gmail.com>
parents: 4874
diff changeset
294 }
d9b6b5ae34e4 [gaim-migrate @ 5250]
Sean Egan <seanegan@gmail.com>
parents: 4874
diff changeset
295
6695
0c5637b5462e [gaim-migrate @ 7221]
Nathan Walp <nwalp@pidgin.im>
parents: 6646
diff changeset
296 void show_confirm_del(GaimBuddy *b)
2743
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
297 {
3753
764ecb5f984b [gaim-migrate @ 3892]
Sean Egan <seanegan@gmail.com>
parents: 3749
diff changeset
298 char *text;
5975
80e5258226f3 [gaim-migrate @ 6422]
Mark Doliner <mark@kingant.net>
parents: 5970
diff changeset
299 if (!b)
3753
764ecb5f984b [gaim-migrate @ 3892]
Sean Egan <seanegan@gmail.com>
parents: 3749
diff changeset
300 return;
764ecb5f984b [gaim-migrate @ 3892]
Sean Egan <seanegan@gmail.com>
parents: 3749
diff changeset
301
5975
80e5258226f3 [gaim-migrate @ 6422]
Mark Doliner <mark@kingant.net>
parents: 5970
diff changeset
302 text = g_strdup_printf(_("You are about to remove %s from your buddy list. Do you want to continue?"), b->name);
80e5258226f3 [gaim-migrate @ 6422]
Mark Doliner <mark@kingant.net>
parents: 5970
diff changeset
303
80e5258226f3 [gaim-migrate @ 6422]
Mark Doliner <mark@kingant.net>
parents: 5970
diff changeset
304 gaim_request_action(NULL, NULL, _("Remove Buddy"), text, -1, b, 2,
5498
cce2d7868c78 [gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents: 5436
diff changeset
305 _("Remove Buddy"), G_CALLBACK(do_remove_buddy),
cce2d7868c78 [gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents: 5436
diff changeset
306 _("Cancel"), NULL);
cce2d7868c78 [gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents: 5436
diff changeset
307
3753
764ecb5f984b [gaim-migrate @ 3892]
Sean Egan <seanegan@gmail.com>
parents: 3749
diff changeset
308 g_free(text);
2743
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
309 }
9f71beb77c60 [gaim-migrate @ 2756]
Rob Flynn <gaim@robflynn.com>
parents: 2725
diff changeset
310
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7108
diff changeset
311 void show_confirm_del_blist_chat(GaimChat *chat)
5234
890b29f00b68 [gaim-migrate @ 5604]
Nathan Walp <nwalp@pidgin.im>
parents: 5228
diff changeset
312 {
7125
208cb260d7a7 [gaim-migrate @ 7692]
Nathan Walp <nwalp@pidgin.im>
parents: 7118
diff changeset
313 char *name = gaim_chat_get_display_name(chat);
6034
5a0060191a77 [gaim-migrate @ 6484]
Luke Schierer <lschiere@pidgin.im>
parents: 6021
diff changeset
314 char *text = g_strdup_printf(_("You are about to remove the chat %s from your buddy list. Do you want to continue?"), name);
5498
cce2d7868c78 [gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents: 5436
diff changeset
315
cce2d7868c78 [gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents: 5436
diff changeset
316 gaim_request_action(NULL, NULL, _("Remove Chat"), text, -1, chat, 2,
cce2d7868c78 [gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents: 5436
diff changeset
317 _("Remove Chat"), G_CALLBACK(do_remove_chat),
cce2d7868c78 [gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents: 5436
diff changeset
318 _("Cancel"), NULL);
cce2d7868c78 [gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents: 5436
diff changeset
319
6034
5a0060191a77 [gaim-migrate @ 6484]
Luke Schierer <lschiere@pidgin.im>
parents: 6021
diff changeset
320 g_free(name);
5234
890b29f00b68 [gaim-migrate @ 5604]
Nathan Walp <nwalp@pidgin.im>
parents: 5228
diff changeset
321 g_free(text);
890b29f00b68 [gaim-migrate @ 5604]
Nathan Walp <nwalp@pidgin.im>
parents: 5228
diff changeset
322 }
890b29f00b68 [gaim-migrate @ 5604]
Nathan Walp <nwalp@pidgin.im>
parents: 5228
diff changeset
323
6695
0c5637b5462e [gaim-migrate @ 7221]
Nathan Walp <nwalp@pidgin.im>
parents: 6646
diff changeset
324 void show_confirm_del_group(GaimGroup *g)
4916
d9b6b5ae34e4 [gaim-migrate @ 5250]
Sean Egan <seanegan@gmail.com>
parents: 4874
diff changeset
325 {
6465
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6431
diff changeset
326 char *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?"),
4916
d9b6b5ae34e4 [gaim-migrate @ 5250]
Sean Egan <seanegan@gmail.com>
parents: 4874
diff changeset
327 g->name);
5498
cce2d7868c78 [gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents: 5436
diff changeset
328
cce2d7868c78 [gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents: 5436
diff changeset
329 gaim_request_action(NULL, NULL, _("Remove Group"), text, -1, g, 2,
cce2d7868c78 [gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents: 5436
diff changeset
330 _("Remove Group"), G_CALLBACK(do_remove_group),
cce2d7868c78 [gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents: 5436
diff changeset
331 _("Cancel"), NULL);
cce2d7868c78 [gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents: 5436
diff changeset
332
4916
d9b6b5ae34e4 [gaim-migrate @ 5250]
Sean Egan <seanegan@gmail.com>
parents: 4874
diff changeset
333 g_free(text);
d9b6b5ae34e4 [gaim-migrate @ 5250]
Sean Egan <seanegan@gmail.com>
parents: 4874
diff changeset
334 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
335
6742
d93c6a1fadf2 [gaim-migrate @ 7274]
Nathan Walp <nwalp@pidgin.im>
parents: 6695
diff changeset
336 void show_confirm_del_contact(GaimContact *c)
d93c6a1fadf2 [gaim-migrate @ 7274]
Nathan Walp <nwalp@pidgin.im>
parents: 6695
diff changeset
337 {
d93c6a1fadf2 [gaim-migrate @ 7274]
Nathan Walp <nwalp@pidgin.im>
parents: 6695
diff changeset
338 GaimBuddy *b = gaim_contact_get_priority_buddy(c);
d93c6a1fadf2 [gaim-migrate @ 7274]
Nathan Walp <nwalp@pidgin.im>
parents: 6695
diff changeset
339
d93c6a1fadf2 [gaim-migrate @ 7274]
Nathan Walp <nwalp@pidgin.im>
parents: 6695
diff changeset
340 if(!b)
d93c6a1fadf2 [gaim-migrate @ 7274]
Nathan Walp <nwalp@pidgin.im>
parents: 6695
diff changeset
341 return;
d93c6a1fadf2 [gaim-migrate @ 7274]
Nathan Walp <nwalp@pidgin.im>
parents: 6695
diff changeset
342
d93c6a1fadf2 [gaim-migrate @ 7274]
Nathan Walp <nwalp@pidgin.im>
parents: 6695
diff changeset
343 if(((GaimBlistNode*)c)->child == (GaimBlistNode*)b &&
d93c6a1fadf2 [gaim-migrate @ 7274]
Nathan Walp <nwalp@pidgin.im>
parents: 6695
diff changeset
344 !((GaimBlistNode*)b)->next) {
d93c6a1fadf2 [gaim-migrate @ 7274]
Nathan Walp <nwalp@pidgin.im>
parents: 6695
diff changeset
345 show_confirm_del(b);
d93c6a1fadf2 [gaim-migrate @ 7274]
Nathan Walp <nwalp@pidgin.im>
parents: 6695
diff changeset
346 } else {
d93c6a1fadf2 [gaim-migrate @ 7274]
Nathan Walp <nwalp@pidgin.im>
parents: 6695
diff changeset
347 char *text = g_strdup_printf(_("You are about to remove the contact containing %s and %d other buddies from your buddy list. Do you want to continue?"),
d93c6a1fadf2 [gaim-migrate @ 7274]
Nathan Walp <nwalp@pidgin.im>
parents: 6695
diff changeset
348 b->name, c->totalsize - 1);
d93c6a1fadf2 [gaim-migrate @ 7274]
Nathan Walp <nwalp@pidgin.im>
parents: 6695
diff changeset
349
d93c6a1fadf2 [gaim-migrate @ 7274]
Nathan Walp <nwalp@pidgin.im>
parents: 6695
diff changeset
350 gaim_request_action(NULL, NULL, _("Remove Contact"), text, -1, c, 2,
d93c6a1fadf2 [gaim-migrate @ 7274]
Nathan Walp <nwalp@pidgin.im>
parents: 6695
diff changeset
351 _("Remove Contact"), G_CALLBACK(do_remove_contact),
d93c6a1fadf2 [gaim-migrate @ 7274]
Nathan Walp <nwalp@pidgin.im>
parents: 6695
diff changeset
352 _("Cancel"), NULL);
d93c6a1fadf2 [gaim-migrate @ 7274]
Nathan Walp <nwalp@pidgin.im>
parents: 6695
diff changeset
353
d93c6a1fadf2 [gaim-migrate @ 7274]
Nathan Walp <nwalp@pidgin.im>
parents: 6695
diff changeset
354 g_free(text);
d93c6a1fadf2 [gaim-migrate @ 7274]
Nathan Walp <nwalp@pidgin.im>
parents: 6695
diff changeset
355 }
d93c6a1fadf2 [gaim-migrate @ 7274]
Nathan Walp <nwalp@pidgin.im>
parents: 6695
diff changeset
356 }
d93c6a1fadf2 [gaim-migrate @ 7274]
Nathan Walp <nwalp@pidgin.im>
parents: 6695
diff changeset
357
7757
72727edb37ef [gaim-migrate @ 8402]
Mark Doliner <mark@kingant.net>
parents: 7756
diff changeset
358 static gboolean show_ee_dialog(const char *ee)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
359 {
3767
65e9ea5934c8 [gaim-migrate @ 3906]
Sean Egan <seanegan@gmail.com>
parents: 3757
diff changeset
360 GtkWidget *window;
65e9ea5934c8 [gaim-migrate @ 3906]
Sean Egan <seanegan@gmail.com>
parents: 3757
diff changeset
361 GtkWidget *hbox;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
362 GtkWidget *label;
7098
770233dad86c [gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents: 7085
diff changeset
363 GaimGtkBuddyList *gtkblist;
5024
8e55a4d362a3 [gaim-migrate @ 5361]
Sean Egan <seanegan@gmail.com>
parents: 4978
diff changeset
364 GtkWidget *img = gtk_image_new_from_stock(GAIM_STOCK_DIALOG_COOL, GTK_ICON_SIZE_DIALOG);
7757
72727edb37ef [gaim-migrate @ 8402]
Mark Doliner <mark@kingant.net>
parents: 7756
diff changeset
365 gchar *norm = gaim_strreplace(ee, "rocksmyworld", "");
4695
4bdd9a5fd026 [gaim-migrate @ 5006]
Christian Hammond <chipx86@chipx86.com>
parents: 4687
diff changeset
366
4bdd9a5fd026 [gaim-migrate @ 5006]
Christian Hammond <chipx86@chipx86.com>
parents: 4687
diff changeset
367 gtkblist = GAIM_GTK_BLIST(gaim_get_blist());
4bdd9a5fd026 [gaim-migrate @ 5006]
Christian Hammond <chipx86@chipx86.com>
parents: 4687
diff changeset
368
3767
65e9ea5934c8 [gaim-migrate @ 3906]
Sean Egan <seanegan@gmail.com>
parents: 3757
diff changeset
369 label = gtk_label_new(NULL);
7757
72727edb37ef [gaim-migrate @ 8402]
Mark Doliner <mark@kingant.net>
parents: 7756
diff changeset
370 if (!strcmp(norm, "zilding"))
6465
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6431
diff changeset
371 gtk_label_set_markup(GTK_LABEL(label),
3767
65e9ea5934c8 [gaim-migrate @ 3906]
Sean Egan <seanegan@gmail.com>
parents: 3757
diff changeset
372 "<span weight=\"bold\" size=\"large\" foreground=\"purple\">Amazing! Simply Amazing!</span>");
7757
72727edb37ef [gaim-migrate @ 8402]
Mark Doliner <mark@kingant.net>
parents: 7756
diff changeset
373 else if (!strcmp(norm, "robflynn"))
6465
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6431
diff changeset
374 gtk_label_set_markup(GTK_LABEL(label),
3767
65e9ea5934c8 [gaim-migrate @ 3906]
Sean Egan <seanegan@gmail.com>
parents: 3757
diff changeset
375 "<span weight=\"bold\" size=\"large\" foreground=\"#1f6bad\">Pimpin\' Penguin Style! *Waddle Waddle*</span>");
7757
72727edb37ef [gaim-migrate @ 8402]
Mark Doliner <mark@kingant.net>
parents: 7756
diff changeset
376 else if (!strcmp(norm, "flynorange"))
6465
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6431
diff changeset
377 gtk_label_set_markup(GTK_LABEL(label),
3767
65e9ea5934c8 [gaim-migrate @ 3906]
Sean Egan <seanegan@gmail.com>
parents: 3757
diff changeset
378 "<span weight=\"bold\" size=\"large\" foreground=\"blue\">You should be me. I'm so cute!</span>");
7757
72727edb37ef [gaim-migrate @ 8402]
Mark Doliner <mark@kingant.net>
parents: 7756
diff changeset
379 else if (!strcmp(norm, "ewarmenhoven"))
6465
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6431
diff changeset
380 gtk_label_set_markup(GTK_LABEL(label),
3767
65e9ea5934c8 [gaim-migrate @ 3906]
Sean Egan <seanegan@gmail.com>
parents: 3757
diff changeset
381 "<span weight=\"bold\" size=\"large\" foreground=\"orange\">Now that's what I like!</span>");
7757
72727edb37ef [gaim-migrate @ 8402]
Mark Doliner <mark@kingant.net>
parents: 7756
diff changeset
382 else if (!strcmp(norm, "markster97"))
6465
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6431
diff changeset
383 gtk_label_set_markup(GTK_LABEL(label),
3767
65e9ea5934c8 [gaim-migrate @ 3906]
Sean Egan <seanegan@gmail.com>
parents: 3757
diff changeset
384 "<span weight=\"bold\" size=\"large\" foreground=\"brown\">Ahh, and excellent choice!</span>");
7757
72727edb37ef [gaim-migrate @ 8402]
Mark Doliner <mark@kingant.net>
parents: 7756
diff changeset
385 else if (!strcmp(norm, "seanegn"))
6465
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6431
diff changeset
386 gtk_label_set_markup(GTK_LABEL(label),
3767
65e9ea5934c8 [gaim-migrate @ 3906]
Sean Egan <seanegan@gmail.com>
parents: 3757
diff changeset
387 "<span weight=\"bold\" size=\"large\" foreground=\"#009900\">Everytime you click my name, an angel gets its wings.</span>");
7757
72727edb37ef [gaim-migrate @ 8402]
Mark Doliner <mark@kingant.net>
parents: 7756
diff changeset
388 else if (!strcmp(norm, "chipx86"))
6465
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6431
diff changeset
389 gtk_label_set_markup(GTK_LABEL(label),
3767
65e9ea5934c8 [gaim-migrate @ 3906]
Sean Egan <seanegan@gmail.com>
parents: 3757
diff changeset
390 "<span weight=\"bold\" size=\"large\" foreground=\"red\">This sunflower seed taste like pizza.</span>");
7757
72727edb37ef [gaim-migrate @ 8402]
Mark Doliner <mark@kingant.net>
parents: 7756
diff changeset
391 else if (!strcmp(norm, "markdoliner"))
6465
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6431
diff changeset
392 gtk_label_set_markup(GTK_LABEL(label),
3767
65e9ea5934c8 [gaim-migrate @ 3906]
Sean Egan <seanegan@gmail.com>
parents: 3757
diff changeset
393 "<span weight=\"bold\" size=\"large\" foreground=\"#6364B1\">Hey! I was in that tumbleweed!</span>");
7757
72727edb37ef [gaim-migrate @ 8402]
Mark Doliner <mark@kingant.net>
parents: 7756
diff changeset
394 else if (!strcmp(norm, "lschiere"))
6465
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6431
diff changeset
395 gtk_label_set_markup(GTK_LABEL(label),
3767
65e9ea5934c8 [gaim-migrate @ 3906]
Sean Egan <seanegan@gmail.com>
parents: 3757
diff changeset
396 "<span weight=\"bold\" size=\"large\" foreground=\"gray\">I'm not anything.</span>");
7757
72727edb37ef [gaim-migrate @ 8402]
Mark Doliner <mark@kingant.net>
parents: 7756
diff changeset
397 g_free(norm);
72727edb37ef [gaim-migrate @ 8402]
Mark Doliner <mark@kingant.net>
parents: 7756
diff changeset
398
72727edb37ef [gaim-migrate @ 8402]
Mark Doliner <mark@kingant.net>
parents: 7756
diff changeset
399 if (strlen(gtk_label_get_label(GTK_LABEL(label))) <= 0)
72727edb37ef [gaim-migrate @ 8402]
Mark Doliner <mark@kingant.net>
parents: 7756
diff changeset
400 return FALSE;
6465
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6431
diff changeset
401
7678
cf6a7939af78 [gaim-migrate @ 8322]
Sean Egan <seanegan@gmail.com>
parents: 7538
diff changeset
402 window = gtk_dialog_new_with_buttons(GAIM_ALERT_TITLE, GTK_WINDOW(gtkblist->window), 0, GTK_STOCK_OK, GTK_RESPONSE_OK, NULL);
3767
65e9ea5934c8 [gaim-migrate @ 3906]
Sean Egan <seanegan@gmail.com>
parents: 3757
diff changeset
403 gtk_dialog_set_default_response (GTK_DIALOG(window), GTK_RESPONSE_OK);
65e9ea5934c8 [gaim-migrate @ 3906]
Sean Egan <seanegan@gmail.com>
parents: 3757
diff changeset
404 g_signal_connect(G_OBJECT(window), "response", G_CALLBACK(gtk_widget_destroy), NULL);
6465
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6431
diff changeset
405
3767
65e9ea5934c8 [gaim-migrate @ 3906]
Sean Egan <seanegan@gmail.com>
parents: 3757
diff changeset
406 gtk_container_set_border_width (GTK_CONTAINER(window), 6);
65e9ea5934c8 [gaim-migrate @ 3906]
Sean Egan <seanegan@gmail.com>
parents: 3757
diff changeset
407 gtk_window_set_resizable(GTK_WINDOW(window), FALSE);
65e9ea5934c8 [gaim-migrate @ 3906]
Sean Egan <seanegan@gmail.com>
parents: 3757
diff changeset
408 gtk_dialog_set_has_separator(GTK_DIALOG(window), FALSE);
65e9ea5934c8 [gaim-migrate @ 3906]
Sean Egan <seanegan@gmail.com>
parents: 3757
diff changeset
409 gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(window)->vbox), 12);
65e9ea5934c8 [gaim-migrate @ 3906]
Sean Egan <seanegan@gmail.com>
parents: 3757
diff changeset
410 gtk_container_set_border_width (GTK_CONTAINER(GTK_DIALOG(window)->vbox), 6);
65e9ea5934c8 [gaim-migrate @ 3906]
Sean Egan <seanegan@gmail.com>
parents: 3757
diff changeset
411
65e9ea5934c8 [gaim-migrate @ 3906]
Sean Egan <seanegan@gmail.com>
parents: 3757
diff changeset
412 hbox = gtk_hbox_new(FALSE, 12);
65e9ea5934c8 [gaim-migrate @ 3906]
Sean Egan <seanegan@gmail.com>
parents: 3757
diff changeset
413 gtk_container_add(GTK_CONTAINER(GTK_DIALOG(window)->vbox), hbox);
65e9ea5934c8 [gaim-migrate @ 3906]
Sean Egan <seanegan@gmail.com>
parents: 3757
diff changeset
414 gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0);
6465
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6431
diff changeset
415
3767
65e9ea5934c8 [gaim-migrate @ 3906]
Sean Egan <seanegan@gmail.com>
parents: 3757
diff changeset
416 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
65e9ea5934c8 [gaim-migrate @ 3906]
Sean Egan <seanegan@gmail.com>
parents: 3757
diff changeset
417 gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
65e9ea5934c8 [gaim-migrate @ 3906]
Sean Egan <seanegan@gmail.com>
parents: 3757
diff changeset
418 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
4635
42d53c416bb9 [gaim-migrate @ 4942]
Nathan Walp <nwalp@pidgin.im>
parents: 4630
diff changeset
419
3767
65e9ea5934c8 [gaim-migrate @ 3906]
Sean Egan <seanegan@gmail.com>
parents: 3757
diff changeset
420 gtk_widget_show_all(window);
7757
72727edb37ef [gaim-migrate @ 8402]
Mark Doliner <mark@kingant.net>
parents: 7756
diff changeset
421 return TRUE;
72727edb37ef [gaim-migrate @ 8402]
Mark Doliner <mark@kingant.net>
parents: 7756
diff changeset
422 }
72727edb37ef [gaim-migrate @ 8402]
Mark Doliner <mark@kingant.net>
parents: 7756
diff changeset
423
8286
89d9d004e3f3 [gaim-migrate @ 9010]
Christian Hammond <chipx86@chipx86.com>
parents: 8152
diff changeset
424 static void
89d9d004e3f3 [gaim-migrate @ 9010]
Christian Hammond <chipx86@chipx86.com>
parents: 8152
diff changeset
425 new_im_cb(gpointer data, GaimRequestFields *fields)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
426 {
8286
89d9d004e3f3 [gaim-migrate @ 9010]
Christian Hammond <chipx86@chipx86.com>
parents: 8152
diff changeset
427 const char *username;
89d9d004e3f3 [gaim-migrate @ 9010]
Christian Hammond <chipx86@chipx86.com>
parents: 8152
diff changeset
428 GaimAccount *account;
89d9d004e3f3 [gaim-migrate @ 9010]
Christian Hammond <chipx86@chipx86.com>
parents: 8152
diff changeset
429 GaimConversation *conv;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
430
8286
89d9d004e3f3 [gaim-migrate @ 9010]
Christian Hammond <chipx86@chipx86.com>
parents: 8152
diff changeset
431 username = gaim_request_fields_get_string(fields, "screenname");
89d9d004e3f3 [gaim-migrate @ 9010]
Christian Hammond <chipx86@chipx86.com>
parents: 8152
diff changeset
432 account = gaim_request_fields_get_account(fields, "account");
4695
4bdd9a5fd026 [gaim-migrate @ 5006]
Christian Hammond <chipx86@chipx86.com>
parents: 4687
diff changeset
433
8286
89d9d004e3f3 [gaim-migrate @ 9010]
Christian Hammond <chipx86@chipx86.com>
parents: 8152
diff changeset
434 conv = gaim_find_conversation_with_account(username, account);
4613
5385b3625a72 [gaim-migrate @ 4902]
Nathan Walp <nwalp@pidgin.im>
parents: 4609
diff changeset
435
8286
89d9d004e3f3 [gaim-migrate @ 9010]
Christian Hammond <chipx86@chipx86.com>
parents: 8152
diff changeset
436 if (conv == NULL)
89d9d004e3f3 [gaim-migrate @ 9010]
Christian Hammond <chipx86@chipx86.com>
parents: 8152
diff changeset
437 conv = gaim_conversation_new(GAIM_CONV_IM, account, username);
89d9d004e3f3 [gaim-migrate @ 9010]
Christian Hammond <chipx86@chipx86.com>
parents: 8152
diff changeset
438 else
89d9d004e3f3 [gaim-migrate @ 9010]
Christian Hammond <chipx86@chipx86.com>
parents: 8152
diff changeset
439 gaim_conv_window_raise(gaim_conversation_get_window(conv));
89d9d004e3f3 [gaim-migrate @ 9010]
Christian Hammond <chipx86@chipx86.com>
parents: 8152
diff changeset
440 }
7755
8ebd9038ef62 [gaim-migrate @ 8400]
Mark Doliner <mark@kingant.net>
parents: 7751
diff changeset
441
8286
89d9d004e3f3 [gaim-migrate @ 9010]
Christian Hammond <chipx86@chipx86.com>
parents: 8152
diff changeset
442 void
89d9d004e3f3 [gaim-migrate @ 9010]
Christian Hammond <chipx86@chipx86.com>
parents: 8152
diff changeset
443 show_im_dialog(void)
89d9d004e3f3 [gaim-migrate @ 9010]
Christian Hammond <chipx86@chipx86.com>
parents: 8152
diff changeset
444 {
89d9d004e3f3 [gaim-migrate @ 9010]
Christian Hammond <chipx86@chipx86.com>
parents: 8152
diff changeset
445 GaimRequestFields *fields;
89d9d004e3f3 [gaim-migrate @ 9010]
Christian Hammond <chipx86@chipx86.com>
parents: 8152
diff changeset
446 GaimRequestFieldGroup *group;
89d9d004e3f3 [gaim-migrate @ 9010]
Christian Hammond <chipx86@chipx86.com>
parents: 8152
diff changeset
447 GaimRequestField *field;
4613
5385b3625a72 [gaim-migrate @ 4902]
Nathan Walp <nwalp@pidgin.im>
parents: 4609
diff changeset
448
8286
89d9d004e3f3 [gaim-migrate @ 9010]
Christian Hammond <chipx86@chipx86.com>
parents: 8152
diff changeset
449 fields = gaim_request_fields_new();
89d9d004e3f3 [gaim-migrate @ 9010]
Christian Hammond <chipx86@chipx86.com>
parents: 8152
diff changeset
450
89d9d004e3f3 [gaim-migrate @ 9010]
Christian Hammond <chipx86@chipx86.com>
parents: 8152
diff changeset
451 group = gaim_request_field_group_new(NULL);
89d9d004e3f3 [gaim-migrate @ 9010]
Christian Hammond <chipx86@chipx86.com>
parents: 8152
diff changeset
452 gaim_request_fields_add_group(fields, group);
4613
5385b3625a72 [gaim-migrate @ 4902]
Nathan Walp <nwalp@pidgin.im>
parents: 4609
diff changeset
453
8286
89d9d004e3f3 [gaim-migrate @ 9010]
Christian Hammond <chipx86@chipx86.com>
parents: 8152
diff changeset
454 field = gaim_request_field_string_new("screenname", _("_Screen name"),
89d9d004e3f3 [gaim-migrate @ 9010]
Christian Hammond <chipx86@chipx86.com>
parents: 8152
diff changeset
455 NULL, FALSE);
89d9d004e3f3 [gaim-migrate @ 9010]
Christian Hammond <chipx86@chipx86.com>
parents: 8152
diff changeset
456 gaim_request_field_set_required(field, TRUE);
8293
a1b7c7f3d9a7 [gaim-migrate @ 9017]
Christian Hammond <chipx86@chipx86.com>
parents: 8290
diff changeset
457 gaim_request_field_set_type_hint(field, "screenname");
8286
89d9d004e3f3 [gaim-migrate @ 9010]
Christian Hammond <chipx86@chipx86.com>
parents: 8152
diff changeset
458 gaim_request_field_group_add_field(group, field);
7755
8ebd9038ef62 [gaim-migrate @ 8400]
Mark Doliner <mark@kingant.net>
parents: 7751
diff changeset
459
8286
89d9d004e3f3 [gaim-migrate @ 9010]
Christian Hammond <chipx86@chipx86.com>
parents: 8152
diff changeset
460 field = gaim_request_field_account_new("account", _("_Account"), NULL);
89d9d004e3f3 [gaim-migrate @ 9010]
Christian Hammond <chipx86@chipx86.com>
parents: 8152
diff changeset
461 gaim_request_field_set_visible(field,
89d9d004e3f3 [gaim-migrate @ 9010]
Christian Hammond <chipx86@chipx86.com>
parents: 8152
diff changeset
462 (gaim_connections_get_all() != NULL &&
89d9d004e3f3 [gaim-migrate @ 9010]
Christian Hammond <chipx86@chipx86.com>
parents: 8152
diff changeset
463 gaim_connections_get_all()->next != NULL));
89d9d004e3f3 [gaim-migrate @ 9010]
Christian Hammond <chipx86@chipx86.com>
parents: 8152
diff changeset
464 gaim_request_field_set_required(field, TRUE);
89d9d004e3f3 [gaim-migrate @ 9010]
Christian Hammond <chipx86@chipx86.com>
parents: 8152
diff changeset
465 gaim_request_field_group_add_field(group, field);
4613
5385b3625a72 [gaim-migrate @ 4902]
Nathan Walp <nwalp@pidgin.im>
parents: 4609
diff changeset
466
8286
89d9d004e3f3 [gaim-migrate @ 9010]
Christian Hammond <chipx86@chipx86.com>
parents: 8152
diff changeset
467 gaim_request_fields(gaim_get_blist(), _("New Instant Message"),
89d9d004e3f3 [gaim-migrate @ 9010]
Christian Hammond <chipx86@chipx86.com>
parents: 8152
diff changeset
468 NULL,
89d9d004e3f3 [gaim-migrate @ 9010]
Christian Hammond <chipx86@chipx86.com>
parents: 8152
diff changeset
469 _("Please enter the screen name of the person you "
89d9d004e3f3 [gaim-migrate @ 9010]
Christian Hammond <chipx86@chipx86.com>
parents: 8152
diff changeset
470 "would like to IM."),
89d9d004e3f3 [gaim-migrate @ 9010]
Christian Hammond <chipx86@chipx86.com>
parents: 8152
diff changeset
471 fields,
89d9d004e3f3 [gaim-migrate @ 9010]
Christian Hammond <chipx86@chipx86.com>
parents: 8152
diff changeset
472 _("OK"), G_CALLBACK(new_im_cb),
89d9d004e3f3 [gaim-migrate @ 9010]
Christian Hammond <chipx86@chipx86.com>
parents: 8152
diff changeset
473 _("Cancel"), NULL,
89d9d004e3f3 [gaim-migrate @ 9010]
Christian Hammond <chipx86@chipx86.com>
parents: 8152
diff changeset
474 NULL);
3197
389ed797f396 [gaim-migrate @ 3214]
Sean Egan <seanegan@gmail.com>
parents: 3159
diff changeset
475 }
389ed797f396 [gaim-migrate @ 3214]
Sean Egan <seanegan@gmail.com>
parents: 3159
diff changeset
476
8290
84ec38c3efcc [gaim-migrate @ 9014]
Christian Hammond <chipx86@chipx86.com>
parents: 8286
diff changeset
477 static void
84ec38c3efcc [gaim-migrate @ 9014]
Christian Hammond <chipx86@chipx86.com>
parents: 8286
diff changeset
478 get_info_cb(gpointer data, GaimRequestFields *fields)
935
5e6ca3dd4d02 [gaim-migrate @ 945]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 934
diff changeset
479 {
8290
84ec38c3efcc [gaim-migrate @ 9014]
Christian Hammond <chipx86@chipx86.com>
parents: 8286
diff changeset
480 char *username;
84ec38c3efcc [gaim-migrate @ 9014]
Christian Hammond <chipx86@chipx86.com>
parents: 8286
diff changeset
481 gboolean found = FALSE;
84ec38c3efcc [gaim-migrate @ 9014]
Christian Hammond <chipx86@chipx86.com>
parents: 8286
diff changeset
482 GaimAccount *account;
3197
389ed797f396 [gaim-migrate @ 3214]
Sean Egan <seanegan@gmail.com>
parents: 3159
diff changeset
483
8290
84ec38c3efcc [gaim-migrate @ 9014]
Christian Hammond <chipx86@chipx86.com>
parents: 8286
diff changeset
484 account = gaim_request_fields_get_account(fields, "account");
6465
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6431
diff changeset
485
8290
84ec38c3efcc [gaim-migrate @ 9014]
Christian Hammond <chipx86@chipx86.com>
parents: 8286
diff changeset
486 username = g_strdup(gaim_normalize(account,
84ec38c3efcc [gaim-migrate @ 9014]
Christian Hammond <chipx86@chipx86.com>
parents: 8286
diff changeset
487 gaim_request_fields_get_string(fields, "screenname")));
5880
1b85ff65be57 [gaim-migrate @ 6312]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
488
8290
84ec38c3efcc [gaim-migrate @ 9014]
Christian Hammond <chipx86@chipx86.com>
parents: 8286
diff changeset
489 if (username != NULL && gaim_str_has_suffix(username, "rocksmyworld"))
84ec38c3efcc [gaim-migrate @ 9014]
Christian Hammond <chipx86@chipx86.com>
parents: 8286
diff changeset
490 found = show_ee_dialog(username);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
491
8290
84ec38c3efcc [gaim-migrate @ 9014]
Christian Hammond <chipx86@chipx86.com>
parents: 8286
diff changeset
492 if (!found && username != NULL && *username != '\0' && account != NULL)
84ec38c3efcc [gaim-migrate @ 9014]
Christian Hammond <chipx86@chipx86.com>
parents: 8286
diff changeset
493 serv_get_info(gaim_account_get_connection(account), username);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
494
8290
84ec38c3efcc [gaim-migrate @ 9014]
Christian Hammond <chipx86@chipx86.com>
parents: 8286
diff changeset
495 g_free(username);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
496 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
497
8290
84ec38c3efcc [gaim-migrate @ 9014]
Christian Hammond <chipx86@chipx86.com>
parents: 8286
diff changeset
498 void
84ec38c3efcc [gaim-migrate @ 9014]
Christian Hammond <chipx86@chipx86.com>
parents: 8286
diff changeset
499 show_info_dialog(void)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
500 {
8290
84ec38c3efcc [gaim-migrate @ 9014]
Christian Hammond <chipx86@chipx86.com>
parents: 8286
diff changeset
501 GaimRequestFields *fields;
84ec38c3efcc [gaim-migrate @ 9014]
Christian Hammond <chipx86@chipx86.com>
parents: 8286
diff changeset
502 GaimRequestFieldGroup *group;
84ec38c3efcc [gaim-migrate @ 9014]
Christian Hammond <chipx86@chipx86.com>
parents: 8286
diff changeset
503 GaimRequestField *field;
7927
1441648fe974 [gaim-migrate @ 8598]
Mark Doliner <mark@kingant.net>
parents: 7925
diff changeset
504
8290
84ec38c3efcc [gaim-migrate @ 9014]
Christian Hammond <chipx86@chipx86.com>
parents: 8286
diff changeset
505 fields = gaim_request_fields_new();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
506
8290
84ec38c3efcc [gaim-migrate @ 9014]
Christian Hammond <chipx86@chipx86.com>
parents: 8286
diff changeset
507 group = gaim_request_field_group_new(NULL);
84ec38c3efcc [gaim-migrate @ 9014]
Christian Hammond <chipx86@chipx86.com>
parents: 8286
diff changeset
508 gaim_request_fields_add_group(fields, group);
4262
7103653dd34e [gaim-migrate @ 4513]
Rob Flynn <gaim@robflynn.com>
parents: 4249
diff changeset
509
8290
84ec38c3efcc [gaim-migrate @ 9014]
Christian Hammond <chipx86@chipx86.com>
parents: 8286
diff changeset
510 field = gaim_request_field_string_new("screenname", _("_Screen name"),
84ec38c3efcc [gaim-migrate @ 9014]
Christian Hammond <chipx86@chipx86.com>
parents: 8286
diff changeset
511 NULL, FALSE);
8293
a1b7c7f3d9a7 [gaim-migrate @ 9017]
Christian Hammond <chipx86@chipx86.com>
parents: 8290
diff changeset
512 gaim_request_field_set_type_hint(field, "screenname");
8290
84ec38c3efcc [gaim-migrate @ 9014]
Christian Hammond <chipx86@chipx86.com>
parents: 8286
diff changeset
513 gaim_request_field_set_required(field, TRUE);
84ec38c3efcc [gaim-migrate @ 9014]
Christian Hammond <chipx86@chipx86.com>
parents: 8286
diff changeset
514 gaim_request_field_group_add_field(group, field);
6465
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6431
diff changeset
515
8290
84ec38c3efcc [gaim-migrate @ 9014]
Christian Hammond <chipx86@chipx86.com>
parents: 8286
diff changeset
516 field = gaim_request_field_account_new("account", _("_Account"), NULL);
84ec38c3efcc [gaim-migrate @ 9014]
Christian Hammond <chipx86@chipx86.com>
parents: 8286
diff changeset
517 gaim_request_field_set_visible(field,
84ec38c3efcc [gaim-migrate @ 9014]
Christian Hammond <chipx86@chipx86.com>
parents: 8286
diff changeset
518 (gaim_connections_get_all() != NULL &&
84ec38c3efcc [gaim-migrate @ 9014]
Christian Hammond <chipx86@chipx86.com>
parents: 8286
diff changeset
519 gaim_connections_get_all()->next != NULL));
84ec38c3efcc [gaim-migrate @ 9014]
Christian Hammond <chipx86@chipx86.com>
parents: 8286
diff changeset
520 gaim_request_field_set_required(field, TRUE);
84ec38c3efcc [gaim-migrate @ 9014]
Christian Hammond <chipx86@chipx86.com>
parents: 8286
diff changeset
521 gaim_request_field_group_add_field(group, field);
6465
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6431
diff changeset
522
8290
84ec38c3efcc [gaim-migrate @ 9014]
Christian Hammond <chipx86@chipx86.com>
parents: 8286
diff changeset
523 gaim_request_fields(gaim_get_blist(), _("Get User Info"),
84ec38c3efcc [gaim-migrate @ 9014]
Christian Hammond <chipx86@chipx86.com>
parents: 8286
diff changeset
524 NULL,
84ec38c3efcc [gaim-migrate @ 9014]
Christian Hammond <chipx86@chipx86.com>
parents: 8286
diff changeset
525 _("Please enter the screen name of the person whose "
84ec38c3efcc [gaim-migrate @ 9014]
Christian Hammond <chipx86@chipx86.com>
parents: 8286
diff changeset
526 "info you would like to view."),
84ec38c3efcc [gaim-migrate @ 9014]
Christian Hammond <chipx86@chipx86.com>
parents: 8286
diff changeset
527 fields,
84ec38c3efcc [gaim-migrate @ 9014]
Christian Hammond <chipx86@chipx86.com>
parents: 8286
diff changeset
528 _("OK"), G_CALLBACK(get_info_cb),
84ec38c3efcc [gaim-migrate @ 9014]
Christian Hammond <chipx86@chipx86.com>
parents: 8286
diff changeset
529 _("Cancel"), NULL,
84ec38c3efcc [gaim-migrate @ 9014]
Christian Hammond <chipx86@chipx86.com>
parents: 8286
diff changeset
530 NULL);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
531 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
532
8911
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
533 static void
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
534 get_log_cb(gpointer data, GaimRequestFields *fields)
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
535 {
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
536 char *username;
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
537 GaimAccount *account;
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
538
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
539 account = gaim_request_fields_get_account(fields, "account");
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
540
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
541 username = g_strdup(gaim_normalize(account,
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
542 gaim_request_fields_get_string(fields, "screenname")));
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
543
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
544 if( username != NULL && *username != '\0' && account != NULL )
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
545 gaim_gtk_log_show( username, account );
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
546
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
547 g_free(username);
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
548 }
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
549
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
550 void
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
551 show_log_dialog(void)
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
552 {
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
553 GaimRequestFields *fields;
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
554 GaimRequestFieldGroup *group;
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
555 GaimRequestField *field;
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
556
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
557 fields = gaim_request_fields_new();
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
558
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
559 group = gaim_request_field_group_new(NULL);
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
560 gaim_request_fields_add_group(fields, group);
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
561
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
562 field = gaim_request_field_string_new("screenname", _("_Screen name"),
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
563 NULL, FALSE);
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
564 gaim_request_field_set_type_hint(field, "screenname");
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
565 gaim_request_field_set_required(field, TRUE);
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
566 gaim_request_field_group_add_field(group, field);
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
567
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
568 field = gaim_request_field_account_new("account", _("_Account"), NULL);
8936
7cbdbed9d329 [gaim-migrate @ 9706]
Mark Doliner <mark@kingant.net>
parents: 8911
diff changeset
569 gaim_request_field_account_set_show_all(field, TRUE);
8911
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
570 gaim_request_field_set_visible(field,
8936
7cbdbed9d329 [gaim-migrate @ 9706]
Mark Doliner <mark@kingant.net>
parents: 8911
diff changeset
571 (gaim_accounts_get_all() != NULL &&
7cbdbed9d329 [gaim-migrate @ 9706]
Mark Doliner <mark@kingant.net>
parents: 8911
diff changeset
572 gaim_accounts_get_all()->next != NULL));
8911
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
573 gaim_request_field_set_required(field, TRUE);
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
574 gaim_request_field_group_add_field(group, field);
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
575
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
576 gaim_request_fields(gaim_get_blist(), _("Get User Log"),
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
577 NULL,
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
578 _("Please enter the screen name of the person whose "
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
579 "log you would like to view."),
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
580 fields,
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
581 _("OK"), G_CALLBACK(get_log_cb),
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
582 _("Cancel"), NULL,
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
583 NULL);
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
584 }
35b68d76cb4c [gaim-migrate @ 9681]
Luke Schierer <lschiere@pidgin.im>
parents: 8887
diff changeset
585
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
586 /*------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
587 /* Color Selection Dialog */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
588 /*------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
589
3367
3b00d97d59aa [gaim-migrate @ 3386]
Sean Egan <seanegan@gmail.com>
parents: 3348
diff changeset
590 GtkWidget *fgcseld = NULL;
3b00d97d59aa [gaim-migrate @ 3386]
Sean Egan <seanegan@gmail.com>
parents: 3348
diff changeset
591 GtkWidget *bgcseld = NULL;
657
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
592
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5593
diff changeset
593 void show_fgcolor_dialog(GaimConversation *c, GtkWidget *color)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
594 {
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5593
diff changeset
595 GaimGtkConversation *gtkconv;
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5498
diff changeset
596 GdkColor fgcolor;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
597
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4350
diff changeset
598 gtkconv = GAIM_GTK_CONVERSATION(c);
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4350
diff changeset
599
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5498
diff changeset
600 gdk_color_parse(gaim_prefs_get_string("/gaim/gtk/conversations/fgcolor"),
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5498
diff changeset
601 &fgcolor);
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5498
diff changeset
602
8317
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
603 if (fgcseld)
657
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
604 return;
8317
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
605
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
606 fgcseld = gtk_color_selection_dialog_new(_("Select Text Color"));
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
607 gtk_color_selection_set_current_color(GTK_COLOR_SELECTION
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
608 (GTK_COLOR_SELECTION_DIALOG(fgcseld)->colorsel), &fgcolor);
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
609 g_signal_connect(G_OBJECT(fgcseld), "delete_event",
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
610 G_CALLBACK(destroy_colorsel), (void *)1);
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
611 g_signal_connect(G_OBJECT(GTK_COLOR_SELECTION_DIALOG(fgcseld)->cancel_button),
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
612 "clicked", G_CALLBACK(destroy_colorsel), (void *)1);
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
613 g_signal_connect(G_OBJECT(GTK_COLOR_SELECTION_DIALOG(fgcseld)->ok_button), "clicked",
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
614 G_CALLBACK(apply_color_dlg), (void *)1);
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
615 gtk_widget_realize(fgcseld);
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
616 gtk_widget_show(fgcseld);
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
617 gdk_window_raise(fgcseld->window);
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
618 return;
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
619 }
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
620
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5593
diff changeset
621 void show_bgcolor_dialog(GaimConversation *c, GtkWidget *color)
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
622 {
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5593
diff changeset
623 GaimGtkConversation *gtkconv;
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5498
diff changeset
624 GdkColor bgcolor;
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 854
diff changeset
625
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4350
diff changeset
626 gtkconv = GAIM_GTK_CONVERSATION(c);
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4350
diff changeset
627
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5498
diff changeset
628 gdk_color_parse(gaim_prefs_get_string("/gaim/gtk/conversations/bgcolor"),
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5498
diff changeset
629 &bgcolor);
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5498
diff changeset
630
8317
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
631 if (bgcseld)
657
4bbc103a3294 [gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 654
diff changeset
632 return;
8317
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
633
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
634 bgcseld = gtk_color_selection_dialog_new(_("Select Background Color"));
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
635 gtk_color_selection_set_current_color(GTK_COLOR_SELECTION
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
636 (GTK_COLOR_SELECTION_DIALOG(bgcseld)->colorsel), &bgcolor);
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
637 g_signal_connect(G_OBJECT(bgcseld), "delete_event",
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
638 G_CALLBACK(destroy_colorsel), NULL);
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
639 g_signal_connect(G_OBJECT(GTK_COLOR_SELECTION_DIALOG(bgcseld)->cancel_button),
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
640 "clicked", G_CALLBACK(destroy_colorsel), NULL);
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
641 g_signal_connect(G_OBJECT(GTK_COLOR_SELECTION_DIALOG(bgcseld)->ok_button), "clicked",
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
642 G_CALLBACK(apply_color_dlg), (void *)2);
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
643 gtk_widget_realize(bgcseld);
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
644 gtk_widget_show(bgcseld);
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
645 gdk_window_raise(bgcseld->window);
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
646 return;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
647 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
648
8317
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
649
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
650 /*------------------------ ----------------------------------------------*/
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
651 /* Font Selection Dialog */
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
652 /*------------------------------------------------------------------------*/
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
653
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
654
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
655 void destroy_fontsel(GtkWidget *w, gpointer d)
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
656 {
334
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
657 gtk_widget_destroy(fontseld);
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
658 fontseld = NULL;
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
659 }
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
660
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5593
diff changeset
661 void show_font_dialog(GaimConversation *c, GtkWidget *font)
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
662 {
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5593
diff changeset
663 GaimGtkConversation *gtkconv;
3473
0073a014e55b [gaim-migrate @ 3524]
Sean Egan <seanegan@gmail.com>
parents: 3472
diff changeset
664 char fonttif[128];
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5498
diff changeset
665 const char *fontface;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4350
diff changeset
666
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4350
diff changeset
667 gtkconv = GAIM_GTK_CONVERSATION(c);
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4350
diff changeset
668
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5498
diff changeset
669
8317
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
670 if (fontseld)
334
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
671 return;
8317
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
672
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
673 fontseld = gtk_font_selection_dialog_new(_("Select Font"));
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
674
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
675 fontface = gaim_prefs_get_string("/gaim/gtk/conversations/font_face");
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
676
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
677 if (fontface != NULL && *fontface != '\0') {
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
678 g_snprintf(fonttif, sizeof(fonttif), "%s 12", fontface);
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
679 gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG(fontseld),
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
680 fonttif);
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
681 } else {
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
682 gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG(fontseld),
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
683 DEFAULT_FONT_FACE " 12");
334
0fa651368776 [gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 311
diff changeset
684 }
8317
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
685
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
686 g_signal_connect(G_OBJECT(fontseld), "delete_event",
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
687 G_CALLBACK(destroy_fontsel), NULL);
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
688 g_signal_connect(G_OBJECT(GTK_FONT_SELECTION_DIALOG(fontseld)->cancel_button),
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
689 "clicked", G_CALLBACK(destroy_fontsel), NULL);
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
690 g_signal_connect(G_OBJECT(GTK_FONT_SELECTION_DIALOG(fontseld)->ok_button), "clicked",
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
691 G_CALLBACK(apply_font_dlg), fontseld);
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
692 gtk_widget_realize(fontseld);
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
693 gtk_widget_show(fontseld);
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
694 gdk_window_raise(fontseld->window);
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
695 return;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4350
diff changeset
696
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
697 }
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
698
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 229
diff changeset
699 /*------------------------------------------------------------------------*/
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
700 /* The dialog for new away messages */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
701 /*------------------------------------------------------------------------*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
702
8502
48112dfe1179 [gaim-migrate @ 9238]
Mark Doliner <mark@kingant.net>
parents: 8481
diff changeset
703 static void away_mess_destroy(GtkWidget *widget, struct create_away *ca)
48112dfe1179 [gaim-migrate @ 9238]
Mark Doliner <mark@kingant.net>
parents: 8481
diff changeset
704 {
48112dfe1179 [gaim-migrate @ 9238]
Mark Doliner <mark@kingant.net>
parents: 8481
diff changeset
705 destroy_dialog(NULL, ca->window);
48112dfe1179 [gaim-migrate @ 9238]
Mark Doliner <mark@kingant.net>
parents: 8481
diff changeset
706 g_free(ca);
48112dfe1179 [gaim-migrate @ 9238]
Mark Doliner <mark@kingant.net>
parents: 8481
diff changeset
707 }
48112dfe1179 [gaim-migrate @ 9238]
Mark Doliner <mark@kingant.net>
parents: 8481
diff changeset
708
48112dfe1179 [gaim-migrate @ 9238]
Mark Doliner <mark@kingant.net>
parents: 8481
diff changeset
709 static void away_mess_destroy_ca(GtkWidget *widget, GdkEvent *event, struct create_away *ca)
48112dfe1179 [gaim-migrate @ 9238]
Mark Doliner <mark@kingant.net>
parents: 8481
diff changeset
710 {
48112dfe1179 [gaim-migrate @ 9238]
Mark Doliner <mark@kingant.net>
parents: 8481
diff changeset
711 away_mess_destroy(NULL, ca);
48112dfe1179 [gaim-migrate @ 9238]
Mark Doliner <mark@kingant.net>
parents: 8481
diff changeset
712 }
48112dfe1179 [gaim-migrate @ 9238]
Mark Doliner <mark@kingant.net>
parents: 8481
diff changeset
713
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
714 static struct away_message *save_away_message(struct create_away *ca)
717
d7c39f12eb89 [gaim-migrate @ 727]
Todd Kulesza <fflewddur>
parents: 710
diff changeset
715 {
d7c39f12eb89 [gaim-migrate @ 727]
Todd Kulesza <fflewddur>
parents: 710
diff changeset
716 struct away_message *am;
d7c39f12eb89 [gaim-migrate @ 727]
Todd Kulesza <fflewddur>
parents: 710
diff changeset
717 gchar *away_message;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
718
832
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 825
diff changeset
719 if (!ca->mess)
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 825
diff changeset
720 am = g_new0(struct away_message, 1);
2851
6eb5bf5089f0 [gaim-migrate @ 2864]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2827
diff changeset
721 else {
832
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 825
diff changeset
722 am = ca->mess;
2851
6eb5bf5089f0 [gaim-migrate @ 2864]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2827
diff changeset
723 }
1387
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
724
717
d7c39f12eb89 [gaim-migrate @ 727]
Todd Kulesza <fflewddur>
parents: 710
diff changeset
725 g_snprintf(am->name, sizeof(am->name), "%s", gtk_entry_get_text(GTK_ENTRY(ca->entry)));
8317
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
726 away_message = gtk_imhtml_get_markup(GTK_IMHTML(ca->text));
717
d7c39f12eb89 [gaim-migrate @ 727]
Todd Kulesza <fflewddur>
parents: 710
diff changeset
727
d7c39f12eb89 [gaim-migrate @ 727]
Todd Kulesza <fflewddur>
parents: 710
diff changeset
728 g_snprintf(am->message, sizeof(am->message), "%s", away_message);
d7c39f12eb89 [gaim-migrate @ 727]
Todd Kulesza <fflewddur>
parents: 710
diff changeset
729 g_free(away_message);
d7c39f12eb89 [gaim-migrate @ 727]
Todd Kulesza <fflewddur>
parents: 710
diff changeset
730
7942
3e268e113bf1 [gaim-migrate @ 8613]
Mark Doliner <mark@kingant.net>
parents: 7939
diff changeset
731 if (!ca->mess)
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
732 away_messages = g_slist_insert_sorted(away_messages, am, sort_awaymsg_list);
832
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 825
diff changeset
733
5560
b7319c094153 [gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents: 5551
diff changeset
734 do_away_menu(NULL);
6065
3a40666c08b4 [gaim-migrate @ 6515]
Sean Egan <seanegan@gmail.com>
parents: 6059
diff changeset
735 gaim_status_sync();
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
736
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
737 return am;
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
738 }
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
739
1387
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
740 int check_away_mess(struct create_away *ca, int type)
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
741 {
8502
48112dfe1179 [gaim-migrate @ 9238]
Mark Doliner <mark@kingant.net>
parents: 8481
diff changeset
742 gchar *msg;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
743 if ((strlen(gtk_entry_get_text(GTK_ENTRY(ca->entry))) == 0) && (type == 1)) {
1387
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
744 /* We shouldn't allow a blank title */
5436
ad445074d239 [gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents: 5411
diff changeset
745 gaim_notify_error(NULL, NULL,
ad445074d239 [gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents: 5411
diff changeset
746 _("You cannot save an away message with a "
ad445074d239 [gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents: 5411
diff changeset
747 "blank title"),
ad445074d239 [gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents: 5411
diff changeset
748 _("Please give the message a title, or choose "
ad445074d239 [gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents: 5411
diff changeset
749 "\"Use\" to use without saving."));
1387
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
750 return 0;
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
751 }
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
752
8677
cc2ce209cc46 [gaim-migrate @ 9430]
Sean Egan <seanegan@gmail.com>
parents: 8502
diff changeset
753 msg = gtk_imhtml_get_text(GTK_IMHTML(ca->text), NULL, NULL);
4630
5cdfd20daa07 [gaim-migrate @ 4921]
Sean Egan <seanegan@gmail.com>
parents: 4614
diff changeset
754
8502
48112dfe1179 [gaim-migrate @ 9238]
Mark Doliner <mark@kingant.net>
parents: 8481
diff changeset
755 if ((type <= 1) && ((msg == NULL) || (*msg == '\0'))) {
1387
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
756 /* We shouldn't allow a blank message */
5436
ad445074d239 [gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents: 5411
diff changeset
757 gaim_notify_error(NULL, NULL,
ad445074d239 [gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents: 5411
diff changeset
758 _("You cannot create an empty away message"), NULL);
1387
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
759 return 0;
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
760 }
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
761
4630
5cdfd20daa07 [gaim-migrate @ 4921]
Sean Egan <seanegan@gmail.com>
parents: 4614
diff changeset
762 g_free(msg);
5cdfd20daa07 [gaim-migrate @ 4921]
Sean Egan <seanegan@gmail.com>
parents: 4614
diff changeset
763
1387
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
764 return 1;
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
765 }
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
766
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
767 void save_away_mess(GtkWidget *widget, struct create_away *ca)
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
768 {
1387
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
769 if (!check_away_mess(ca, 1))
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
770 return;
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
771
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
772 save_away_message(ca);
8502
48112dfe1179 [gaim-migrate @ 9238]
Mark Doliner <mark@kingant.net>
parents: 8481
diff changeset
773
48112dfe1179 [gaim-migrate @ 9238]
Mark Doliner <mark@kingant.net>
parents: 8481
diff changeset
774 away_mess_destroy(NULL, ca);
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
775 }
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
776
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
777 void use_away_mess(GtkWidget *widget, struct create_away *ca)
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
778 {
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
779 static struct away_message am;
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
780 gchar *away_message;
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
781
1387
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
782 if (!check_away_mess(ca, 0))
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
783 return;
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
784
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
785 g_snprintf(am.name, sizeof(am.name), "%s", gtk_entry_get_text(GTK_ENTRY(ca->entry)));
8317
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
786 away_message = gtk_imhtml_get_markup(GTK_IMHTML(ca->text));
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
787
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
788 g_snprintf(am.message, sizeof(am.message), "%s", away_message);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
789 g_free(away_message);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
790
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
791 do_away_message(NULL, &am);
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
792
8502
48112dfe1179 [gaim-migrate @ 9238]
Mark Doliner <mark@kingant.net>
parents: 8481
diff changeset
793 away_mess_destroy(NULL, ca);
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
794 }
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
795
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
796 void su_away_mess(GtkWidget *widget, struct create_away *ca)
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
797 {
1387
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
798 if (!check_away_mess(ca, 1))
595a844dbe0b [gaim-migrate @ 1397]
Rob Flynn <gaim@robflynn.com>
parents: 1369
diff changeset
799 return;
8502
48112dfe1179 [gaim-migrate @ 9238]
Mark Doliner <mark@kingant.net>
parents: 8481
diff changeset
800
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
801 do_away_message(NULL, save_away_message(ca));
8502
48112dfe1179 [gaim-migrate @ 9238]
Mark Doliner <mark@kingant.net>
parents: 8481
diff changeset
802
48112dfe1179 [gaim-migrate @ 9238]
Mark Doliner <mark@kingant.net>
parents: 8481
diff changeset
803 away_mess_destroy(NULL, ca);
717
d7c39f12eb89 [gaim-migrate @ 727]
Todd Kulesza <fflewddur>
parents: 710
diff changeset
804 }
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
805
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
806 void create_away_mess(GtkWidget *widget, void *dummy)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
807 {
7949
b356e2a9d7fc [gaim-migrate @ 8623]
Mark Doliner <mark@kingant.net>
parents: 7942
diff changeset
808 GtkWidget *vbox, *hbox;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
809 GtkWidget *label;
7949
b356e2a9d7fc [gaim-migrate @ 8623]
Mark Doliner <mark@kingant.net>
parents: 7942
diff changeset
810 GtkWidget *sw;
441
995b0fc981a3 [gaim-migrate @ 451]
Rob Flynn <gaim@robflynn.com>
parents: 440
diff changeset
811 GtkWidget *button;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
812
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
813 struct create_away *ca = g_new0(struct create_away, 1);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
814
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
815 /* Set up window */
2725
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2681
diff changeset
816 GAIM_DIALOG(ca->window);
4635
42d53c416bb9 [gaim-migrate @ 4942]
Nathan Walp <nwalp@pidgin.im>
parents: 4630
diff changeset
817 gtk_widget_set_size_request(ca->window, -1, 250);
7949
b356e2a9d7fc [gaim-migrate @ 8623]
Mark Doliner <mark@kingant.net>
parents: 7942
diff changeset
818 gtk_container_set_border_width(GTK_CONTAINER(ca->window), 6);
4074
3ccbdf8e7f8d [gaim-migrate @ 4289]
Sean Egan <seanegan@gmail.com>
parents: 4061
diff changeset
819 gtk_window_set_role(GTK_WINDOW(ca->window), "away_mess");
4703
e4dda06a3143 [gaim-migrate @ 5014]
Sean Egan <seanegan@gmail.com>
parents: 4695
diff changeset
820 gtk_window_set_title(GTK_WINDOW(ca->window), _("New away message"));
5314
1f901484599d [gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents: 5294
diff changeset
821 g_signal_connect(G_OBJECT(ca->window), "delete_event",
8502
48112dfe1179 [gaim-migrate @ 9238]
Mark Doliner <mark@kingant.net>
parents: 8481
diff changeset
822 G_CALLBACK(away_mess_destroy_ca), ca);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
823
7949
b356e2a9d7fc [gaim-migrate @ 8623]
Mark Doliner <mark@kingant.net>
parents: 7942
diff changeset
824 /*
b356e2a9d7fc [gaim-migrate @ 8623]
Mark Doliner <mark@kingant.net>
parents: 7942
diff changeset
825 * This would be higgy... but I think it's pretty ugly --Mark
b356e2a9d7fc [gaim-migrate @ 8623]
Mark Doliner <mark@kingant.net>
parents: 7942
diff changeset
826 * If you want to use this, make sure you add the vbox to the hbox below
b356e2a9d7fc [gaim-migrate @ 8623]
Mark Doliner <mark@kingant.net>
parents: 7942
diff changeset
827 */
b356e2a9d7fc [gaim-migrate @ 8623]
Mark Doliner <mark@kingant.net>
parents: 7942
diff changeset
828 /*
b356e2a9d7fc [gaim-migrate @ 8623]
Mark Doliner <mark@kingant.net>
parents: 7942
diff changeset
829 hbox = gtk_hbox_new(FALSE, 12);
b356e2a9d7fc [gaim-migrate @ 8623]
Mark Doliner <mark@kingant.net>
parents: 7942
diff changeset
830 gtk_container_set_border_width(GTK_CONTAINER(hbox), 12);
b356e2a9d7fc [gaim-migrate @ 8623]
Mark Doliner <mark@kingant.net>
parents: 7942
diff changeset
831 gtk_container_add(GTK_CONTAINER(ca->window), hbox);
b356e2a9d7fc [gaim-migrate @ 8623]
Mark Doliner <mark@kingant.net>
parents: 7942
diff changeset
832 */
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
833
7949
b356e2a9d7fc [gaim-migrate @ 8623]
Mark Doliner <mark@kingant.net>
parents: 7942
diff changeset
834 vbox = gtk_vbox_new(FALSE, 12);
b356e2a9d7fc [gaim-migrate @ 8623]
Mark Doliner <mark@kingant.net>
parents: 7942
diff changeset
835 gtk_container_add(GTK_CONTAINER(ca->window), vbox);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
836
7949
b356e2a9d7fc [gaim-migrate @ 8623]
Mark Doliner <mark@kingant.net>
parents: 7942
diff changeset
837 /* Away message title */
b356e2a9d7fc [gaim-migrate @ 8623]
Mark Doliner <mark@kingant.net>
parents: 7942
diff changeset
838 hbox = gtk_hbox_new(FALSE, 0);
b356e2a9d7fc [gaim-migrate @ 8623]
Mark Doliner <mark@kingant.net>
parents: 7942
diff changeset
839 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
840
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
841 label = gtk_label_new(_("Away title: "));
7949
b356e2a9d7fc [gaim-migrate @ 8623]
Mark Doliner <mark@kingant.net>
parents: 7942
diff changeset
842 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1174
diff changeset
843
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
844 ca->entry = gtk_entry_new();
7949
b356e2a9d7fc [gaim-migrate @ 8623]
Mark Doliner <mark@kingant.net>
parents: 7942
diff changeset
845 gtk_box_pack_start(GTK_BOX(hbox), ca->entry, TRUE, TRUE, 0);
8137
4971193f761d [gaim-migrate @ 8842]
Mark Doliner <mark@kingant.net>
parents: 8061
diff changeset
846 gaim_set_accessible_label (ca->entry, label);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
847
8317
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
848 /* Toolbar */
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
849 ca->toolbar = gtk_imhtmltoolbar_new();
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
850 gtk_box_pack_start(GTK_BOX(vbox), ca->toolbar, FALSE, FALSE, 0);
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
851
7949
b356e2a9d7fc [gaim-migrate @ 8623]
Mark Doliner <mark@kingant.net>
parents: 7942
diff changeset
852 /* Away message text */
b356e2a9d7fc [gaim-migrate @ 8623]
Mark Doliner <mark@kingant.net>
parents: 7942
diff changeset
853 sw = gtk_scrolled_window_new(NULL, NULL);
b356e2a9d7fc [gaim-migrate @ 8623]
Mark Doliner <mark@kingant.net>
parents: 7942
diff changeset
854 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
b356e2a9d7fc [gaim-migrate @ 8623]
Mark Doliner <mark@kingant.net>
parents: 7942
diff changeset
855 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
b356e2a9d7fc [gaim-migrate @ 8623]
Mark Doliner <mark@kingant.net>
parents: 7942
diff changeset
856 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN);
b356e2a9d7fc [gaim-migrate @ 8623]
Mark Doliner <mark@kingant.net>
parents: 7942
diff changeset
857 gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0);
5024
8e55a4d362a3 [gaim-migrate @ 5361]
Sean Egan <seanegan@gmail.com>
parents: 4978
diff changeset
858
8317
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
859 ca->text = gtk_imhtml_new(NULL, NULL);
8319
a2c5537a814b [gaim-migrate @ 9043]
Christian Hammond <chipx86@chipx86.com>
parents: 8317
diff changeset
860 gtk_imhtml_set_editable(GTK_IMHTML(ca->text), TRUE);
8788
262f81346c0a [gaim-migrate @ 9550]
Mark Doliner <mark@kingant.net>
parents: 8697
diff changeset
861 gtk_imhtml_set_format_functions(GTK_IMHTML(ca->text), GTK_IMHTML_ALL ^ GTK_IMHTML_IMAGE);
5105
4cfc49e31c2e [gaim-migrate @ 5468]
Luke Schierer <lschiere@pidgin.im>
parents: 5092
diff changeset
862 gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(ca->text), GTK_WRAP_WORD_CHAR);
5024
8e55a4d362a3 [gaim-migrate @ 5361]
Sean Egan <seanegan@gmail.com>
parents: 4978
diff changeset
863
8481
6d0869404696 [gaim-migrate @ 9214]
Luke Schierer <lschiere@pidgin.im>
parents: 8319
diff changeset
864 gtk_imhtml_smiley_shortcuts(GTK_IMHTML(ca->text),
6d0869404696 [gaim-migrate @ 9214]
Luke Schierer <lschiere@pidgin.im>
parents: 8319
diff changeset
865 gaim_prefs_get_bool("/gaim/gtk/conversations/smiley_shortcuts"));
6d0869404696 [gaim-migrate @ 9214]
Luke Schierer <lschiere@pidgin.im>
parents: 8319
diff changeset
866 gtk_imhtml_html_shortcuts(GTK_IMHTML(ca->text),
6d0869404696 [gaim-migrate @ 9214]
Luke Schierer <lschiere@pidgin.im>
parents: 8319
diff changeset
867 gaim_prefs_get_bool("/gaim/gtk/conversations/html_shortcuts"));
7538
357eb1c39b72 [gaim-migrate @ 8151]
Christian Hammond <chipx86@chipx86.com>
parents: 7431
diff changeset
868 if (gaim_prefs_get_bool("/gaim/gtk/conversations/spellcheck"))
357eb1c39b72 [gaim-migrate @ 8151]
Christian Hammond <chipx86@chipx86.com>
parents: 7431
diff changeset
869 gaim_gtk_setup_gtkspell(GTK_TEXT_VIEW(ca->text));
8317
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
870 gtk_imhtmltoolbar_attach(GTK_IMHTMLTOOLBAR(ca->toolbar), ca->text);
8804
ef1e60f82be0 [gaim-migrate @ 9566]
Mark Doliner <mark@kingant.net>
parents: 8788
diff changeset
871 gtk_imhtmltoolbar_associate_smileys(GTK_IMHTMLTOOLBAR(ca->toolbar), "default");
ef1e60f82be0 [gaim-migrate @ 9566]
Mark Doliner <mark@kingant.net>
parents: 8788
diff changeset
872 gaim_setup_imhtml(ca->text);
7002
57ea8be4ff4a [gaim-migrate @ 7558]
Sean Egan <seanegan@gmail.com>
parents: 6982
diff changeset
873
7949
b356e2a9d7fc [gaim-migrate @ 8623]
Mark Doliner <mark@kingant.net>
parents: 7942
diff changeset
874 gtk_container_add(GTK_CONTAINER(sw), ca->text);
5024
8e55a4d362a3 [gaim-migrate @ 5361]
Sean Egan <seanegan@gmail.com>
parents: 4978
diff changeset
875
3374
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 3367
diff changeset
876 if (dummy) {
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 3367
diff changeset
877 struct away_message *amt;
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 3367
diff changeset
878 GtkTreeIter iter;
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 3367
diff changeset
879 GtkListStore *ls = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(dummy)));
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 3367
diff changeset
880 GtkTreeSelection *sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(dummy));
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 3367
diff changeset
881 GValue val = { 0, };
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 3367
diff changeset
882
3716
d7e83b4db191 [gaim-migrate @ 3849]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3671
diff changeset
883 if (! gtk_tree_selection_get_selected (sel, (GtkTreeModel**)&ls, &iter))
3374
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 3367
diff changeset
884 return;
3716
d7e83b4db191 [gaim-migrate @ 3849]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3671
diff changeset
885 gtk_tree_model_get_value (GTK_TREE_MODEL(ls), &iter, 1, &val);
3374
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 3367
diff changeset
886 amt = g_value_get_pointer (&val);
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 3367
diff changeset
887 gtk_entry_set_text(GTK_ENTRY(ca->entry), amt->name);
8317
6f549c1d0829 [gaim-migrate @ 9041]
Sean Egan <seanegan@gmail.com>
parents: 8302
diff changeset
888 gtk_imhtml_append_text_with_images(GTK_IMHTML(ca->text), amt->message, 0, NULL);
3374
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 3367
diff changeset
889 ca->mess = amt;
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 3367
diff changeset
890 }
832
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 825
diff changeset
891
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
892 hbox = gtk_hbox_new(FALSE, 5);
7949
b356e2a9d7fc [gaim-migrate @ 8623]
Mark Doliner <mark@kingant.net>
parents: 7942
diff changeset
893 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
5024
8e55a4d362a3 [gaim-migrate @ 5361]
Sean Egan <seanegan@gmail.com>
parents: 4978
diff changeset
894
8e55a4d362a3 [gaim-migrate @ 5361]
Sean Egan <seanegan@gmail.com>
parents: 4978
diff changeset
895 button = gaim_pixbuf_button_from_stock(_("Save"), GTK_STOCK_SAVE, GAIM_BUTTON_HORIZONTAL);
5314
1f901484599d [gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents: 5294
diff changeset
896 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(save_away_mess), ca);
4092
7edd02612086 [gaim-migrate @ 4307]
Luke Schierer <lschiere@pidgin.im>
parents: 4074
diff changeset
897 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
7edd02612086 [gaim-migrate @ 4307]
Luke Schierer <lschiere@pidgin.im>
parents: 4074
diff changeset
898
5024
8e55a4d362a3 [gaim-migrate @ 5361]
Sean Egan <seanegan@gmail.com>
parents: 4978
diff changeset
899 button = gaim_pixbuf_button_from_stock(_("Save & Use"), GTK_STOCK_OK, GAIM_BUTTON_HORIZONTAL);
5314
1f901484599d [gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents: 5294
diff changeset
900 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(su_away_mess), ca);
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
901 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
902
5024
8e55a4d362a3 [gaim-migrate @ 5361]
Sean Egan <seanegan@gmail.com>
parents: 4978
diff changeset
903 button = gaim_pixbuf_button_from_stock(_("Use"), GTK_STOCK_EXECUTE, GAIM_BUTTON_HORIZONTAL);
5314
1f901484599d [gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents: 5294
diff changeset
904 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(use_away_mess), ca);
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
905 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
906
5024
8e55a4d362a3 [gaim-migrate @ 5361]
Sean Egan <seanegan@gmail.com>
parents: 4978
diff changeset
907 button = gaim_pixbuf_button_from_stock(_("Cancel"), GTK_STOCK_CANCEL, GAIM_BUTTON_HORIZONTAL);
8502
48112dfe1179 [gaim-migrate @ 9238]
Mark Doliner <mark@kingant.net>
parents: 8481
diff changeset
908 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(away_mess_destroy), ca);
1213
1bdb08cc5d59 [gaim-migrate @ 1223]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1210
diff changeset
909 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2370
diff changeset
910
5024
8e55a4d362a3 [gaim-migrate @ 5361]
Sean Egan <seanegan@gmail.com>
parents: 4978
diff changeset
911 gtk_widget_show_all(ca->window);
8887
56339eb6dab1 [gaim-migrate @ 9656]
Mark Doliner <mark@kingant.net>
parents: 8804
diff changeset
912 gtk_widget_grab_focus(ca->text);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
913 }
555
66fe9f2c26ad [gaim-migrate @ 565]
Todd Kulesza <fflewddur>
parents: 550
diff changeset
914
6329
418cc72136d1 [gaim-migrate @ 6828]
Christian Hammond <chipx86@chipx86.com>
parents: 6328
diff changeset
915 static void
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7108
diff changeset
916 alias_chat_cb(GaimChat *chat, const char *new_alias)
5234
890b29f00b68 [gaim-migrate @ 5604]
Nathan Walp <nwalp@pidgin.im>
parents: 5228
diff changeset
917 {
6329
418cc72136d1 [gaim-migrate @ 6828]
Christian Hammond <chipx86@chipx86.com>
parents: 6328
diff changeset
918 gaim_blist_alias_chat(chat, new_alias);
418cc72136d1 [gaim-migrate @ 6828]
Christian Hammond <chipx86@chipx86.com>
parents: 6328
diff changeset
919 gaim_blist_save();
5234
890b29f00b68 [gaim-migrate @ 5604]
Nathan Walp <nwalp@pidgin.im>
parents: 5228
diff changeset
920 }
890b29f00b68 [gaim-migrate @ 5604]
Nathan Walp <nwalp@pidgin.im>
parents: 5228
diff changeset
921
6329
418cc72136d1 [gaim-migrate @ 6828]
Christian Hammond <chipx86@chipx86.com>
parents: 6328
diff changeset
922 void
7118
bf630f7dfdcd [gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents: 7108
diff changeset
923 alias_dialog_blist_chat(GaimChat *chat)
6329
418cc72136d1 [gaim-migrate @ 6828]
Christian Hammond <chipx86@chipx86.com>
parents: 6328
diff changeset
924 {
7843
9408c12b4a61 [gaim-migrate @ 8497]
Mark Doliner <mark@kingant.net>
parents: 7797
diff changeset
925 gaim_request_input(NULL, _("Alias Chat"), NULL,
9408c12b4a61 [gaim-migrate @ 8497]
Mark Doliner <mark@kingant.net>
parents: 7797
diff changeset
926 _("Enter an alias for this chat."),
8697
725413cc9fb9 [gaim-migrate @ 9450]
Mark Doliner <mark@kingant.net>
parents: 8677
diff changeset
927 chat->alias, FALSE, FALSE, NULL,
8302
462ead6fc1a0 [gaim-migrate @ 9026]
Christian Hammond <chipx86@chipx86.com>
parents: 8301
diff changeset
928 _("Alias"), G_CALLBACK(alias_chat_cb),
6329
418cc72136d1 [gaim-migrate @ 6828]
Christian Hammond <chipx86@chipx86.com>
parents: 6328
diff changeset
929 _("Cancel"), NULL, chat);
5234
890b29f00b68 [gaim-migrate @ 5604]
Nathan Walp <nwalp@pidgin.im>
parents: 5228
diff changeset
930 }
890b29f00b68 [gaim-migrate @ 5604]
Nathan Walp <nwalp@pidgin.im>
parents: 5228
diff changeset
931
6327
493eed80869c [gaim-migrate @ 6826]
Christian Hammond <chipx86@chipx86.com>
parents: 6322
diff changeset
932 static void
7245
747b9e00ef60 [gaim-migrate @ 7822]
Nathan Walp <nwalp@pidgin.im>
parents: 7125
diff changeset
933 alias_contact_cb(GaimContact *contact, const char *new_alias)
747b9e00ef60 [gaim-migrate @ 7822]
Nathan Walp <nwalp@pidgin.im>
parents: 7125
diff changeset
934 {
747b9e00ef60 [gaim-migrate @ 7822]
Nathan Walp <nwalp@pidgin.im>
parents: 7125
diff changeset
935 gaim_contact_set_alias(contact, new_alias);
747b9e00ef60 [gaim-migrate @ 7822]
Nathan Walp <nwalp@pidgin.im>
parents: 7125
diff changeset
936 gaim_blist_save();
747b9e00ef60 [gaim-migrate @ 7822]
Nathan Walp <nwalp@pidgin.im>
parents: 7125
diff changeset
937 }
747b9e00ef60 [gaim-migrate @ 7822]
Nathan Walp <nwalp@pidgin.im>
parents: 7125
diff changeset
938
747b9e00ef60 [gaim-migrate @ 7822]
Nathan Walp <nwalp@pidgin.im>
parents: 7125
diff changeset
939 void
747b9e00ef60 [gaim-migrate @ 7822]
Nathan Walp <nwalp@pidgin.im>
parents: 7125
diff changeset
940 alias_dialog_contact(GaimContact *contact)
747b9e00ef60 [gaim-migrate @ 7822]
Nathan Walp <nwalp@pidgin.im>
parents: 7125
diff changeset
941 {
7843
9408c12b4a61 [gaim-migrate @ 8497]
Mark Doliner <mark@kingant.net>
parents: 7797
diff changeset
942 gaim_request_input(NULL, _("Alias Contact"), NULL,
9408c12b4a61 [gaim-migrate @ 8497]
Mark Doliner <mark@kingant.net>
parents: 7797
diff changeset
943 _("Enter an alias for this contact."),
8697
725413cc9fb9 [gaim-migrate @ 9450]
Mark Doliner <mark@kingant.net>
parents: 8677
diff changeset
944 contact->alias, FALSE, FALSE, NULL,
8302
462ead6fc1a0 [gaim-migrate @ 9026]
Christian Hammond <chipx86@chipx86.com>
parents: 8301
diff changeset
945 _("Alias"), G_CALLBACK(alias_contact_cb),
7843
9408c12b4a61 [gaim-migrate @ 8497]
Mark Doliner <mark@kingant.net>
parents: 7797
diff changeset
946 _("Cancel"), NULL, contact);
7245
747b9e00ef60 [gaim-migrate @ 7822]
Nathan Walp <nwalp@pidgin.im>
parents: 7125
diff changeset
947 }
747b9e00ef60 [gaim-migrate @ 7822]
Nathan Walp <nwalp@pidgin.im>
parents: 7125
diff changeset
948
747b9e00ef60 [gaim-migrate @ 7822]
Nathan Walp <nwalp@pidgin.im>
parents: 7125
diff changeset
949 static void
7843
9408c12b4a61 [gaim-migrate @ 8497]
Mark Doliner <mark@kingant.net>
parents: 7797
diff changeset
950 alias_buddy_cb(GaimBuddy *buddy, const char *alias)
6327
493eed80869c [gaim-migrate @ 6826]
Christian Hammond <chipx86@chipx86.com>
parents: 6322
diff changeset
951 {
7843
9408c12b4a61 [gaim-migrate @ 8497]
Mark Doliner <mark@kingant.net>
parents: 7797
diff changeset
952 gaim_blist_alias_buddy(buddy, (alias != NULL && *alias != '\0') ? alias : NULL);
6327
493eed80869c [gaim-migrate @ 6826]
Christian Hammond <chipx86@chipx86.com>
parents: 6322
diff changeset
953 serv_alias_buddy(buddy);
493eed80869c [gaim-migrate @ 6826]
Christian Hammond <chipx86@chipx86.com>
parents: 6322
diff changeset
954 gaim_blist_save();
493eed80869c [gaim-migrate @ 6826]
Christian Hammond <chipx86@chipx86.com>
parents: 6322
diff changeset
955 }
493eed80869c [gaim-migrate @ 6826]
Christian Hammond <chipx86@chipx86.com>
parents: 6322
diff changeset
956
5050
dfec167391a5 [gaim-migrate @ 5398]
Christian Hammond <chipx86@chipx86.com>
parents: 5024
diff changeset
957 void
6695
0c5637b5462e [gaim-migrate @ 7221]
Nathan Walp <nwalp@pidgin.im>
parents: 6646
diff changeset
958 alias_dialog_bud(GaimBuddy *b)
1397
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
959 {
7843
9408c12b4a61 [gaim-migrate @ 8497]
Mark Doliner <mark@kingant.net>
parents: 7797
diff changeset
960 char *secondary = g_strdup_printf(_("Enter an alias for %s."), b->name);
6327
493eed80869c [gaim-migrate @ 6826]
Christian Hammond <chipx86@chipx86.com>
parents: 6322
diff changeset
961
7843
9408c12b4a61 [gaim-migrate @ 8497]
Mark Doliner <mark@kingant.net>
parents: 7797
diff changeset
962 gaim_request_input(NULL, _("Alias Buddy"), NULL,
8697
725413cc9fb9 [gaim-migrate @ 9450]
Mark Doliner <mark@kingant.net>
parents: 8677
diff changeset
963 secondary, b->alias, FALSE, FALSE, NULL,
8302
462ead6fc1a0 [gaim-migrate @ 9026]
Christian Hammond <chipx86@chipx86.com>
parents: 8301
diff changeset
964 _("Alias"), G_CALLBACK(alias_buddy_cb),
7843
9408c12b4a61 [gaim-migrate @ 8497]
Mark Doliner <mark@kingant.net>
parents: 7797
diff changeset
965 _("Cancel"), NULL, b);
6327
493eed80869c [gaim-migrate @ 6826]
Christian Hammond <chipx86@chipx86.com>
parents: 6322
diff changeset
966
7843
9408c12b4a61 [gaim-migrate @ 8497]
Mark Doliner <mark@kingant.net>
parents: 7797
diff changeset
967 g_free(secondary);
1397
d2799e0672ee [gaim-migrate @ 1407]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1396
diff changeset
968 }