summaryrefslogtreecommitdiff
path: root/src/library/LibraryWindow.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2018-05-01 14:35:32 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2018-05-01 14:35:32 +0200
commite230b6f78546827521107be23797048482c8b193 (patch)
tree948c1e77382c484819ea399bba4edcdc19cc6bf0 /src/library/LibraryWindow.vala
parent211da5fc3048ca2b6ccee2166b0aaaade55cb84f (diff)
parent49120f48474fc8fdc2448c75d961bc238213cfac (diff)
Update upstream source from tag 'upstream/0.28.2'
Update to upstream version '0.28.2' with Debian dir 811236a8e9a1308bf427065dcb6270419ff4f965
Diffstat (limited to 'src/library/LibraryWindow.vala')
-rw-r--r--src/library/LibraryWindow.vala17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/library/LibraryWindow.vala b/src/library/LibraryWindow.vala
index 0a39318..47a0ad9 100644
--- a/src/library/LibraryWindow.vala
+++ b/src/library/LibraryWindow.vala
@@ -95,6 +95,7 @@ public class LibraryWindow : AppWindow {
}
private string import_dir = Environment.get_home_dir();
+ private bool import_recursive = true;
private Gtk.Paned sidebar_paned = new Gtk.Paned(Gtk.Orientation.VERTICAL);
private Gtk.Paned client_paned = new Gtk.Paned(Gtk.Orientation.HORIZONTAL);
@@ -510,10 +511,15 @@ public class LibraryWindow : AppWindow {
import_dialog.set_local_only(false);
import_dialog.set_select_multiple(true);
import_dialog.set_current_folder(import_dir);
+
+ var recursive = new Gtk.CheckButton.with_label(_("Recurse Into Subfolders"));
+ recursive.active = import_recursive;
+ import_dialog.set_extra_widget(recursive);
int response = import_dialog.run();
if (response == Gtk.ResponseType.OK) {
+ import_dialog.hide();
// force file linking if directory is inside current library directory
Gtk.ResponseType copy_files_response =
AppDirs.is_in_import_dir(File.new_for_uri(import_dialog.get_uri()))
@@ -521,11 +527,12 @@ public class LibraryWindow : AppWindow {
if (copy_files_response != Gtk.ResponseType.CANCEL) {
dispatch_import_jobs(import_dialog.get_uris(), "folders",
- copy_files_response == Gtk.ResponseType.ACCEPT);
+ copy_files_response == Gtk.ResponseType.ACCEPT, recursive.active);
}
}
import_dir = import_dialog.get_current_folder();
+ import_recursive = recursive.active;
import_dialog.destroy();
}
@@ -645,7 +652,7 @@ public class LibraryWindow : AppWindow {
}
private void on_preferences() {
- PreferencesDialog.show();
+ PreferencesDialog.show_preferences();
}
private void on_display_basic_properties(GLib.SimpleAction action, Variant? value) {
@@ -766,7 +773,7 @@ public class LibraryWindow : AppWindow {
ImportUI.report_manifest(manifest, true);
}
- private void dispatch_import_jobs(GLib.SList<string> uris, string job_name, bool copy_to_library) {
+ private void dispatch_import_jobs(GLib.SList<string> uris, string job_name, bool copy_to_library, bool recurse) {
if (AppDirs.get_import_dir().get_path() == Environment.get_home_dir() && notify_library_is_home_dir) {
Gtk.ResponseType response = AppWindow.affirm_cancel_question(
_("Shotwell is configured to import photos to your home directory.\n" +
@@ -790,7 +797,7 @@ public class LibraryWindow : AppWindow {
continue;
}
- jobs.add(new FileImportJob(file_or_dir, copy_to_library));
+ jobs.add(new FileImportJob(file_or_dir, copy_to_library, recurse));
}
if (jobs.size > 0) {
@@ -897,7 +904,7 @@ public class LibraryWindow : AppWindow {
}
}
- dispatch_import_jobs(uris, "drag-and-drop", selected_action == Gdk.DragAction.COPY);
+ dispatch_import_jobs(uris, "drag-and-drop", selected_action == Gdk.DragAction.COPY, true);
Gtk.drag_finish(context, true, false, time);
}