annotate src/gtk/gtkui_transfer.c @ 371:39b57989c34a

2003-1-18 Brian Masney <masneyb@gftp.org> * src/gtk/gtkui_transfer.c - gtk+ specific file transfer code. Forgot to attach this with the last commit
author masneyb
date Mon, 19 Jan 2004 12:23:52 +0000
parents
children d207b8241e96
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
371
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1 /*****************************************************************************/
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2 /* gtkui_transfer.c - GTK+ UI transfer related functions for gFTP */
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3 /* Copyright (C) 1998-2003 Brian Masney <masneyb@gftp.org> */
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4 /* */
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5 /* This program is free software; you can redistribute it and/or modify */
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6 /* it under the terms of the GNU General Public License as published by */
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7 /* the Free Software Foundation; either version 2 of the License, or */
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8 /* (at your option) any later version. */
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9 /* */
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
10 /* This program is distributed in the hope that it will be useful, */
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
11 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
12 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
13 /* GNU General Public License for more details. */
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
14 /* */
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
15 /* You should have received a copy of the GNU General Public License */
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
16 /* along with this program; if not, write to the Free Software */
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
17 /* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA */
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
18 /*****************************************************************************/
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
19
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
20 #include "gftp-gtk.h"
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
21 static const char cvsid[] = "$Id$";
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
22
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
23 static void
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
24 trans_selectall (GtkWidget * widget, gpointer data)
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
25 {
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
26 gftp_transfer * tdata;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
27 tdata = data;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
28
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
29 gtk_clist_select_all (GTK_CLIST (tdata->clist));
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
30 }
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
31
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
32
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
33 static void
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
34 trans_unselectall (GtkWidget * widget, gpointer data)
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
35 {
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
36 gftp_transfer * tdata;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
37 tdata = data;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
38
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
39 gtk_clist_unselect_all (GTK_CLIST (tdata->clist));
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
40 }
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
41
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
42
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
43 static void
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
44 overwrite (GtkWidget * widget, gpointer data)
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
45 {
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
46 GList * templist, * filelist;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
47 gftp_transfer * tdata;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
48 gftp_file * tempfle;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
49 int curpos;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
50
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
51 tdata = data;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
52 curpos = 0;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
53 filelist = tdata->files;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
54 templist = GTK_CLIST (tdata->clist)->selection;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
55 while (templist != NULL)
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
56 {
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
57 templist = get_next_selection (templist, &filelist, &curpos);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
58 tempfle = filelist->data;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
59 tempfle->transfer_action = GFTP_TRANS_ACTION_OVERWRITE;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
60 gtk_clist_set_text (GTK_CLIST (tdata->clist), curpos, 3, _("Overwrite"));
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
61 }
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
62 }
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
63
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
64
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
65 static void
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
66 resume (GtkWidget * widget, gpointer data)
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
67 {
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
68 GList * templist, * filelist;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
69 gftp_transfer * tdata;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
70 gftp_file * tempfle;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
71 int curpos;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
72
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
73 tdata = data;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
74 curpos = 0;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
75 filelist = tdata->files;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
76 templist = GTK_CLIST (tdata->clist)->selection;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
77 while (templist != NULL)
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
78 {
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
79 templist = get_next_selection (templist, &filelist, &curpos);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
80 tempfle = filelist->data;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
81 tempfle->transfer_action = GFTP_TRANS_ACTION_RESUME;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
82 gtk_clist_set_text (GTK_CLIST (tdata->clist), curpos, 3, _("Resume"));
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
83 }
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
84 }
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
85
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
86
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
87 static void
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
88 skip (GtkWidget * widget, gpointer data)
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
89 {
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
90 GList * templist, * filelist;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
91 gftp_transfer * tdata;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
92 gftp_file * tempfle;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
93 int curpos;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
94
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
95 tdata = data;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
96 curpos = 0;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
97 filelist = tdata->files;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
98 templist = GTK_CLIST (tdata->clist)->selection;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
99 while (templist != NULL)
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
100 {
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
101 templist = get_next_selection (templist, &filelist, &curpos);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
102 tempfle = filelist->data;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
103 tempfle->transfer_action = GFTP_TRANS_ACTION_SKIP;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
104 gtk_clist_set_text (GTK_CLIST (tdata->clist), curpos, 3, _("Skip"));
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
105 }
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
106 }
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
107
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
108
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
109 static void
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
110 ok (GtkWidget * widget, gpointer data)
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
111 {
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
112 gftp_transfer * tdata;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
113 gftp_file * tempfle;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
114 GList * templist;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
115
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
116 tdata = data;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
117 g_static_mutex_lock (&tdata->structmutex);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
118 for (templist = tdata->files; templist != NULL; templist = templist->next)
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
119 {
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
120 tempfle = templist->data;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
121 if (tempfle->transfer_action != GFTP_TRANS_ACTION_SKIP)
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
122 break;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
123 }
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
124
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
125 if (templist == NULL)
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
126 {
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
127 tdata->show = 0;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
128 tdata->ready = tdata->done = 1;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
129 }
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
130 else
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
131 tdata->show = tdata->ready = 1;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
132 g_static_mutex_unlock (&tdata->structmutex);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
133 }
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
134
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
135
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
136 static void
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
137 cancel (GtkWidget * widget, gpointer data)
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
138 {
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
139 gftp_transfer * tdata;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
140
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
141 tdata = data;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
142 g_static_mutex_lock (&tdata->structmutex);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
143 tdata->show = 0;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
144 tdata->done = tdata->ready = 1;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
145 g_static_mutex_unlock (&tdata->structmutex);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
146 }
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
147
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
148
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
149 #if GTK_MAJOR_VERSION > 1
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
150 static void
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
151 transfer_action (GtkWidget * widget, gint response, gpointer user_data)
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
152 {
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
153 switch (response)
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
154 {
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
155 case GTK_RESPONSE_OK:
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
156 ok (widget, user_data);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
157 gtk_widget_destroy (widget);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
158 break;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
159 case GTK_RESPONSE_CANCEL:
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
160 cancel (widget, user_data);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
161 /* no break */
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
162 default:
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
163 gtk_widget_destroy (widget);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
164 }
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
165 }
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
166 #endif
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
167
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
168
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
169 void
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
170 gftpui_ask_transfer (gftp_transfer * tdata)
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
171 {
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
172 char *dltitles[4], *add_data[4] = { NULL, NULL, NULL, NULL },
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
173 tempstr[50], temp1str[50], *pos;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
174 GtkWidget * dialog, * tempwid, * scroll, * hbox;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
175 intptr_t overwrite_default;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
176 gftp_file * tempfle;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
177 GList * templist;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
178 size_t len;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
179 int i;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
180
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
181 dltitles[0] = _("Filename");
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
182 dltitles[1] = tdata->fromreq->hostname;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
183 dltitles[2] = tdata->toreq->hostname;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
184 dltitles[3] = _("Action");
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
185
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
186 #if GTK_MAJOR_VERSION == 1
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
187 dialog = gtk_dialog_new ();
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
188 gtk_grab_add (dialog);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
189 gtk_window_set_title (GTK_WINDOW (dialog), _("Transfer Files"));
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
190 gtk_container_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area), 5);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
191 gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->action_area), 35);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
192 gtk_box_set_homogeneous (GTK_BOX (GTK_DIALOG (dialog)->action_area), TRUE);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
193
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
194 gtk_signal_connect_object (GTK_OBJECT (dialog), "delete_event",
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
195 GTK_SIGNAL_FUNC (gtk_widget_destroy),
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
196 GTK_OBJECT (dialog));
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
197 #else
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
198 dialog = gtk_dialog_new_with_buttons (_("Transfer Files"), NULL, 0,
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
199 GTK_STOCK_OK,
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
200 GTK_RESPONSE_OK,
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
201 GTK_STOCK_CANCEL,
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
202 GTK_RESPONSE_CANCEL,
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
203 NULL);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
204 #endif
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
205 gtk_window_set_wmclass (GTK_WINDOW(dialog), "transfer", "gFTP");
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
206 gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
207 gtk_container_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), 10);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
208 gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 5);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
209
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
210 tempwid = gtk_label_new (_("The following file(s) exist on both the local and remote computer\nPlease select what you would like to do"));
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
211 gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), tempwid, FALSE,
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
212 FALSE, 0);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
213 gtk_widget_show (tempwid);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
214
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
215 scroll = gtk_scrolled_window_new (NULL, NULL);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
216 gtk_widget_set_size_request (scroll, 450, 200);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
217
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
218 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll),
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
219 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
220 tdata->clist = gtk_clist_new_with_titles (4, dltitles);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
221 gtk_container_add (GTK_CONTAINER (scroll), tdata->clist);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
222
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
223 #if GTK_MAJOR_VERSION == 1
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
224 gtk_clist_set_selection_mode (GTK_CLIST (tdata->clist),
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
225 GTK_SELECTION_EXTENDED);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
226 #else
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
227 gtk_clist_set_selection_mode (GTK_CLIST (tdata->clist),
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
228 GTK_SELECTION_MULTIPLE);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
229 #endif
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
230 gtk_clist_set_column_width (GTK_CLIST (tdata->clist), 0, 100);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
231 gtk_clist_set_column_justification (GTK_CLIST (tdata->clist), 1,
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
232 GTK_JUSTIFY_RIGHT);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
233 gtk_clist_set_column_width (GTK_CLIST (tdata->clist), 1, 85);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
234 gtk_clist_set_column_justification (GTK_CLIST (tdata->clist), 2,
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
235 GTK_JUSTIFY_RIGHT);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
236 gtk_clist_set_column_width (GTK_CLIST (tdata->clist), 2, 85);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
237 gtk_clist_set_column_width (GTK_CLIST (tdata->clist), 3, 85);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
238 gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), scroll, TRUE, TRUE,
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
239 0);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
240 gtk_widget_show (tdata->clist);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
241 gtk_widget_show (scroll);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
242
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
243 gftp_lookup_request_option (tdata->fromreq, "overwrite_default",
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
244 &overwrite_default);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
245
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
246 for (templist = tdata->files; templist != NULL;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
247 templist = templist->next)
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
248 {
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
249 tempfle = templist->data;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
250 if (tempfle->startsize == 0 || tempfle->isdir)
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
251 {
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
252 tempfle->shown = 0;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
253 continue;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
254 }
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
255 tempfle->shown = 1;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
256
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
257 pos = tempfle->destfile;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
258 len = strlen (tdata->toreq->directory);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
259 if (strncmp (pos, tdata->toreq->directory, len) == 0)
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
260 pos = tempfle->destfile + len + 1;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
261 add_data[0] = pos;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
262
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
263 if (overwrite_default)
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
264 {
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
265 add_data[3] = _("Overwrite");
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
266 tempfle->transfer_action = GFTP_TRANS_ACTION_OVERWRITE;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
267 }
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
268 else if (tempfle->startsize == tempfle->size)
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
269 {
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
270 add_data[3] = _("Skip");
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
271 tempfle->transfer_action = GFTP_TRANS_ACTION_SKIP;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
272 }
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
273 else if (tempfle->startsize > tempfle->size)
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
274 {
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
275 add_data[3] = _("Overwrite");
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
276 tempfle->transfer_action = GFTP_TRANS_ACTION_OVERWRITE;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
277 }
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
278 else
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
279 {
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
280 add_data[3] = _("Resume");
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
281 tempfle->transfer_action = GFTP_TRANS_ACTION_RESUME;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
282 }
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
283
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
284 add_data[1] = insert_commas (tempfle->size, tempstr, sizeof (tempstr));
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
285 add_data[2] = insert_commas (tempfle->startsize, temp1str,
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
286 sizeof (temp1str));
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
287
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
288 i = gtk_clist_append (GTK_CLIST (tdata->clist), add_data);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
289 gtk_clist_set_row_data (GTK_CLIST (tdata->clist), i, tempfle);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
290 }
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
291
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
292 gtk_clist_select_all (GTK_CLIST (tdata->clist));
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
293
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
294 hbox = gtk_hbox_new (TRUE, 20);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
295 gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, TRUE, TRUE, 0);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
296 gtk_widget_show (hbox);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
297
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
298 tempwid = gtk_button_new_with_label (_("Overwrite"));
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
299 gtk_box_pack_start (GTK_BOX (hbox), tempwid, TRUE, TRUE, 0);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
300 gtk_signal_connect (GTK_OBJECT (tempwid), "clicked",
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
301 GTK_SIGNAL_FUNC (overwrite), (gpointer) tdata);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
302 gtk_widget_show (tempwid);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
303
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
304 tempwid = gtk_button_new_with_label (_("Resume"));
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
305 gtk_box_pack_start (GTK_BOX (hbox), tempwid, TRUE, TRUE, 0);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
306 gtk_signal_connect (GTK_OBJECT (tempwid), "clicked",
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
307 GTK_SIGNAL_FUNC (resume), (gpointer) tdata);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
308 gtk_widget_show (tempwid);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
309
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
310 tempwid = gtk_button_new_with_label (_("Skip File"));
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
311 gtk_box_pack_start (GTK_BOX (hbox), tempwid, TRUE, TRUE, 0);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
312 gtk_signal_connect (GTK_OBJECT (tempwid), "clicked", GTK_SIGNAL_FUNC (skip),
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
313 (gpointer) tdata);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
314 gtk_widget_show (tempwid);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
315
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
316 hbox = gtk_hbox_new (TRUE, 20);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
317 gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, TRUE, TRUE, 0);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
318 gtk_widget_show (hbox);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
319
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
320 tempwid = gtk_button_new_with_label (_("Select All"));
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
321 gtk_box_pack_start (GTK_BOX (hbox), tempwid, TRUE, TRUE, 0);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
322 gtk_signal_connect (GTK_OBJECT (tempwid), "clicked",
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
323 GTK_SIGNAL_FUNC (trans_selectall), (gpointer) tdata);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
324 gtk_widget_show (tempwid);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
325
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
326 tempwid = gtk_button_new_with_label (_("Deselect All"));
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
327 gtk_box_pack_start (GTK_BOX (hbox), tempwid, TRUE, TRUE, 0);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
328 gtk_signal_connect (GTK_OBJECT (tempwid), "clicked",
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
329 GTK_SIGNAL_FUNC (trans_unselectall), (gpointer) tdata);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
330 gtk_widget_show (tempwid);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
331
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
332 #if GTK_MAJOR_VERSION == 1
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
333 tempwid = gtk_button_new_with_label (_("OK"));
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
334 GTK_WIDGET_SET_FLAGS (tempwid, GTK_CAN_DEFAULT);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
335 gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area), tempwid,
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
336 TRUE, TRUE, 0);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
337 gtk_signal_connect (GTK_OBJECT (tempwid), "clicked", GTK_SIGNAL_FUNC (ok),
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
338 (gpointer) tdata);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
339 gtk_signal_connect_object (GTK_OBJECT (tempwid), "clicked",
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
340 GTK_SIGNAL_FUNC (gtk_widget_destroy),
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
341 GTK_OBJECT (dialog));
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
342 gtk_widget_grab_default (tempwid);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
343 gtk_widget_show (tempwid);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
344
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
345 tempwid = gtk_button_new_with_label (_(" Cancel "));
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
346 GTK_WIDGET_SET_FLAGS (tempwid, GTK_CAN_DEFAULT);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
347 gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area), tempwid,
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
348 TRUE, TRUE, 0);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
349 gtk_signal_connect (GTK_OBJECT (tempwid), "clicked",
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
350 GTK_SIGNAL_FUNC (cancel), (gpointer) tdata);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
351 gtk_signal_connect_object (GTK_OBJECT (tempwid), "clicked",
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
352 GTK_SIGNAL_FUNC (gtk_widget_destroy),
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
353 GTK_OBJECT (dialog));
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
354 gtk_widget_show (tempwid);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
355 #else
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
356 g_signal_connect (GTK_OBJECT (dialog), "response",
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
357 G_CALLBACK (transfer_action), (gpointer) tdata);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
358 #endif
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
359
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
360 gtk_widget_show (dialog);
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
361 dialog = NULL;
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
362 }
39b57989c34a 2003-1-18 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
363