annotate src/gtk/mkdir_dialog.c @ 308:758d9d648cc0

croatian translations added
author delacko
date Fri, 07 Nov 2003 18:10:04 +0000
parents 2ad324cf4930
children cdabbe5c9a95
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 /* mkdir_dialog.c - make directory dialog box and ftp routines */
255
2ad324cf4930 2003-8-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 195
diff changeset
3 /* Copyright (C) 1998-2003 Brian Masney <masneyb@gftp.org> */
1
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., 59 Temple Place - Suite 330, Boston, MA 02111 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"
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 19
diff changeset
21 static const char cvsid[] = "$Id$";
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
22
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
23 static const char *edttext;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
24
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
25
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
26 static void *
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
27 do_make_dir_thread (void * data)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
28 {
129
fe0b21c006f6 2003-4-13 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
29 int success, sj, network_timeout;
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
30 gftp_window_data * wdata;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
31
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
32 wdata = data;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
33
129
fe0b21c006f6 2003-4-13 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
34 gftp_lookup_request_option (wdata->request, "network_timeout",
fe0b21c006f6 2003-4-13 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
35 &network_timeout);
fe0b21c006f6 2003-4-13 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
36
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
37 if (wdata->request->use_threads)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
38 {
42
cd169e4789df 2002-10-29 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
39 sj = sigsetjmp (jmp_environment, 1);
cd169e4789df 2002-10-29 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
40 use_jmp_environment = 1;
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
41 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
42 else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
43 sj = 0;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
44
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
45 success = 0;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
46 if (sj == 0)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
47 {
129
fe0b21c006f6 2003-4-13 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
48 if (network_timeout > 0)
fe0b21c006f6 2003-4-13 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
49 alarm (network_timeout);
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
50 success = gftp_make_directory (wdata->request, edttext) == 0;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
51 alarm (0);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
52 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
53 else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
54 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
55 gftp_disconnect (wdata->request);
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
56 wdata->request->logging_function (gftp_logging_error,
186
13ca1defdc75 2003-6-16 Brian Masney <masneyb@gftp.org>
masneyb
parents: 182
diff changeset
57 wdata->request,
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
58 _("Operation canceled\n"));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
59 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
60
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
61 if (wdata->request->use_threads)
42
cd169e4789df 2002-10-29 Brian Masney <masneyb@gftp.org>
masneyb
parents: 33
diff changeset
62 use_jmp_environment = 0;
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
63
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
64 wdata->request->stopable = 0;
195
3fa7b4f4ab78 2003-6-19 Brian Masney <masneyb@gftp.org>
masneyb
parents: 186
diff changeset
65 return (GINT_TO_POINTER (success));
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
66 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
67
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
68
19
3b2dcdefc7e9 2002-09-15 Brian Masney <masneyb@gftp.org>
masneyb
parents: 1
diff changeset
69 static void
3b2dcdefc7e9 2002-09-15 Brian Masney <masneyb@gftp.org>
masneyb
parents: 1
diff changeset
70 domkdir (gftp_window_data * wdata, gftp_dialog_data * ddata)
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
71 {
195
3fa7b4f4ab78 2003-6-19 Brian Masney <masneyb@gftp.org>
masneyb
parents: 186
diff changeset
72 int ret;
3fa7b4f4ab78 2003-6-19 Brian Masney <masneyb@gftp.org>
masneyb
parents: 186
diff changeset
73
19
3b2dcdefc7e9 2002-09-15 Brian Masney <masneyb@gftp.org>
masneyb
parents: 1
diff changeset
74 edttext = gtk_entry_get_text (GTK_ENTRY (ddata->edit));
3b2dcdefc7e9 2002-09-15 Brian Masney <masneyb@gftp.org>
masneyb
parents: 1
diff changeset
75 if (*edttext == '\0')
3b2dcdefc7e9 2002-09-15 Brian Masney <masneyb@gftp.org>
masneyb
parents: 1
diff changeset
76 {
3b2dcdefc7e9 2002-09-15 Brian Masney <masneyb@gftp.org>
masneyb
parents: 1
diff changeset
77 ftp_log (gftp_logging_misc, NULL,
3b2dcdefc7e9 2002-09-15 Brian Masney <masneyb@gftp.org>
masneyb
parents: 1
diff changeset
78 _("Mkdir: Operation canceled...you must enter a string\n"));
3b2dcdefc7e9 2002-09-15 Brian Masney <masneyb@gftp.org>
masneyb
parents: 1
diff changeset
79 return;
3b2dcdefc7e9 2002-09-15 Brian Masney <masneyb@gftp.org>
masneyb
parents: 1
diff changeset
80 }
3b2dcdefc7e9 2002-09-15 Brian Masney <masneyb@gftp.org>
masneyb
parents: 1
diff changeset
81
3b2dcdefc7e9 2002-09-15 Brian Masney <masneyb@gftp.org>
masneyb
parents: 1
diff changeset
82 if (check_reconnect (wdata) < 0)
3b2dcdefc7e9 2002-09-15 Brian Masney <masneyb@gftp.org>
masneyb
parents: 1
diff changeset
83 return;
3b2dcdefc7e9 2002-09-15 Brian Masney <masneyb@gftp.org>
masneyb
parents: 1
diff changeset
84
195
3fa7b4f4ab78 2003-6-19 Brian Masney <masneyb@gftp.org>
masneyb
parents: 186
diff changeset
85 ret = GPOINTER_TO_INT (generic_thread (do_make_dir_thread, wdata));
3fa7b4f4ab78 2003-6-19 Brian Masney <masneyb@gftp.org>
masneyb
parents: 186
diff changeset
86 if (ret)
19
3b2dcdefc7e9 2002-09-15 Brian Masney <masneyb@gftp.org>
masneyb
parents: 1
diff changeset
87 {
182
33b394ebba68 2003-6-15 Brian Masney <masneyb@gftp.org>
masneyb
parents: 129
diff changeset
88 gftp_delete_cache_entry (wdata->request, NULL, 0);
19
3b2dcdefc7e9 2002-09-15 Brian Masney <masneyb@gftp.org>
masneyb
parents: 1
diff changeset
89 refresh (wdata);
3b2dcdefc7e9 2002-09-15 Brian Masney <masneyb@gftp.org>
masneyb
parents: 1
diff changeset
90 }
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
91 }
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
92
19
3b2dcdefc7e9 2002-09-15 Brian Masney <masneyb@gftp.org>
masneyb
parents: 1
diff changeset
93
3b2dcdefc7e9 2002-09-15 Brian Masney <masneyb@gftp.org>
masneyb
parents: 1
diff changeset
94 void
3b2dcdefc7e9 2002-09-15 Brian Masney <masneyb@gftp.org>
masneyb
parents: 1
diff changeset
95 mkdir_dialog (gpointer data)
3b2dcdefc7e9 2002-09-15 Brian Masney <masneyb@gftp.org>
masneyb
parents: 1
diff changeset
96 {
3b2dcdefc7e9 2002-09-15 Brian Masney <masneyb@gftp.org>
masneyb
parents: 1
diff changeset
97 gftp_window_data * wdata;
3b2dcdefc7e9 2002-09-15 Brian Masney <masneyb@gftp.org>
masneyb
parents: 1
diff changeset
98
3b2dcdefc7e9 2002-09-15 Brian Masney <masneyb@gftp.org>
masneyb
parents: 1
diff changeset
99 wdata = data;
3b2dcdefc7e9 2002-09-15 Brian Masney <masneyb@gftp.org>
masneyb
parents: 1
diff changeset
100 if (!check_status (_("Mkdir"), wdata, wdata->request->use_threads, 0, 0,
3b2dcdefc7e9 2002-09-15 Brian Masney <masneyb@gftp.org>
masneyb
parents: 1
diff changeset
101 wdata->request->mkdir != NULL))
3b2dcdefc7e9 2002-09-15 Brian Masney <masneyb@gftp.org>
masneyb
parents: 1
diff changeset
102 return;
3b2dcdefc7e9 2002-09-15 Brian Masney <masneyb@gftp.org>
masneyb
parents: 1
diff changeset
103
3b2dcdefc7e9 2002-09-15 Brian Masney <masneyb@gftp.org>
masneyb
parents: 1
diff changeset
104 MakeEditDialog (_("Make Directory"), _("Enter name of directory to create"),
3b2dcdefc7e9 2002-09-15 Brian Masney <masneyb@gftp.org>
masneyb
parents: 1
diff changeset
105 NULL, 1, NULL, gftp_dialog_button_create, domkdir, wdata,
3b2dcdefc7e9 2002-09-15 Brian Masney <masneyb@gftp.org>
masneyb
parents: 1
diff changeset
106 NULL, NULL);
3b2dcdefc7e9 2002-09-15 Brian Masney <masneyb@gftp.org>
masneyb
parents: 1
diff changeset
107 }
3b2dcdefc7e9 2002-09-15 Brian Masney <masneyb@gftp.org>
masneyb
parents: 1
diff changeset
108