diff options
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/LibraryWindow.vala | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/library/LibraryWindow.vala b/src/library/LibraryWindow.vala index 849ae2e..280a50b 100644 --- a/src/library/LibraryWindow.vala +++ b/src/library/LibraryWindow.vala @@ -765,17 +765,27 @@ public class LibraryWindow : AppWindow { } Gee.ArrayList<FileImportJob> jobs = new Gee.ArrayList<FileImportJob>(); + Gee.ArrayList<string> rejected = new Gee.ArrayList<string>(); foreach (string uri in uris) { File file_or_dir = File.new_for_uri(uri); + if (file_or_dir.get_path() == null) { - // TODO: Specify which directory/file. - AppWindow.error_message(_("Photos cannot be imported from this directory.")); - + rejected.add(uri); continue; } jobs.add(new FileImportJob(file_or_dir, copy_to_library, recurse)); } + + if (rejected.size > 0) { + // TODO: Specify which directory/file. + //var message = ngettext("Photos cannot be imported from this folder", "Photos cannot be imported from these folders", rejected.size) + var message = _("Photos cannot be imported from this directory."); + foreach (var uri in rejected) { + message += uri; + } + AppWindow.error_message(message); + } if (jobs.size > 0) { BatchImport batch_import = new BatchImport(jobs, job_name, import_reporter); |