From c77e63e2cc9d19f865589da454e8810f8804aedf Mon Sep 17 00:00:00 2001 From: Gediminas Paulauskas Date: Thu, 5 Apr 2001 00:26:43 +0000 Subject: Some small header cleanups & fixes, and fix to translate all popup menus (woohoo!): 2001-04-05 Gediminas Paulauskas * gal/widgets/e-popup-menu.c: Copied gnome_app_helper_gettext function here, and use it for translating menu names (they are passed from app as well as from gal in arrays with N_(), and domains differ). svn path=/trunk/; revision=9190 --- widgets/menus/gal-view-factory-etable.c | 3 +-- widgets/misc/e-canvas.h | 1 - widgets/misc/e-popup-menu.c | 30 ++++++++++++++++++++++++++++-- widgets/misc/e-reflow.h | 1 - widgets/table/e-cell-pixbuf.c | 4 +--- widgets/text/e-text.c | 4 ++-- 6 files changed, 32 insertions(+), 11 deletions(-) (limited to 'widgets') diff --git a/widgets/menus/gal-view-factory-etable.c b/widgets/menus/gal-view-factory-etable.c index 80f5d39f92..4fddcdc70a 100644 --- a/widgets/menus/gal-view-factory-etable.c +++ b/widgets/menus/gal-view-factory-etable.c @@ -8,10 +8,9 @@ * (C) 2000 Helix Code, Inc. */ #include +#include "gal/util/e-i18n.h" #include "gal-view-factory-etable.h" #include "gal-view-etable.h" -#include -#include #define GVFE_CLASS(e) ((GalViewFactoryEtableClass *)((GtkObject *)e)->klass) diff --git a/widgets/misc/e-canvas.h b/widgets/misc/e-canvas.h index 6ed13d97d9..212fda7c2f 100644 --- a/widgets/misc/e-canvas.h +++ b/widgets/misc/e-canvas.h @@ -21,7 +21,6 @@ #ifndef __E_CANVAS_H__ #define __E_CANVAS_H__ -#include #include #ifdef __cplusplus diff --git a/widgets/misc/e-popup-menu.c b/widgets/misc/e-popup-menu.c index 4e2ff17378..da28926677 100644 --- a/widgets/misc/e-popup-menu.c +++ b/widgets/misc/e-popup-menu.c @@ -17,9 +17,35 @@ nnn * #include #include #include + #include "e-popup-menu.h" #include "e-gui-utils.h" -#include "gal/util/e-i18n.h" + +#include + +#ifndef GNOME_APP_HELPER_H +/* Copied this i18n function to use for the same purpose */ + +#ifdef ENABLE_NLS +#define L_(x) gnome_app_helper_gettext(x) + +static gchar * +gnome_app_helper_gettext (const gchar *str) +{ + char *s; + + s = gettext (str); + if ( s == str ) + s = dgettext (PACKAGE, str); + + return s; +} + +#else +#define L_(x) x +#endif + +#endif /* * Creates an item with an optional icon @@ -86,7 +112,7 @@ e_popup_menu_create (EPopupMenu *menu_list, guint32 disable_mask, guint32 hide_m if ((!(seperator && last_item_seperator)) && !(menu_list [i].disable_mask & hide_mask)) { GtkWidget *item; - item = make_item (menu, seperator ? "" : _(menu_list[i].name), menu_list[i].pixname); + item = make_item (menu, seperator ? "" : L_(menu_list[i].name), menu_list[i].pixname); gtk_menu_append (menu, item); if (!menu_list[i].submenu) { diff --git a/widgets/misc/e-reflow.h b/widgets/misc/e-reflow.h index 205bdb042c..641a4af0e5 100644 --- a/widgets/misc/e-reflow.h +++ b/widgets/misc/e-reflow.h @@ -21,7 +21,6 @@ #ifndef __E_REFLOW_H__ #define __E_REFLOW_H__ -#include #include #ifdef __cplusplus diff --git a/widgets/table/e-cell-pixbuf.c b/widgets/table/e-cell-pixbuf.c index 3e89f53c75..9b829fbc0b 100644 --- a/widgets/table/e-cell-pixbuf.c +++ b/widgets/table/e-cell-pixbuf.c @@ -8,9 +8,7 @@ */ #include -#include -#include - +#include #include "e-cell-pixbuf.h" static ECellClass *parent_class; diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c index 785367ce32..adef2dffa3 100644 --- a/widgets/text/e-text.c +++ b/widgets/text/e-text.c @@ -24,6 +24,7 @@ #include #include #include +#include #include /* for BlackPixel */ #include #include @@ -34,12 +35,11 @@ #include "gal/widgets/e-canvas.h" #include "gal/widgets/e-canvas-utils.h" #include "gal/widgets/e-unicode.h" +#include "gal/util/e-text-event-processor-emacs-like.h" #include #include #include -#include "gal/util/e-text-event-processor-emacs-like.h" - #define BORDER_INDENT 4 enum { -- cgit