Revision: 2540 http://geany.svn.sourceforge.net/geany/?rev=2540&view=rev Author: ntrel Date: 2008-04-28 09:52:20 -0700 (Mon, 28 Apr 2008)
Log Message: ----------- Refactor create_set_filetype_menu() from filetypes_init().
Modified Paths: -------------- branches/custom-filetypes/ChangeLog branches/custom-filetypes/src/filetypes.c
Modified: branches/custom-filetypes/ChangeLog =================================================================== --- branches/custom-filetypes/ChangeLog 2008-04-28 16:15:08 UTC (rev 2539) +++ branches/custom-filetypes/ChangeLog 2008-04-28 16:52:20 UTC (rev 2540) @@ -8,6 +8,8 @@ available for now. * src/filetypes.c, src/filetypes.h: Add GEANY_MAX_BUILT_IN_FILETYPES for accessing built_in_filetypes[]. + * src/filetypes.c: + Refactor create_set_filetype_menu() from filetypes_init().
2008-04-27 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Modified: branches/custom-filetypes/src/filetypes.c =================================================================== --- branches/custom-filetypes/src/filetypes.c 2008-04-28 16:15:08 UTC (rev 2539) +++ branches/custom-filetypes/src/filetypes.c 2008-04-28 16:52:20 UTC (rev 2540) @@ -37,6 +37,7 @@ #include "utils.h" #include "document.h" #include "sciwrappers.h" +#include "ui_utils.h"
GHashTable *filetypes_hash = NULL; /**< Array of filetype pointers */ @@ -88,7 +89,7 @@
static GtkWidget *radio_items[GEANY_MAX_FILE_TYPES];
-static void filetypes_create_menu_item(GtkWidget *menu, const gchar *label, filetype *ftype); +static void create_radio_menu_item(GtkWidget *menu, const gchar *label, filetype *ftype);
static void fill_filetypes(void) @@ -520,8 +521,7 @@ gtk_widget_show((item));
-/* Calls filetypes_init_types() and creates the filetype menu. */ -void filetypes_init() +static void create_set_filetype_menu() { filetype_id ft_id; GtkWidget *filetype_menu = lookup_widget(app->window, "set_filetype1_menu"); @@ -529,8 +529,6 @@ GtkWidget *sub_menu_programming, *sub_menu_scripts, *sub_menu_markup, *sub_menu_misc; GtkWidget *sub_item_programming, *sub_item_scripts, *sub_item_markup, *sub_item_misc;
- filetypes_init_types(); - create_sub_menu(sub_menu_programming, sub_item_programming, _("_Programming Languages")); create_sub_menu(sub_menu_scripts, sub_item_scripts, _("_Scripting Languages")); create_sub_menu(sub_menu_markup, sub_item_markup, _("_Markup Languages")); @@ -574,11 +572,18 @@ default: break; } ft->item = NULL; - filetypes_create_menu_item(sub_menu, title, ft); + create_radio_menu_item(sub_menu, title, ft); } }
+void filetypes_init() +{ + filetypes_init_types(); + create_set_filetype_menu(); +} + + /* If uid is valid, return corresponding filetype, otherwise NULL. */ filetype *filetypes_get_from_uid(gint uid) { @@ -776,7 +781,7 @@ }
-static void filetypes_create_menu_item(GtkWidget *menu, const gchar *label, filetype *ftype) +static void create_radio_menu_item(GtkWidget *menu, const gchar *label, filetype *ftype) { static GSList *group = NULL; GtkWidget *tmp;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.