comparison src/multi.c @ 5314:1f901484599d

[gaim-migrate @ 5686] GTK_OBJECT -> G_OBJECT Also fixed a few compiler warnings. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Tue, 06 May 2003 05:48:03 +0000
parents 890b29f00b68
children e03f07e1f7f4
comparison
equal deleted inserted replaced
5313:8d118c2b03c9 5314:1f901484599d
357 button = gtk_check_button_new_with_label(text); 357 button = gtk_check_button_new_with_label(text);
358 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), (ma->options & option)); 358 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), (ma->options & option));
359 gtk_box_pack_start(GTK_BOX(box), button, FALSE, FALSE, 0); 359 gtk_box_pack_start(GTK_BOX(box), button, FALSE, FALSE, 0);
360 mao->ma = ma; 360 mao->ma = ma;
361 mao->opt = option; 361 mao->opt = option;
362 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(mod_opt), mao); 362 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(mod_opt), mao);
363 g_signal_connect(GTK_OBJECT(button), "destroy", G_CALLBACK(free_mao), mao); 363 g_signal_connect(G_OBJECT(button), "destroy", G_CALLBACK(free_mao), mao);
364 gtk_widget_show(button); 364 gtk_widget_show(button);
365 return button; 365 return button;
366 } 366 }
367 367
368 static void process_login_opts(struct mod_account *ma) { 368 static void process_login_opts(struct mod_account *ma) {
570 if (e->info->name) 570 if (e->info->name)
571 opt = gtk_menu_item_new_with_label(e->info->name); 571 opt = gtk_menu_item_new_with_label(e->info->name);
572 else 572 else
573 opt = gtk_menu_item_new_with_label("Unknown"); 573 opt = gtk_menu_item_new_with_label("Unknown");
574 g_object_set_data(G_OBJECT(opt), "mod_account", ma); 574 g_object_set_data(G_OBJECT(opt), "mod_account", ma);
575 g_signal_connect(GTK_OBJECT(opt), "activate", 575 g_signal_connect(G_OBJECT(opt), "activate",
576 G_CALLBACK(set_prot), (void *)prpl_info->protocol); 576 G_CALLBACK(set_prot), (void *)prpl_info->protocol);
577 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt); 577 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt);
578 gtk_widget_show(opt); 578 gtk_widget_show(opt);
579 } 579 }
580 580
581 gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu), menu); 581 gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu), menu);
627 } else { 627 } else {
628 g_snprintf(buf, sizeof(buf), "%s" G_DIR_SEPARATOR_S, gaim_home_dir()); 628 g_snprintf(buf, sizeof(buf), "%s" G_DIR_SEPARATOR_S, gaim_home_dir());
629 } 629 }
630 gtk_file_selection_set_filename(GTK_FILE_SELECTION(dlg), buf); 630 gtk_file_selection_set_filename(GTK_FILE_SELECTION(dlg), buf);
631 631
632 g_signal_connect(GTK_OBJECT(dlg), "destroy", G_CALLBACK(des_icon_sel), ma); 632 g_signal_connect(G_OBJECT(dlg), "destroy",
633 g_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(dlg)->cancel_button), "clicked", 633 G_CALLBACK(des_icon_sel), ma);
634 G_CALLBACK(des_icon_sel), ma); 634 g_signal_connect(G_OBJECT(GTK_FILE_SELECTION(dlg)->cancel_button), "clicked",
635 g_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(dlg)->ok_button), "clicked", 635 G_CALLBACK(des_icon_sel), ma);
636 G_CALLBACK(set_icon), ma); 636 g_signal_connect(G_OBJECT(GTK_FILE_SELECTION(dlg)->ok_button), "clicked",
637 G_CALLBACK(set_icon), ma);
637 638
638 ma->icondlg = dlg; 639 ma->icondlg = dlg;
639 640
640 gtk_widget_show(dlg); 641 gtk_widget_show(dlg);
641 } 642 }
673 gtk_box_pack_start(GTK_BOX(hbox), name, TRUE, TRUE, 5); 674 gtk_box_pack_start(GTK_BOX(hbox), name, TRUE, TRUE, 5);
674 gtk_widget_show(name); 675 gtk_widget_show(name);
675 ma->iconentry = name; 676 ma->iconentry = name;
676 677
677 browse = gtk_button_new_with_label(_("Browse")); 678 browse = gtk_button_new_with_label(_("Browse"));
678 g_signal_connect(GTK_OBJECT(browse), "clicked", G_CALLBACK(sel_icon_dlg), ma); 679 g_signal_connect(G_OBJECT(browse), "clicked",
680 G_CALLBACK(sel_icon_dlg), ma);
679 gtk_box_pack_start(GTK_BOX(hbox), browse, FALSE, FALSE, 0); 681 gtk_box_pack_start(GTK_BOX(hbox), browse, FALSE, FALSE, 0);
680 gtk_widget_show(browse); 682 gtk_widget_show(browse);
681 683
682 reset = gtk_button_new_with_label(_("Reset")); 684 reset = gtk_button_new_with_label(_("Reset"));
683 g_signal_connect(GTK_OBJECT(reset), "clicked", G_CALLBACK(reset_icon), ma); 685 g_signal_connect(G_OBJECT(reset), "clicked",
686 G_CALLBACK(reset_icon), ma);
684 gtk_box_pack_start(GTK_BOX(hbox), reset, FALSE, FALSE, 0); 687 gtk_box_pack_start(GTK_BOX(hbox), reset, FALSE, FALSE, 0);
685 gtk_widget_show(reset); 688 gtk_widget_show(reset);
686 689
687 return hbox; 690 return hbox;
688 } 691 }
1202 ma->mod = gtk_window_new(GTK_WINDOW_TOPLEVEL); 1205 ma->mod = gtk_window_new(GTK_WINDOW_TOPLEVEL);
1203 gtk_window_set_role(GTK_WINDOW(ma->mod), "account"); 1206 gtk_window_set_role(GTK_WINDOW(ma->mod), "account");
1204 gtk_widget_realize(ma->mod); 1207 gtk_widget_realize(ma->mod);
1205 gtk_window_set_title(GTK_WINDOW(ma->mod), _("Modify Account")); 1208 gtk_window_set_title(GTK_WINDOW(ma->mod), _("Modify Account"));
1206 gtk_window_set_resizable(GTK_WINDOW(ma->mod), FALSE); /* nothing odd here :) */ 1209 gtk_window_set_resizable(GTK_WINDOW(ma->mod), FALSE); /* nothing odd here :) */
1207 g_signal_connect(GTK_OBJECT(ma->mod), "destroy", G_CALLBACK(delmod), ma); 1210 g_signal_connect(G_OBJECT(ma->mod), "destroy",
1211 G_CALLBACK(delmod), ma);
1208 1212
1209 vbox = gtk_vbox_new(FALSE, 6); 1213 vbox = gtk_vbox_new(FALSE, 6);
1210 gtk_container_set_border_width(GTK_CONTAINER(vbox), 6); 1214 gtk_container_set_border_width(GTK_CONTAINER(vbox), 6);
1211 gtk_container_add(GTK_CONTAINER(ma->mod), vbox); 1215 gtk_container_add(GTK_CONTAINER(ma->mod), vbox);
1212 gtk_widget_show(vbox); 1216 gtk_widget_show(vbox);
1237 button_sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); 1241 button_sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH);
1238 1242
1239 button = gtk_button_new_from_stock(GTK_STOCK_OK); 1243 button = gtk_button_new_from_stock(GTK_STOCK_OK);
1240 gtk_size_group_add_widget(button_sg, button); 1244 gtk_size_group_add_widget(button_sg, button);
1241 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); 1245 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
1242 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(ok_mod), ma); 1246 g_signal_connect(G_OBJECT(button), "clicked",
1247 G_CALLBACK(ok_mod), ma);
1243 1248
1244 button = gtk_button_new_from_stock(GTK_STOCK_CANCEL); 1249 button = gtk_button_new_from_stock(GTK_STOCK_CANCEL);
1245 gtk_size_group_add_widget(button_sg, button); 1250 gtk_size_group_add_widget(button_sg, button);
1246 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); 1251 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
1247 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(cancel_mod), ma); 1252 g_signal_connect(G_OBJECT(button), "clicked",
1253 G_CALLBACK(cancel_mod), ma);
1248 1254
1249 sep = gtk_hseparator_new(); 1255 sep = gtk_hseparator_new();
1250 gtk_box_pack_end (GTK_BOX (vbox), sep, FALSE, FALSE, 0); 1256 gtk_box_pack_end (GTK_BOX (vbox), sep, FALSE, FALSE, 0);
1251 gtk_widget_show(sep); 1257 gtk_widget_show(sep);
1252 1258
1529 gtk_window_set_title(GTK_WINDOW(acctedit), _("Account Editor")); 1535 gtk_window_set_title(GTK_WINDOW(acctedit), _("Account Editor"));
1530 gtk_window_set_role(GTK_WINDOW(acctedit), "accounteditor"); 1536 gtk_window_set_role(GTK_WINDOW(acctedit), "accounteditor");
1531 gtk_widget_realize(acctedit); 1537 gtk_widget_realize(acctedit);
1532 gtk_widget_set_size_request(acctedit, -1, 250); 1538 gtk_widget_set_size_request(acctedit, -1, 250);
1533 gtk_window_set_default_size(GTK_WINDOW(acctedit), 550, 250); 1539 gtk_window_set_default_size(GTK_WINDOW(acctedit), 550, 250);
1534 g_signal_connect(GTK_OBJECT(acctedit), "delete_event", G_CALLBACK(on_delete_acctedit), W); 1540 g_signal_connect(G_OBJECT(acctedit), "delete_event",
1541 G_CALLBACK(on_delete_acctedit), W);
1535 1542
1536 vbox = gtk_vbox_new(FALSE, 6); 1543 vbox = gtk_vbox_new(FALSE, 6);
1537 gtk_container_set_border_width(GTK_CONTAINER(vbox), 6); 1544 gtk_container_set_border_width(GTK_CONTAINER(vbox), 6);
1538 gtk_container_add(GTK_CONTAINER(acctedit), vbox); 1545 gtk_container_add(GTK_CONTAINER(acctedit), vbox);
1539 1546
1541 hbox = gtk_hbox_new(FALSE, 6); 1548 hbox = gtk_hbox_new(FALSE, 6);
1542 gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 6); 1549 gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 6);
1543 1550
1544 gtk_box_pack_start(GTK_BOX(hbox), sw, TRUE, TRUE, 0); 1551 gtk_box_pack_start(GTK_BOX(hbox), sw, TRUE, TRUE, 0);
1545 1552
1546 #if 0
1547 vbox2 = gtk_vbox_new(TRUE, 5);
1548 gtk_box_pack_start(GTK_BOX(hbox), vbox2, FALSE, FALSE, 0);
1549
1550 button = gtk_button_new_from_stock(GTK_STOCK_REFRESH);
1551 gtk_button_set_use_stock(GTK_BUTTON(button), FALSE);
1552 gtk_button_set_label(GTK_BUTTON(button), "Select All");
1553 // button = picture_button2(acctedit, _("Select All"), tb_refresh_xpm, 2);
1554 gtk_box_pack_start(GTK_BOX(vbox2), button, TRUE, TRUE, 0);
1555 g_signal_connect_swapped(GTK_OBJECT(button), "clicked",
1556 G_CALLBACK(gtk_clist_select_all), GTK_OBJECT(list));
1557
1558 button = gtk_button_new_from_stock(GTK_STOCK_REDO);
1559 gtk_button_set_use_stock(GTK_BUTTON(button), FALSE);
1560 // gtk_button_set_label(button, "Select Autos");
1561 // button = picture_button2(acctedit, _("Select Autos"), tb_redo_xpm, 2);
1562 gtk_box_pack_start(GTK_BOX(vbox2), button, TRUE, TRUE, 0);
1563 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(sel_auto), NULL);
1564
1565 button = gtk_button_new_from_stock(GTK_STOCK_UNDO);
1566 gtk_button_set_use_stock(GTK_BUTTON(button), FALSE);
1567 gtk_button_set_label(GTK_BUTTON(button), "Select None");
1568 // button = picture_button2(acctedit, _("Select None"), tb_undo_xpm, 2);
1569 gtk_box_pack_start(GTK_BOX(vbox2), button, TRUE, TRUE, 0);
1570 g_signal_connect_swapped(GTK_OBJECT(button), "clicked",
1571 G_CALLBACK(gtk_clist_unselect_all), GTK_OBJECT(list));
1572
1573 #endif
1574
1575 sep = gtk_hseparator_new(); 1553 sep = gtk_hseparator_new();
1576 gtk_box_pack_start(GTK_BOX(vbox), sep, FALSE, FALSE, 0); 1554 gtk_box_pack_start(GTK_BOX(vbox), sep, FALSE, FALSE, 0);
1577 1555
1578 hbox = gtk_hbox_new(FALSE, 6); 1556 hbox = gtk_hbox_new(FALSE, 6);
1579 gtk_container_set_border_width (GTK_CONTAINER (hbox), 6); 1557 gtk_container_set_border_width (GTK_CONTAINER (hbox), 6);
1582 sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); 1560 sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH);
1583 1561
1584 button = gtk_button_new_from_stock(GTK_STOCK_CLOSE); 1562 button = gtk_button_new_from_stock(GTK_STOCK_CLOSE);
1585 gtk_size_group_add_widget(sg, button); 1563 gtk_size_group_add_widget(sg, button);
1586 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); 1564 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
1587 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(on_close_acctedit), W); 1565 g_signal_connect(G_OBJECT(button), "clicked",
1566 G_CALLBACK(on_close_acctedit), W);
1588 1567
1589 button = gtk_button_new_from_stock(GTK_STOCK_DELETE); 1568 button = gtk_button_new_from_stock(GTK_STOCK_DELETE);
1590 gtk_size_group_add_widget(sg, button); 1569 gtk_size_group_add_widget(sg, button);
1591 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); 1570 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
1592 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(del_acct), NULL); 1571 g_signal_connect(G_OBJECT(button), "clicked",
1572 G_CALLBACK(del_acct), NULL);
1593 1573
1594 button = gaim_pixbuf_button_from_stock(_("_Modify"), GTK_STOCK_PREFERENCES, 1574 button = gaim_pixbuf_button_from_stock(_("_Modify"), GTK_STOCK_PREFERENCES,
1595 GAIM_BUTTON_HORIZONTAL); 1575 GAIM_BUTTON_HORIZONTAL);
1596 gtk_size_group_add_widget(sg, button); 1576 gtk_size_group_add_widget(sg, button);
1597 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); 1577 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
1598 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(mod_acct), NULL); 1578 g_signal_connect(G_OBJECT(button), "clicked",
1579 G_CALLBACK(mod_acct), NULL);
1599 1580
1600 button = gtk_button_new_from_stock(GTK_STOCK_ADD); 1581 button = gtk_button_new_from_stock(GTK_STOCK_ADD);
1601 gtk_size_group_add_widget(sg, button); 1582 gtk_size_group_add_widget(sg, button);
1602 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); 1583 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
1603 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(add_acct), NULL); 1584 g_signal_connect(G_OBJECT(button), "clicked",
1585 G_CALLBACK(add_acct), NULL);
1604 1586
1605 gtk_widget_show_all(acctedit); 1587 gtk_widget_show_all(acctedit);
1606 } 1588 }
1607 1589
1608 struct signon_meter { 1590 struct signon_meter {
1884 gtk_widget_set_size_request(meter->status, 250, -1); 1866 gtk_widget_set_size_request(meter->status, 250, -1);
1885 1867
1886 meter->progress = gtk_progress_bar_new (); 1868 meter->progress = gtk_progress_bar_new ();
1887 1869
1888 meter->button = gaim_pixbuf_button_from_stock (_("Cancel"), GTK_STOCK_CANCEL, GAIM_BUTTON_HORIZONTAL); 1870 meter->button = gaim_pixbuf_button_from_stock (_("Cancel"), GTK_STOCK_CANCEL, GAIM_BUTTON_HORIZONTAL);
1889 g_signal_connect (GTK_OBJECT (meter->button), "clicked", G_CALLBACK (cancel_signon), meter); 1871 g_signal_connect(G_OBJECT (meter->button), "clicked",
1872 G_CALLBACK (cancel_signon), meter);
1890 1873
1891 gtk_table_attach (GTK_TABLE (table), graphic, 0, 1, *rows, *rows+1, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); 1874 gtk_table_attach (GTK_TABLE (table), graphic, 0, 1, *rows, *rows+1, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0);
1892 gtk_table_attach (GTK_TABLE (table), nest_vbox, 1, 2, *rows, *rows+1, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); 1875 gtk_table_attach (GTK_TABLE (table), nest_vbox, 1, 2, *rows, *rows+1, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0);
1893 gtk_box_pack_start (GTK_BOX (nest_vbox), GTK_WIDGET (label), FALSE, FALSE, 0); 1876 gtk_box_pack_start (GTK_BOX (nest_vbox), GTK_WIDGET (label), FALSE, FALSE, 0);
1894 gtk_box_pack_start (GTK_BOX (nest_vbox), GTK_WIDGET (meter->status), FALSE, FALSE, 0); 1877 gtk_box_pack_start (GTK_BOX (nest_vbox), GTK_WIDGET (meter->status), FALSE, FALSE, 0);
1944 gtk_container_set_border_width (GTK_CONTAINER (meter_win->table), 5); 1927 gtk_container_set_border_width (GTK_CONTAINER (meter_win->table), 5);
1945 gtk_table_set_row_spacings (GTK_TABLE (meter_win->table), 5); 1928 gtk_table_set_row_spacings (GTK_TABLE (meter_win->table), 5);
1946 gtk_table_set_col_spacings (GTK_TABLE (meter_win->table), 10); 1929 gtk_table_set_col_spacings (GTK_TABLE (meter_win->table), 10);
1947 1930
1948 cancel_button = gaim_pixbuf_button_from_stock (_("Cancel All"), GTK_STOCK_QUIT, GAIM_BUTTON_HORIZONTAL); 1931 cancel_button = gaim_pixbuf_button_from_stock (_("Cancel All"), GTK_STOCK_QUIT, GAIM_BUTTON_HORIZONTAL);
1949 g_signal_connect_swapped (GTK_OBJECT (cancel_button), "clicked", G_CALLBACK (loop_cancel), NULL); 1932 g_signal_connect_swapped(G_OBJECT(cancel_button), "clicked",
1950 gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (cancel_button), FALSE, FALSE, 0); 1933 G_CALLBACK (loop_cancel), NULL);
1934 gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(cancel_button), FALSE, FALSE, 0);
1951 1935
1952 g_signal_connect (GTK_OBJECT (meter_win->window), "delete_event", G_CALLBACK (meter_destroy), NULL); 1936 g_signal_connect(G_OBJECT(meter_win->window), "delete_event",
1937 G_CALLBACK(meter_destroy), NULL);
1953 } 1938 }
1954 1939
1955 if (!meter) { 1940 if (!meter) {
1956 meter = register_meter(gc, GTK_WIDGET (meter_win->window), GTK_TABLE (meter_win->table), (gint *) &meter_win->rows); 1941 meter = register_meter(gc, GTK_WIDGET (meter_win->window), GTK_TABLE (meter_win->table), (gint *) &meter_win->rows);
1957 meter->gc = gc; 1942 meter->gc = gc;
2003 gtk_widget_destroy(k->dlg); 1988 gtk_widget_destroy(k->dlg);
2004 k = g_new0(struct kick_dlg, 1); 1989 k = g_new0(struct kick_dlg, 1);
2005 k->account = gc->account; 1990 k->account = gc->account;
2006 k->dlg = do_error_dialog(title, buf, GAIM_ERROR); 1991 k->dlg = do_error_dialog(title, buf, GAIM_ERROR);
2007 kicks = g_slist_append(kicks, k); 1992 kicks = g_slist_append(kicks, k);
2008 g_signal_connect(GTK_OBJECT(k->dlg), "destroy", G_CALLBACK(set_kick_null), k); 1993 g_signal_connect(G_OBJECT(k->dlg), "destroy",
1994 G_CALLBACK(set_kick_null), k);
2009 if (meter) { 1995 if (meter) {
2010 kill_meter(meter); 1996 kill_meter(meter);
2011 meters = g_slist_remove(meters, meter); 1997 meters = g_slist_remove(meters, meter);
2012 g_free(meter); 1998 g_free(meter);
2013 } 1999 }