[ease/themes] Add GtkFileFilters to dialogs.



commit a314b2005db9207694e4ac8465c0bb76eefa193d
Author: Nate Stedman <natesm gmail com>
Date:   Mon Jun 7 18:42:08 2010 -0400

    Add GtkFileFilters to dialogs.

 src/EditorWindow.vala |    4 ++++
 src/OpenDialog.vala   |    5 +++++
 2 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/EditorWindow.vala b/src/EditorWindow.vala
index b9cf2d2..bf90467 100644
--- a/src/EditorWindow.vala
+++ b/src/EditorWindow.vala
@@ -166,6 +166,10 @@ public class Ease.EditorWindow : Gtk.Window
 		        	                          Gtk.ResponseType.CANCEL,
 		        	                          "gtk-open",
 		        	                          Gtk.ResponseType.ACCEPT, null);
+		        
+		        var filter = new Gtk.FileFilter();
+				filter.add_pattern("*.ease");
+				dialog.filter = filter;
 
 				if (dialog.run() == Gtk.ResponseType.ACCEPT)
 				{
diff --git a/src/OpenDialog.vala b/src/OpenDialog.vala
index 16f5cef..1e66ded 100644
--- a/src/OpenDialog.vala
+++ b/src/OpenDialog.vala
@@ -53,6 +53,11 @@ public class Ease.OpenDialog : GLib.Object
 		                                       Gtk.ResponseType.CANCEL,
 		                                       "gtk-open",
 		                                       Gtk.ResponseType.ACCEPT);
+		
+		// filter to only .ease files
+		var filter = new Gtk.FileFilter();
+		filter.add_pattern("*.ease");
+		dialog.filter = filter;
 
 		if (dialog.run() == Gtk.ResponseType.ACCEPT)
 		{



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