summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/testfilechooser.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/testfilechooser.c b/tests/testfilechooser.c
index 7c008055ee..86b0d57bff 100644
--- a/tests/testfilechooser.c
+++ b/tests/testfilechooser.c
@@ -489,12 +489,14 @@ main (int argc, char **argv)
gboolean multiple = FALSE;
char *action_arg = NULL;
char *backend = NULL;
+ char *initial_filename = NULL;
GError *error = NULL;
GOptionEntry options[] = {
{ "action", 'a', 0, G_OPTION_ARG_STRING, &action_arg, "Filechooser action", "ACTION" },
{ "backend", 'b', 0, G_OPTION_ARG_STRING, &backend, "Filechooser backend (default: gtk+)", "BACKEND" },
{ "multiple", 'm', 0, G_OPTION_ARG_NONE, &multiple, "Select-multiple", NULL },
{ "right-to-left", 'r', 0, G_OPTION_ARG_NONE, &force_rtl, "Force right-to-left layout.", NULL },
+ { "initial-filename", 'f', 0, G_OPTION_ARG_FILENAME, &initial_filename, "Initial filename to select", "FILENAME" },
{ NULL }
};
@@ -625,6 +627,11 @@ main (int argc, char **argv)
"file:///usr/share/pixmaps",
NULL);
+ /* Initial filename */
+
+ if (initial_filename)
+ set_filename (GTK_FILE_CHOOSER (dialog), initial_filename);
+
/* show_all() to reveal bugs in composite widget handling */
gtk_widget_show_all (dialog);