174
174
// Otherwise we simple use the error notification from glib
178
// Escape to the outer catch clause, and overwrite
179
// the weird glib's standard errors.
180
throw new Error (e.domain, e.code, msg);
180
184
var info = file.query_info ("standard::*", FileQueryInfoFlags.NONE, null);
185
string err_msg = _("File \"%s\" cannot be opened.\n%s");
181
188
switch (info.get_file_type ()) {
182
189
case FileType.REGULAR:
183
190
case FileType.SYMBOLIC_LINK:
186
193
case FileType.MOUNTABLE:
187
string reason = _("Is a mountable location.");
188
msg = _("File \"%s\" cannot be opened.\n%s").printf ("<b>%s</b>".printf (file.get_uri ()), reason);
194
reason = _("It is a mountable location.");
190
196
case FileType.DIRECTORY:
191
string reason = _("Is a directory.");
192
msg = _("File \"%s\" cannot be opened.\n%s").printf ("<b>%s</b>".printf (file.get_uri ()), reason);
197
reason = _("It is a directory.");
194
199
case FileType.SPECIAL:
195
string reason = _("Is a \"special\" file such as a socket,\n fifo, block device, or character device.");
196
msg = _("File \"%s\" cannot be opened.\n%s").printf ("<b>%s</b>".printf (file.get_uri ()), reason);
200
reason = _("It is a \"special\" file such as a socket,\n fifo, block device, or character device.");
199
string reason = _("Is a \"unknown\" file type.");
200
msg = _("File \"%s\" cannot be opened.\n%s").printf ("<b>%s</b>".printf (file.get_uri ()), reason);
203
reason = _("It is an \"unknown\" file type.");
207
if (reason.length > 0) {
208
msg = err_msg.printf ("<b>%s</b>".printf (file.get_uri ()), reason);
203
211
} catch (Error e) {
204
212
warning (e.message);