diff options
author | Matthew Barnes <mbarnes@src.gnome.org> | 2008-12-11 02:30:29 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2008-12-11 02:30:29 +0800 |
commit | d158af8cdfa6e4bf85c1e74769e8d61bc469494c (patch) | |
tree | ba55b970ae3a23e5ade4edbddc4eb8dcaf3033bd /addressbook/gui | |
parent | dc0d0ee010319425b19d8d8d493f0bc489d5fd07 (diff) | |
download | gsoc2013-evolution-d158af8cdfa6e4bf85c1e74769e8d61bc469494c.tar gsoc2013-evolution-d158af8cdfa6e4bf85c1e74769e8d61bc469494c.tar.gz gsoc2013-evolution-d158af8cdfa6e4bf85c1e74769e8d61bc469494c.tar.bz2 gsoc2013-evolution-d158af8cdfa6e4bf85c1e74769e8d61bc469494c.tar.lz gsoc2013-evolution-d158af8cdfa6e4bf85c1e74769e8d61bc469494c.tar.xz gsoc2013-evolution-d158af8cdfa6e4bf85c1e74769e8d61bc469494c.tar.zst gsoc2013-evolution-d158af8cdfa6e4bf85c1e74769e8d61bc469494c.zip |
Merge revisions 36811:36865 from trunk.
svn path=/branches/kill-bonobo/; revision=36867
Diffstat (limited to 'addressbook/gui')
-rw-r--r-- | addressbook/gui/component/ldap-config.glade | 4 | ||||
-rw-r--r-- | addressbook/gui/contact-editor/e-contact-editor-im.c | 59 | ||||
-rw-r--r-- | addressbook/gui/contact-editor/e-contact-editor.c | 11 | ||||
-rw-r--r-- | addressbook/gui/widgets/addresstypes.xml | 67 | ||||
-rw-r--r-- | addressbook/gui/widgets/eab-contact-display.c | 2 | ||||
-rw-r--r-- | addressbook/gui/widgets/eab-gui-util.c | 37 |
6 files changed, 82 insertions, 98 deletions
diff --git a/addressbook/gui/component/ldap-config.glade b/addressbook/gui/component/ldap-config.glade index 58ffba43bf..2cf886b914 100644 --- a/addressbook/gui/component/ldap-config.glade +++ b/addressbook/gui/component/ldap-config.glade @@ -1394,7 +1394,7 @@ <property name="update_policy">GTK_UPDATE_ALWAYS</property> <property name="snap_to_ticks">False</property> <property name="wrap">False</property> - <property name="adjustment">0 0 1000 1 10 10</property> + <property name="adjustment">0 0 1000 1 10 0</property> </widget> <packing> <property name="left_attach">1</property> @@ -2942,7 +2942,7 @@ <property name="update_policy">GTK_UPDATE_ALWAYS</property> <property name="snap_to_ticks">False</property> <property name="wrap">False</property> - <property name="adjustment">0 0 1000 1 10 10</property> + <property name="adjustment">0 0 1000 1 10 0</property> </widget> <packing> <property name="left_attach">1</property> diff --git a/addressbook/gui/contact-editor/e-contact-editor-im.c b/addressbook/gui/contact-editor/e-contact-editor-im.c index 7facb68b45..cc4fcc5d05 100644 --- a/addressbook/gui/contact-editor/e-contact-editor-im.c +++ b/addressbook/gui/contact-editor/e-contact-editor-im.c @@ -47,8 +47,8 @@ enum { PROP_EDITABLE }; -#define FIRST_IM_TYPE E_CONTACT_IM_AIM -#define LAST_IM_TYPE E_CONTACT_IM_ICQ +/*#define FIRST_IM_TYPE E_CONTACT_IM_AIM +#define LAST_IM_TYPE E_CONTACT_IM_ICQ*/ static const char *im_labels[] = { N_("AOL Instant Messenger"), @@ -57,7 +57,8 @@ static const char *im_labels[] = { N_("Yahoo Messenger"), N_("Gadu-Gadu Messenger"), N_("MSN Messenger"), - N_("ICQ") + N_("ICQ"), + N_("Skype") }; static const char *im_images[] = { @@ -67,9 +68,47 @@ static const char *im_images[] = { "im-yahoo", "im-gadugadu", "im-msn", - "im-icq" + "im-icq", + "stock_people" }; +/** + * Decodes from service (E_CONTACT_IM_ value to the index in the above + * fields and back, depending on the second parameter. + * @param val Value to decode + * @param val_is_service TRUE, if val is E_CONTACT_IM_ value, otherwise it's an index number. + **/ +static int +decode_service (int val, gboolean val_is_service) +{ + static const int fields[] = { + E_CONTACT_IM_AIM, + E_CONTACT_IM_GROUPWISE, + E_CONTACT_IM_JABBER, + E_CONTACT_IM_YAHOO, + E_CONTACT_IM_GADUGADU, + E_CONTACT_IM_MSN, + E_CONTACT_IM_ICQ, + E_CONTACT_IM_SKYPE + }; + + int i, sz = G_N_ELEMENTS (fields); + if (val_is_service) { + for (i = 0; i < sz; i++) { + if (val == fields[i]) + break; + } + if (i >= sz) + i = 0; + } else if (val >= 0 && val < sz) { + i = fields [val]; + } else { + i = fields [0]; + } + + return i; +} + GType e_contact_editor_im_get_type (void) { @@ -111,9 +150,9 @@ e_contact_editor_im_class_init (EContactEditorImClass *klass) g_param_spec_int ("service", _("Service"), /*_( */"XXX blurb" /*)*/, - FIRST_IM_TYPE, - LAST_IM_TYPE, - FIRST_IM_TYPE, + E_CONTACT_IM_AIM, + E_CONTACT_IM_SKYPE, + E_CONTACT_IM_AIM, G_PARAM_READWRITE)); g_object_class_install_property (object_class, PROP_LOCATION, @@ -141,7 +180,7 @@ e_contact_editor_im_class_init (EContactEditorImClass *klass) static void service_changed_cb(GtkWidget *optmenu, EContactEditorIm *editor) { - editor->service = gtk_option_menu_get_history(GTK_OPTION_MENU(optmenu)) + FIRST_IM_TYPE; + editor->service = decode_service (gtk_option_menu_get_history(GTK_OPTION_MENU(optmenu)), FALSE); } static void @@ -254,7 +293,7 @@ e_contact_editor_im_init (EContactEditorIm *e_contact_editor_im) gtk_window_set_resizable(GTK_WINDOW(e_contact_editor_im), TRUE); - e_contact_editor_im->service = FIRST_IM_TYPE; + e_contact_editor_im->service = decode_service (0, FALSE); e_contact_editor_im->location = g_strdup("HOME"); e_contact_editor_im->username = NULL; @@ -440,7 +479,7 @@ fill_in_info(EContactEditorIm *editor) optmenu = glade_xml_get_widget(editor->gui, "optmenu-service"); if (optmenu != NULL) - gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu), editor->service - FIRST_IM_TYPE); + gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu), decode_service (editor->service, TRUE)); optmenu = glade_xml_get_widget(editor->gui, "optmenu-location"); diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index 30d672161a..e5686d3f76 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -36,6 +36,7 @@ #include <misc/e-gui-utils.h> #include <libebook/e-address-western.h> +#include <libedataserverui/e-category-completion.h> #include <libedataserverui/e-source-combo-box.h> #include <camel/camel.h> @@ -176,7 +177,8 @@ im_service [] = { E_CONTACT_IM_GADUGADU, N_ ("Gadu-Gadu") }, { E_CONTACT_IM_MSN, N_ ("MSN") }, { E_CONTACT_IM_ICQ, N_ ("ICQ") }, - { E_CONTACT_IM_GROUPWISE, N_ ("GroupWise") } + { E_CONTACT_IM_GROUPWISE, N_ ("GroupWise") }, + { E_CONTACT_IM_SKYPE, N_ ("Skype") } }; /* Defaults from the table above */ @@ -3102,6 +3104,7 @@ static const EContactField non_string_fields [] = { E_CONTACT_IM_GADUGADU, E_CONTACT_IM_MSN, E_CONTACT_IM_ICQ, + E_CONTACT_IM_SKYPE, E_CONTACT_PHOTO, E_CONTACT_LOGO, E_CONTACT_X509_CERT, @@ -3357,6 +3360,7 @@ e_contact_editor_init (EContactEditor *e_contact_editor) { GladeXML *gui; GtkWidget *widget, *label; + GtkEntryCompletion *completion; char *gladefile; e_contact_editor->name = e_contact_name_new(); @@ -3417,6 +3421,11 @@ e_contact_editor_init (EContactEditor *e_contact_editor) if (widget) gtk_widget_grab_focus (widget); + widget = glade_xml_get_widget (e_contact_editor->gui, "entry-categories"); + completion = e_category_completion_new (); + gtk_entry_set_completion (GTK_ENTRY (widget), completion); + g_object_unref (completion); + /* Connect to the deletion of the dialog */ g_signal_connect (e_contact_editor->app, "delete_event", diff --git a/addressbook/gui/widgets/addresstypes.xml b/addressbook/gui/widgets/addresstypes.xml index 813bf1c0ac..c93f9cac19 100644 --- a/addressbook/gui/widgets/addresstypes.xml +++ b/addressbook/gui/widgets/addresstypes.xml @@ -74,72 +74,7 @@ </option> </input> <input type="optionlist" name="category"> - <option value="Anniversary"> - <title>Anniversary</title> - </option> - <option value="Holiday"> - <title>Holiday</title> - </option> - <option value="Ideas"> - <title>Ideas</title> - </option> - <option value="Status"> - <title>Status</title> - </option> - <option value="Holiday Cards"> - <title>Holiday Cards</title> - </option> - <option value="Hot Contacts"> - <title>Hot Contacts</title> - </option> - <option value="International"> - <title>International</title> - </option> - <option value="Birthday"> - <title>Birthday</title> - </option> - <option value="VIP"> - <title>VIP</title> - </option> - <option value="Gifts"> - <title>Gifts</title> - </option> - <option value="Waiting"> - <title>Waiting</title> - </option> - <option value="Key Customer"> - <title>Key Customer</title> - </option> - <option value="Time & Expenses"> - <title>Time & Expenses </title> - </option> - <option value="Miscellaneous"> - <title>Miscellaneous</title> - </option> - <option value="Business"> - <title>Business</title> - </option> - <option value="Personal"> - <title>Personal</title> - </option> - <option value="Suppliers"> - <title>Suppliers</title> - </option> - <option value="Goals/Objectives"> - <title>Goals/Objectives</title> - </option> - <option value="Strategies"> - <title>Strategies</title> - </option> - <option value="Competition"> - <title>Competition</title> - </option> - <option value="Favourites"> - <title>Favourites</title> - </option> - <option value="Phone Calls"> - <title>Phone Calls</title> - </option> + <dynamic func="e_util_get_category_filter_options"/> </input> </part> <part name="sexp"> diff --git a/addressbook/gui/widgets/eab-contact-display.c b/addressbook/gui/widgets/eab-contact-display.c index 1d22f3ea70..0208c4fd0f 100644 --- a/addressbook/gui/widgets/eab-contact-display.c +++ b/addressbook/gui/widgets/eab-contact-display.c @@ -91,6 +91,7 @@ common_location [] = #define MSN_ICON "im-msn" #define YAHOO_ICON "im-yahoo" #define GADUGADU_ICON "im-gadugadu" +#define SKYPE_ICON "stock_people" #define VIDEOCONF_ICON "stock_video-conferencing" #define MAX_COMPACT_IMAGE_DIMENSION 48 @@ -617,6 +618,7 @@ render_contact (GtkHTMLStream *html_stream, EContact *contact) accum_multival_attribute (accum, contact, _("MSN"), E_CONTACT_IM_MSN, MSN_ICON, 0); accum_multival_attribute (accum, contact, _("Yahoo"), E_CONTACT_IM_YAHOO, YAHOO_ICON, 0); accum_multival_attribute (accum, contact, _("Gadu-Gadu"), E_CONTACT_IM_GADUGADU, GADUGADU_ICON, 0); + accum_multival_attribute (accum, contact, _("Skype"), E_CONTACT_IM_SKYPE, SKYPE_ICON, 0); if (accum->len > 0) gtk_html_stream_printf (html_stream, "%s", accum->str); diff --git a/addressbook/gui/widgets/eab-gui-util.c b/addressbook/gui/widgets/eab-gui-util.c index d3c0910827..9db9630b72 100644 --- a/addressbook/gui/widgets/eab-gui-util.c +++ b/addressbook/gui/widgets/eab-gui-util.c @@ -101,46 +101,45 @@ eab_load_error_dialog (GtkWidget *parent, ESource *source, EBookStatus status) if (status == E_BOOK_ERROR_OFFLINE_UNAVAILABLE) { can_detail_error = FALSE; - label_string = _("We were unable to open this address book. This either means " - "this book is not marked for offline usage or not yet downloaded " + label_string = _("This address book cannot be opened. This either means this " + "book is not marked for offline usage or not yet downloaded " "for offline usage. Please load the address book once in online mode " - "to download its contents"); + "to download its contents."); } else if (!strncmp (uri, "file:", 5)) { char *path = g_filename_from_uri (uri, NULL, NULL); label = g_strdup_printf ( - _("We were unable to open this address book. Please check that the " - "path %s exists and that you have permission to access it."), path); + _("This address book cannot be opened. Please check that the " + "path %s exists and that permissions are set to access it."), path); g_free (path); label_string = label; } + +#ifndef HAVE_LDAP else if (!strncmp (uri, "ldap:", 5)) { /* special case for ldap: contact folders so we can tell the user about openldap */ -#ifdef HAVE_LDAP - label_string = - _("We were unable to open this address book. This either " - "means you have entered an incorrect URI, or the LDAP server " - "is unreachable."); -#else + can_detail_error = FALSE; label_string = _("This version of Evolution does not have LDAP support " - "compiled in to it. If you want to use LDAP in Evolution, " - "you must install an LDAP-enabled Evolution package."); + "compiled in to it. To use LDAP in Evolution " + "an LDAP-enabled Evolution package must be installed."); + + } #endif - } else { - /* other network folders */ + else { + /* other network folders (or if ldap is enabled and server is unreachable) */ label_string = - _("We were unable to open this address book. This either " - "means you have entered an incorrect URI, or the server " + _("This address book cannot be opened. This either " + "means that an incorrect URI was entered, or the server " "is unreachable."); } if (can_detail_error) { /* do not show repository offline message, it's kind of generic error */ if (status != E_BOOK_ERROR_REPOSITORY_OFFLINE && status > 0 && status < G_N_ELEMENTS (status_to_string) && status_to_string [status]) { - label = g_strconcat (label_string, "\n\n", _("Detailed error:"), " ", _(status_to_string [status]), NULL); + label = g_strconcat (label_string, "\n\n", _("Detailed error message:"), " ", _(status_to_string [status]), NULL); label_string = label; } } @@ -170,7 +169,7 @@ eab_search_result_dialog (GtkWidget *parent, break; case E_BOOK_VIEW_STATUS_TIME_LIMIT_EXCEEDED: str = _("The time to execute this query exceeded the server limit or the limit\n" - "you have configured for this address book. Please make your search\n" + "configured for this address book. Please make your search\n" "more specific or raise the time limit in the directory server\n" "preferences for this address book."); break; |