diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-03-29 23:39:25 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-03-29 23:40:17 -0400 |
commit | 8b64f0147ccd88d00f9e84a2855fc37883f61181 (patch) | |
tree | 0192368992f750c22294e663533d1f5d0e777c8b /demos | |
parent | ca0e1be03e0f7ded97e2b1746baee0de0ead15c5 (diff) | |
download | gtk+-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.c | 15 |
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)); |