comparison src/away.c @ 4162:d3c8d2b40494

[gaim-migrate @ 4391] gtk_signal_connect() to g_signal_connect() Everything seems fine, and nothing should be broken. However, please let me know if anything strange happens. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Tue, 31 Dec 2002 19:32:38 +0000
parents 19ee0409a3d7
children 7002b6f16bdf
comparison
equal deleted inserted replaced
4161:c79961f48063 4162:d3c8d2b40494
188 gtk_window_set_role(GTK_WINDOW(imaway), "imaway"); 188 gtk_window_set_role(GTK_WINDOW(imaway), "imaway");
189 if (strlen(a->name)) 189 if (strlen(a->name))
190 gtk_window_set_title(GTK_WINDOW(imaway), a->name); 190 gtk_window_set_title(GTK_WINDOW(imaway), a->name);
191 else 191 else
192 gtk_window_set_title(GTK_WINDOW(imaway), _("Gaim - Away!")); 192 gtk_window_set_title(GTK_WINDOW(imaway), _("Gaim - Away!"));
193 gtk_signal_connect(GTK_OBJECT(imaway), "destroy", GTK_SIGNAL_FUNC(do_im_back), imaway); 193 g_signal_connect(G_OBJECT(imaway), "destroy",
194 G_CALLBACK(do_im_back), imaway);
194 gtk_widget_realize(imaway); 195 gtk_widget_realize(imaway);
195 196
196 vbox = gtk_vbox_new(FALSE, 5); 197 vbox = gtk_vbox_new(FALSE, 5);
197 gtk_container_add(GTK_CONTAINER(imaway), vbox); 198 gtk_container_add(GTK_CONTAINER(imaway), vbox);
198 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); 199 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
248 gtk_widget_show(awayqueue); 249 gtk_widget_show(awayqueue);
249 } 250 }
250 251
251 back = picture_button(imaway, _("I'm Back!"), join_xpm); 252 back = picture_button(imaway, _("I'm Back!"), join_xpm);
252 gtk_box_pack_start(GTK_BOX(vbox), back, FALSE, FALSE, 0); 253 gtk_box_pack_start(GTK_BOX(vbox), back, FALSE, FALSE, 0);
253 gtk_signal_connect(GTK_OBJECT(back), "clicked", GTK_SIGNAL_FUNC(do_im_back), imaway); 254 g_signal_connect(GTK_OBJECT(back), "clicked", G_CALLBACK(do_im_back), imaway);
254 gtk_window_set_focus(GTK_WINDOW(imaway), back); 255 gtk_window_set_focus(GTK_WINDOW(imaway), back);
255 256
256 awaymessage = a; 257 awaymessage = a;
257 258
258 #ifdef _WIN32 259 #ifdef _WIN32
334 gtk_list_clear_items(GTK_LIST(prefs_away_list), 0, -1); 335 gtk_list_clear_items(GTK_LIST(prefs_away_list), 0, -1);
335 while (awy) { 336 while (awy) {
336 a = (struct away_message *)awy->data; 337 a = (struct away_message *)awy->data;
337 list_item = gtk_list_item_new(); 338 list_item = gtk_list_item_new();
338 gtk_container_add(GTK_CONTAINER(prefs_away_list), list_item); 339 gtk_container_add(GTK_CONTAINER(prefs_away_list), list_item);
339 gtk_signal_connect(GTK_OBJECT(list_item), "select", 340 g_signal_connect(GTK_OBJECT(list_item), "select",
340 GTK_SIGNAL_FUNC(away_list_clicked), a); 341 G_CALLBACK(away_list_clicked), a);
341 gtk_object_set_user_data(GTK_OBJECT(list_item), a); 342 gtk_object_set_user_data(GTK_OBJECT(list_item), a);
342 gtk_widget_show(list_item); 343 gtk_widget_show(list_item);
343 344
344 hbox = gtk_hbox_new(FALSE, 5); 345 hbox = gtk_hbox_new(FALSE, 5);
345 gtk_container_add(GTK_CONTAINER(list_item), hbox); 346 gtk_container_add(GTK_CONTAINER(list_item), hbox);
367 remmenu = gtk_menu_new(); 368 remmenu = gtk_menu_new();
368 369
369 menuitem = gtk_menu_item_new_with_label(_("New Away Message")); 370 menuitem = gtk_menu_item_new_with_label(_("New Away Message"));
370 gtk_menu_append(GTK_MENU(awaymenu), menuitem); 371 gtk_menu_append(GTK_MENU(awaymenu), menuitem);
371 gtk_widget_show(menuitem); 372 gtk_widget_show(menuitem);
372 gtk_signal_connect(GTK_OBJECT(menuitem), "activate", GTK_SIGNAL_FUNC(create_away_mess), 373 g_signal_connect(GTK_OBJECT(menuitem), "activate", G_CALLBACK(create_away_mess),
373 NULL); 374 NULL);
374 375
375 awy = away_messages; 376 awy = away_messages;
376 while (awy) { 377 while (awy) {
377 a = (struct away_message *)awy->data; 378 a = (struct away_message *)awy->data;
378 379
379 remitem = gtk_menu_item_new_with_label(a->name); 380 remitem = gtk_menu_item_new_with_label(a->name);
380 gtk_menu_append(GTK_MENU(remmenu), remitem); 381 gtk_menu_append(GTK_MENU(remmenu), remitem);
381 gtk_widget_show(remitem); 382 gtk_widget_show(remitem);
382 gtk_signal_connect(GTK_OBJECT(remitem), "activate", 383 g_signal_connect(GTK_OBJECT(remitem), "activate",
383 GTK_SIGNAL_FUNC(rem_away_mess), a); 384 G_CALLBACK(rem_away_mess), a);
384 385
385 awy = g_slist_next(awy); 386 awy = g_slist_next(awy);
386 387
387 } 388 }
388 389
428 429
429 menuitem = gtk_menu_item_new_with_label(a->name); 430 menuitem = gtk_menu_item_new_with_label(a->name);
430 gtk_object_set_user_data(GTK_OBJECT(menuitem), a); 431 gtk_object_set_user_data(GTK_OBJECT(menuitem), a);
431 gtk_menu_append(GTK_MENU(awaymenu), menuitem); 432 gtk_menu_append(GTK_MENU(awaymenu), menuitem);
432 gtk_widget_show(menuitem); 433 gtk_widget_show(menuitem);
433 gtk_signal_connect(GTK_OBJECT(menuitem), "activate", 434 g_signal_connect(GTK_OBJECT(menuitem), "activate",
434 GTK_SIGNAL_FUNC(do_away_message), a); 435 G_CALLBACK(do_away_message), a);
435 436
436 awy = g_slist_next(awy); 437 awy = g_slist_next(awy);
437 } 438 }
438 } else 439 } else
439 while (msgs) { 440 while (msgs) {
443 gtk_object_set_user_data(GTK_OBJECT(menuitem), msgs->data); 444 gtk_object_set_user_data(GTK_OBJECT(menuitem), msgs->data);
444 gtk_menu_append(GTK_MENU(awaymenu), menuitem); 445 gtk_menu_append(GTK_MENU(awaymenu), menuitem);
445 gtk_widget_show(menuitem); 446 gtk_widget_show(menuitem);
446 447
447 if (strcmp(msgs->data, GAIM_AWAY_CUSTOM)) { 448 if (strcmp(msgs->data, GAIM_AWAY_CUSTOM)) {
448 gtk_signal_connect(GTK_OBJECT(menuitem), "activate", 449 g_signal_connect(GTK_OBJECT(menuitem), "activate",
449 GTK_SIGNAL_FUNC(set_gc_state), gc); 450 G_CALLBACK(set_gc_state), gc);
450 } else { 451 } else {
451 submenu = gtk_menu_new(); 452 submenu = gtk_menu_new();
452 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), 453 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem),
453 submenu); 454 submenu);
454 gtk_widget_show(submenu); 455 gtk_widget_show(submenu);
459 menuitem = gtk_menu_item_new_with_label(a->name); 460 menuitem = gtk_menu_item_new_with_label(a->name);
460 gtk_object_set_user_data(GTK_OBJECT(menuitem), 461 gtk_object_set_user_data(GTK_OBJECT(menuitem),
461 a); 462 a);
462 gtk_menu_append(GTK_MENU(submenu), menuitem); 463 gtk_menu_append(GTK_MENU(submenu), menuitem);
463 gtk_widget_show(menuitem); 464 gtk_widget_show(menuitem);
464 gtk_signal_connect(GTK_OBJECT(menuitem), 465 g_signal_connect(GTK_OBJECT(menuitem),
465 "activate", 466 "activate",
466 GTK_SIGNAL_FUNC 467 G_CALLBACK
467 (do_away_message), a); 468 (do_away_message), a);
468 469
469 awy = g_slist_next(awy); 470 awy = g_slist_next(awy);
470 } 471 }
471 } 472 }
499 if ((g_list_length(msgs) == 1) && 500 if ((g_list_length(msgs) == 1) &&
500 (!strcmp(msgs->data, GAIM_AWAY_CUSTOM))) { 501 (!strcmp(msgs->data, GAIM_AWAY_CUSTOM))) {
501 menuitem = gtk_menu_item_new_with_label(_("Back")); 502 menuitem = gtk_menu_item_new_with_label(_("Back"));
502 gtk_menu_append(GTK_MENU(submenu), menuitem); 503 gtk_menu_append(GTK_MENU(submenu), menuitem);
503 gtk_widget_show(menuitem); 504 gtk_widget_show(menuitem);
504 gtk_signal_connect(GTK_OBJECT(menuitem), "activate", 505 g_signal_connect(GTK_OBJECT(menuitem), "activate",
505 GTK_SIGNAL_FUNC(set_gc_away), gc); 506 G_CALLBACK(set_gc_away), gc);
506 507
507 sep = gtk_hseparator_new(); 508 sep = gtk_hseparator_new();
508 menuitem = gtk_menu_item_new(); 509 menuitem = gtk_menu_item_new();
509 gtk_menu_append(GTK_MENU(submenu), menuitem); 510 gtk_menu_append(GTK_MENU(submenu), menuitem);
510 gtk_container_add(GTK_CONTAINER(menuitem), sep); 511 gtk_container_add(GTK_CONTAINER(menuitem), sep);
519 520
520 menuitem = gtk_menu_item_new_with_label(a->name); 521 menuitem = gtk_menu_item_new_with_label(a->name);
521 gtk_object_set_user_data(GTK_OBJECT(menuitem), a); 522 gtk_object_set_user_data(GTK_OBJECT(menuitem), a);
522 gtk_menu_append(GTK_MENU(submenu), menuitem); 523 gtk_menu_append(GTK_MENU(submenu), menuitem);
523 gtk_widget_show(menuitem); 524 gtk_widget_show(menuitem);
524 gtk_signal_connect(GTK_OBJECT(menuitem), "activate", 525 g_signal_connect(GTK_OBJECT(menuitem), "activate",
525 GTK_SIGNAL_FUNC(set_gc_away), gc); 526 G_CALLBACK(set_gc_away), gc);
526 527
527 awy = g_slist_next(awy); 528 awy = g_slist_next(awy);
528 } 529 }
529 } else 530 } else
530 while (msgs) { 531 while (msgs) {
535 msgs->data); 536 msgs->data);
536 gtk_menu_append(GTK_MENU(submenu), menuitem); 537 gtk_menu_append(GTK_MENU(submenu), menuitem);
537 gtk_widget_show(menuitem); 538 gtk_widget_show(menuitem);
538 539
539 if (strcmp(msgs->data, GAIM_AWAY_CUSTOM)) { 540 if (strcmp(msgs->data, GAIM_AWAY_CUSTOM)) {
540 gtk_signal_connect(GTK_OBJECT(menuitem), 541 g_signal_connect(GTK_OBJECT(menuitem),
541 "activate", 542 "activate",
542 GTK_SIGNAL_FUNC(set_gc_state), 543 G_CALLBACK(set_gc_state),
543 gc); 544 gc);
544 } else { 545 } else {
545 submenu2 = gtk_menu_new(); 546 submenu2 = gtk_menu_new();
546 gtk_menu_item_set_submenu(GTK_MENU_ITEM 547 gtk_menu_item_set_submenu(GTK_MENU_ITEM
547 (menuitem), submenu2); 548 (menuitem), submenu2);
556 gtk_object_set_user_data(GTK_OBJECT 557 gtk_object_set_user_data(GTK_OBJECT
557 (menuitem), a); 558 (menuitem), a);
558 gtk_menu_append(GTK_MENU(submenu2), 559 gtk_menu_append(GTK_MENU(submenu2),
559 menuitem); 560 menuitem);
560 gtk_widget_show(menuitem); 561 gtk_widget_show(menuitem);
561 gtk_signal_connect(GTK_OBJECT(menuitem), 562 g_signal_connect(GTK_OBJECT(menuitem),
562 "activate", 563 "activate",
563 GTK_SIGNAL_FUNC 564 G_CALLBACK
564 (set_gc_away), gc); 565 (set_gc_away), gc);
565 566
566 awy = g_slist_next(awy); 567 awy = g_slist_next(awy);
567 } 568 }
568 } 569 }
589 590
590 menuitem = gtk_menu_item_new_with_label(a->name); 591 menuitem = gtk_menu_item_new_with_label(a->name);
591 gtk_object_set_user_data(GTK_OBJECT(menuitem), a); 592 gtk_object_set_user_data(GTK_OBJECT(menuitem), a);
592 gtk_menu_append(GTK_MENU(submenu), menuitem); 593 gtk_menu_append(GTK_MENU(submenu), menuitem);
593 gtk_widget_show(menuitem); 594 gtk_widget_show(menuitem);
594 gtk_signal_connect(GTK_OBJECT(menuitem), "activate", 595 g_signal_connect(GTK_OBJECT(menuitem), "activate",
595 GTK_SIGNAL_FUNC(do_away_message), a); 596 G_CALLBACK(do_away_message), a);
596 597
597 awy = g_slist_next(awy); 598 awy = g_slist_next(awy);
598 } 599 }
599 } 600 }
600 } 601 }