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