comparison src/buddy_chat.c @ 692:f4026275bc9f

[gaim-migrate @ 702] chat mods committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 16 Aug 2000 01:00:27 +0000
parents 71ea550c22ac
children 150214f1d48b
comparison
equal deleted inserted replaced
691:104a2659b358 692:f4026275bc9f
40 static GtkWidget *joinchat; 40 static GtkWidget *joinchat;
41 static GtkWidget *entry; 41 static GtkWidget *entry;
42 static GtkWidget *invite; 42 static GtkWidget *invite;
43 static GtkWidget *inviteentry; 43 static GtkWidget *inviteentry;
44 static GtkWidget *invitemess; 44 static GtkWidget *invitemess;
45 static int community;
45 extern int state_lock; 46 extern int state_lock;
46 47
47 static void destroy_join_chat() 48 static void destroy_join_chat()
48 { 49 {
49 if (joinchat) 50 if (joinchat)
66 char *group; 67 char *group;
67 68
68 group = gtk_entry_get_text(GTK_ENTRY(entry)); 69 group = gtk_entry_get_text(GTK_ENTRY(entry));
69 70
70 if (joinchat) { 71 if (joinchat) {
71 serv_join_chat(4, group); 72 serv_join_chat(community + 4, group);
72 gtk_widget_destroy(joinchat); 73 gtk_widget_destroy(joinchat);
73 } 74 }
74 joinchat=NULL; 75 joinchat=NULL;
75 } 76 }
76 77
82 GtkWidget *join; 83 GtkWidget *join;
83 GtkWidget *label; 84 GtkWidget *label;
84 GtkWidget *bbox; 85 GtkWidget *bbox;
85 GtkWidget *vbox; 86 GtkWidget *vbox;
86 GtkWidget *topbox; 87 GtkWidget *topbox;
87 GtkWidget *button_box;
88 GtkWidget *icon_i;
89 GdkBitmap *mask;
90 GdkPixmap *icon;
91 GtkWidget *frame; 88 GtkWidget *frame;
89 GtkWidget *opt;
90 GtkWidget *hbox;
92 91
93 if (!joinchat) { 92 if (!joinchat) {
94 joinchat = gtk_window_new(GTK_WINDOW_DIALOG); 93 joinchat = gtk_window_new(GTK_WINDOW_DIALOG);
95 gtk_widget_set_usize(joinchat, 300, 100); 94 gtk_widget_set_usize(joinchat, 300, 100);
96 gtk_window_set_policy(GTK_WINDOW(joinchat), FALSE, FALSE, TRUE); 95 gtk_window_set_policy(GTK_WINDOW(joinchat), FALSE, FALSE, TRUE);
97 gtk_widget_show(joinchat); 96 gtk_widget_show(joinchat);
98 bbox = gtk_hbox_new(TRUE, 10); 97 bbox = gtk_hbox_new(TRUE, 10);
99 topbox = gtk_hbox_new(FALSE, 5); 98 topbox = gtk_hbox_new(FALSE, 5);
100 vbox = gtk_vbox_new(FALSE, 5); 99 vbox = gtk_vbox_new(FALSE, 5);
101 entry = gtk_entry_new(); 100 entry = gtk_entry_new();
101 hbox = gtk_hbox_new(TRUE, 10);
102 102
103 frame = gtk_frame_new(_("Buddy Chat")); 103 frame = gtk_frame_new(_("Buddy Chat"));
104 /* Build Join Button */ 104
105 105 join = picture_button(joinchat, _("Join"), join_xpm);
106 join = gtk_button_new(); 106 cancel = picture_button(joinchat, _("Cancel"), cancel_xpm);
107 107
108 button_box = gtk_hbox_new(FALSE, 5); 108 gtk_box_pack_start(GTK_BOX(bbox), join, FALSE, FALSE, 5);
109 icon = gdk_pixmap_create_from_xpm_d (joinchat->window, &mask, NULL, join_xpm); 109 gtk_box_pack_end(GTK_BOX(bbox), cancel, FALSE, FALSE, 5);
110 icon_i = gtk_pixmap_new(icon, mask);
111
112 label = gtk_label_new(_("Join"));
113
114 gtk_box_pack_start(GTK_BOX(button_box), icon_i, FALSE, FALSE, 2);
115 gtk_box_pack_end(GTK_BOX(button_box), label, FALSE, FALSE, 2);
116
117 gtk_widget_show(label);
118 gtk_widget_show(icon_i);
119
120 gtk_widget_show(button_box);
121
122 gtk_container_add(GTK_CONTAINER(join), button_box);
123 gtk_widget_set_usize(join, 75, 30);
124
125 /* End of OK Button */
126
127 /* Build Cancel Button */
128
129 cancel = gtk_button_new();
130
131 button_box = gtk_hbox_new(FALSE, 5);
132 icon = gdk_pixmap_create_from_xpm_d ( joinchat->window, &mask, NULL, cancel_xpm);
133 icon_i = gtk_pixmap_new(icon, mask);
134
135 label = gtk_label_new(_("Cancel"));
136
137 gtk_box_pack_start(GTK_BOX(button_box), icon_i, FALSE, FALSE, 2);
138 gtk_box_pack_end(GTK_BOX(button_box), label, FALSE, FALSE, 2);
139
140 gtk_widget_show(label);
141 gtk_widget_show(icon_i);
142
143 gtk_widget_show(button_box);
144
145 gtk_container_add(GTK_CONTAINER(cancel), button_box);
146
147 gtk_widget_set_usize(cancel, 75, 30);
148
149 /* End of Cancel Button */
150
151 if (display_options & OPT_DISP_COOL_LOOK)
152 {
153 gtk_button_set_relief(GTK_BUTTON(join), GTK_RELIEF_NONE);
154 gtk_button_set_relief(GTK_BUTTON(cancel), GTK_RELIEF_NONE);
155 }
156
157 gtk_box_pack_start(GTK_BOX(bbox), join, FALSE, FALSE, 5);
158 gtk_box_pack_end(GTK_BOX(bbox), cancel, FALSE, FALSE, 5);
159 110
160 label = gtk_label_new(_("Join what group:")); 111 label = gtk_label_new(_("Join what group:"));
161 gtk_widget_show(label); 112 gtk_widget_show(label);
162 gtk_box_pack_start(GTK_BOX(topbox), label, FALSE, FALSE, 5); 113 gtk_box_pack_start(GTK_BOX(topbox), label, FALSE, FALSE, 5);
163 gtk_box_pack_start(GTK_BOX(topbox), entry, FALSE, FALSE, 5); 114 gtk_box_pack_start(GTK_BOX(topbox), entry, FALSE, FALSE, 5);
164 115
116 opt = gtk_radio_button_new_with_label(NULL,
117 _("AIM Private Chats"));
118 gtk_box_pack_start(GTK_BOX(hbox), opt, FALSE, FALSE, 0);
119 community = 0;
120 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(opt), TRUE);
121 gtk_signal_connect(GTK_OBJECT(opt), "clicked", set_option, &community);
122 gtk_widget_show(opt);
123
124 opt = gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(opt)),
125 _("AOL Community Chats"));
126 gtk_box_pack_start(GTK_BOX(hbox), opt, FALSE, FALSE, 0);
127 gtk_widget_show(opt);
128
165 /* And the boxes in the box */ 129 /* And the boxes in the box */
166 gtk_box_pack_start(GTK_BOX(vbox), topbox, TRUE, TRUE, 5); 130 gtk_box_pack_start(GTK_BOX(vbox), topbox, TRUE, TRUE, 5);
131 gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 5);
167 gtk_box_pack_start(GTK_BOX(vbox), bbox, TRUE, TRUE, 5); 132 gtk_box_pack_start(GTK_BOX(vbox), bbox, TRUE, TRUE, 5);
168 133
169 /* Handle closes right */ 134 /* Handle closes right */
170 gtk_signal_connect(GTK_OBJECT(joinchat), "delete_event", 135 gtk_signal_connect(GTK_OBJECT(joinchat), "delete_event",
171 GTK_SIGNAL_FUNC(destroy_join_chat), joinchat); 136 GTK_SIGNAL_FUNC(destroy_join_chat), joinchat);
179 /* Finish up */ 144 /* Finish up */
180 gtk_widget_show(join); 145 gtk_widget_show(join);
181 gtk_widget_show(cancel); 146 gtk_widget_show(cancel);
182 gtk_widget_show(entry); 147 gtk_widget_show(entry);
183 gtk_widget_show(topbox); 148 gtk_widget_show(topbox);
149 gtk_widget_show(hbox);
184 gtk_widget_show(bbox); 150 gtk_widget_show(bbox);
185 gtk_widget_show(vbox); 151 gtk_widget_show(vbox);
186 gtk_widget_show(frame); 152 gtk_widget_show(frame);
187 gtk_container_add(GTK_CONTAINER(frame), vbox); 153 gtk_container_add(GTK_CONTAINER(frame), vbox);
188 gtk_window_set_title(GTK_WINDOW(joinchat), _("Join Chat")); 154 gtk_window_set_title(GTK_WINDOW(joinchat), _("Join Chat"));