diff options
author | Owen Taylor <otaylor@src.gnome.org> | 2003-03-26 17:09:26 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2003-03-26 17:09:26 +0000 |
commit | 79491c1d25c1a417d2588319e706ebf35a8d1779 (patch) | |
tree | 7dfec9d1741d6afc465777c0b75427cc031c92fb /tests | |
parent | 5ef90224aaa8a2054247e8031fcd93c52014f438 (diff) | |
download | gdk-pixbuf-79491c1d25c1a417d2588319e706ebf35a8d1779.tar.gz |
Add a construct-only 'file_system' property, split test case into testfilechooser, testfilechooser-vfs
Diffstat (limited to 'tests')
-rw-r--r-- | tests/testfilechooser.c | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/tests/testfilechooser.c b/tests/testfilechooser.c index bfdaa7233..afcdf1601 100644 --- a/tests/testfilechooser.c +++ b/tests/testfilechooser.c @@ -3,6 +3,12 @@ #include "gtkfilechooser.h" #include "prop-editor.h" +#ifdef USE_GNOME_VFS +#include "gtkfilesystemgnomevfs.h" +#else +#include "gtkfilesystemunix.h" +#endif + static void print_current_folder (GtkFileChooser *chooser) { @@ -45,14 +51,26 @@ main (int argc, char **argv) GtkWidget *button; GtkWidget *dialog; GtkWidget *prop_editor; + GtkFileSystem *file_system; gtk_init (&argc, &argv); - dialog = gtk_file_chooser_dialog_new ("Select a file", NULL, - GTK_FILE_CHOOSER_ACTION_OPEN, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_OPEN, GTK_RESPONSE_OK, - NULL); +#ifdef USE_GNOME_VFS + file_system = _gtk_file_system_gnome_vfs_new (); +#else + file_system = _gtk_file_system_unix_new (); +#endif + + dialog = g_object_new (GTK_TYPE_FILE_CHOOSER_DIALOG, + "action", GTK_FILE_CHOOSER_ACTION_OPEN, + "file_system", file_system, + "title", "Select a file", + NULL); + + gtk_dialog_add_buttons (GTK_DIALOG (dialog), + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_OPEN, GTK_RESPONSE_OK, + NULL); gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK); g_signal_connect (dialog, "selection_changed", |