comparison src/prpl.c @ 5024:8e55a4d362a3

[gaim-migrate @ 5361] Patch by Rob McQueen, NEWS and CREDITS updates. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Sat, 05 Apr 2003 05:01:47 +0000
parents 54cd43869333
children ab2ae9dc9370
comparison
equal deleted inserted replaced
5023:e218d2d2b7e9 5024:8e55a4d362a3
30 30
31 #ifdef _WIN32 31 #ifdef _WIN32
32 #include "win32dep.h" 32 #include "win32dep.h"
33 #endif 33 #endif
34 34
35 #include "pixmaps/ok.xpm"
36 #include "pixmaps/cancel.xpm"
37 #include "pixmaps/tb_forward.xpm"
38
39 GSList *protocols = NULL; 35 GSList *protocols = NULL;
40 36
41 GtkWidget *protomenu = NULL; 37 GtkWidget *protomenu = NULL;
42 int prpl_accounts[PROTO_UNTAKEN]; 38 int prpl_accounts[PROTO_UNTAKEN];
43 39
204 { 200 {
205 GtkWidget *window; 201 GtkWidget *window;
206 GtkWidget *hbox; 202 GtkWidget *hbox;
207 GtkWidget *label; 203 GtkWidget *label;
208 char labeltext[1024 * 2]; 204 char labeltext[1024 * 2];
209 char *filename = g_build_filename(DATADIR, "pixmaps", "gaim", "dialogs", "gaim_question.png", NULL); 205 GtkWidget *img = gtk_image_new_from_stock(GAIM_STOCK_DIALOG_QUESTION, GTK_ICON_SIZE_DIALOG);
210 GtkWidget *img = gtk_image_new_from_file(filename);
211 struct doaskstruct *doask = g_new0(struct doaskstruct, 1); 206 struct doaskstruct *doask = g_new0(struct doaskstruct, 1);
212 207
213 g_free(filename);
214 gtk_misc_set_alignment(GTK_MISC(img), 0, 0); 208 gtk_misc_set_alignment(GTK_MISC(img), 0, 0);
215 209
216 /* This is ugly. GTK Stock items will take a button with a label "gtk-cancel" and turn it into a 210 /* This is ugly. GTK Stock items will take a button with a label "gtk-cancel" and turn it into a
217 * Cancel button with a Cancel icon and whatnot. We want to avoid using anything gtk in the prpls 211 * Cancel button with a Cancel icon and whatnot. We want to avoid using anything gtk in the prpls
218 * so we replace "Cancel" with "gtk-cancel" right here. */ 212 * so we replace "Cancel" with "gtk-cancel" right here. */
317 p->entry = entry; 311 p->entry = entry;
318 312
319 hbox = gtk_hbox_new(FALSE, 5); 313 hbox = gtk_hbox_new(FALSE, 5);
320 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); 314 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
321 315
322 button = picture_button(window, _("Accept"), ok_xpm); 316 button = gaim_pixbuf_button_from_stock(_("OK"), GTK_STOCK_OK, GAIM_BUTTON_HORIZONTAL);
323 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); 317 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
324 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(act_prompt), p); 318 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(act_prompt), p);
325 319
326 button = picture_button(window, _("Cancel"), cancel_xpm); 320 button = gaim_pixbuf_button_from_stock(_("Cancel"), GTK_STOCK_CANCEL, GAIM_BUTTON_HORIZONTAL);
327 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); 321 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
328 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(des_win), window); 322 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(des_win), window);
329 323
330 gtk_widget_show_all(window); 324 gtk_widget_show_all(window);
331 } 325 }
520 gtk_widget_realize(mn->email_win); 514 gtk_widget_realize(mn->email_win);
521 515
522 vbox = gtk_vbox_new(FALSE, 5); 516 vbox = gtk_vbox_new(FALSE, 5);
523 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); 517 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
524 gtk_container_add(GTK_CONTAINER(mn->email_win), vbox); 518 gtk_container_add(GTK_CONTAINER(mn->email_win), vbox);
525 gtk_widget_show(vbox);
526 519
527 mn->email_label = gtk_label_new(buf); 520 mn->email_label = gtk_label_new(buf);
528 gtk_label_set_text(GTK_LABEL(mn->email_label), buf); 521 gtk_label_set_text(GTK_LABEL(mn->email_label), buf);
529 gtk_label_set_line_wrap(GTK_LABEL(mn->email_label), TRUE); 522 gtk_label_set_line_wrap(GTK_LABEL(mn->email_label), TRUE);
530 gtk_box_pack_start(GTK_BOX(vbox), mn->email_label, FALSE, TRUE, 5); 523 gtk_box_pack_start(GTK_BOX(vbox), mn->email_label, FALSE, TRUE, 5);
531 gtk_widget_show(mn->email_label);
532 524
533 hbox = gtk_hbox_new(FALSE, 5); 525 hbox = gtk_hbox_new(FALSE, 5);
534 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); 526 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
535 gtk_widget_show(hbox);
536 527
537 if (url) { 528 if (url) {
538 mn->url = g_strdup(url); 529 mn->url = g_strdup(url);
539 urlbut = picture_button(mn->email_win, _("Open Mail"), tb_forward_xpm); 530 urlbut = gaim_pixbuf_button_from_stock(_("Open Mail"), GTK_STOCK_JUMP_TO, GAIM_BUTTON_HORIZONTAL);
540 gtk_box_pack_end(GTK_BOX(hbox), urlbut, 0, 0, 5); 531 gtk_box_pack_end(GTK_BOX(hbox), urlbut, 0, 0, 5);
541 g_signal_connect(GTK_OBJECT(urlbut), "clicked", G_CALLBACK(open_url), mn->url); 532 g_signal_connect(GTK_OBJECT(urlbut), "clicked", G_CALLBACK(open_url), mn->url);
542 g_signal_connect(GTK_OBJECT(urlbut), "clicked", G_CALLBACK(des_email_win), mn); 533 g_signal_connect(GTK_OBJECT(urlbut), "clicked", G_CALLBACK(des_email_win), mn);
543 } 534 }
544 535
545 close = picture_button(mn->email_win, _("Close"), cancel_xpm); 536 close = gaim_pixbuf_button_from_stock(_("Close"), GTK_STOCK_CLOSE, GAIM_BUTTON_HORIZONTAL);
546 gtk_window_set_focus(GTK_WINDOW(mn->email_win), close); 537 gtk_window_set_focus(GTK_WINDOW(mn->email_win), close);
547 gtk_box_pack_end(GTK_BOX(hbox), close, 0, 0, 5); 538 gtk_box_pack_end(GTK_BOX(hbox), close, 0, 0, 5);
548 g_signal_connect(GTK_OBJECT(close), "clicked", G_CALLBACK(des_email_win), mn); 539 g_signal_connect(GTK_OBJECT(close), "clicked", G_CALLBACK(des_email_win), mn);
549 540
550 gtk_widget_show(mn->email_win); 541 gtk_widget_show_all(mn->email_win);
551 } 542 }
552 543
553 struct icon_data { 544 struct icon_data {
554 struct gaim_connection *gc; 545 struct gaim_connection *gc;
555 char *who; 546 char *who;
825 g_signal_connect(GTK_OBJECT(regdlg), "destroy", G_CALLBACK(delete_regdlg), NULL); 816 g_signal_connect(GTK_OBJECT(regdlg), "destroy", G_CALLBACK(delete_regdlg), NULL);
826 817
827 vbox = gtk_vbox_new(FALSE, 5); 818 vbox = gtk_vbox_new(FALSE, 5);
828 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); 819 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
829 gtk_container_add(GTK_CONTAINER(regdlg), vbox); 820 gtk_container_add(GTK_CONTAINER(regdlg), vbox);
830 gtk_widget_show(vbox);
831 821
832 reg_list = gtk_hbox_new(FALSE, 5); 822 reg_list = gtk_hbox_new(FALSE, 5);
833 gtk_box_pack_start(GTK_BOX(vbox), reg_list, FALSE, FALSE, 5); 823 gtk_box_pack_start(GTK_BOX(vbox), reg_list, FALSE, FALSE, 5);
834 gtk_widget_show(reg_list);
835 824
836 frame = gtk_frame_new(_("Registration Information")); 825 frame = gtk_frame_new(_("Registration Information"));
837 gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 5); 826 gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 5);
838 gtk_widget_show(frame);
839 827
840 reg_area = gtk_hbox_new(FALSE, 5); 828 reg_area = gtk_hbox_new(FALSE, 5);
841 gtk_container_add(GTK_CONTAINER(frame), reg_area); 829 gtk_container_add(GTK_CONTAINER(frame), reg_area);
842 gtk_widget_show(reg_area);
843 830
844 hbox = gtk_hbox_new(FALSE, 5); 831 hbox = gtk_hbox_new(FALSE, 5);
845 gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); 832 gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 5);
846 gtk_widget_show(hbox); 833
847 834 close = gaim_pixbuf_button_from_stock(_("Close"), GTK_STOCK_CLOSE, GAIM_BUTTON_HORIZONTAL);
848 close = picture_button(regdlg, _("Close"), cancel_xpm);
849 gtk_box_pack_end(GTK_BOX(hbox), close, FALSE, FALSE, 5); 835 gtk_box_pack_end(GTK_BOX(hbox), close, FALSE, FALSE, 5);
850 g_signal_connect(GTK_OBJECT(close), "clicked", G_CALLBACK(delete_regdlg), NULL); 836 g_signal_connect(GTK_OBJECT(close), "clicked", G_CALLBACK(delete_regdlg), NULL);
851 gtk_widget_show(close); 837
852 838 reg_reg = gaim_pixbuf_button_from_stock(_("Register"), GTK_STOCK_JUMP_TO, GAIM_BUTTON_HORIZONTAL);
853 reg_reg = picture_button(regdlg, _("Register"), ok_xpm);
854 gtk_box_pack_end(GTK_BOX(hbox), reg_reg, FALSE, FALSE, 5); 839 gtk_box_pack_end(GTK_BOX(hbox), reg_reg, FALSE, FALSE, 5);
855 gtk_widget_show(reg_reg);
856 840
857 /* fuck me */ 841 /* fuck me */
858 reset_reg_dlg(); 842 reset_reg_dlg();
859 843
860 gtk_widget_show(regdlg); 844 gtk_widget_show_all(regdlg);
861 } 845 }
862 846
863 static gboolean delayed_unload(void *handle) { 847 static gboolean delayed_unload(void *handle) {
864 g_module_close(handle); 848 g_module_close(handle);
865 return FALSE; 849 return FALSE;