[gnome-boxes] wizard-source: Drop use of file chooser dialog



commit dec5863b97f4eab95dcafcc5aee3a981d2e5af87
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Wed Dec 3 17:32:29 2014 +0000

    wizard-source: Drop use of file chooser dialog
    
    Instead of creating and launching a separate dialog to let user select
    ISO960 files/devices, use the new WizardWindow API to present an in-view
    file chooser.
    
    Nested dialogs is something we want to avoid according to our designers.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=741046

 src/wizard-source.vala |   19 +++----------------
 1 files changed, 3 insertions(+), 16 deletions(-)
---
diff --git a/src/wizard-source.vala b/src/wizard-source.vala
index cf8a8f5..4d18ae6 100644
--- a/src/wizard-source.vala
+++ b/src/wizard-source.vala
@@ -279,27 +279,14 @@ private class Boxes.WizardSource: Gtk.Stack {
 
     [GtkCallback]
     private void on_select_file_button_clicked () {
-        var dialog = new Gtk.FileChooserDialog (_("Select a device or ISO file"),
-                                                window,
-                                                Gtk.FileChooserAction.OPEN,
-                                                _("_Cancel"), Gtk.ResponseType.CANCEL,
-                                                _("_Open"), Gtk.ResponseType.ACCEPT);
-        dialog.show_hidden = false;
-        dialog.local_only = false;
-        dialog.filter = new Gtk.FileFilter ();
-        dialog.filter.add_mime_type ("application/x-cd-image");
-        foreach (var extension in InstalledMedia.supported_extensions)
-            dialog.filter.add_pattern ("*" + extension);
-        if (dialog.run () == Gtk.ResponseType.ACCEPT) {
-            uri = dialog.get_uri ();
+        window.wizard_window.show_file_chooser ((uri) => {
+            this.uri = uri;
             // clean install_media as this may be set already when going back in the wizard
             install_media = null;
             activated ();
 
             selected = select_file_button;
-        }
-
-        dialog.destroy ();
+        });
     }
 
     [GtkCallback]


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