Revision: 3848 http://geany.svn.sourceforge.net/geany/?rev=3848&view=rev Author: ntrel Date: 2009-06-09 14:39:28 +0000 (Tue, 09 Jun 2009)
Log Message: ----------- Add filetypes.common Configuration Files menu item.
Modified Paths: -------------- trunk/ChangeLog trunk/src/filetypes.c trunk/src/ui_utils.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2009-06-08 19:59:48 UTC (rev 3847) +++ trunk/ChangeLog 2009-06-09 14:39:28 UTC (rev 3848) @@ -1,3 +1,9 @@ +2009-06-09 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com> + + * src/filetypes.c, src/ui_utils.c: + Add filetypes.common Configuration Files menu item. + + 2009-06-08 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* src/callbacks.c:
Modified: trunk/src/filetypes.c =================================================================== --- trunk/src/filetypes.c 2009-06-08 19:59:48 UTC (rev 3847) +++ trunk/src/filetypes.c 2009-06-09 14:39:28 UTC (rev 3848) @@ -655,6 +655,10 @@ if (utils_str_equal(doc->real_path, utils_build_path(app->configdir, "filetype_extensions.conf", NULL))) filetypes_read_extensions(); + else if (utils_str_equal(doc->real_path, + utils_build_path(app->configdir, GEANY_FILEDEFS_SUBDIR, "filetypes.common", NULL))) + ui_set_statusbar(FALSE, "%s", + _("For all changes you make in this file to take effect, you need to restart Geany.")); }
@@ -662,6 +666,8 @@ { ui_add_config_file_menu_item( utils_build_path(app->configdir, "filetype_extensions.conf", NULL), NULL, NULL); + ui_add_config_file_menu_item( + utils_build_path(app->configdir, GEANY_FILEDEFS_SUBDIR, "filetypes.common", NULL), NULL, NULL);
g_signal_connect(geany_object, "document-save", G_CALLBACK(on_document_save), NULL); }
Modified: trunk/src/ui_utils.c =================================================================== --- trunk/src/ui_utils.c 2009-06-08 19:59:48 UTC (rev 3847) +++ trunk/src/ui_utils.c 2009-06-09 14:39:28 UTC (rev 3848) @@ -1700,9 +1700,13 @@ static void on_config_file_clicked(GtkWidget *widget, gpointer user_data) { const gchar *file_name = user_data; + GeanyFiletype *ft = NULL;
+ if (strstr(file_name, G_DIR_SEPARATOR_S "filetypes.")) + ft = filetypes[GEANY_FILETYPES_CONF]; + if (g_file_test(file_name, G_FILE_TEST_EXISTS)) - document_open_file(file_name, FALSE, NULL, NULL); + document_open_file(file_name, FALSE, ft, NULL); else { gchar *utf8 = utils_get_utf8_from_locale(file_name); @@ -1715,7 +1719,7 @@ if (g_file_test(global_file, G_FILE_TEST_EXISTS)) g_file_get_contents(global_file, &global_content, NULL, NULL);
- document_new_file(utf8, NULL, global_content); + document_new_file(utf8, ft, global_content); utils_free_pointers(4, utf8, base_name, global_file, global_content, NULL); } }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.