annotate src/gtk/menu-items.c @ 1:8b1883341c6f

Initial revision
author masneyb
date Mon, 05 Aug 2002 19:46:57 +0000
parents
children 83090328581e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1 /*****************************************************************************/
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2 /* menu-items.c - menu callbacks */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
3 /* Copyright (C) 1998-2002 Brian Masney <masneyb@gftp.org> */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
4 /* */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
5 /* This program is free software; you can redistribute it and/or modify */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
6 /* it under the terms of the GNU General Public License as published by */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
7 /* the Free Software Foundation; either version 2 of the License, or */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
8 /* (at your option) any later version. */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
9 /* */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
10 /* This program is distributed in the hope that it will be useful, */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
11 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
12 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
13 /* GNU General Public License for more details. */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
14 /* */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
15 /* You should have received a copy of the GNU General Public License */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
16 /* along with this program; if not, write to the Free Software */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
17 /* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
18 /*****************************************************************************/
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
19
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
20 #include <gftp-gtk.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
21
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
22 static void do_openurl ( GtkWidget * widget,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
23 gftp_dialog_data * data );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
24 static void dochange_filespec ( GtkWidget * widget,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
25 gftp_dialog_data * data );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
26 static void dosite ( GtkWidget * widget,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
27 gftp_dialog_data * data );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
28 static int do_change_dir ( gftp_window_data * wdata,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
29 char * directory );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
30 static void *do_change_dir_thread ( void * data );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
31 static void dosavelog ( GtkWidget * widget,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
32 GtkFileSelection * fs );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
33
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
34 static RETSIGTYPE sig_chdirquit ( int signo );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
35 static sigjmp_buf chdirenvir;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
36
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
37 void
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
38 change_setting (gftp_window_data * wdata, int menuitem, GtkWidget * checkmenu)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
39 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
40 switch (menuitem)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
41 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
42 case 1:
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
43 if (wdata->request != NULL)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
44 gftp_set_data_type (wdata->request, GFTP_TYPE_ASCII);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
45 break;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
46 case 2:
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
47 if (wdata->request != NULL)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
48 gftp_set_data_type (wdata->request, GFTP_TYPE_BINARY);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
49 break;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
50 case 3:
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
51 current_wdata = &window1;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
52 other_wdata = &window2;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
53 if (wdata->request)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
54 update_window_info ();
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
55 break;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
56 case 4:
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
57 current_wdata = &window2;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
58 other_wdata = &window1;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
59 if (wdata->request)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
60 update_window_info ();
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
61 break;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
62 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
63 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
64
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
65
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
66 void
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
67 tb_openurl_dialog (gpointer data)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
68 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
69 const char *edttxt;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
70
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
71 if (current_wdata->request->stopable)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
72 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
73 ftp_log (gftp_logging_misc, NULL,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
74 _("%s: Please hit the stop button first to do anything else\n"),
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
75 _("OpenURL"));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
76 return;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
77 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
78
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
79 edttxt = gtk_entry_get_text (GTK_ENTRY (GTK_COMBO (hostedit)->entry));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
80 if (*edttxt == '\0')
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
81 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
82 ftp_log (gftp_logging_misc, NULL,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
83 _("OpenURL: Operation canceled...you must enter a string\n"));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
84 return;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
85 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
86
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
87 if (GFTP_IS_CONNECTED (current_wdata->request))
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
88 disconnect (current_wdata);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
89 else if (edttxt != NULL && *edttxt != '\0')
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
90 toolbar_hostedit (NULL, NULL);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
91 else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
92 openurl_dialog (current_wdata);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
93 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
94
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
95
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
96 void
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
97 openurl_dialog (gpointer data)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
98 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
99 MakeEditDialog (_("Connect via URL"), _("Enter ftp url to connect to"),
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
100 NULL, 1, 1, NULL, _("Connect"), do_openurl, data,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
101 _(" Cancel "), NULL, NULL);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
102 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
103
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
104
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
105 static void
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
106 do_openurl (GtkWidget * widget, gftp_dialog_data * data)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
107 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
108 gftp_window_data * wdata;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
109 const char *tempstr;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
110
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
111 wdata = data->data;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
112 if (current_wdata->request->stopable)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
113 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
114 ftp_log (gftp_logging_misc, NULL,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
115 _("%s: Please hit the stop button first to do anything else\n"),
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
116 _("OpenURL"));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
117 return;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
118 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
119
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
120 tempstr = gtk_entry_get_text (GTK_ENTRY (data->edit));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
121 if (*tempstr == '\0')
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
122 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
123 ftp_log (gftp_logging_misc, NULL,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
124 _("OpenURL: Operation canceled...you must enter a string\n"));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
125 return;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
126 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
127
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
128 if (GFTP_IS_CONNECTED (wdata->request))
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
129 disconnect (wdata);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
130
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
131 if (gftp_parse_url (wdata->request, tempstr) == 0)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
132 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
133 gtk_widget_destroy (data->dialog);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
134 ftp_connect (wdata, wdata->request, 1);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
135 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
136 else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
137 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
138 gtk_widget_destroy (data->dialog);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
139 ftp_log (gftp_logging_misc, NULL, _("Could not parse URL %s\n"), tempstr);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
140 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
141 data->dialog = NULL;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
142 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
143
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
144
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
145 void
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
146 disconnect (gpointer data)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
147 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
148 gftp_window_data * wdata;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
149
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
150 wdata = data;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
151 gftp_disconnect (wdata->request);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
152 remove_files_window (wdata);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
153 update_window (wdata);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
154 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
155
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
156
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
157 void
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
158 change_filespec (gpointer data)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
159 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
160 gftp_window_data * wdata;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
161
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
162 wdata = data;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
163 if (!check_status (_("Change Filespec"), wdata, 0, 0, 0, 1))
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
164 return;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
165
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
166 MakeEditDialog (_("Change Filespec"), _("Enter the new file specification"),
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
167 wdata->filespec, 1, 1, NULL, _("Change"), dochange_filespec,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
168 wdata, _(" Cancel "), NULL, NULL);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
169 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
170
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
171
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
172 static void
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
173 dochange_filespec (GtkWidget * widget, gftp_dialog_data * data)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
174 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
175 GList * templist, * filelist;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
176 gftp_file * tempfle;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
177 gftp_window_data * wdata;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
178 const char *edttext;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
179 int num;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
180
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
181 wdata = data->data;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
182 wdata->show_selected = 0;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
183
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
184 edttext = gtk_entry_get_text (GTK_ENTRY (data->edit));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
185 if (*edttext == '\0')
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
186 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
187 ftp_log (gftp_logging_misc, NULL,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
188 _("Change Filespec: Operation canceled...you must enter a string\n"));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
189 return;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
190 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
191 if (wdata->filespec)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
192 g_free (wdata->filespec);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
193 wdata->filespec = g_malloc (strlen (edttext) + 1);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
194 strcpy (wdata->filespec, edttext);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
195
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
196 filelist = wdata->files;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
197 templist = GTK_CLIST (wdata->listbox)->selection;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
198 num = 0;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
199 while (templist != NULL)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
200 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
201 templist = get_next_selection (templist, &filelist, &num);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
202 tempfle = filelist->data;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
203 tempfle->was_sel = 1;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
204 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
205
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
206 gtk_clist_freeze (GTK_CLIST (wdata->listbox));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
207 gtk_clist_clear (GTK_CLIST (wdata->listbox));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
208 templist = wdata->files;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
209 while (templist != NULL)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
210 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
211 tempfle = templist->data;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
212 add_file_listbox (wdata, tempfle);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
213 templist = templist->next;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
214 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
215 gtk_clist_thaw (GTK_CLIST (wdata->listbox));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
216 update_window (wdata);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
217 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
218
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
219
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
220 void
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
221 show_selected (gpointer data)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
222 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
223 GList * templist, * filelist;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
224 gftp_window_data * wdata;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
225 gftp_file * tempfle;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
226 int num;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
227
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
228 wdata = data;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
229 wdata->show_selected = 1;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
230
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
231 filelist = wdata->files;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
232 templist = GTK_CLIST (wdata->listbox)->selection;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
233 num = 0;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
234 while (templist != NULL)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
235 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
236 templist = get_next_selection (templist, &filelist, &num);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
237 tempfle = filelist->data;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
238 tempfle->was_sel = 1;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
239 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
240
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
241 gtk_clist_freeze (GTK_CLIST (wdata->listbox));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
242 gtk_clist_clear (GTK_CLIST (wdata->listbox));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
243 templist = wdata->files;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
244 while (templist != NULL)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
245 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
246 tempfle = templist->data;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
247 add_file_listbox (wdata, tempfle);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
248 templist = templist->next;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
249 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
250 gtk_clist_thaw (GTK_CLIST (wdata->listbox));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
251 update_window (wdata);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
252 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
253
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
254
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
255 void
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
256 selectall (gpointer data)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
257 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
258 gftp_window_data * wdata;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
259
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
260 wdata = data;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
261 wdata->show_selected = 0;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
262 gtk_clist_select_all (GTK_CLIST (wdata->listbox));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
263 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
264
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
265
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
266 void
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
267 selectallfiles (gpointer data)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
268 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
269 gftp_window_data * wdata;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
270 gftp_file * tempfle;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
271 GList *templist;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
272 int i;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
273
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
274 wdata = data;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
275 wdata->show_selected = 0;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
276 gtk_clist_freeze (GTK_CLIST (wdata->listbox));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
277 i = 0;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
278 templist = g_list_first (wdata->files);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
279 while (templist != NULL)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
280 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
281 tempfle = (gftp_file *) templist->data;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
282 if (tempfle->shown)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
283 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
284 if (tempfle->isdir)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
285 gtk_clist_unselect_row (GTK_CLIST (wdata->listbox), i, 0);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
286 else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
287 gtk_clist_select_row (GTK_CLIST (wdata->listbox), i, 0);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
288 i++;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
289 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
290 templist = templist->next;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
291 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
292 gtk_clist_thaw (GTK_CLIST (wdata->listbox));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
293 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
294
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
295
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
296 void
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
297 deselectall (gpointer data)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
298 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
299 gftp_window_data * wdata;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
300
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
301 wdata = data;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
302 wdata->show_selected = 0;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
303 gtk_clist_unselect_all (GTK_CLIST (wdata->listbox));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
304 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
305
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
306
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
307 void
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
308 site_dialog (gpointer data)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
309 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
310 gftp_window_data * wdata;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
311
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
312 wdata = data;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
313 if (!check_status (_("Site"), wdata, 0, 0, 0, wdata->request->site != NULL))
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
314 return;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
315
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
316 MakeEditDialog (_("Site"), _("Enter site-specific command"), NULL, 1, 1,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
317 NULL, _("OK"), dosite, wdata, _(" Cancel "), NULL, NULL);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
318 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
319
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
320
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
321 static void
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
322 dosite (GtkWidget * widget, gftp_dialog_data * data)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
323 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
324 gftp_window_data * wdata;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
325 const char *edttext;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
326
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
327 wdata = data->data;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
328 edttext = gtk_entry_get_text (GTK_ENTRY (data->edit));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
329 if (*edttext == '\0')
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
330 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
331 ftp_log (gftp_logging_misc, NULL,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
332 _("SITE: Operation canceled...you must enter a string\n"));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
333 return;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
334 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
335
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
336 if (check_reconnect (wdata) < 0)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
337 return;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
338 gftp_site_cmd (wdata->request, edttext);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
339
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
340 if (!GFTP_IS_CONNECTED (wdata->request))
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
341 disconnect (wdata);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
342 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
343
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
344
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
345 int
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
346 chdir_edit (GtkWidget * widget, gpointer data)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
347 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
348 gftp_window_data * wdata;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
349 const char *edttxt;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
350 char *tempstr;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
351
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
352 wdata = data;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
353 edttxt = gtk_entry_get_text (GTK_ENTRY (GTK_COMBO (wdata->combo)->entry));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
354 if (!GFTP_IS_CONNECTED (wdata->request) && *edttxt != '\0')
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
355 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
356 toolbar_hostedit (NULL, NULL);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
357 return (0);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
358 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
359
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
360 if (!check_status (_("Chdir"), wdata, wdata->request->use_threads, 0, 0,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
361 wdata->request->chdir != NULL))
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
362 return (FALSE);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
363
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
364 if ((tempstr = expand_path (edttxt)) == NULL)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
365 return (FALSE);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
366
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
367 if (check_reconnect (wdata) < 0)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
368 return (FALSE);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
369
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
370 if (do_change_dir (wdata, tempstr) == 0)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
371 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
372 gtk_clist_freeze (GTK_CLIST (wdata->listbox));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
373 remove_files_window (wdata);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
374 ftp_list_files (wdata, 1);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
375 gtk_clist_thaw (GTK_CLIST (wdata->listbox));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
376 add_history (wdata->combo, wdata->history, wdata->histlen, tempstr);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
377 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
378
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
379 g_free (tempstr);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
380 return (FALSE);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
381 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
382
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
383
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
384 int
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
385 chdir_dialog (gpointer data)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
386 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
387 GList * templist, * filelist;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
388 gftp_window_data * wdata;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
389 char *newdir, *tempstr;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
390 gftp_file *tempfle;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
391 int num, ret;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
392
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
393 wdata = data;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
394 if (!check_status (_("Chdir"), wdata, wdata->request->use_threads, 1, 0,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
395 wdata->request->chdir != NULL))
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
396 return (0);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
397
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
398 filelist = g_list_first (wdata->files);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
399 templist = GTK_CLIST (wdata->listbox)->selection;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
400 num = 0;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
401 templist = get_next_selection (templist, &filelist, &num);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
402 tempfle = filelist->data;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
403
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
404 newdir = g_strconcat (GFTP_GET_DIRECTORY (wdata->request), "/",
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
405 tempfle->file, NULL);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
406 remove_double_slashes (newdir);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
407 if ((tempstr = expand_path (newdir)) == NULL)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
408 return (0);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
409 g_free (newdir);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
410
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
411 if (check_reconnect (wdata) < 0)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
412 return (0);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
413
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
414 ret = 0;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
415 if (do_change_dir (wdata, tempstr) == 0)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
416 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
417 gtk_clist_freeze (GTK_CLIST (wdata->listbox));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
418 remove_files_window (wdata);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
419 ftp_list_files (wdata, 1);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
420 gtk_clist_thaw (GTK_CLIST (wdata->listbox));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
421 ret = 1;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
422 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
423 g_free (tempstr);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
424 return (ret);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
425 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
426
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
427
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
428 static int
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
429 do_change_dir (gftp_window_data * wdata, char *directory)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
430 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
431 char *olddir;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
432 int ret;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
433
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
434 if (directory != wdata->request->directory)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
435 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
436 olddir = wdata->request->directory;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
437 wdata->request->directory = g_malloc (strlen (directory) + 1);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
438 strcpy (wdata->request->directory, directory);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
439 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
440 else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
441 olddir = NULL;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
442
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
443 ret = (int) generic_thread (do_change_dir_thread, wdata);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
444
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
445 if (!GFTP_IS_CONNECTED (wdata->request))
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
446 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
447 disconnect (wdata);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
448 if (olddir != NULL)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
449 g_free (olddir);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
450 return (-2);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
451 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
452
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
453 if (ret != 0)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
454 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
455 g_free (wdata->request->directory);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
456 wdata->request->directory = olddir;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
457 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
458 else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
459 g_free (olddir);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
460
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
461 return (ret);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
462 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
463
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
464
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
465 static void *
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
466 do_change_dir_thread (void * data)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
467 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
468 gftp_window_data * wdata;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
469 int success, sj;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
470
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
471 wdata = data;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
472 wdata->request->user_data = (void *) 0x01;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
473
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
474 if (wdata->request->use_threads)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
475 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
476 sj = sigsetjmp (chdirenvir, 1);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
477 signal (SIGINT, sig_chdirquit);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
478 signal (SIGALRM, sig_chdirquit);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
479 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
480 else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
481 sj = 0;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
482
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
483 success = 0;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
484 if (sj == 0)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
485 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
486 if (wdata->request->network_timeout > 0)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
487 alarm (wdata->request->network_timeout);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
488 success = gftp_set_directory (wdata->request, wdata->request->directory);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
489 alarm (0);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
490 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
491 else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
492 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
493 gftp_disconnect (wdata->request);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
494 wdata->request->logging_function (gftp_logging_error,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
495 wdata->request->user_data,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
496 _("Operation canceled\n"));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
497 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
498
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
499 if (wdata->request->use_threads)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
500 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
501 signal (SIGINT, SIG_DFL);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
502 signal (SIGALRM, SIG_IGN);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
503 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
504
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
505 wdata->request->user_data = NULL;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
506 wdata->request->stopable = 0;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
507 return ((void *) success);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
508 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
509
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
510
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
511 static RETSIGTYPE
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
512 sig_chdirquit (int signo)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
513 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
514 signal (signo, sig_chdirquit);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
515 siglongjmp (chdirenvir, signo == SIGINT ? 1 : 2);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
516 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
517
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
518
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
519 void
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
520 clearlog (gpointer data)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
521 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
522 guint len;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
523 #if GTK_MAJOR_VERSION == 1 && GTK_MINOR_VERSION == 2
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
524 len = gtk_text_get_length (GTK_TEXT (logwdw));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
525 gtk_text_set_point (GTK_TEXT (logwdw), len);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
526 gtk_text_backward_delete (GTK_TEXT (logwdw), len);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
527 #else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
528 GtkTextBuffer * textbuf;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
529 GtkTextIter iter, iter2;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
530
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
531 textbuf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (logwdw));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
532 len = gtk_text_buffer_get_char_count (textbuf);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
533 gtk_text_buffer_get_iter_at_offset (textbuf, &iter, 0);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
534 gtk_text_buffer_get_iter_at_offset (textbuf, &iter2, len - 1);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
535 gtk_text_buffer_delete (textbuf, &iter, &iter2);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
536 #endif
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
537 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
538
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
539
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
540 void
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
541 viewlog (gpointer data)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
542 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
543 char *tempstr, *txt, *pos;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
544 guint textlen;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
545 ssize_t len;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
546 int fd;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
547 #if !(GTK_MAJOR_VERSION == 1 && GTK_MINOR_VERSION == 2)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
548 GtkTextBuffer * textbuf;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
549 GtkTextIter iter, iter2;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
550 #endif
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
551
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
552 tempstr = g_strconcat (tmp_directory, "/gftp-view.XXXXXXXXXX", NULL);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
553 if ((fd = mkstemp (tempstr)) < 0)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
554 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
555 ftp_log (gftp_logging_misc, NULL, _("Error: Cannot open %s: %s\n"),
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
556 tempstr, g_strerror (errno));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
557 g_free (tempstr);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
558 return;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
559 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
560 chmod (tempstr, S_IRUSR | S_IWUSR);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
561 unlink (tempstr);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
562
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
563 #if GTK_MAJOR_VERSION == 1 && GTK_MINOR_VERSION == 2
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
564 textlen = gtk_text_get_length (GTK_TEXT (logwdw));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
565 txt = gtk_editable_get_chars (GTK_EDITABLE (logwdw), 0, -1);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
566 #else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
567 textbuf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (logwdw));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
568 textlen = gtk_text_buffer_get_char_count (textbuf);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
569 gtk_text_buffer_get_iter_at_offset (textbuf, &iter, 0);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
570 gtk_text_buffer_get_iter_at_offset (textbuf, &iter2, textlen - 1);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
571 txt = gtk_text_buffer_get_text (textbuf, &iter, &iter2, 0);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
572 #endif
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
573 pos = txt;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
574 do
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
575 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
576 if ((len = write (fd, pos, textlen)) == -1)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
577 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
578 ftp_log (gftp_logging_misc, NULL, _("Error: Error writing to %s: %s\n"), tempstr, g_strerror (errno));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
579 break;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
580 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
581 textlen -= len;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
582 pos += len;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
583 } while (textlen > 0);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
584
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
585 lseek (fd, 0, SEEK_SET);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
586 view_file (tempstr, fd, 1, 0, 0, 1, NULL, NULL);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
587 close (fd);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
588 g_free (tempstr);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
589 g_free (txt);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
590 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
591
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
592
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
593 void
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
594 savelog (gpointer data)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
595 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
596 GtkWidget *filew;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
597
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
598 filew = gtk_file_selection_new (_("Save Log"));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
599
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
600 gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (filew)->ok_button),
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
601 "clicked", GTK_SIGNAL_FUNC (dosavelog), filew);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
602 gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION (filew)->ok_button),
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
603 "clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy),
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
604 GTK_OBJECT (filew));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
605 gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION (filew)->cancel_button), "clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (filew));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
606
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
607 gtk_file_selection_set_filename (GTK_FILE_SELECTION (filew), "gftp.log");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
608 gtk_window_set_wmclass (GTK_WINDOW(filew), "Save Log", "gFTP");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
609 gtk_widget_show (filew);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
610 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
611
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
612
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
613 static void
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
614 dosavelog (GtkWidget * widget, GtkFileSelection * fs)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
615 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
616 const char *filename;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
617 char *txt, *pos;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
618 guint textlen;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
619 ssize_t len;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
620 FILE *fd;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
621 int ok;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
622 #if !(GTK_MAJOR_VERSION == 1 && GTK_MINOR_VERSION == 2)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
623 GtkTextBuffer * textbuf;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
624 GtkTextIter iter, iter2;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
625 #endif
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
626
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
627 filename = gtk_file_selection_get_filename (GTK_FILE_SELECTION (fs));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
628 if ((fd = fopen (filename, "w")) == NULL)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
629 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
630 ftp_log (gftp_logging_misc, NULL, _("Error: Cannot open %s: %s\n"),
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
631 filename, g_strerror (errno));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
632 return;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
633 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
634
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
635 #if GTK_MAJOR_VERSION == 1 && GTK_MINOR_VERSION == 2
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
636 textlen = gtk_text_get_length (GTK_TEXT (logwdw));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
637 txt = gtk_editable_get_chars (GTK_EDITABLE (logwdw), 0, -1);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
638 #else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
639 textbuf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (logwdw));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
640 textlen = gtk_text_buffer_get_char_count (textbuf);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
641 gtk_text_buffer_get_iter_at_offset (textbuf, &iter, 0);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
642 gtk_text_buffer_get_iter_at_offset (textbuf, &iter2, textlen - 1);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
643 txt = gtk_text_buffer_get_text (textbuf, &iter, &iter2, 0);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
644 #endif
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
645
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
646 ok = 1;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
647 pos = txt;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
648 do
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
649 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
650 if ((len = write (fileno (fd), pos, textlen)) == -1)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
651 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
652 ok = 0;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
653 ftp_log (gftp_logging_misc, NULL, _("Error: Error writing to %s: %s\n"), filename, g_strerror (errno));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
654 break;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
655 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
656
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
657 textlen -= len;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
658 pos += len;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
659 } while (textlen > 0);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
660
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
661 if (ok)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
662 ftp_log (gftp_logging_misc, NULL,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
663 _("Successfully wrote the log file to %s\n"), filename);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
664
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
665 fclose (fd);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
666 g_free (txt);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
667 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
668
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
669
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
670 void
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
671 clear_cache (gpointer data)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
672 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
673 gftp_clear_cache_files ();
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
674 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
675
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
676
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
677 void
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
678 about_dialog (gpointer data)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
679 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
680 GtkWidget * tempwid, * notebook, * box, * label, * view, * vscroll,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
681 * dialog;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
682 char *tempstr, *no_license_agreement, *str, buf[255];
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
683 size_t len;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
684 FILE * fd;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
685 #if !(GTK_MAJOR_VERSION == 1 && GTK_MINOR_VERSION == 2)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
686 GtkTextBuffer * textbuf;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
687 GtkTextIter iter;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
688 guint textlen;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
689 #endif
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
690
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
691 no_license_agreement = g_strdup_printf (_("Cannot find the license agreement file COPYING. Please make sure it is in either %s or in %s"), BASE_CONF_DIR, SHARE_DIR);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
692
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
693 dialog = gtk_dialog_new ();
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
694 gtk_window_set_title (GTK_WINDOW (dialog), _("About gFTP"));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
695 gtk_window_set_wmclass (GTK_WINDOW(dialog), "about", "gFTP");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
696 gtk_container_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), 10);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
697 gtk_container_border_width (GTK_CONTAINER
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
698 (GTK_DIALOG (dialog)->action_area), 5);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
699 gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 5);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
700 gtk_box_set_homogeneous (GTK_BOX (GTK_DIALOG (dialog)->action_area), TRUE);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
701 gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
702 gtk_signal_connect_object (GTK_OBJECT (dialog), "delete_event",
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
703 GTK_SIGNAL_FUNC (gtk_widget_destroy),
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
704 GTK_OBJECT (dialog));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
705 gtk_widget_realize (dialog);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
706
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
707 notebook = gtk_notebook_new ();
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
708 gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), notebook, TRUE,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
709 TRUE, 0);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
710 gtk_widget_show (notebook);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
711
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
712 box = gtk_vbox_new (TRUE, 5);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
713 gtk_container_border_width (GTK_CONTAINER (box), 10);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
714 gtk_widget_show (box);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
715
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
716 tempwid = toolbar_pixmap (dialog, "gftp-logo.xpm");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
717 gtk_box_pack_start (GTK_BOX (box), tempwid, FALSE, FALSE, 0);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
718 gtk_widget_show (tempwid);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
719
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
720 tempstr = g_strdup_printf (_("%s\nCopyright (C) 1998-2002 Brian Masney <masneyb@gftp.org>\nOfficial Homepage: http://www.gftp.org/\nLogo by: Aaron Worley <planet_hoth@yahoo.com>\n"),
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
721 version);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
722 str = _("Translated by");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
723 if (strcmp (str, "Translated by") != 0)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
724 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
725 tempstr = g_realloc (tempstr, strlen (tempstr) + strlen (str) + 1);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
726 strcat (tempstr, str);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
727 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
728 tempwid = gtk_label_new (tempstr);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
729 g_free (tempstr);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
730 gtk_box_pack_start (GTK_BOX (box), tempwid, FALSE, FALSE, 0);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
731 gtk_widget_show (tempwid);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
732
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
733 label = gtk_label_new (_("About"));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
734 gtk_widget_show (label);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
735
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
736 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), box, label);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
737
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
738 box = gtk_vbox_new (FALSE, 5);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
739 gtk_container_border_width (GTK_CONTAINER (box), 10);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
740 gtk_widget_show (box);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
741
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
742 tempwid = gtk_table_new (1, 2, FALSE);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
743 gtk_box_pack_start (GTK_BOX (box), tempwid, TRUE, TRUE, 0);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
744 gtk_widget_show (tempwid);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
745
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
746 #if GTK_MAJOR_VERSION == 1 && GTK_MINOR_VERSION == 2
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
747 view = gtk_text_new (NULL, NULL);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
748 gtk_text_set_editable (GTK_TEXT (view), FALSE);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
749 gtk_text_set_word_wrap (GTK_TEXT (view), TRUE);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
750
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
751 gtk_table_attach (GTK_TABLE (tempwid), view, 0, 1, 0, 1,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
752 GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND | GTK_SHRINK,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
753 0, 0);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
754 gtk_widget_show (view);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
755
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
756 vscroll = gtk_vscrollbar_new (GTK_TEXT (view)->vadj);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
757 gtk_table_attach (GTK_TABLE (tempwid), vscroll, 1, 2, 0, 1,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
758 GTK_FILL, GTK_EXPAND | GTK_FILL | GTK_SHRINK, 0, 0);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
759 gtk_widget_show (vscroll);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
760 #else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
761 view = gtk_text_view_new ();
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
762 gtk_text_view_set_editable (GTK_TEXT_VIEW (view), FALSE);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
763 gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (view), FALSE);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
764 gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (view), GTK_WRAP_WORD);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
765
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
766 vscroll = gtk_scrolled_window_new (NULL, NULL);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
767 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (vscroll),
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
768 GTK_POLICY_AUTOMATIC,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
769 GTK_POLICY_AUTOMATIC);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
770
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
771 gtk_container_add (GTK_CONTAINER (vscroll), view);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
772 gtk_widget_show (view);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
773
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
774 gtk_table_attach (GTK_TABLE (tempwid), vscroll, 0, 1, 0, 1,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
775 GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND | GTK_SHRINK,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
776 0, 0);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
777 gtk_widget_show (vscroll);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
778
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
779 textbuf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
780 #endif
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
781
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
782 label = gtk_label_new (_("License Agreement"));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
783 gtk_widget_show (label);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
784
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
785 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), box, label);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
786
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
787 tempwid = gtk_button_new_with_label (_(" Close "));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
788 GTK_WIDGET_SET_FLAGS (tempwid, GTK_CAN_DEFAULT);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
789 gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area), tempwid,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
790 FALSE, FALSE, 0);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
791 gtk_signal_connect_object (GTK_OBJECT (tempwid), "clicked",
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
792 GTK_SIGNAL_FUNC (gtk_widget_destroy),
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
793 GTK_OBJECT (dialog));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
794 gtk_widget_grab_default (tempwid);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
795 gtk_widget_show (tempwid);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
796
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
797 tempstr = g_strconcat ("/usr/share/common-licenses/GPL", NULL);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
798 if (access (tempstr, F_OK) != 0)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
799 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
800 g_free (tempstr);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
801 tempstr = expand_path (SHARE_DIR "/COPYING");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
802 if (access (tempstr, F_OK) != 0)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
803 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
804 g_free (tempstr);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
805 tempstr = expand_path (BASE_CONF_DIR "/COPYING");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
806 if (access (tempstr, F_OK) != 0)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
807 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
808 #if GTK_MAJOR_VERSION == 1 && GTK_MINOR_VERSION == 2
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
809 gtk_text_insert (GTK_TEXT (view), NULL, NULL, NULL,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
810 no_license_agreement, -1);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
811 #else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
812 textlen = gtk_text_buffer_get_char_count (textbuf);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
813 gtk_text_buffer_get_iter_at_offset (textbuf, &iter, textlen - 1);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
814 gtk_text_buffer_insert (textbuf, &iter, no_license_agreement, -1);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
815 #endif
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
816 gtk_widget_show (dialog);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
817 return;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
818 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
819 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
820 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
821
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
822 if ((fd = fopen (tempstr, "r")) == NULL)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
823 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
824 #if GTK_MAJOR_VERSION == 1 && GTK_MINOR_VERSION == 2
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
825 gtk_text_insert (GTK_TEXT (view), NULL, NULL, NULL,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
826 no_license_agreement, -1);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
827 #else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
828 textlen = gtk_text_buffer_get_char_count (textbuf);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
829 gtk_text_buffer_get_iter_at_offset (textbuf, &iter, textlen - 1);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
830 gtk_text_buffer_insert (textbuf, &iter, no_license_agreement, -1);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
831 #endif
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
832 gtk_widget_show (dialog);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
833 g_free (tempstr);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
834 return;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
835 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
836 g_free (tempstr);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
837
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
838 memset (buf, 0, sizeof (buf));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
839 while ((len = fread (buf, 1, sizeof (buf) - 1, fd)))
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
840 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
841 buf[len] = '\0';
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
842 #if GTK_MAJOR_VERSION == 1 && GTK_MINOR_VERSION == 2
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
843 gtk_text_insert (GTK_TEXT (view), NULL, NULL, NULL, buf, -1);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
844 #else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
845 textlen = gtk_text_buffer_get_char_count (textbuf);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
846 gtk_text_buffer_get_iter_at_offset (textbuf, &iter, textlen - 1);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
847 gtk_text_buffer_insert (textbuf, &iter, buf, -1);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
848 #endif
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
849 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
850 fclose (fd);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
851 gtk_widget_show (dialog);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
852 g_free (no_license_agreement);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
853 gftp_free_pixmap ("gftp-logo.xpm");
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
854 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
855
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
856
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
857 void
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
858 compare_windows (gpointer data)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
859 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
860 gftp_file * curfle, * otherfle;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
861 GList * curlist, * otherlist;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
862 int row;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
863
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
864 if (!check_status (_("Compare Windows"), &window2, 1, 0, 0, 1))
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
865 return;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
866
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
867 deselectall (&window1);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
868 deselectall (&window2);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
869
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
870 row = 0;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
871 curlist = window1.files;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
872 while (curlist != NULL)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
873 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
874 curfle = curlist->data;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
875 if (!curfle->shown)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
876 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
877 curlist = curlist->next;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
878 continue;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
879 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
880
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
881 otherlist = window2.files;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
882 while (otherlist != NULL)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
883 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
884 otherfle = otherlist->data;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
885 if (!otherfle->shown)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
886 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
887 otherlist = otherlist->next;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
888 continue;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
889 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
890
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
891 if (strcmp (otherfle->file, curfle->file) == 0 &&
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
892 otherfle->isdir == curfle->isdir &&
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
893 (curfle->isdir || otherfle->size == curfle->size))
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
894 break;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
895
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
896 otherlist = otherlist->next;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
897 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
898
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
899 if (otherlist == NULL)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
900 gtk_clist_select_row (GTK_CLIST (window1.listbox), row, 0);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
901 row++;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
902 curlist = curlist->next;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
903 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
904
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
905 row = 0;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
906 curlist = window2.files;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
907 while (curlist != NULL)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
908 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
909 curfle = curlist->data;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
910 if (!curfle->shown)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
911 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
912 curlist = curlist->next;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
913 continue;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
914 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
915
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
916 otherlist = window1.files;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
917 while (otherlist != NULL)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
918 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
919 otherfle = otherlist->data;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
920 if (!otherfle->shown)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
921 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
922 otherlist = otherlist->next;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
923 continue;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
924 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
925
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
926 if (strcmp (otherfle->file, curfle->file) == 0 &&
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
927 otherfle->isdir == curfle->isdir &&
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
928 (curfle->isdir || otherfle->size == curfle->size))
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
929 break;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
930
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
931 otherlist = otherlist->next;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
932 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
933
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
934 if (otherlist == NULL)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
935 gtk_clist_select_row (GTK_CLIST (window2.listbox), row, 0);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
936 row++;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
937 curlist = curlist->next;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
938 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
939 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
940