Mercurial > pidgin
comparison src/away.c @ 3472:d33ec392a5e1
[gaim-migrate @ 3523]
Rob McQueen went and removed all the GTK version preprocessor statements.
Thanks!
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Thu, 29 Aug 2002 21:40:08 +0000 |
parents | 8e924e4aa256 |
children | cfbdfe334975 |
comparison
equal
deleted
inserted
replaced
3471:7fb93ecd631c | 3472:d33ec392a5e1 |
---|---|
20 */ | 20 */ |
21 | 21 |
22 #ifdef HAVE_CONFIG_H | 22 #ifdef HAVE_CONFIG_H |
23 #include <config.h> | 23 #include <config.h> |
24 #endif | 24 #endif |
25 #ifdef USE_APPLET | |
26 #include <gnome.h> | |
27 #include <applet-widget.h> | |
28 #include "applet.h" | |
29 #endif /* USE_APPLET */ | |
30 #include <string.h> | 25 #include <string.h> |
31 #include <stdio.h> | 26 #include <stdio.h> |
32 #include <stdlib.h> | 27 #include <stdlib.h> |
33 #include <time.h> | 28 #include <time.h> |
34 | 29 |
121 } | 116 } |
122 } | 117 } |
123 g_free(name); | 118 g_free(name); |
124 gtk_clist_remove(GTK_CLIST(clist), row); | 119 gtk_clist_remove(GTK_CLIST(clist), row); |
125 | 120 |
126 #ifdef USE_APPLET | |
127 set_user_state(away); | |
128 #endif | |
129 | |
130 } | 121 } |
131 | 122 |
132 | 123 |
133 | 124 |
134 | 125 |
168 | 159 |
169 serv_set_away_all(NULL); | 160 serv_set_away_all(NULL); |
170 awaymessage = NULL; | 161 awaymessage = NULL; |
171 clistqueue = NULL; | 162 clistqueue = NULL; |
172 clistqueuesw = NULL; | 163 clistqueuesw = NULL; |
173 #ifdef USE_APPLET | |
174 applet_widget_unregister_callback(APPLET_WIDGET(applet), "away"); | |
175 set_user_state(online); | |
176 insert_applet_away(); | |
177 #endif /* USE_APPLET */ | |
178 } | 164 } |
179 | 165 |
180 | 166 |
181 void do_away_message(GtkWidget *w, struct away_message *a) | 167 void do_away_message(GtkWidget *w, struct away_message *a) |
182 { | 168 { |
258 destroy_im_away(); | 244 destroy_im_away(); |
259 do_away_message(w, a); | 245 do_away_message(w, a); |
260 return; | 246 return; |
261 } | 247 } |
262 | 248 |
263 #ifdef USE_APPLET | |
264 remove_applet_away(); | |
265 applet_widget_register_callback(APPLET_WIDGET(applet), | |
266 "away", _("Back"), (AppletCallbackFunc)do_im_back, NULL); | |
267 set_user_state(away); | |
268 #endif | |
269 | |
270 /* New away message... Clear out the old sent_aways */ | 249 /* New away message... Clear out the old sent_aways */ |
271 while (away_time_queue) { | 250 while (away_time_queue) { |
272 struct queued_away_response *qar = away_time_queue->data; | 251 struct queued_away_response *qar = away_time_queue->data; |
273 away_time_queue = g_slist_remove(away_time_queue, qar); | 252 away_time_queue = g_slist_remove(away_time_queue, qar); |
274 g_free(qar); | 253 g_free(qar); |
282 } | 261 } |
283 | 262 |
284 void rem_away_mess(GtkWidget *w, struct away_message *a) | 263 void rem_away_mess(GtkWidget *w, struct away_message *a) |
285 { | 264 { |
286 int default_index; | 265 int default_index; |
287 #ifdef USE_APPLET | |
288 char *awayname; | |
289 awayname = g_malloc(sizeof(*awayname) * (6 + strlen(a->name))); | |
290 awayname[0] = '\0'; | |
291 strcat(awayname, "away/"); | |
292 strcat(awayname, a->name); | |
293 applet_widget_unregister_callback(APPLET_WIDGET(applet), awayname); | |
294 g_free(awayname); | |
295 #endif | |
296 default_index = g_slist_index(away_messages, default_away); | 266 default_index = g_slist_index(away_messages, default_away); |
297 if (default_index == -1) { | 267 if (default_index == -1) { |
298 if (away_messages != NULL) | 268 if (away_messages != NULL) |
299 default_away = away_messages->data; | 269 default_away = away_messages->data; |
300 else | 270 else |
337 struct away_message *a; | 307 struct away_message *a; |
338 GSList *con = connections; | 308 GSList *con = connections; |
339 struct gaim_connection *gc = NULL; | 309 struct gaim_connection *gc = NULL; |
340 int count = 0; | 310 int count = 0; |
341 | 311 |
342 #ifdef USE_APPLET | |
343 remove_applet_away(); | |
344 if (imaway && applet) | |
345 applet_widget_register_callback(APPLET_WIDGET(applet), | |
346 "away", _("Back"), (AppletCallbackFunc)do_im_back, NULL); | |
347 else if (applet && !imaway) | |
348 insert_applet_away(); | |
349 #endif | |
350 | |
351 if (prefs_away_list != NULL) { | 312 if (prefs_away_list != NULL) { |
352 GtkWidget *hbox; | 313 GtkWidget *hbox; |
353 gtk_list_clear_items(GTK_LIST(prefs_away_list), 0, -1); | 314 gtk_list_clear_items(GTK_LIST(prefs_away_list), 0, -1); |
354 while (awy) { | 315 while (awy) { |
355 a = (struct away_message *)awy->data; | 316 a = (struct away_message *)awy->data; |