pidgin/gtkft.c

branch
next.minor
changeset 29694
4efd5d82fef3
parent 29680
327d95375fbd
parent 29321
c089a3e0092e
child 29731
e50d65336613
child 29772
00ac6589c56a
equal deleted inserted replaced
29693:1f3d2781dc78 29694:4efd5d82fef3
712 { 712 {
713 PidginXferDialog *dialog; 713 PidginXferDialog *dialog;
714 GtkWidget *window; 714 GtkWidget *window;
715 GtkWidget *vbox1, *vbox2; 715 GtkWidget *vbox1, *vbox2;
716 GtkWidget *sw; 716 GtkWidget *sw;
717 GtkWidget *button;
718 GtkWidget *expander; 717 GtkWidget *expander;
719 GtkWidget *alignment; 718 GtkWidget *alignment;
720 GtkWidget *table; 719 GtkWidget *table;
721 GtkWidget *checkbox; 720 GtkWidget *checkbox;
721 GtkWidget *bbox;
722 722
723 dialog = g_new0(PidginXferDialog, 1); 723 dialog = g_new0(PidginXferDialog, 1);
724 dialog->keep_open = 724 dialog->keep_open =
725 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/filetransfer/keep_open"); 725 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/filetransfer/keep_open");
726 dialog->auto_clear = 726 dialog->auto_clear =
727 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/filetransfer/clear_finished"); 727 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/filetransfer/clear_finished");
728 728
729 /* Create the window. */ 729 /* Create the window. */
730 dialog->window = window = pidgin_create_dialog(_("File Transfers"), PIDGIN_HIG_BORDER, "file transfer", TRUE); 730 dialog->window = window = pidgin_create_window(_("File Transfers"), PIDGIN_HIG_BORDER, "file transfer", TRUE);
731 gtk_window_set_default_size(GTK_WINDOW(window), 450, 250); 731 gtk_window_set_default_size(GTK_WINDOW(window), 450, 250);
732 732
733 g_signal_connect(G_OBJECT(window), "delete_event", 733 g_signal_connect(G_OBJECT(window), "delete_event",
734 G_CALLBACK(delete_win_cb), dialog); 734 G_CALLBACK(delete_win_cb), dialog);
735 735
736 /* Create the parent vbox for everything. */ 736 /* Create the parent vbox for everything. */
737 vbox1 = pidgin_dialog_get_vbox_with_properties(GTK_DIALOG(window), FALSE, PIDGIN_HIG_BORDER); 737 vbox1 = gtk_vbox_new(FALSE, 0);
738 gtk_widget_show(vbox1);
739 gtk_container_add(GTK_CONTAINER(window), vbox1);
738 740
739 /* Create the main vbox for top half of the window. */ 741 /* Create the main vbox for top half of the window. */
740 vbox2 = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); 742 vbox2 = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
741 gtk_box_pack_start(GTK_BOX(vbox1), vbox2, TRUE, TRUE, 0); 743 gtk_box_pack_start(GTK_BOX(vbox1), vbox2, TRUE, TRUE, 0);
742 gtk_widget_show(vbox2); 744 gtk_widget_show(vbox2);
783 /* The table of information. */ 785 /* The table of information. */
784 table = make_info_table(dialog); 786 table = make_info_table(dialog);
785 gtk_container_add(GTK_CONTAINER(alignment), table); 787 gtk_container_add(GTK_CONTAINER(alignment), table);
786 gtk_widget_show(table); 788 gtk_widget_show(table);
787 789
790 bbox = gtk_hbutton_box_new();
791 gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END);
792 gtk_box_set_spacing(GTK_BOX(bbox), PIDGIN_HIG_BOX_SPACE);
793 gtk_box_pack_end(GTK_BOX(vbox1), bbox, FALSE, TRUE, 0);
794 gtk_widget_show(bbox);
795
796 #define ADD_BUTTON(b, label, callback, callbackdata) do { \
797 GtkWidget *button = gtk_button_new_from_stock(label); \
798 gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 0); \
799 g_signal_connect(G_OBJECT(button), "clicked", callback, callbackdata); \
800 gtk_widget_show(button); \
801 b = button; \
802 } while (0)
803
788 /* Open button */ 804 /* Open button */
789 button = pidgin_dialog_add_button(GTK_DIALOG(window), GTK_STOCK_OPEN, G_CALLBACK(open_button_cb), dialog); 805 ADD_BUTTON(dialog->open_button, GTK_STOCK_OPEN, G_CALLBACK(open_button_cb), dialog);
790 gtk_widget_set_sensitive(button, FALSE); 806 gtk_widget_set_sensitive(dialog->open_button, FALSE);
791 dialog->open_button = button;
792 807
793 /* Remove button */ 808 /* Remove button */
794 button = pidgin_dialog_add_button(GTK_DIALOG(window), GTK_STOCK_REMOVE, G_CALLBACK(remove_button_cb), dialog); 809 ADD_BUTTON(dialog->remove_button, GTK_STOCK_REMOVE, G_CALLBACK(remove_button_cb), dialog);
795 gtk_widget_hide(button); 810 gtk_widget_hide(dialog->remove_button);
796 dialog->remove_button = button;
797 811
798 /* Stop button */ 812 /* Stop button */
799 button = pidgin_dialog_add_button(GTK_DIALOG(window), GTK_STOCK_STOP, G_CALLBACK(stop_button_cb), dialog); 813 ADD_BUTTON(dialog->stop_button, GTK_STOCK_STOP, G_CALLBACK(stop_button_cb), dialog);
800 gtk_widget_set_sensitive(button, FALSE); 814 gtk_widget_set_sensitive(dialog->stop_button, FALSE);
801 dialog->stop_button = button;
802 815
803 /* Close button */ 816 /* Close button */
804 button = pidgin_dialog_add_button(GTK_DIALOG(window), GTK_STOCK_CLOSE, G_CALLBACK(close_button_cb), dialog); 817 ADD_BUTTON(dialog->close_button, GTK_STOCK_CLOSE, G_CALLBACK(close_button_cb), dialog);
805 dialog->close_button = button; 818
819 #undef ADD_BUTTON
806 820
807 #ifdef _WIN32 821 #ifdef _WIN32
808 g_signal_connect(G_OBJECT(dialog->window), "show", 822 g_signal_connect(G_OBJECT(dialog->window), "show",
809 G_CALLBACK(winpidgin_ensure_onscreen), dialog->window); 823 G_CALLBACK(winpidgin_ensure_onscreen), dialog->window);
810 #endif 824 #endif

mercurial