[gnome-boxes/wip/feborges/no-filesystem-access: 4/6] app-window: Use GtkFileChooserNative



commit dad1ab9808580267e4a6d4b0e4949a599d4ae483
Author: Felipe Borges <felipeborges gnome org>
Date:   Fri Oct 26 17:47:50 2018 +0200

    app-window: Use GtkFileChooserNative
    
    These changes are necessary in order to make Boxes consume the
    Flatpak file chooser portal.
    
    FileChooserNative is an abstraction of a file chooser dialog that
    uses the running platform's native file chooser dialog. Although
    Boxes is Linux-exclusive, we need FileChooserNative in order to
    consume the org.freedesktop.portal.FileChooser portal whenever it
    is available on the session bus.
    
    This way we bring up an out-of-process file chooser that enables
    the user to select a file to be used in Boxes without giving us
    access to the filesystem out of the Flatpak sandbox.

 src/app-window.vala | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/src/app-window.vala b/src/app-window.vala
index 005723bb..858ea234 100644
--- a/src/app-window.vala
+++ b/src/app-window.vala
@@ -322,12 +322,9 @@ public void show_properties () {
     }
 
     public void show_send_file () {
-        var dialog = new Gtk.FileChooserDialog (
+        var dialog = new Gtk.FileChooserNative (
                 _("Select files to transfer"), this, Gtk.FileChooserAction.OPEN,
-                _("_Cancel"),
-                Gtk.ResponseType.CANCEL,
-                _("_Open"),
-                Gtk.ResponseType.ACCEPT);
+                _("_Open"), _("_Cancel"));
         dialog.select_multiple = true;
 
         if (dialog.run () == Gtk.ResponseType.ACCEPT) {


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