Mercurial > pidgin
comparison src/ft.c @ 3730:a20bf3d247ff
[gaim-migrate @ 3868]
Pretty do_ask_dialog. I also "fixed" the "hitting yes calls the 'no' function
anyway" behavior.
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Thu, 17 Oct 2002 21:29:53 +0000 |
parents | d7e83b4db191 |
children | 1bd663beada5 |
comparison
equal
deleted
inserted
replaced
3729:a8f0c169e529 | 3730:a20bf3d247ff |
---|---|
76 int bytesleft; | 76 int bytesleft; |
77 }; | 77 }; |
78 | 78 |
79 | 79 |
80 | 80 |
81 static int ft_choose_file(gpointer a, struct file_transfer *xfer); | 81 static int ft_choose_file(struct file_transfer *xfer); |
82 static void ft_cancel(gpointer w, struct file_transfer *xfer); | 82 static void ft_cancel(struct file_transfer *xfer); |
83 static void ft_delete(struct file_transfer *xfer); | 83 static void ft_delete(struct file_transfer *xfer); |
84 static void ft_callback(gpointer data, gint source, GaimInputCondition condition); | 84 static void ft_callback(gpointer data, gint source, GaimInputCondition condition); |
85 static void ft_nextfile(struct file_transfer *xfer); | 85 static void ft_nextfile(struct file_transfer *xfer); |
86 static int ft_mkdir(const char *name); | 86 static int ft_mkdir(const char *name); |
87 static int ft_mkdir_help(char *dir); | 87 static int ft_mkdir_help(char *dir); |
142 char *newmsg = g_strconcat(buf, ": ", msg, NULL); | 142 char *newmsg = g_strconcat(buf, ": ", msg, NULL); |
143 g_free(buf); | 143 g_free(buf); |
144 buf = newmsg; | 144 buf = newmsg; |
145 } | 145 } |
146 | 146 |
147 do_ask_dialog(buf, xfer, ft_choose_file, ft_cancel); | 147 do_ask_dialog(buf, NULL, xfer, _("Accept"), ft_choose_file, _("Cancel"), ft_cancel); |
148 g_free(buf); | 148 g_free(buf); |
149 | 149 |
150 return xfer; | 150 return xfer; |
151 } | 151 } |
152 | 152 |
154 const char *who) | 154 const char *who) |
155 { | 155 { |
156 struct file_transfer *xfer = ft_new(FILE_TRANSFER_TYPE_SEND, gc, | 156 struct file_transfer *xfer = ft_new(FILE_TRANSFER_TYPE_SEND, gc, |
157 who); | 157 who); |
158 | 158 |
159 ft_choose_file(NULL, xfer); | 159 ft_choose_file(xfer); |
160 | 160 |
161 return xfer; | 161 return xfer; |
162 } | 162 } |
163 | 163 |
164 /* We canceled the transfer, either by declining the initial | 164 /* We canceled the transfer, either by declining the initial |
165 * confirmation dialog or canceling the file dialog. | 165 * confirmation dialog or canceling the file dialog. |
166 */ | 166 */ |
167 static void ft_cancel(gpointer w, struct file_transfer *xfer) | 167 static void ft_cancel(struct file_transfer *xfer) |
168 { | 168 { |
169 /* Make sure we weren't aborted while waiting for | 169 /* Make sure we weren't aborted while waiting for |
170 * confirmation from the user. | 170 * confirmation from the user. |
171 */ | 171 */ |
172 if (xfer->state == FILE_TRANSFER_STATE_INTERRUPTED) { | 172 if (xfer->state == FILE_TRANSFER_STATE_INTERRUPTED) { |
365 *size = xfer->sizes[xfer->filesdone]; | 365 *size = xfer->sizes[xfer->filesdone]; |
366 *name = xfer->names[xfer->filesdone]; | 366 *name = xfer->names[xfer->filesdone]; |
367 return 0; | 367 return 0; |
368 } | 368 } |
369 | 369 |
370 static int ft_choose_file(gpointer a, struct file_transfer *xfer) | 370 static int ft_choose_file(struct file_transfer *xfer) |
371 { | 371 { |
372 char *curdir = g_get_current_dir(); /* should be freed */ | 372 char *curdir = g_get_current_dir(); /* should be freed */ |
373 char *initstr; | 373 char *initstr; |
374 | 374 |
375 /* If the connection is interrupted while we are waiting | 375 /* If the connection is interrupted while we are waiting |