Mercurial > pidgin
comparison src/html.c @ 350:fd3cc0a28d5d
[gaim-migrate @ 360]
Some locale stuff
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Wed, 07 Jun 2000 18:33:21 +0000 |
parents | b402a23f35df |
children | 104a2659b358 |
comparison
equal
deleted
inserted
replaced
349:b402a23f35df | 350:fd3cc0a28d5d |
---|---|
114 int startsaving = 0; | 114 int startsaving = 0; |
115 GtkWidget *pw = NULL, *pbar = NULL, *label; | 115 GtkWidget *pw = NULL, *pbar = NULL, *label; |
116 | 116 |
117 website = parse_url(url); | 117 website = parse_url(url); |
118 | 118 |
119 /* | |
120 host = gethostbyname(website.address); | |
121 if (!host) { return g_strdup("g001: Error resolving host\n"); } | |
122 | |
123 if ((sock = connect_address(inet_addr(host->h_addr), website.port)) <= -1) | |
124 return g_strdup("g003: Error opening connection.\n"); | |
125 */ | |
126 host = (struct in_addr *)get_address(website.address); | 119 host = (struct in_addr *)get_address(website.address); |
127 if (!host) { return g_strdup("g001: Error resolving host\n"); } | 120 if (!host) { return g_strdup(_("g001: Error resolving host\n")); } |
128 if ((sock = connect_address(host->s_addr, website.port)) < 0) | 121 if ((sock = connect_address(host->s_addr, website.port)) < 0) |
129 return g_strdup("g003: Error opening connection.\n"); | 122 return g_strdup(_("g003: Error opening connection.\n")); |
130 | 123 |
131 g_snprintf(buf, sizeof(buf), "GET /%s HTTP/1.0\n\n", website.page); | 124 g_snprintf(buf, sizeof(buf), "GET /%s HTTP/1.0\n\n", website.page); |
132 g_snprintf(debug_buff, sizeof(debug_buff), "Request: %s\n", buf); | 125 g_snprintf(debug_buff, sizeof(debug_buff), "Request: %s\n", buf); |
133 debug_print(debug_buff); | 126 debug_print(debug_buff); |
134 write(sock, buf, strlen(buf)); | 127 write(sock, buf, strlen(buf)); |
156 char *cs = strstr(webdata, "Content-Length"); | 149 char *cs = strstr(webdata, "Content-Length"); |
157 if (cs) { | 150 if (cs) { |
158 char tmpbuf[1024]; | 151 char tmpbuf[1024]; |
159 sscanf(cs, "Content-Length: %d", &datalen); | 152 sscanf(cs, "Content-Length: %d", &datalen); |
160 | 153 |
161 g_snprintf(tmpbuf, 1024, "Getting %d bytes from %s", datalen, url); | 154 g_snprintf(tmpbuf, 1024, _("Getting %d bytes from %s"), datalen, url); |
162 pw = gtk_dialog_new(); | 155 pw = gtk_dialog_new(); |
163 | 156 |
164 label = gtk_label_new(tmpbuf); | 157 label = gtk_label_new(tmpbuf); |
165 gtk_widget_show(label); | 158 gtk_widget_show(label); |
166 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(pw)->vbox), | 159 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(pw)->vbox), |
169 pbar = gtk_progress_bar_new(); | 162 pbar = gtk_progress_bar_new(); |
170 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(pw)->action_area), | 163 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(pw)->action_area), |
171 pbar, FALSE, FALSE, 5); | 164 pbar, FALSE, FALSE, 5); |
172 gtk_widget_show(pbar); | 165 gtk_widget_show(pbar); |
173 | 166 |
174 gtk_window_set_title(GTK_WINDOW(pw), "Getting Data"); | 167 gtk_window_set_title(GTK_WINDOW(pw), _("Getting Data")); |
175 | 168 |
176 gtk_widget_realize(pw); | 169 gtk_widget_realize(pw); |
177 aol_icon(pw->window); | 170 aol_icon(pw->window); |
178 | 171 |
179 gtk_widget_show(pw); | 172 gtk_widget_show(pw); |
202 | 195 |
203 webdata = g_realloc(webdata, len+1); | 196 webdata = g_realloc(webdata, len+1); |
204 webdata[len] = 0; | 197 webdata[len] = 0; |
205 | 198 |
206 | 199 |
207 g_snprintf(debug_buff, sizeof(debug_buff), "Receieved: '%s'\n", webdata); | 200 g_snprintf(debug_buff, sizeof(debug_buff), _("Receieved: '%s'\n"), webdata); |
208 debug_print(debug_buff); | 201 debug_print(debug_buff); |
209 | 202 |
210 if (pw) | 203 if (pw) |
211 gtk_widget_destroy(pw); | 204 gtk_widget_destroy(pw); |
212 | 205 |