[gnome-games] application: Use Gtk.FileChooserDialog for Flatpak



commit 90b486ad1d523f068af7e8f723dd1e6fdcfdd702
Author: Yetizone <andreii lisita gmail com>
Date:   Sat Dec 8 14:45:14 2018 +0200

    application: Use Gtk.FileChooserDialog for Flatpak
    
    File chooser portal right now can only mount one file, which prevents
    multi-file games from working. So let's use regular file chooser for now.
    
    Prevents games on external drives from being added, that will be solved in
    the following commit.
    
    Reverts commit 0184a5d35a38a9b58d667b7f3694ec68bcee4836

 src/ui/application.vala | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/ui/application.vala b/src/ui/application.vala
index 79e40bee..f41dc45b 100644
--- a/src/ui/application.vala
+++ b/src/ui/application.vala
@@ -165,9 +165,11 @@ public class Games.Application : Gtk.Application {
        }
 
        public async void add_game_files_async () {
-               var chooser = new Gtk.FileChooserNative (
+               var chooser = new Gtk.FileChooserDialog (
                        _("Select game files"), window, Gtk.FileChooserAction.OPEN,
-                       _("_Add"), _("_Cancel"));
+                       _("_Cancel"), Gtk.ResponseType.CANCEL,
+                       _("_Add"), Gtk.ResponseType.ACCEPT);
+
 
                chooser.select_multiple = true;
 
@@ -181,6 +183,8 @@ public class Games.Application : Gtk.Application {
                                var uri = new Uri (uri_string);
                                yield add_cached_uri (uri);
                        }
+
+               chooser.close ();
        }
 
        protected override void open (File[] files, string hint) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]