diff options
-rw-r--r-- | addressbook/ChangeLog | 43 | ||||
-rw-r--r-- | addressbook/backend/ebook/e-card-simple.c | 95 | ||||
-rw-r--r-- | addressbook/gui/contact-editor/e-contact-editor.c | 5 | ||||
-rw-r--r-- | addressbook/gui/widgets/Makefile.am | 2 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-view.c | 230 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-minicard-view-widget.c | 5 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-minicard-view-widget.h | 3 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-minicard-view.c | 20 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-minicard-view.h | 3 |
9 files changed, 249 insertions, 157 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index e1eb58f4bb..553c3be34a 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,46 @@ +2001-08-05 Zbigniew Chyla <cyba@gnome.pl> + + I18n fixes (mainly making buttons on the right side less Anglocentric :-) + + * backend/ebook/e-card-simple.c + (field_data): Marked "name" and "short_name" fields for translation. + (e_card_simple_get_name, e_card_simple_get_short_name): Return + localized version of the name (using U_() macro). + + * gui/contact-editor/e-contact-editor.c (set_entry_changed_signals): + Connect "changed" signal from "entry-web" entry to widget_changed. + (changing this field wasn't making "Save and Close" button sensitive) + + * gui/widgets/Makefile.am (glade_DATA): Removed alphabet.glade. + + * gui/widgets/e-addressbook-view.c + (button_labels, button_letters): New strings containing a list of + labels and "values" of all buttons placed on the right side of the + addressbook view (intended for localization). + (struct LetterClosure): Changed the type of letter field to gunichar. + (e_utf8_split): New function, similar to g_strsplit, but operates on + UTF-8 strings. + (jump_to_letter): Don't hardcode letters, build queries dynamically + using UTF-8 and localized letters stored in button_letters. + (connect_button): Removed. + (create_alphabet): Don't use glade file, build buttons manually using + (localized) labels from button_labels. Use (localized) values from + button_letters when creating LetterClosure. + + * gui/widgets/e-minicard-view-widget.[ch] + (e_minicard_view_widget_jump_to_letter): Changed the type of the + second argument from char to gunichar. + + * gui/widgets/e-minicard-view.c + (compare_to_utf_str): Renamed from compare_to_letter, now operates on + UTF-8 string. + (e_minicard_view_jump_to_letter): Changed the type of the second + argument from char to gunichar + conversion to UTF-8 string. + + * gui/widgets/e-minicard-view.h + (e_minicard_view_jump_to_letter): Changed the type of the second + argument from char to gunichar. + 2001-09-02 Christopher James Lahey <clahey@ximian.com> * backend/ebook/e-book.c (e_book_add_card, e_book_commit_card), diff --git a/addressbook/backend/ebook/e-card-simple.c b/addressbook/backend/ebook/e-card-simple.c index f41c4f0cb5..6f13356428 100644 --- a/addressbook/backend/ebook/e-card-simple.c +++ b/addressbook/backend/ebook/e-card-simple.c @@ -14,6 +14,7 @@ #include <stdlib.h> #include <string.h> #include <gtk/gtkobject.h> +#include <e-util/e-unicode-i18n.h> #include <libversit/vcc.h> #include "e-card-simple.h" @@ -54,51 +55,51 @@ struct _ECardSimpleFieldData { for the get_supported functionality. */ static ECardSimpleFieldData field_data[] = { - { E_CARD_SIMPLE_FIELD_FILE_AS, "file_as", "File As", "", 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING }, - { E_CARD_SIMPLE_FIELD_FULL_NAME, "full_name", "Name", "Name", 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING }, - { E_CARD_SIMPLE_FIELD_FAMILY_NAME, "family_name", "Family Name", "Family Name", 0, E_CARD_SIMPLE_INTERNAL_TYPE_SPECIAL }, - { E_CARD_SIMPLE_FIELD_EMAIL, "email", "Email", "Email", E_CARD_SIMPLE_EMAIL_ID_EMAIL, E_CARD_SIMPLE_INTERNAL_TYPE_EMAIL }, - { E_CARD_SIMPLE_FIELD_PHONE_PRIMARY, "primary_phone", "Primary", "Prim", E_CARD_SIMPLE_PHONE_ID_PRIMARY, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE }, - { E_CARD_SIMPLE_FIELD_PHONE_ASSISTANT, "assistant_phone", "Assistant", "Assistant",E_CARD_SIMPLE_PHONE_ID_ASSISTANT, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE }, - { E_CARD_SIMPLE_FIELD_PHONE_BUSINESS, "business_phone", "Business", "Bus", E_CARD_SIMPLE_PHONE_ID_BUSINESS, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE }, - { E_CARD_SIMPLE_FIELD_PHONE_CALLBACK, "callback_phone", "Callback", "Callback", E_CARD_SIMPLE_PHONE_ID_CALLBACK, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE }, - { E_CARD_SIMPLE_FIELD_PHONE_COMPANY, "company_phone", "Company", "Comp", E_CARD_SIMPLE_PHONE_ID_COMPANY, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE }, - { E_CARD_SIMPLE_FIELD_PHONE_HOME, "home_phone", "Home", "Home", E_CARD_SIMPLE_PHONE_ID_HOME, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE }, - { E_CARD_SIMPLE_FIELD_ORG, "org", "Organization", "Org", 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING }, - { E_CARD_SIMPLE_FIELD_ADDRESS_BUSINESS, "business_address","Business", "Bus", E_CARD_SIMPLE_ADDRESS_ID_BUSINESS, E_CARD_SIMPLE_INTERNAL_TYPE_ADDRESS }, - { E_CARD_SIMPLE_FIELD_ADDRESS_HOME, "home_address", "Home", "Home", E_CARD_SIMPLE_ADDRESS_ID_HOME, E_CARD_SIMPLE_INTERNAL_TYPE_ADDRESS }, - { E_CARD_SIMPLE_FIELD_PHONE_MOBILE, "mobile_phone", "Mobile", "Mobile", E_CARD_SIMPLE_PHONE_ID_MOBILE, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE }, - { E_CARD_SIMPLE_FIELD_PHONE_CAR, "car_phone", "Car", "Car", E_CARD_SIMPLE_PHONE_ID_CAR, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE }, - { E_CARD_SIMPLE_FIELD_PHONE_BUSINESS_FAX, "business_fax", "Business Fax", "Bus Fax", E_CARD_SIMPLE_PHONE_ID_BUSINESS_FAX, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE }, - { E_CARD_SIMPLE_FIELD_PHONE_HOME_FAX, "home_fax", "Home Fax", "Home Fax", E_CARD_SIMPLE_PHONE_ID_HOME_FAX, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE }, - { E_CARD_SIMPLE_FIELD_PHONE_BUSINESS_2, "business_phone_2","Business 2", "Bus 2", E_CARD_SIMPLE_PHONE_ID_BUSINESS_2, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE }, - { E_CARD_SIMPLE_FIELD_PHONE_HOME_2, "home_phone_2", "Home 2", "Home 2", E_CARD_SIMPLE_PHONE_ID_HOME_2, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE }, - { E_CARD_SIMPLE_FIELD_PHONE_ISDN, "isdn", "ISDN", "ISDN", E_CARD_SIMPLE_PHONE_ID_ISDN, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE }, - { E_CARD_SIMPLE_FIELD_PHONE_OTHER, "other_phone", "Other", "Other", E_CARD_SIMPLE_PHONE_ID_OTHER, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE }, - { E_CARD_SIMPLE_FIELD_PHONE_OTHER_FAX, "other_fax", "Other Fax", "Other Fax", E_CARD_SIMPLE_PHONE_ID_OTHER_FAX, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE }, - { E_CARD_SIMPLE_FIELD_PHONE_PAGER, "pager", "Pager", "Pager", E_CARD_SIMPLE_PHONE_ID_PAGER, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE }, - { E_CARD_SIMPLE_FIELD_PHONE_RADIO, "radio", "Radio", "Radio", E_CARD_SIMPLE_PHONE_ID_RADIO, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE }, - { E_CARD_SIMPLE_FIELD_PHONE_TELEX, "telex", "Telex", "Telex", E_CARD_SIMPLE_PHONE_ID_TELEX, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE }, - { E_CARD_SIMPLE_FIELD_PHONE_TTYTTD, "tty", "TTY", "TTY", E_CARD_SIMPLE_PHONE_ID_TTYTTD, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE }, - { E_CARD_SIMPLE_FIELD_ADDRESS_OTHER, "other_address", "Other", "Other", E_CARD_SIMPLE_ADDRESS_ID_OTHER, E_CARD_SIMPLE_INTERNAL_TYPE_ADDRESS }, - { E_CARD_SIMPLE_FIELD_EMAIL_2, "email_2", "Email 2", "Email 2", E_CARD_SIMPLE_EMAIL_ID_EMAIL_2, E_CARD_SIMPLE_INTERNAL_TYPE_EMAIL }, - { E_CARD_SIMPLE_FIELD_EMAIL_3, "email_3", "Email 3", "Email 3", E_CARD_SIMPLE_EMAIL_ID_EMAIL_3, E_CARD_SIMPLE_INTERNAL_TYPE_EMAIL }, - { E_CARD_SIMPLE_FIELD_URL, "url", "Web Site", "Url", 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING }, - { E_CARD_SIMPLE_FIELD_ORG_UNIT, "org_unit", "Department", "Dep", 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING }, - { E_CARD_SIMPLE_FIELD_OFFICE, "office", "Office", "Off", 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING }, - { E_CARD_SIMPLE_FIELD_TITLE, "title", "Title", "Title", 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING }, - { E_CARD_SIMPLE_FIELD_ROLE, "role", "Profession", "Prof", 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING }, - { E_CARD_SIMPLE_FIELD_MANAGER, "manager", "Manager", "Man", 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING }, - { E_CARD_SIMPLE_FIELD_ASSISTANT, "assistant", "Assistant", "Ass", 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING }, - { E_CARD_SIMPLE_FIELD_NICKNAME, "nickname", "Nickname", "Nick", 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING }, - { E_CARD_SIMPLE_FIELD_SPOUSE, "spouse", "Spouse", "Spouse", 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING }, - { E_CARD_SIMPLE_FIELD_NOTE, "note", "Note", "Note", 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING }, - { E_CARD_SIMPLE_FIELD_FBURL, "fburl", "Free-busy URL", "FBUrl", 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING }, - { E_CARD_SIMPLE_FIELD_ANNIVERSARY, "anniversary", "Anniversary", "Anniv", 0, E_CARD_SIMPLE_INTERNAL_TYPE_DATE }, - { E_CARD_SIMPLE_FIELD_BIRTH_DATE, "birth_date", "Birth Date", "", 0, E_CARD_SIMPLE_INTERNAL_TYPE_DATE }, - { E_CARD_SIMPLE_FIELD_MAILER, "mailer", "", "", 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING }, - { E_CARD_SIMPLE_FIELD_NAME_OR_ORG, "nameororg", "", "", 0, E_CARD_SIMPLE_INTERNAL_TYPE_SPECIAL }, - { E_CARD_SIMPLE_FIELD_CATEGORIES, "categories", "Categories", "Categories", 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING }, + { E_CARD_SIMPLE_FIELD_FILE_AS, "file_as", N_("File As"), "", 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING }, + { E_CARD_SIMPLE_FIELD_FULL_NAME, "full_name", N_("Name"), N_("Name"), 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING }, + { E_CARD_SIMPLE_FIELD_FAMILY_NAME, "family_name", N_("Family Name"), N_("Family Name"), 0, E_CARD_SIMPLE_INTERNAL_TYPE_SPECIAL }, + { E_CARD_SIMPLE_FIELD_EMAIL, "email", N_("Email"), N_("Email"), E_CARD_SIMPLE_EMAIL_ID_EMAIL, E_CARD_SIMPLE_INTERNAL_TYPE_EMAIL }, + { E_CARD_SIMPLE_FIELD_PHONE_PRIMARY, "primary_phone", N_("Primary"), N_("Prim"), E_CARD_SIMPLE_PHONE_ID_PRIMARY, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE }, + { E_CARD_SIMPLE_FIELD_PHONE_ASSISTANT, "assistant_phone", N_("Assistant"), N_("Assistant"),E_CARD_SIMPLE_PHONE_ID_ASSISTANT, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE }, + { E_CARD_SIMPLE_FIELD_PHONE_BUSINESS, "business_phone", N_("Business"), N_("Bus"), E_CARD_SIMPLE_PHONE_ID_BUSINESS, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE }, + { E_CARD_SIMPLE_FIELD_PHONE_CALLBACK, "callback_phone", N_("Callback"), N_("Callback"), E_CARD_SIMPLE_PHONE_ID_CALLBACK, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE }, + { E_CARD_SIMPLE_FIELD_PHONE_COMPANY, "company_phone", N_("Company"), N_("Comp"), E_CARD_SIMPLE_PHONE_ID_COMPANY, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE }, + { E_CARD_SIMPLE_FIELD_PHONE_HOME, "home_phone", N_("Home"), N_("Home"), E_CARD_SIMPLE_PHONE_ID_HOME, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE }, + { E_CARD_SIMPLE_FIELD_ORG, "org", N_("Organization"), N_("Org"), 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING }, + { E_CARD_SIMPLE_FIELD_ADDRESS_BUSINESS, "business_address",N_("Business"), N_("Bus"), E_CARD_SIMPLE_ADDRESS_ID_BUSINESS, E_CARD_SIMPLE_INTERNAL_TYPE_ADDRESS }, + { E_CARD_SIMPLE_FIELD_ADDRESS_HOME, "home_address", N_("Home"), N_("Home"), E_CARD_SIMPLE_ADDRESS_ID_HOME, E_CARD_SIMPLE_INTERNAL_TYPE_ADDRESS }, + { E_CARD_SIMPLE_FIELD_PHONE_MOBILE, "mobile_phone", N_("Mobile"), N_("Mobile"), E_CARD_SIMPLE_PHONE_ID_MOBILE, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE }, + { E_CARD_SIMPLE_FIELD_PHONE_CAR, "car_phone", N_("Car"), N_("Car"), E_CARD_SIMPLE_PHONE_ID_CAR, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE }, + { E_CARD_SIMPLE_FIELD_PHONE_BUSINESS_FAX, "business_fax", N_("Business Fax"), N_("Bus Fax"), E_CARD_SIMPLE_PHONE_ID_BUSINESS_FAX, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE }, + { E_CARD_SIMPLE_FIELD_PHONE_HOME_FAX, "home_fax", N_("Home Fax"), N_("Home Fax"), E_CARD_SIMPLE_PHONE_ID_HOME_FAX, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE }, + { E_CARD_SIMPLE_FIELD_PHONE_BUSINESS_2, "business_phone_2",N_("Business 2"), N_("Bus 2"), E_CARD_SIMPLE_PHONE_ID_BUSINESS_2, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE }, + { E_CARD_SIMPLE_FIELD_PHONE_HOME_2, "home_phone_2", N_("Home 2"), N_("Home 2"), E_CARD_SIMPLE_PHONE_ID_HOME_2, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE }, + { E_CARD_SIMPLE_FIELD_PHONE_ISDN, "isdn", N_("ISDN"), N_("ISDN"), E_CARD_SIMPLE_PHONE_ID_ISDN, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE }, + { E_CARD_SIMPLE_FIELD_PHONE_OTHER, "other_phone", N_("Other"), N_("Other"), E_CARD_SIMPLE_PHONE_ID_OTHER, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE }, + { E_CARD_SIMPLE_FIELD_PHONE_OTHER_FAX, "other_fax", N_("Other Fax"), N_("Other Fax"), E_CARD_SIMPLE_PHONE_ID_OTHER_FAX, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE }, + { E_CARD_SIMPLE_FIELD_PHONE_PAGER, "pager", N_("Pager"), N_("Pager"), E_CARD_SIMPLE_PHONE_ID_PAGER, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE }, + { E_CARD_SIMPLE_FIELD_PHONE_RADIO, "radio", N_("Radio"), N_("Radio"), E_CARD_SIMPLE_PHONE_ID_RADIO, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE }, + { E_CARD_SIMPLE_FIELD_PHONE_TELEX, "telex", N_("Telex"), N_("Telex"), E_CARD_SIMPLE_PHONE_ID_TELEX, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE }, + { E_CARD_SIMPLE_FIELD_PHONE_TTYTTD, "tty", N_("TTY"), N_("TTY"), E_CARD_SIMPLE_PHONE_ID_TTYTTD, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE }, + { E_CARD_SIMPLE_FIELD_ADDRESS_OTHER, "other_address", N_("Other"), N_("Other"), E_CARD_SIMPLE_ADDRESS_ID_OTHER, E_CARD_SIMPLE_INTERNAL_TYPE_ADDRESS }, + { E_CARD_SIMPLE_FIELD_EMAIL_2, "email_2", N_("Email 2"), N_("Email 2"), E_CARD_SIMPLE_EMAIL_ID_EMAIL_2, E_CARD_SIMPLE_INTERNAL_TYPE_EMAIL }, + { E_CARD_SIMPLE_FIELD_EMAIL_3, "email_3", N_("Email 3"), N_("Email 3"), E_CARD_SIMPLE_EMAIL_ID_EMAIL_3, E_CARD_SIMPLE_INTERNAL_TYPE_EMAIL }, + { E_CARD_SIMPLE_FIELD_URL, "url", N_("Web Site"), N_("Url"), 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING }, + { E_CARD_SIMPLE_FIELD_ORG_UNIT, "org_unit", N_("Department"), N_("Dep"), 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING }, + { E_CARD_SIMPLE_FIELD_OFFICE, "office", N_("Office"), N_("Off"), 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING }, + { E_CARD_SIMPLE_FIELD_TITLE, "title", N_("Title"), N_("Title"), 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING }, + { E_CARD_SIMPLE_FIELD_ROLE, "role", N_("Profession"), N_("Prof"), 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING }, + { E_CARD_SIMPLE_FIELD_MANAGER, "manager", N_("Manager"), N_("Man"), 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING }, + { E_CARD_SIMPLE_FIELD_ASSISTANT, "assistant", N_("Assistant"), N_("Ass"), 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING }, + { E_CARD_SIMPLE_FIELD_NICKNAME, "nickname", N_("Nickname"), N_("Nick"), 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING }, + { E_CARD_SIMPLE_FIELD_SPOUSE, "spouse", N_("Spouse"), N_("Spouse"), 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING }, + { E_CARD_SIMPLE_FIELD_NOTE, "note", N_("Note"), N_("Note"), 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING }, + { E_CARD_SIMPLE_FIELD_FBURL, "fburl", N_("Free-busy URL"), N_("FBUrl"), 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING }, + { E_CARD_SIMPLE_FIELD_ANNIVERSARY, "anniversary", N_("Anniversary"), N_("Anniv"), 0, E_CARD_SIMPLE_INTERNAL_TYPE_DATE }, + { E_CARD_SIMPLE_FIELD_BIRTH_DATE, "birth_date", N_("Birth Date"), "", 0, E_CARD_SIMPLE_INTERNAL_TYPE_DATE }, + { E_CARD_SIMPLE_FIELD_MAILER, "mailer", "", "", 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING }, + { E_CARD_SIMPLE_FIELD_NAME_OR_ORG, "nameororg", "", "", 0, E_CARD_SIMPLE_INTERNAL_TYPE_SPECIAL }, + { E_CARD_SIMPLE_FIELD_CATEGORIES, "categories", N_("Categories"), N_("Categories"), 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING }, }; static int field_data_count = sizeof (field_data) / sizeof (field_data[0]); @@ -1042,13 +1043,13 @@ const char *e_card_simple_get_ecard_field (ECardSimple *simple, const char *e_card_simple_get_name (ECardSimple *simple, ECardSimpleField field) { - return field_data[field].name; + return U_(field_data[field].name); } const char *e_card_simple_get_short_name (ECardSimple *simple, ECardSimpleField field) { - return field_data[field].short_name; + return U_(field_data[field].short_name); } void e_card_simple_arbitrary_foreach (ECardSimple *simple, diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index 9740902313..c313e5720a 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -627,6 +627,11 @@ set_entry_changed_signals(EContactEditor *editor) gtk_signal_connect(GTK_OBJECT(widget), "changed", widget_changed, editor); } + widget = glade_xml_get_widget(editor->gui, "entry-web"); + if (widget && GTK_IS_ENTRY(widget)) { + gtk_signal_connect(GTK_OBJECT(widget), "changed", + widget_changed, editor); + } } diff --git a/addressbook/gui/widgets/Makefile.am b/addressbook/gui/widgets/Makefile.am index f031b284e5..39da68797c 100644 --- a/addressbook/gui/widgets/Makefile.am +++ b/addressbook/gui/widgets/Makefile.am @@ -134,7 +134,7 @@ libeminicard_a_SOURCES = \ # $(GNOME_PRINT_LIBS) gladedir = $(datadir)/evolution/glade -glade_DATA = alphabet.glade +glade_DATA = EXTRA_DIST = \ $(glade_DATA) diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c index 8b2a002247..bf07164486 100644 --- a/addressbook/gui/widgets/e-addressbook-view.c +++ b/addressbook/gui/widgets/e-addressbook-view.c @@ -31,8 +31,10 @@ #include <gal/e-table/e-table-model.h> #include <gal/widgets/e-scroll-frame.h> #include <gal/widgets/e-popup-menu.h> +#include <gal/widgets/e-unicode.h> #include <gal/menus/gal-view-factory-etable.h> #include <gal/menus/gal-view-etable.h> +#include <gal/unicode/gunicode.h> #include <libgnomeui/gnome-dialog-util.h> #include <libgnomeprint/gnome-print.h> @@ -40,6 +42,8 @@ #include <libgnomeprint/gnome-print-master.h> #include <libgnomeprint/gnome-print-master-preview.h> +#include <e-util/e-unicode-i18n.h> + #include "addressbook/printing/e-contact-print.h" #include "addressbook/printing/e-contact-print-envelope.h" @@ -389,80 +393,97 @@ e_addressbook_view_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) } +/* Translators: put here a list of labels you want to see on buttons in + addressbook. You may use any character to separate labels but it must + also be placed at the begining ot the string */ +const char *button_labels = N_(",123,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z"); +/* Translators: put here a list of characters that correspond to buttons + in addressbook. You may use any character to separate labels but it + must also be placed at the begining ot the string. + Use lower case letters if possible. */ +const char *button_letters = N_(",0,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z"); typedef struct { EAddressbookView *view; - char letter; + gunichar letter; } LetterClosure; +static char ** +e_utf8_split (const char *utf8_str, gunichar delim) +{ + GSList *str_list = NULL, *sl; + int n = 0; + const char *str, *s; + char **str_array; + + g_return_val_if_fail (utf8_str != NULL, NULL); + + str = utf8_str; + while (*str != '\0') { + int len; + char *new_str; + + for (s = str; *s != '\0' && g_utf8_get_char (s) != delim; s = g_utf8_next_char (s)) + ; + len = s - str; + new_str = g_new (char, len + 1); + if (len > 0) { + memcpy (new_str, str, len); + } + new_str[len] = '\0'; + str_list = g_slist_prepend (str_list, new_str); + n++; + if (*s != '\0') { + str = g_utf8_next_char (s); + } else { + str = s; + } + } + + str_array = g_new (char *, n + 1); + str_array[n--] = NULL; + for (sl = str_list; sl != NULL; sl = sl->next) { + str_array[n--] = sl->data; + } + g_slist_free (str_list); + + return str_array; +} + static void jump_to_letter(GtkWidget *button, LetterClosure *closure) { char *query; - switch (closure->letter) { - case '1': - query = g_strdup ("(not (or " - "(beginswith \"file_as\" \"a\") " - "(beginswith \"file_as\" \"b\") " - "(beginswith \"file_as\" \"c\") " - "(beginswith \"file_as\" \"d\") " - "(beginswith \"file_as\" \"e\") " - "(beginswith \"file_as\" \"f\") " - "(beginswith \"file_as\" \"g\") " - "(beginswith \"file_as\" \"h\") " - "(beginswith \"file_as\" \"i\") " - "(beginswith \"file_as\" \"j\") " - "(beginswith \"file_as\" \"k\") " - "(beginswith \"file_as\" \"l\") " - "(beginswith \"file_as\" \"m\") " - "(beginswith \"file_as\" \"n\") " - "(beginswith \"file_as\" \"o\") " - "(beginswith \"file_as\" \"p\") " - "(beginswith \"file_as\" \"q\") " - "(beginswith \"file_as\" \"r\") " - "(beginswith \"file_as\" \"s\") " - "(beginswith \"file_as\" \"t\") " - "(beginswith \"file_as\" \"u\") " - "(beginswith \"file_as\" \"v\") " - "(beginswith \"file_as\" \"w\") " - "(beginswith \"file_as\" \"x\") " - "(beginswith \"file_as\" \"y\") " - "(beginswith \"file_as\" \"z\") " - - "(beginswith \"file_as\" \"A\") " - "(beginswith \"file_as\" \"B\") " - "(beginswith \"file_as\" \"C\") " - "(beginswith \"file_as\" \"D\") " - "(beginswith \"file_as\" \"E\") " - "(beginswith \"file_as\" \"F\") " - "(beginswith \"file_as\" \"G\") " - "(beginswith \"file_as\" \"H\") " - "(beginswith \"file_as\" \"I\") " - "(beginswith \"file_as\" \"J\") " - "(beginswith \"file_as\" \"K\") " - "(beginswith \"file_as\" \"L\") " - "(beginswith \"file_as\" \"M\") " - "(beginswith \"file_as\" \"N\") " - "(beginswith \"file_as\" \"O\") " - "(beginswith \"file_as\" \"P\") " - "(beginswith \"file_as\" \"Q\") " - "(beginswith \"file_as\" \"R\") " - "(beginswith \"file_as\" \"S\") " - "(beginswith \"file_as\" \"T\") " - "(beginswith \"file_as\" \"U\") " - "(beginswith \"file_as\" \"V\") " - "(beginswith \"file_as\" \"W\") " - "(beginswith \"file_as\" \"X\") " - "(beginswith \"file_as\" \"Y\") " - "(beginswith \"file_as\" \"Z\") " - "))"); - break; - default: + + if (g_unichar_isdigit (closure->letter)) { + const char *letters = U_(button_letters); + char **letter_v; + GString *gstr; + char **p; + + letter_v = e_utf8_split (g_utf8_next_char (letters), + g_utf8_get_char (letters)); + g_assert (letter_v != NULL && letter_v[0] != NULL); + gstr = g_string_new ("(not (or "); + for (p = letter_v + 1; *p != NULL; p++) { + char s[7]; + + g_string_sprintfa (gstr, "(beginswith \"file_as\" \"%s\")", *p); + s[g_unichar_to_utf8 (g_unichar_toupper (g_utf8_get_char (*p)), s)] = '\0'; + g_string_sprintfa (gstr, "(beginswith \"file_as\" \"%s\")", s); + } + g_string_append (gstr, "))"); + query = gstr->str; + g_string_free (gstr, FALSE); + } else { + char s1[6 + 1], s2[6 + 1]; + + s1 [g_unichar_to_utf8 (closure->letter, s1)] = '\0'; + s2 [g_unichar_to_utf8 (g_unichar_toupper (closure->letter), s2)] = '\0'; query = g_strdup_printf ("(or " - "(beginswith \"file_as\" \"%c\")" - "(beginswith \"file_as\" \"%c\")" - ")", closure->letter, toupper (closure->letter)); - break; + "(beginswith \"file_as\" \"%s\")" + "(beginswith \"file_as\" \"%s\")" + ")", s1, s2); } gtk_object_set (GTK_OBJECT (closure->view), "query", query, @@ -476,44 +497,59 @@ free_closure(GtkWidget *button, LetterClosure *closure) g_free(closure); } -static void -connect_button (EAddressbookView *view, GladeXML *gui, char letter) -{ - char *name; - GtkWidget *button; - LetterClosure *closure; - name = g_strdup_printf("button-%c", letter); - button = glade_xml_get_widget(gui, name); - g_free(name); - if (!button) - return; - closure = g_new(LetterClosure, 1); - closure->view = view; - closure->letter = letter; - gtk_signal_connect(GTK_OBJECT(button), "clicked", - GTK_SIGNAL_FUNC(jump_to_letter), closure); - gtk_signal_connect(GTK_OBJECT(button), "destroy", - GTK_SIGNAL_FUNC(free_closure), closure); -} - static GtkWidget * create_alphabet (EAddressbookView *view) { - GtkWidget *widget; - char letter; - GladeXML *gui = glade_xml_new (EVOLUTION_GLADEDIR "/alphabet.glade", NULL); + GtkWidget *widget, *viewport, *vbox; + const char *labels, *letters; + char **label_v, **letter_v; + char **pl, **pc; + gunichar sep; + + widget = gtk_scrolled_window_new (NULL, NULL); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (widget), + GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); + + viewport = gtk_viewport_new (NULL, NULL); + gtk_container_add (GTK_CONTAINER (widget), viewport); + gtk_container_set_border_width (GTK_CONTAINER (viewport), 4); + gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport), GTK_SHADOW_NONE); + + vbox = gtk_vbox_new (FALSE, 4); + gtk_container_add (GTK_CONTAINER (viewport), vbox); + gtk_widget_set_usize (vbox, 27, 0); + + labels = U_(button_labels); + sep = g_utf8_get_char (labels); + label_v = e_utf8_split (g_utf8_next_char (labels), sep); + letters = U_(button_letters); + sep = g_utf8_get_char (letters); + letter_v = e_utf8_split (g_utf8_next_char (letters), sep); + g_assert (label_v != NULL && letter_v != NULL); + for (pl = label_v, pc = letter_v; *pl != NULL && *pc != NULL; pl++, pc++) { + GtkWidget *button; + LetterClosure *closure; + char *label; + + label = e_utf8_to_locale_string (*pl); + button = gtk_button_new_with_label (label); + g_free (label); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + + closure = g_new (LetterClosure, 1); + closure->view = view; + closure->letter = g_utf8_get_char (*pc); + gtk_signal_connect(GTK_OBJECT(button), "clicked", + GTK_SIGNAL_FUNC (jump_to_letter), closure); + gtk_signal_connect(GTK_OBJECT(button), "destroy", + GTK_SIGNAL_FUNC (free_closure), closure); - widget = glade_xml_get_widget(gui, "scrolledwindow-top"); - if (!widget) { - return NULL; - } - - connect_button(view, gui, '1'); - for (letter = 'a'; letter <= 'z'; letter ++) { - connect_button(view, gui, letter); } - - gtk_object_unref(GTK_OBJECT(gui)); + g_strfreev (label_v); + g_strfreev (letter_v); + + gtk_widget_show_all (widget); + return widget; } diff --git a/addressbook/gui/widgets/e-minicard-view-widget.c b/addressbook/gui/widgets/e-minicard-view-widget.c index e01ec2cbb0..73d76ade73 100644 --- a/addressbook/gui/widgets/e-minicard-view-widget.c +++ b/addressbook/gui/widgets/e-minicard-view-widget.c @@ -326,8 +326,9 @@ e_minicard_view_widget_remove_selection(EMinicardViewWidget *view, e_minicard_view_remove_selection(E_MINICARD_VIEW(view->emv), cb, closure); } -void e_minicard_view_widget_jump_to_letter (EMinicardViewWidget *view, - char letter) +void +e_minicard_view_widget_jump_to_letter (EMinicardViewWidget *view, + gunichar letter) { if (view->emv) e_minicard_view_jump_to_letter(E_MINICARD_VIEW(view->emv), letter); diff --git a/addressbook/gui/widgets/e-minicard-view-widget.h b/addressbook/gui/widgets/e-minicard-view-widget.h index 61d5912dd5..2d94f15ec5 100644 --- a/addressbook/gui/widgets/e-minicard-view-widget.h +++ b/addressbook/gui/widgets/e-minicard-view-widget.h @@ -22,6 +22,7 @@ #define __E_MINICARD_VIEW_WIDGET_H__ #include <gal/widgets/e-canvas.h> +#include <gal/unicode/gunicode.h> #include "addressbook/backend/ebook/e-book.h" #include "e-minicard-view.h" @@ -66,7 +67,7 @@ void e_minicard_view_widget_remove_selection (EMinicardViewWidget *view, EBookCallback cb, gpointer closure); void e_minicard_view_widget_jump_to_letter (EMinicardViewWidget *view, - char letter); + gunichar letter); GtkWidget *e_minicard_view_widget_new (EAddressbookReflowAdapter *adapter); ESelectionModel *e_minicard_view_widget_get_selection_model (EMinicardViewWidget *view); diff --git a/addressbook/gui/widgets/e-minicard-view.c b/addressbook/gui/widgets/e-minicard-view.c index 4a3925d75b..fe3cf42206 100644 --- a/addressbook/gui/widgets/e-minicard-view.c +++ b/addressbook/gui/widgets/e-minicard-view.c @@ -342,13 +342,14 @@ e_minicard_view_remove_selection(EMinicardView *view, #if 0 static int -compare_to_letter(EMinicard *card, char *letter) +compare_to_utf_str (EMinicard *card, const char *utf_str) { g_return_val_if_fail(card != NULL, 0); g_return_val_if_fail(E_IS_MINICARD(card), 0); - if (*letter == '1') + if (g_unichar_isdigit (g_utf8_get_char (utf_str))) { return 1; + } if (card->card) { char *file_as; @@ -356,7 +357,7 @@ compare_to_letter(EMinicard *card, char *letter) "file_as", &file_as, NULL); if (file_as) - return strncasecmp(file_as, letter, 1); + return g_utf8_strcasecmp (file_as, utf_str); else return 0; } else { @@ -368,13 +369,16 @@ compare_to_letter(EMinicard *card, char *letter) void -e_minicard_view_jump_to_letter (EMinicardView *view, - char letter) +e_minicard_view_jump_to_letter (EMinicardView *view, + gunichar letter) { #if 0 - e_reflow_sorted_jump(E_REFLOW_SORTED(view), - (GCompareFunc) compare_to_letter, - &letter); + char uft_str[6 + 1]; + + utf_str [g_unichar_to_utf8 (letter, utf_str)] = '\0'; + e_reflow_sorted_jump (E_REFLOW_SORTED (view), + (GCompareFunc) compare_to_utf_str, + utf_str); #endif } diff --git a/addressbook/gui/widgets/e-minicard-view.h b/addressbook/gui/widgets/e-minicard-view.h index 5c7065fe1d..b735cc1ea7 100644 --- a/addressbook/gui/widgets/e-minicard-view.h +++ b/addressbook/gui/widgets/e-minicard-view.h @@ -25,6 +25,7 @@ #include <gal/widgets/e-reflow.h> #include <gal/widgets/e-selection-model-simple.h> +#include <gal/unicode/gunicode.h> #include "addressbook/backend/ebook/e-book.h" #include "e-addressbook-reflow-adapter.h" @@ -90,7 +91,7 @@ void e_minicard_view_remove_selection (EMinicardView *view, EBookCallback cb, gpointer closure); void e_minicard_view_jump_to_letter (EMinicardView *view, - char letter); + gunichar letter); #ifdef __cplusplus } |