diff --git a/README.md b/README.md index 3fe16b5c1..a9775d4b0 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ You'll need the following dependencies: * libswitchboard-3-dev * libgee-0.8-dev * libgexiv2-dev -* libgtk-4-dev (>=4.8) +* libgtk-4-dev (>=4.10) * libgranite-7-dev (>=7.5.0) * meson * valac diff --git a/meson.build b/meson.build index 7d0ed9c40..e6147efd3 100644 --- a/meson.build +++ b/meson.build @@ -21,7 +21,7 @@ gio_dep = dependency('gio-2.0') glib_dep = dependency('glib-2.0') gobject_dep = dependency('gobject-2.0') granite_dep = dependency('granite-7', version: '>=7.5.0') -gtk_dep = dependency('gtk4', version: '>=4.8') +gtk_dep = dependency('gtk4', version: '>=4.10') hdy_dep = dependency ('libadwaita-1') posix_dep = meson.get_compiler('vala').find_library('posix') diff --git a/src/Views/Wallpaper.vala b/src/Views/Wallpaper.vala index 4855d9101..335e008ef 100644 --- a/src/Views/Wallpaper.vala +++ b/src/Views/Wallpaper.vala @@ -148,20 +148,18 @@ public class PantheonShell.Wallpaper : Gtk.Box { var filter = new Gtk.FileFilter (); filter.add_mime_type ("image/*"); - var chooser = new Gtk.FileChooserNative ( - _("Import Photo"), null, Gtk.FileChooserAction.OPEN, - _("Import"), - _("Cancel") - ); - chooser.filter = filter; - chooser.select_multiple = true; - - chooser.show (); - chooser.response.connect ((response) => { - if (response == Gtk.ResponseType.ACCEPT) { - var files = chooser.get_files (); - for (var i = 0; i <= files.get_n_items (); i++) { - var file = (File) files.get_item (i); + var file_dialog = new Gtk.FileDialog () { + accept_label = _("Import"), + default_filter = filter, + modal = true, + title = _("Import Photos") + }; + + file_dialog.open_multiple.begin ((Gtk.Window) get_root (), null, (obj, res) => { + var list_model = file_dialog.open_multiple.end (res); + if (list_model != null) { + for (var i = 0; i <= list_model.get_n_items (); i++) { + var file = (File) list_model.get_item (i); if (WallpaperOperation.get_is_file_in_bg_dir (file)) { continue; @@ -176,7 +174,6 @@ public class PantheonShell.Wallpaper : Gtk.Box { add_wallpaper_from_file (file, local_uri); } } - chooser.destroy (); }); }