aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2008-08-15 04:19:12 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2008-08-15 04:19:12 +0800
commit7ade227e6409c98a4010992450e111cf7bb10520 (patch)
treebdd716d894ae2f3b1affaa6bb68950a89441db13 /addressbook/gui
parentcca29c3424aede2bb3c9ec5a6d255ce490d3511b (diff)
downloadgsoc2013-evolution-7ade227e6409c98a4010992450e111cf7bb10520.tar.gz
gsoc2013-evolution-7ade227e6409c98a4010992450e111cf7bb10520.tar.zst
gsoc2013-evolution-7ade227e6409c98a4010992450e111cf7bb10520.zip
Merge revisions 35951:35992 from trunk.
svn path=/branches/kill-bonobo/; revision=35994
Diffstat (limited to 'addressbook/gui')
-rw-r--r--addressbook/gui/component/GNOME_Evolution_Addressbook.server.in.in2
-rw-r--r--addressbook/gui/component/addressbook-migrate.c2
-rw-r--r--addressbook/gui/component/addressbook-view.c12
-rw-r--r--addressbook/gui/component/addressbook.c41
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor-address.c10
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor-fullname.c10
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor-im.c14
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c15
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.c13
-rw-r--r--addressbook/gui/widgets/eab-gui-util.c9
10 files changed, 57 insertions, 71 deletions
diff --git a/addressbook/gui/component/GNOME_Evolution_Addressbook.server.in.in b/addressbook/gui/component/GNOME_Evolution_Addressbook.server.in.in
index 4fe2ce7a6a..823d5bd89f 100644
--- a/addressbook/gui/component/GNOME_Evolution_Addressbook.server.in.in
+++ b/addressbook/gui/component/GNOME_Evolution_Addressbook.server.in.in
@@ -102,7 +102,7 @@
<oaf_attribute name="evolution2:config_item:priority" type="string" value="-6"/>
<oaf_attribute name="name" type="string"
- _value="Evolution S/Mime Certificate Management Control"/>
+ _value="Evolution S/MIME Certificate Management Control"/>
</oaf_server>
diff --git a/addressbook/gui/component/addressbook-migrate.c b/addressbook/gui/component/addressbook-migrate.c
index 5b73f7ae1e..e6d5616e13 100644
--- a/addressbook/gui/component/addressbook-migrate.c
+++ b/addressbook/gui/component/addressbook-migrate.c
@@ -122,7 +122,7 @@ dialog_set_folder_name (MigrationContext *context, const char *folder_name)
{
char *text;
- text = g_strdup_printf (_("Migrating `%s':"), folder_name);
+ text = g_strdup_printf (_("Migrating '%s':"), folder_name);
gtk_label_set_text (GTK_LABEL (context->folder_label), text);
g_free (text);
diff --git a/addressbook/gui/component/addressbook-view.c b/addressbook/gui/component/addressbook-view.c
index 7fa76e7fdc..cc8f195c98 100644
--- a/addressbook/gui/component/addressbook-view.c
+++ b/addressbook/gui/component/addressbook-view.c
@@ -43,7 +43,6 @@
#include "misc/e-task-bar.h"
#include "misc/e-info-label.h"
-
#include "e-util/e-icon-factory.h"
#include "e-util/e-util-private.h"
#include "shell/e-user-creatable-items-handler.h"
@@ -66,10 +65,6 @@
#define PARENT_TYPE G_TYPE_OBJECT
static GObjectClass *parent_class = NULL;
-/* This is used for the addressbook status bar */
-#define EVOLUTION_CONTACTS_PROGRESS_IMAGE "contact-new"
-static GdkPixbuf *progress_icon = NULL;
-
#define d(x)
struct _AddressbookViewPrivate {
@@ -489,11 +484,8 @@ set_status_message (EABView *eav, const char *message, AddressbookView *view)
} else if (priv->activity_id == 0) {
char *clientid = g_strdup_printf ("%p", view);
- if (progress_icon == NULL)
- progress_icon = e_icon_factory_get_icon (EVOLUTION_CONTACTS_PROGRESS_IMAGE, E_ICON_SIZE_STATUS);
-
- priv->activity_id = e_activity_handler_operation_started (activity_handler, clientid,
- progress_icon, message, TRUE);
+ priv->activity_id = e_activity_handler_operation_started (
+ activity_handler, clientid, message, TRUE);
g_free (clientid);
} else {
diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c
index ac135a0be0..132ad51cea 100644
--- a/addressbook/gui/component/addressbook.c
+++ b/addressbook/gui/component/addressbook.c
@@ -73,6 +73,9 @@ static void
load_source_auth_cb (EBook *book, EBookStatus status, gpointer closure)
{
LoadSourceData *data = closure;
+ gboolean was_in = g_object_get_data (G_OBJECT (book), "authenticated") != NULL;
+
+ g_object_set_data (G_OBJECT (book), "authenticated", NULL);
if (data->cancelled) {
free_load_source_data (data);
@@ -99,38 +102,42 @@ load_source_auth_cb (EBook *book, EBookStatus status, gpointer closure)
"%s", _("Accessing LDAP Server anonymously"));
g_signal_connect (dialog, "response", G_CALLBACK(gtk_widget_destroy), NULL);
gtk_widget_show (dialog);
- if (data->cb)
- data->cb (book, E_BOOK_ERROR_OK, data->closure);
- free_load_source_data (data);
- return;
+ status = E_BOOK_ERROR_OK;
+
+ goto done;
}
} else if (status == E_BOOK_ERROR_INVALID_SERVER_VERSION) {
e_error_run (NULL, "addressbook:server-version", NULL);
status = E_BOOK_ERROR_OK;
- if (data->cb)
- data->cb (book, status, data->closure);
- free_load_source_data (data);
- return;
-
+ goto done;
+ } else if (status == E_BOOK_ERROR_UNSUPPORTED_AUTHENTICATION_METHOD) {
+ goto done;
} else {
- const gchar *uri = e_book_get_uri (book);
- gchar *stripped_uri = remove_parameters_from_uri (uri);
- const gchar *auth_domain = e_source_get_property (data->source, "auth-domain");
- const gchar *component_name;
+ if (status == E_BOOK_ERROR_AUTHENTICATION_FAILED) {
+ const gchar *uri = e_book_get_uri (book);
+ gchar *stripped_uri = remove_parameters_from_uri (uri);
+ const gchar *auth_domain = e_source_get_property (data->source, "auth-domain");
+ const gchar *component_name;
- component_name = auth_domain ? auth_domain : "Addressbook";
+ component_name = auth_domain ? auth_domain : "Addressbook";
- if (status == E_BOOK_ERROR_AUTHENTICATION_FAILED) {
e_passwords_forget_password (component_name, stripped_uri);
+
+ g_free (stripped_uri);
+ } else if (was_in) {
+ /* We already tried to authenticate to the server, and it failed with
+ other reason than with E_BOOK_ERROR_AUTHENTICATION_FAILED, thus stop
+ poking with the server and report error to the user. */
+ goto done;
}
+ g_object_set_data (G_OBJECT (book), "authenticated", GINT_TO_POINTER (1));
addressbook_authenticate (book, TRUE, data->source, load_source_auth_cb, closure);
-
- g_free (stripped_uri);
return;
}
}
+done:
if (data->cb)
data->cb (book, status, data->closure);
diff --git a/addressbook/gui/contact-editor/e-contact-editor-address.c b/addressbook/gui/contact-editor/e-contact-editor-address.c
index 7b2a54424b..1a1e6e18ed 100644
--- a/addressbook/gui/contact-editor/e-contact-editor-address.c
+++ b/addressbook/gui/contact-editor/e-contact-editor-address.c
@@ -22,7 +22,6 @@
#include <config.h>
#include <e-contact-editor-address.h>
-#include <e-util/e-icon-factory.h>
#include <e-util/e-util-private.h>
#include <glib/gi18n.h>
@@ -417,7 +416,6 @@ e_contact_editor_address_init (EContactEditorAddress *e_contact_editor_address)
{
GladeXML *gui;
GtkWidget *widget;
- GList *icon_list;
char *gladefile;
gtk_dialog_add_buttons (GTK_DIALOG (e_contact_editor_address),
@@ -450,12 +448,8 @@ e_contact_editor_address_init (EContactEditorAddress *e_contact_editor_address)
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (e_contact_editor_address)->vbox), widget, TRUE, TRUE, 0);
g_object_unref(widget);
- icon_list = e_icon_factory_get_icon_list ("contact-new");
- if (icon_list) {
- gtk_window_set_icon_list (GTK_WINDOW (e_contact_editor_address), icon_list);
- g_list_foreach (icon_list, (GFunc) g_object_unref, NULL);
- g_list_free (icon_list);
- }
+ gtk_window_set_icon_name (
+ GTK_WINDOW (e_contact_editor_address), "contact-new");
}
static void
diff --git a/addressbook/gui/contact-editor/e-contact-editor-fullname.c b/addressbook/gui/contact-editor/e-contact-editor-fullname.c
index 0943e2111f..af0db54e7e 100644
--- a/addressbook/gui/contact-editor/e-contact-editor-fullname.c
+++ b/addressbook/gui/contact-editor/e-contact-editor-fullname.c
@@ -21,7 +21,6 @@
#include <config.h>
#include "e-contact-editor-fullname.h"
-#include <e-util/e-icon-factory.h>
#include <e-util/e-util-private.h>
#include <libgnome/gnome-util.h>
#include <glib/gi18n.h>
@@ -100,7 +99,6 @@ e_contact_editor_fullname_init (EContactEditorFullname *e_contact_editor_fullnam
{
GladeXML *gui;
GtkWidget *widget;
- GList *icon_list;
char *gladefile;
gtk_widget_realize (GTK_WIDGET (e_contact_editor_fullname));
@@ -136,12 +134,8 @@ e_contact_editor_fullname_init (EContactEditorFullname *e_contact_editor_fullnam
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (e_contact_editor_fullname)->vbox), widget, TRUE, TRUE, 0);
g_object_unref(widget);
- icon_list = e_icon_factory_get_icon_list ("contact-new");
- if (icon_list) {
- gtk_window_set_icon_list (GTK_WINDOW (e_contact_editor_fullname), icon_list);
- g_list_foreach (icon_list, (GFunc) g_object_unref, NULL);
- g_list_free (icon_list);
- }
+ gtk_window_set_icon_name (
+ GTK_WINDOW (e_contact_editor_fullname), "contact-new");
}
static void
diff --git a/addressbook/gui/contact-editor/e-contact-editor-im.c b/addressbook/gui/contact-editor/e-contact-editor-im.c
index d438444147..8b421c0b3b 100644
--- a/addressbook/gui/contact-editor/e-contact-editor-im.c
+++ b/addressbook/gui/contact-editor/e-contact-editor-im.c
@@ -24,7 +24,6 @@
#include <libgnome/gnome-util.h>
#include <glib/gi18n.h>
#include <string.h>
-#include <e-util/e-icon-factory.h>
#include <e-util/e-util-private.h>
static void e_contact_editor_im_init (EContactEditorIm *card);
@@ -189,7 +188,8 @@ setup_service_optmenu(EContactEditorIm *editor)
gtk_container_add(GTK_CONTAINER(item), hbox);
gtk_widget_show(hbox);
- image = e_icon_factory_get_image (im_images[i], E_ICON_SIZE_MENU);
+ image = gtk_image_new_from_icon_name (
+ im_images[i], GTK_ICON_SIZE_MENU);
gtk_size_group_add_widget(sg, image);
@@ -240,7 +240,6 @@ e_contact_editor_im_init (EContactEditorIm *e_contact_editor_im)
{
GladeXML *gui;
GtkWidget *widget;
- GList *icon_list;
char *gladefile;
gtk_dialog_add_buttons (GTK_DIALOG (e_contact_editor_im),
@@ -279,13 +278,8 @@ e_contact_editor_im_init (EContactEditorIm *e_contact_editor_im)
gtk_widget_grab_focus(glade_xml_get_widget(gui, "entry-username"));
- /* set the icon */
- icon_list = e_icon_factory_get_icon_list ("contact-new");
- if (icon_list) {
- gtk_window_set_icon_list (GTK_WINDOW (e_contact_editor_im), icon_list);
- g_list_foreach (icon_list, (GFunc) g_object_unref, NULL);
- g_list_free (icon_list);
- }
+ gtk_window_set_icon_name (
+ GTK_WINDOW (e_contact_editor_im), "contact-new");
}
static void
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c
index c0616d9916..a226cfe132 100644
--- a/addressbook/gui/contact-editor/e-contact-editor.c
+++ b/addressbook/gui/contact-editor/e-contact-editor.c
@@ -28,10 +28,7 @@
#include <time.h>
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
-#include <libgnomeui/gnome-window-icon.h>
-#include <libgnome/gnome-util.h>
#include <glib/gi18n.h>
-#include <libgnome/gnome-help.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <libedataserverui/e-categories-dialog.h>
@@ -45,6 +42,7 @@
#include "addressbook/gui/component/addressbook.h"
#include "addressbook/printing/e-contact-print.h"
#include "addressbook/gui/widgets/eab-gui-util.h"
+#include "e-util/e-util.h"
#include "e-util/e-gui-utils.h"
#include "e-util/e-error.h"
#include "misc/e-dateedit.h"
@@ -3210,14 +3208,8 @@ app_delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer data)
static void
show_help_cb (GtkWidget *widget, gpointer data)
{
- GError *error = NULL;
-
- gnome_help_display (
- "evolution.xml", "usage-contact-cards", &error);
- if (error != NULL) {
- g_warning ("%s", error->message);
- g_error_free (error);
- }
+ /* FIXME Pass a proper parent window. */
+ e_display_help (NULL, "usage-contact-cards");
}
static GList *
@@ -3314,7 +3306,6 @@ e_contact_editor_init (EContactEditor *e_contact_editor)
{
GladeXML *gui;
GtkWidget *widget, *label;
- char *icon_path;
char *gladefile;
e_contact_editor->name = e_contact_name_new();
diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c
index b30ece1581..ecae7ed8c3 100644
--- a/addressbook/gui/widgets/e-addressbook-view.c
+++ b/addressbook/gui/widgets/e-addressbook-view.c
@@ -31,7 +31,6 @@
#include <filter/rule-editor.h>
#include <widgets/menus/gal-view-etable.h>
#include <e-util/e-xml-utils.h>
-#include <e-util/e-icon-factory.h>
#include <libgnomeui/gnome-dialog-util.h>
#include "addressbook/printing/e-contact-print.h"
@@ -1476,8 +1475,16 @@ generate_viewoption_menu (EABSearchBarItem *subitems)
char *str = NULL;
str = e_str_without_underscores (subitems[i].search.text);
menu_item = gtk_image_menu_item_new_with_label (str);
-/* if (subitems[i].image)
- gtk_image_menu_item_set_image (menu_item, e_icon_factory_get_image (subitems[i].image, E_ICON_SIZE_MENU)); */
+ if (subitems[i].image) {
+ GtkWidget *image;
+
+ image = gtk_image_new_from_icon_name (
+ subitems[i].image,
+ GTK_ICON_SIZE_MENU);
+ gtk_image_menu_item_set_image (
+ GTK_IMAGE_MENU_ITEM (menu_item),
+ image);
+ }
g_free (str);
} else {
menu_item = gtk_menu_item_new ();
diff --git a/addressbook/gui/widgets/eab-gui-util.c b/addressbook/gui/widgets/eab-gui-util.c
index 1b59371935..42ce9cd8f2 100644
--- a/addressbook/gui/widgets/eab-gui-util.c
+++ b/addressbook/gui/widgets/eab-gui-util.c
@@ -75,7 +75,8 @@ static const char *status_to_string[] = {
/* E_BOOK_ERROR_NO_SUCH_SOURCE */ N_("No such source"),
/* E_BOOK_ERROR_OFFLINE_UNAVAILABLE */ N_("Not available in offline mode"),
/* E_BOOK_ERROR_OTHER_ERROR */ N_("Other error"),
- /* E_BOOK_ERROR_INVALID_SERVER_VERSION */ N_("Invalid server version")
+ /* E_BOOK_ERROR_INVALID_SERVER_VERSION */ N_("Invalid server version"),
+ /* E_BOOK_ERROR_UNSUPPORTED_AUTHENTICATION_METHOD */ N_("Unsupported authentication method")
};
void
@@ -131,6 +132,12 @@ eab_load_error_dialog (GtkWidget *parent, ESource *source, EBookStatus status)
_("We were unable to open this addressbook. This either "
"means you have entered an incorrect URI, or the server "
"is unreachable.");
+
+ /* 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_string = label;
+ }
}
dialog = e_error_new ((GtkWindow *) parent, "addressbook:load-error", label_string, NULL);