Mercurial > pidgin
comparison src/gtkft.c @ 8366:5956297c6bcc
[gaim-migrate @ 9091]
Win32 users can now open things from the FT dialog with the Open button.
It's about time Win32 got a useful feature before Linux.
Patch by Kevin Stange.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Sun, 29 Feb 2004 00:30:51 +0000 |
parents | ffa642240fc1 |
children | e4087b5c0627 |
comparison
equal
deleted
inserted
replaced
8365:0e05e094e371 | 8366:5956297c6bcc |
---|---|
260 | 260 |
261 if (gaim_xfer_is_completed(xfer)) { | 261 if (gaim_xfer_is_completed(xfer)) { |
262 gtk_widget_hide(dialog->stop_button); | 262 gtk_widget_hide(dialog->stop_button); |
263 gtk_widget_show(dialog->remove_button); | 263 gtk_widget_show(dialog->remove_button); |
264 | 264 |
265 /* TODO: gtk_widget_set_sensitive(dialog->open_button, TRUE); */ | 265 #ifdef _WIN32 /* Only supported in Win32 right now */ |
266 if (gaim_xfer_get_type(xfer) == GAIM_XFER_RECEIVE) { | |
267 gtk_widget_set_sensitive(dialog->open_button, TRUE); | |
268 } else { | |
269 gtk_widget_set_sensitive(dialog->open_button, FALSE); | |
270 } | |
271 #endif | |
266 gtk_widget_set_sensitive(dialog->pause_button, FALSE); | 272 gtk_widget_set_sensitive(dialog->pause_button, FALSE); |
267 gtk_widget_set_sensitive(dialog->resume_button, FALSE); | 273 gtk_widget_set_sensitive(dialog->resume_button, FALSE); |
268 | 274 |
269 gtk_widget_set_sensitive(dialog->remove_button, TRUE); | 275 gtk_widget_set_sensitive(dialog->remove_button, TRUE); |
270 } else if (gaim_xfer_is_canceled(xfer)) { | 276 } else if (gaim_xfer_is_canceled(xfer)) { |
368 } | 374 } |
369 | 375 |
370 static void | 376 static void |
371 open_button_cb(GtkButton *button, GaimGtkXferDialog *dialog) | 377 open_button_cb(GtkButton *button, GaimGtkXferDialog *dialog) |
372 { | 378 { |
379 #ifdef _WIN32 /* Only supported in Win32 right now */ | |
380 int code = (int)ShellExecute(NULL, NULL, | |
381 gaim_xfer_get_local_filename(dialog->selected_xfer), | |
382 NULL, NULL, SW_SHOW); | |
383 if (code == SE_ERR_ASSOCINCOMPLETE || code == SE_ERR_NOASSOC) | |
384 { | |
385 gaim_notify_error(NULL, NULL, | |
386 _("There is no application configured to open this type of file."), NULL); | |
387 } | |
388 else if (code < 32) | |
389 { | |
390 gaim_notify_error(NULL, NULL, | |
391 _("An error occurred while opening the file."), NULL); | |
392 gaim_debug_warning("ft", "filename: %s; code: %d\n", gaim_xfer_get_local_filename(dialog->selected_xfer), code); | |
393 } | |
394 #endif | |
373 } | 395 } |
374 | 396 |
375 static void | 397 static void |
376 pause_button_cb(GtkButton *button, GaimGtkXferDialog *dialog) | 398 pause_button_cb(GtkButton *button, GaimGtkXferDialog *dialog) |
377 { | 399 { |