[PATCH xoo 5/8] Provide default location and filetype in the file chooser

Yaakov (Cygwin/X) yselkowitz at users.sourceforge.net
Wed Oct 10 16:07:00 PDT 2012


From: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>

"*.xml" is used instead of "application/xml" so that the xoo.ui GtkBuilder
interface file isn't shown.

Signed-off-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
---
 src/callbacks.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/callbacks.c b/src/callbacks.c
index 9cbdeb8..499b584 100644
--- a/src/callbacks.c
+++ b/src/callbacks.c
@@ -130,6 +130,10 @@ void
 on_select_device (GtkMenuItem * menuitem, FakeApp * app)
 {
   GtkWidget *dialog;
+  GtkFileFilter *filter;
+
+  filter = gtk_file_filter_new ();
+  gtk_file_filter_add_pattern (filter, "*.xml");
 
   dialog = gtk_file_chooser_dialog_new ("Open Device",
 					GTK_WINDOW (app->window),
@@ -137,6 +141,8 @@ on_select_device (GtkMenuItem * menuitem, FakeApp * app)
 					GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
 					GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
 					NULL);
+  gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), PKGDATADIR);
+  gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (dialog), filter);
 
   if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
     {
-- 
1.7.9



More information about the xorg-devel mailing list