[baobab/wip/vala: 25/45] Implement file chooser dir selection



commit 2480624e4bff8f2693ef7ed16cd450afcc7b9adc
Author: Paolo Borelli <pborelli gnome org>
Date:   Sat Jan 7 18:40:29 2012 +0100

    Implement file chooser dir selection

 src/baobab-window.vala |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)
---
diff --git a/src/baobab-window.vala b/src/baobab-window.vala
index ddc0730..2042e7a 100644
--- a/src/baobab-window.vala
+++ b/src/baobab-window.vala
@@ -73,7 +73,22 @@ namespace Baobab {
 		}
 
 		void on_scan_folder_activate () {
-			print ("sf\n");
+			var file_chooser = new Gtk.FileChooserDialog (_("Select Folder"), this,
+			                                              Gtk.FileChooserAction.SELECT_FOLDER,
+			                                              Gtk.Stock.CANCEL, Gtk.ResponseType.CANCEL,
+			                                              Gtk.Stock.OPEN, Gtk.ResponseType.ACCEPT);
+
+			file_chooser.set_modal (true);
+
+			file_chooser.response.connect((response) => {
+				if (response == Gtk.ResponseType.ACCEPT) {
+					var dir = file_chooser.get_file ();
+					scan_directory (dir);
+				}
+				file_chooser.destroy ();
+			});
+
+			file_chooser.show ();
 		}
 
 		void on_scan_remote_activate () {



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