# HG changeset patch # User Christian Hammond # Date 1078014651 0 # Node ID 5956297c6bcc60421fd8ee0e8190d54a43fb44fa # Parent 0e05e094e3711b907d0f4557d5be28275429a2a3 [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 diff -r 0e05e094e371 -r 5956297c6bcc ChangeLog.win32 --- a/ChangeLog.win32 Sat Feb 28 23:33:20 2004 +0000 +++ b/ChangeLog.win32 Sun Feb 29 00:30:51 2004 +0000 @@ -1,4 +1,5 @@ version 0.76: + * Ability to open files directly from file transfer window. * Installer translations for: Russian, Polish, Finnish, Japanese. version 0.75 (01/09/2004): diff -r 0e05e094e371 -r 5956297c6bcc src/gtkft.c --- a/src/gtkft.c Sat Feb 28 23:33:20 2004 +0000 +++ b/src/gtkft.c Sun Feb 29 00:30:51 2004 +0000 @@ -262,7 +262,13 @@ gtk_widget_hide(dialog->stop_button); gtk_widget_show(dialog->remove_button); - /* TODO: gtk_widget_set_sensitive(dialog->open_button, TRUE); */ +#ifdef _WIN32 /* Only supported in Win32 right now */ + if (gaim_xfer_get_type(xfer) == GAIM_XFER_RECEIVE) { + gtk_widget_set_sensitive(dialog->open_button, TRUE); + } else { + gtk_widget_set_sensitive(dialog->open_button, FALSE); + } +#endif gtk_widget_set_sensitive(dialog->pause_button, FALSE); gtk_widget_set_sensitive(dialog->resume_button, FALSE); @@ -370,6 +376,22 @@ static void open_button_cb(GtkButton *button, GaimGtkXferDialog *dialog) { +#ifdef _WIN32 /* Only supported in Win32 right now */ + int code = (int)ShellExecute(NULL, NULL, + gaim_xfer_get_local_filename(dialog->selected_xfer), + NULL, NULL, SW_SHOW); + if (code == SE_ERR_ASSOCINCOMPLETE || code == SE_ERR_NOASSOC) + { + gaim_notify_error(NULL, NULL, + _("There is no application configured to open this type of file."), NULL); + } + else if (code < 32) + { + gaim_notify_error(NULL, NULL, + _("An error occurred while opening the file."), NULL); + gaim_debug_warning("ft", "filename: %s; code: %d\n", gaim_xfer_get_local_filename(dialog->selected_xfer), code); + } +#endif } static void