Revision: 3665 http://geany.svn.sourceforge.net/geany/?rev=3665&view=rev Author: ntrel Date: 2009-03-27 16:14:29 +0000 (Fri, 27 Mar 2009)
Log Message: ----------- Make None filetype name = title = _("None").
Modified Paths: -------------- branches/reorder-filetypes/ChangeLog branches/reorder-filetypes/src/filetypes.c branches/reorder-filetypes/src/templates.c branches/reorder-filetypes/src/ui_utils.c
Modified: branches/reorder-filetypes/ChangeLog =================================================================== --- branches/reorder-filetypes/ChangeLog 2009-03-27 15:52:38 UTC (rev 3664) +++ branches/reorder-filetypes/ChangeLog 2009-03-27 16:14:29 UTC (rev 3665) @@ -7,9 +7,10 @@ Sort filetype IDs randomly (so we can append randomly). * src/filetypes.c: Fix sorting Document menu filetype names. + * src/templates.c, src/filetypes.c, src/ui_utils.c: + Make None filetype name = title = _("None").
- 2009-03-20 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* src/highlighting.c, src/dialogs.c, src/plugindata.h,
Modified: branches/reorder-filetypes/src/filetypes.c =================================================================== --- branches/reorder-filetypes/src/filetypes.c 2009-03-27 15:52:38 UTC (rev 3664) +++ branches/reorder-filetypes/src/filetypes.c 2009-03-27 16:14:29 UTC (rev 3665) @@ -85,8 +85,8 @@ #define NONE /* these macros are only to ease navigation */ ft = filetypes[GEANY_FILETYPES_NONE]; ft->lang = -2; - ft->name = g_strdup("None"); - ft->title = g_strdup(_("All files")); + ft->name = g_strdup(_("None")); + ft->title = g_strdup(_("None")); ft->extension = g_strdup("*"); ft->pattern = utils_strv_new("*", NULL); ft->comment_open = NULL; @@ -1294,11 +1294,13 @@ { GtkFileFilter *new_filter; gint i; + const gchar *title;
g_return_val_if_fail(ft != NULL, NULL);
new_filter = gtk_file_filter_new(); - gtk_file_filter_set_name(new_filter, ft->title); + title = ft->id == GEANY_FILETYPES_NONE ? _("All files") : ft->title; + gtk_file_filter_set_name(new_filter, title);
for (i = 0; ft->pattern[i]; i++) {
Modified: branches/reorder-filetypes/src/templates.c =================================================================== --- branches/reorder-filetypes/src/templates.c 2009-03-27 15:52:38 UTC (rev 3664) +++ branches/reorder-filetypes/src/templates.c 2009-03-27 16:14:29 UTC (rev 3665) @@ -372,8 +372,6 @@
if (ft_templates[ft_id] == NULL) continue; - if (ft_id == GEANY_FILETYPES_NONE) - label = _("None");
tmp_menu = gtk_menu_item_new_with_label(label); gtk_widget_show(tmp_menu);
Modified: branches/reorder-filetypes/src/ui_utils.c =================================================================== --- branches/reorder-filetypes/src/ui_utils.c 2009-03-27 15:52:38 UTC (rev 3664) +++ branches/reorder-filetypes/src/ui_utils.c 2009-03-27 16:14:29 UTC (rev 3665) @@ -134,6 +134,14 @@ }
+static GeanyFiletype *document_get_filetype(GeanyDocument *doc) +{ + g_return_val_if_fail(doc, NULL); + + return filetypes[FILETYPE_ID(doc->file_type)]; +} + + /* updates the status bar document statistics */ void ui_update_statusbar(GeanyDocument *doc, gint pos) { @@ -149,14 +157,8 @@ const gchar sp[] = " "; guint line, col; const gchar *cur_tag; - gchar *filetype_name; + gchar *filetype_name = document_get_filetype(doc)->name;
- /* workaround to make the name of filetype GEANY_FILETYPES_NONE translatable */ - if (doc->file_type == NULL || doc->file_type->id == GEANY_FILETYPES_NONE) - filetype_name = _("None"); - else - filetype_name = doc->file_type->name; - if (stats_str == NULL) stats_str = g_string_sized_new(120);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.