summaryrefslogtreecommitdiffstats
path: root/gtk/src/main.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2011-09-19 16:54:09 +0000
committerjstebbins <[email protected]>2011-09-19 16:54:09 +0000
commit425fbc1171959cf2257e71933d87e2a88589016d (patch)
tree7f7fa22cb13ff40846662553de997683711a914e /gtk/src/main.c
parent243f77efd0bede0ea44f63e309b8fcb3b29b5cbc (diff)
LinGui: add source type filter to source dialog
Lets you filter down the list to just the files you are interested in seeing. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4234 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src/main.c')
-rw-r--r--gtk/src/main.c96
1 files changed, 96 insertions, 0 deletions
diff --git a/gtk/src/main.c b/gtk/src/main.c
index 3c49e8766..3c771aedc 100644
--- a/gtk/src/main.c
+++ b/gtk/src/main.c
@@ -997,6 +997,102 @@ main (int argc, char *argv[])
gtk_window_resize(GTK_WINDOW(widget), width, height);
gtk_widget_show(widget);
+ /*
+ * Filter objects in GtkBuilder xml
+ * Unfortunately, GtkFilter is poorly supported by GtkBuilder,
+ * so a lot of the setup must happen in code.
+ SourceFilterAll
+ SourceFilterVideo
+ SourceFilterTS
+ SourceFilterMPG
+ SourceFilterEVO
+ SourceFilterVOB
+ SourceFilterMKV
+ SourceFilterMP4
+ SourceFilterAVI
+ SourceFilterMOV
+ SourceFilterOGG
+ SourceFilterFLV
+ SourceFilterWMV
+ */
+ // Add filters to source chooser
+ GtkFileFilter *filter;
+ GtkFileChooser *chooser;
+ chooser = GTK_FILE_CHOOSER(GHB_WIDGET(ud->builder, "source_dialog"));
+ filter = GTK_FILE_FILTER(GHB_OBJECT(ud->builder, "SourceFilterAll"));
+ gtk_file_filter_set_name(filter, "All");
+ gtk_file_filter_add_pattern(filter, "*");
+ gtk_file_chooser_add_filter(chooser, filter);
+ filter = GTK_FILE_FILTER(GHB_OBJECT(ud->builder, "SourceFilterVideo"));
+ gtk_file_filter_set_name(filter, "Video");
+ gtk_file_filter_add_mime_type(filter, "video/*");
+ gtk_file_chooser_add_filter(chooser, filter);
+ filter = GTK_FILE_FILTER(GHB_OBJECT(ud->builder, "SourceFilterTS"));
+ gtk_file_filter_set_name(filter, "TS");
+ gtk_file_filter_add_pattern(filter, "*.ts");
+ gtk_file_filter_add_pattern(filter, "*.TS");
+ gtk_file_filter_add_pattern(filter, "*.m2ts");
+ gtk_file_filter_add_pattern(filter, "*.M2TS");
+ gtk_file_chooser_add_filter(chooser, filter);
+ filter = GTK_FILE_FILTER(GHB_OBJECT(ud->builder, "SourceFilterMPG"));
+ gtk_file_filter_set_name(filter, "MPG");
+ gtk_file_filter_add_pattern(filter, "*.mpg");
+ gtk_file_filter_add_pattern(filter, "*.MPG");
+ gtk_file_filter_add_pattern(filter, "*.mepg");
+ gtk_file_filter_add_pattern(filter, "*.MEPG");
+ gtk_file_chooser_add_filter(chooser, filter);
+ filter = GTK_FILE_FILTER(GHB_OBJECT(ud->builder, "SourceFilterEVO"));
+ gtk_file_filter_set_name(filter, "EVO");
+ gtk_file_filter_add_pattern(filter, "*.evo");
+ gtk_file_filter_add_pattern(filter, "*.EVO");
+ gtk_file_chooser_add_filter(chooser, filter);
+ filter = GTK_FILE_FILTER(GHB_OBJECT(ud->builder, "SourceFilterVOB"));
+ gtk_file_filter_set_name(filter, "VOB");
+ gtk_file_filter_add_pattern(filter, "*.vob");
+ gtk_file_filter_add_pattern(filter, "*.VOB");
+ gtk_file_chooser_add_filter(chooser, filter);
+ filter = GTK_FILE_FILTER(GHB_OBJECT(ud->builder, "SourceFilterMKV"));
+ gtk_file_filter_set_name(filter, "MKV");
+ gtk_file_filter_add_pattern(filter, "*.mkv");
+ gtk_file_filter_add_pattern(filter, "*.MKV");
+ gtk_file_chooser_add_filter(chooser, filter);
+ filter = GTK_FILE_FILTER(GHB_OBJECT(ud->builder, "SourceFilterMP4"));
+ gtk_file_filter_set_name(filter, "MP4");
+ gtk_file_filter_add_pattern(filter, "*.mp4");
+ gtk_file_filter_add_pattern(filter, "*.MP4");
+ gtk_file_filter_add_pattern(filter, "*.m4v");
+ gtk_file_filter_add_pattern(filter, "*.M4V");
+ gtk_file_chooser_add_filter(chooser, filter);
+ filter = GTK_FILE_FILTER(GHB_OBJECT(ud->builder, "SourceFilterMOV"));
+ gtk_file_filter_set_name(filter, "MOV");
+ gtk_file_filter_add_pattern(filter, "*.mov");
+ gtk_file_filter_add_pattern(filter, "*.MOV");
+ gtk_file_chooser_add_filter(chooser, filter);
+ filter = GTK_FILE_FILTER(GHB_OBJECT(ud->builder, "SourceFilterAVI"));
+ gtk_file_filter_set_name(filter, "AVI");
+ gtk_file_filter_add_pattern(filter, "*.avi");
+ gtk_file_filter_add_pattern(filter, "*.AVI");
+ gtk_file_chooser_add_filter(chooser, filter);
+ filter = GTK_FILE_FILTER(GHB_OBJECT(ud->builder, "SourceFilterOGG"));
+ gtk_file_filter_set_name(filter, "OGG");
+ gtk_file_filter_add_pattern(filter, "*.ogg");
+ gtk_file_filter_add_pattern(filter, "*.OGG");
+ gtk_file_filter_add_pattern(filter, "*.ogv");
+ gtk_file_filter_add_pattern(filter, "*.OGV");
+ gtk_file_filter_add_pattern(filter, "*.ogm");
+ gtk_file_filter_add_pattern(filter, "*.OGM");
+ gtk_file_chooser_add_filter(chooser, filter);
+ filter = GTK_FILE_FILTER(GHB_OBJECT(ud->builder, "SourceFilterFLV"));
+ gtk_file_filter_set_name(filter, "FLV");
+ gtk_file_filter_add_pattern(filter, "*.flv");
+ gtk_file_filter_add_pattern(filter, "*.FLV");
+ gtk_file_chooser_add_filter(chooser, filter);
+ filter = GTK_FILE_FILTER(GHB_OBJECT(ud->builder, "SourceFilterWMV"));
+ gtk_file_filter_set_name(filter, "WMV");
+ gtk_file_filter_add_pattern(filter, "*.wmv");
+ gtk_file_filter_add_pattern(filter, "*.WMV");
+ gtk_file_chooser_add_filter(chooser, filter);
+
// Everything should be go-to-go. Lets rock!
gtk_main ();