comparison src/gtk/view_dialog.c @ 677:8990a8a26ccf

2005-1-24 Brian Masney <masneyb@gftp.org> * lib/protocols.c lib/rfc959.c src/gtk/dnd.c src/gtk/gftp-gtk.c src/gtk/gtkui.c src/gtk/menu-items.c src/gtk/misc-gtk.c src/gtk/transfer.c src/gtk/view-dialog.c src/uicommon/gftpui.c - make sure the logging level gftp_logging_error is used for all error messages
author masneyb
date Tue, 25 Jan 2005 02:34:19 +0000
parents fa0838b22b14
children 49cfbe02926b
comparison
equal deleted inserted replaced
676:72a6de68d9c8 677:8990a8a26ccf
42 templist = get_next_selection (templist, &filelist, &num); 42 templist = get_next_selection (templist, &filelist, &num);
43 curfle = filelist->data; 43 curfle = filelist->data;
44 44
45 if (S_ISDIR (curfle->st_mode)) 45 if (S_ISDIR (curfle->st_mode))
46 { 46 {
47 ftp_log (gftp_logging_misc, NULL, 47 ftp_log (gftp_logging_error, NULL,
48 _("View: %s is a directory. Cannot view it.\n"), curfle->file); 48 _("View: %s is a directory. Cannot view it.\n"), curfle->file);
49 return; 49 return;
50 } 50 }
51 51
52 if (strcmp (gftp_protocols[fromwdata->request->protonum].name, "Local") == 0) 52 if (strcmp (gftp_protocols[fromwdata->request->protonum].name, "Local") == 0)
70 new_fle->fd = mkstemps (new_fle->destfile, 0); 70 new_fle->fd = mkstemps (new_fle->destfile, 0);
71 } 71 }
72 72
73 if (new_fle->fd < 0) 73 if (new_fle->fd < 0)
74 { 74 {
75 ftp_log (gftp_logging_misc, NULL, 75 ftp_log (gftp_logging_error, NULL,
76 _("Error: Cannot open %s for writing: %s\n"), 76 _("Error: Cannot open %s for writing: %s\n"),
77 new_fle->destfile, g_strerror (errno)); 77 new_fle->destfile, g_strerror (errno));
78 gftp_file_destroy (new_fle, 1); 78 gftp_file_destroy (new_fle, 1);
79 return; 79 return;
80 } 80 }
108 gftp_lookup_request_option (fromwdata->request, "edit_program", 108 gftp_lookup_request_option (fromwdata->request, "edit_program",
109 &edit_program); 109 &edit_program);
110 110
111 if (*edit_program == '\0') 111 if (*edit_program == '\0')
112 { 112 {
113 ftp_log (gftp_logging_misc, NULL, 113 ftp_log (gftp_logging_error, NULL,
114 _("Edit: You must specify an editor in the options dialog\n")); 114 _("Edit: You must specify an editor in the options dialog\n"));
115 return; 115 return;
116 } 116 }
117 117
118 templist = GTK_CLIST (fromwdata->listbox)->selection; 118 templist = GTK_CLIST (fromwdata->listbox)->selection;
121 templist = get_next_selection (templist, &filelist, &num); 121 templist = get_next_selection (templist, &filelist, &num);
122 curfle = filelist->data; 122 curfle = filelist->data;
123 123
124 if (S_ISDIR (curfle->st_mode)) 124 if (S_ISDIR (curfle->st_mode))
125 { 125 {
126 ftp_log (gftp_logging_misc, NULL, 126 ftp_log (gftp_logging_error, NULL,
127 _("Edit: %s is a directory. Cannot edit it.\n"), curfle->file); 127 _("Edit: %s is a directory. Cannot edit it.\n"), curfle->file);
128 return; 128 return;
129 } 129 }
130 130
131 if (strcmp (gftp_protocols[fromwdata->request->protonum].name, "Local") == 0) 131 if (strcmp (gftp_protocols[fromwdata->request->protonum].name, "Local") == 0)
149 new_fle->fd = mkstemps (new_fle->destfile, 0); 149 new_fle->fd = mkstemps (new_fle->destfile, 0);
150 } 150 }
151 151
152 if (new_fle->fd < 0) 152 if (new_fle->fd < 0)
153 { 153 {
154 ftp_log (gftp_logging_misc, NULL, 154 ftp_log (gftp_logging_error, NULL,
155 _("Error: Cannot open %s for writing: %s\n"), 155 _("Error: Cannot open %s for writing: %s\n"),
156 new_fle->destfile, g_strerror (errno)); 156 new_fle->destfile, g_strerror (errno));
157 gftp_file_destroy (new_fle, 1); 157 gftp_file_destroy (new_fle, 1);
158 return; 158 return;
159 } 159 }
307 307
308 if (fd == 0) 308 if (fd == 0)
309 { 309 {
310 if ((fd = open (filename, O_RDONLY)) < 0) 310 if ((fd = open (filename, O_RDONLY)) < 0)
311 { 311 {
312 ftp_log (gftp_logging_misc, NULL, 312 ftp_log (gftp_logging_error, NULL,
313 _("View: Cannot open file %s: %s\n"), filename, 313 _("View: Cannot open file %s: %s\n"), filename,
314 g_strerror (errno)); 314 g_strerror (errno));
315 return; 315 return;
316 } 316 }
317 doclose = 1; 317 doclose = 1;