comparison src/gnome_applet_mgr.c @ 18:99d91a6c2fbf

[gaim-migrate @ 27] Yet another patch by Eric. Someone needs to stop this boy :) committer: Tailor Script <tailor@pidgin.im>
author Rob Flynn <gaim@robflynn.com>
date Thu, 23 Mar 2000 18:40:39 +0000
parents 5cdd1f11db02
children 2c150f36612b
comparison
equal deleted inserted replaced
17:e5cc6e691bff 18:99d91a6c2fbf
247 applet_widget_register_callback(APPLET_WIDGET(applet), 247 applet_widget_register_callback(APPLET_WIDGET(applet),
248 "signoff", 248 "signoff",
249 _("Signoff"), 249 _("Signoff"),
250 signoff, 250 signoff,
251 NULL); 251 NULL);
252 applet_widget_register_callback(APPLET_WIDGET(applet), 252 insert_applet_away();
253 "away",
254 _("Away Message"),
255 show_away_mess,
256 NULL);
257 applet_widget_register_callback(APPLET_WIDGET(applet), 253 applet_widget_register_callback(APPLET_WIDGET(applet),
258 "buddy", 254 "buddy",
259 _("Buddy List"), 255 _("Buddy List"),
260 (AppletCallbackFunc)make_buddy, 256 (AppletCallbackFunc)make_buddy,
261 NULL); 257 NULL);
258 }
259
260 void insert_applet_away() {
261 GList *awy = away_messages;
262 struct away_message *a;
263 char *awayname;
264
265 applet_widget_register_callback_dir(APPLET_WIDGET(applet),
266 "away",
267 _("Away"));
268 applet_widget_register_callback(APPLET_WIDGET(applet),
269 "away/new",
270 _("New Away Message"),
271 (AppletCallbackFunc)create_away_mess,
272 NULL);
273
274 while(awy) {
275 a = (struct away_message *)awy->data;
276
277 awayname = malloc(sizeof *awayname * (6 + strlen(a->name)));
278 awayname[0] = '\0';
279 strcat(awayname, "away/");
280 strcat(awayname, a->name);
281 applet_widget_register_callback(APPLET_WIDGET(applet),
282 awayname,
283 a->name,
284 (AppletCallbackFunc)do_away_message,
285 a);
286
287 awy = awy->next;
288 }
289 }
290
291 void remove_applet_away() {
292 GList *awy = away_messages;
293 struct away_message *a;
294 char *awayname;
295
296 applet_widget_unregister_callback(APPLET_WIDGET(applet), "away/new");
297
298 while (awy) {
299 a = (struct away_message *)awy->data;
300
301 awayname = malloc(sizeof *awayname * (5 + strlen(a->name)));
302 awayname[0] = '\0';
303 strcat(awayname, "away/");
304 strcat(awayname, a->name);
305 applet_widget_unregister_callback(APPLET_WIDGET(applet), awayname);
306
307 awy = awy->next;
308 }
309 applet_widget_unregister_callback_dir(APPLET_WIDGET(applet), "away");
310 applet_widget_unregister_callback(APPLET_WIDGET(applet), "away");
262 } 311 }
263 312
264 /*************************************************************** 313 /***************************************************************
265 ** 314 **
266 ** function applet_show_about 315 ** function applet_show_about
409 458
410 void closeAwayPopup(){ 459 void closeAwayPopup(){
411 applet_draw_open = FALSE; 460 applet_draw_open = FALSE;
412 } 461 }
413 462
414 /**************************************************
415 **
416 ** Dummy function to fix compiles for gnome
417 ** Feel free to implement an away message
418 **
419 ***************************************************/
420 void show_away_mess( AppletWidget *widget, gpointer data ) {
421 }
422
423 void AppletClicked( GtkWidget *sender, gpointer data ){ 463 void AppletClicked( GtkWidget *sender, gpointer data ){
424 464
425 if( applet_draw_open ){ 465 if( applet_draw_open ){
426 switch( MRI_user_status ){ 466 switch( MRI_user_status ){
427 case offline: 467 case offline: