summaryrefslogtreecommitdiff
path: root/demos
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-03-29 23:39:25 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-03-29 23:40:17 -0400
commit8b64f0147ccd88d00f9e84a2855fc37883f61181 (patch)
tree0192368992f750c22294e663533d1f5d0e777c8b /demos
parentca0e1be03e0f7ded97e2b1746baee0de0ead15c5 (diff)
downloadgtk+-8b64f0147ccd88d00f9e84a2855fc37883f61181.tar.gz
gtk-demo: Allow opening images in video player
It works, so why not.
Diffstat (limited to 'demos')
-rw-r--r--demos/gtk-demo/video_player.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/demos/gtk-demo/video_player.c b/demos/gtk-demo/video_player.c
index 2ea4c9f3a3..8b467a25d9 100644
--- a/demos/gtk-demo/video_player.c
+++ b/demos/gtk-demo/video_player.c
@@ -42,10 +42,25 @@ open_clicked_cb (GtkWidget *button,
"_Cancel");
filter = gtk_file_filter_new ();
+ gtk_file_filter_add_pattern (filter, "*");
+ gtk_file_filter_set_name (filter, "All Files");
+ gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter);
+ g_object_unref (filter);
+
+ filter = gtk_file_filter_new ();
+ gtk_file_filter_add_mime_type (filter, "image/*");
+ gtk_file_filter_set_name (filter, "Images");
+ gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter);
+ g_object_unref (filter);
+
+ filter = gtk_file_filter_new ();
gtk_file_filter_add_mime_type (filter, "video/*");
gtk_file_filter_set_name (filter, "Video");
+ gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter);
+
gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (dialog), filter);
g_object_unref (filter);
+
gtk_native_dialog_set_modal (GTK_NATIVE_DIALOG (dialog), TRUE);
g_signal_connect (dialog, "response", G_CALLBACK (open_dialog_response_cb), video);
gtk_native_dialog_show (GTK_NATIVE_DIALOG (dialog));