# HG changeset patch # User Mark Doliner # Date 1050699698 0 # Node ID 71927464a1db38a4eba8126f69e9a9af4c3554e1 # Parent 0f31d00d2501998999826075f36e41eb96f3c1c5 [gaim-migrate @ 5533] I needed to do this for getfile. Basically, I added a new ui operation for when a new xfer is created. The ui operation creates the needed ui data. Previously it was done when the file was choosen, but with getfile, when sending files to other peeps there isn't a "save file" or "choose file to send" dialog. Ya catch my drift? committer: Tailor Script diff -r 0f31d00d2501 -r 71927464a1db src/ft.c --- a/src/ft.c Fri Apr 18 19:48:42 2003 +0000 +++ b/src/ft.c Fri Apr 18 21:01:38 2003 +0000 @@ -41,6 +41,7 @@ const char *who) { struct gaim_xfer *xfer; + struct gaim_xfer_ui_ops *ui_ops; if (account == NULL || type == GAIM_XFER_UNKNOWN || who == NULL) return NULL; @@ -52,6 +53,11 @@ xfer->who = g_strdup(who); xfer->ui_ops = gaim_get_xfer_ui_ops(); + ui_ops = gaim_xfer_get_ui_ops(xfer); + + if (ui_ops != NULL && ui_ops->new != NULL) + ui_ops->new(xfer); + return xfer; } diff -r 0f31d00d2501 -r 71927464a1db src/ft.h --- a/src/ft.h Fri Apr 18 19:48:42 2003 +0000 +++ b/src/ft.h Fri Apr 18 21:01:38 2003 +0000 @@ -47,6 +47,7 @@ */ struct gaim_xfer_ui_ops { + void (*new)(struct gaim_xfer *xfer); void (*destroy)(struct gaim_xfer *xfer); void (*request_file)(struct gaim_xfer *xfer); void (*ask_cancel)(struct gaim_xfer *xfer); diff -r 0f31d00d2501 -r 71927464a1db src/gtkft.c --- a/src/gtkft.c Fri Apr 18 19:48:42 2003 +0000 +++ b/src/gtkft.c Fri Apr 18 21:01:38 2003 +0000 @@ -917,6 +917,16 @@ * File Transfer UI Ops **************************************************************************/ static void +gaim_gtkxfer_new(struct gaim_xfer *xfer) +{ + struct gaim_gtkxfer_ui_data *data; + + /* This is where we're setting xfer->ui_data for the first time. */ + data = g_malloc0(sizeof(struct gaim_gtkxfer_ui_data)); + xfer->ui_data = data; +} + +static void gaim_gtkxfer_destroy(struct gaim_xfer *xfer) { gaim_gtkxfer_dialog_remove_xfer(xfer_dialog, xfer); @@ -1037,12 +1047,9 @@ char *cur_dir, *init_str; struct gaim_gtkxfer_ui_data *data; + data = GAIM_GTKXFER(xfer); cur_dir = g_get_current_dir(); - /* This is where we're setting xfer->ui_data for the first time. */ - data = g_malloc0(sizeof(struct gaim_gtkxfer_ui_data)); - xfer->ui_data = data; - if (gaim_xfer_get_type(xfer) == GAIM_XFER_SEND) data->filesel = gtk_file_selection_new(_("Gaim - Open...")); else @@ -1158,6 +1165,7 @@ struct gaim_xfer_ui_ops ops = { + gaim_gtkxfer_new, gaim_gtkxfer_destroy, gaim_gtkxfer_request_file, gaim_gtkxfer_ask_cancel,