diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2023-12-29 18:43:43 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2023-12-29 18:43:43 +0100 |
commit | 14bc7db2e07c5d1ccfb4d723c9dba395e6c93171 (patch) | |
tree | 7b00861348dedd18d3651537128bbe783dab364c /src/library/LibraryWindow.vala | |
parent | 1bf62485f701b52ae27433e3570ac24cd7da886f (diff) | |
parent | 67d142325abb0d9345baef77f00a047a7dc1eca3 (diff) |
Merge branch 'release/debian/0.32.4-1'debian/0.32.4-1
Diffstat (limited to 'src/library/LibraryWindow.vala')
-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); |