Revision: 1356 http://svn.sourceforge.net/geany/?rev=1356&view=rev Author: eht16 Date: 2007-03-01 14:38:31 -0800 (Thu, 01 Mar 2007)
Log Message: ----------- Added new file filter for Open File dialog to only show supported source files (list of all defined filename extensions).
Modified Paths: -------------- trunk/ChangeLog trunk/src/dialogs.c trunk/src/filetypes.c trunk/src/filetypes.h
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-03-01 22:20:37 UTC (rev 1355) +++ trunk/ChangeLog 2007-03-01 22:38:31 UTC (rev 1356) @@ -18,8 +18,11 @@ * src/build.c, src/tools.c, src/utils.c, src/utils.h: Set IO channels for custom commands to blocking mode (thanks to Jeff Pohlmeyer). - * data/filetypes.python: + * data/filetypes.python, src/highlighting.c: Added missing keywords: as, with, False, None and True. + * src/dialogs.c, src/filetypes.c, src/filetypes.h: + Added new file filter for Open File dialog to only show supported + source files (list of all defined filename extensions).
2007-02-28 Nick Treleaven nick.treleaven@btinternet.com
Modified: trunk/src/dialogs.c =================================================================== --- trunk/src/dialogs.c 2007-03-01 22:20:37 UTC (rev 1355) +++ trunk/src/dialogs.c 2007-03-01 22:38:31 UTC (rev 1356) @@ -108,6 +108,9 @@ // add FileFilters(start with "All Files") gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(app->open_filesel), filetypes_create_file_filter(filetypes[GEANY_FILETYPES_ALL])); + // now create meta filter "All Source" + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(app->open_filesel), + filetypes_create_file_filter_all_source()); for (i = 0; i < GEANY_MAX_FILE_TYPES - 1; i++) { gtk_combo_box_append_text(GTK_COMBO_BOX(filetype_combo), filetypes[i]->title);
Modified: trunk/src/filetypes.c =================================================================== --- trunk/src/filetypes.c 2007-03-01 22:20:37 UTC (rev 1355) +++ trunk/src/filetypes.c 2007-03-01 22:38:31 UTC (rev 1356) @@ -924,11 +924,34 @@ }
+/* create one file filter which has each file pattern of each filetype */ +GtkFileFilter *filetypes_create_file_filter_all_source() +{ + GtkFileFilter *new_filter; + gint i, j; + + new_filter = gtk_file_filter_new(); + gtk_file_filter_set_name(new_filter, _("All Source")); + + for (i = 0; i < GEANY_FILETYPES_ALL; i++) + { + for (j = 0; filetypes[i]->pattern[j]; j++) + { + gtk_file_filter_add_pattern(new_filter, filetypes[i]->pattern[j]); + } + } + + return new_filter; +} + + GtkFileFilter *filetypes_create_file_filter(filetype *ft) { GtkFileFilter *new_filter; gint i;
+ g_return_val_if_fail(ft != NULL, NULL); + new_filter = gtk_file_filter_new(); gtk_file_filter_set_name(new_filter, ft->title);
Modified: trunk/src/filetypes.h =================================================================== --- trunk/src/filetypes.h 2007-03-01 22:20:37 UTC (rev 1355) +++ trunk/src/filetypes.h 2007-03-01 22:38:31 UTC (rev 1356) @@ -132,6 +132,8 @@
GtkFileFilter *filetypes_create_file_filter(filetype *ft);
+GtkFileFilter *filetypes_create_file_filter_all_source(); + gchar *filetypes_get_conf_extension(gint filetype_idx);
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.