aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/contact-editor
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@novell.com>2004-05-25 22:57:04 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2004-05-25 22:57:04 +0800
commit479e75883911fc03b2b7d09d69f48faf0f3812eb (patch)
treee0fd0f15f7abaf56031e6be4262a2cc3aea74ba7 /addressbook/gui/contact-editor
parentf87fe83e1df3a2370b9b2dcef90eb8869f4b0eff (diff)
downloadgsoc2013-evolution-479e75883911fc03b2b7d09d69f48faf0f3812eb.tar
gsoc2013-evolution-479e75883911fc03b2b7d09d69f48faf0f3812eb.tar.gz
gsoc2013-evolution-479e75883911fc03b2b7d09d69f48faf0f3812eb.tar.bz2
gsoc2013-evolution-479e75883911fc03b2b7d09d69f48faf0f3812eb.tar.lz
gsoc2013-evolution-479e75883911fc03b2b7d09d69f48faf0f3812eb.tar.xz
gsoc2013-evolution-479e75883911fc03b2b7d09d69f48faf0f3812eb.tar.zst
gsoc2013-evolution-479e75883911fc03b2b7d09d69f48faf0f3812eb.zip
Generate the addressbook-errors.xml.h file and install the xml file and
2004-05-25 Jeffrey Stedfast <fejj@novell.com> * Makefile.am: Generate the addressbook-errors.xml.h file and install the xml file and all that jazz. * addressbook-errors.xml: New error xml file. * gui/widgets/e-addressbook-view.c (backend_died): Use e_error_run(). * gui/widgets/eab-gui-util.c (eab_error_dialog): Use e_error_run(). (eab_load_error_dialog): Same. (eab_search_result_dialog): Same. (eab_prompt_save_dialog): Same. (save_it): Same. * gui/contact-editor/e-contact-editor.c (categories_clicked): Use e_error_run(). (e_contact_editor_is_valid): Same. (save_contact): Same. * gui/component/addressbook-view.c (delete_addressbook_cb): Use e_error_run(). * gui/component/addressbook-config.c (addressbook_ldap_init): Use e_error_run(). (addressbook_ldap_auth): Same. (addressbook_root_dse_query): Same. (do_ldap_root_dse_query): Same. (do_schema_query): Same. svn path=/trunk/; revision=26077
Diffstat (limited to 'addressbook/gui/contact-editor')
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c48
1 files changed, 8 insertions, 40 deletions
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c
index 85b2f2f5dc..2d058eca04 100644
--- a/addressbook/gui/contact-editor/e-contact-editor.c
+++ b/addressbook/gui/contact-editor/e-contact-editor.c
@@ -56,6 +56,7 @@
#include "addressbook/printing/e-contact-print-envelope.h"
#include "addressbook/gui/widgets/eab-gui-util.h"
#include "e-util/e-gui-utils.h"
+#include "widgets/misc/e-error.h"
#include "widgets/misc/e-dateedit.h"
#include "widgets/misc/e-image-chooser.h"
#include "widgets/misc/e-url-entry.h"
@@ -2285,18 +2286,12 @@ categories_clicked (GtkWidget *button, EContactEditor *editor)
else if (editor->contact)
categories = e_contact_get (editor->contact, E_CONTACT_CATEGORIES);
- dialog = GTK_DIALOG(e_categories_new(categories));
-
- if (dialog == NULL) {
- GtkWidget *uh_oh = gtk_message_dialog_new (NULL,
- 0, GTK_MESSAGE_ERROR,
- GTK_RESPONSE_OK,
- _("Category editor not available."));
+ if (!(dialog = GTK_DIALOG (e_categories_new (categories)))) {
+ e_error_run (NULL, "addressbook:edit-categories", NULL);
g_free (categories);
- gtk_widget_show (uh_oh);
return;
}
-
+
ecml = e_categories_master_list_wombat_new ();
g_object_set (dialog,
"header", _("This contact belongs to these categories:"),
@@ -2550,27 +2545,7 @@ save_contact (EContactEditor *ce, gboolean should_close)
return;
if (ce->target_editable && !ce->source_editable) {
- GtkWidget *dialog;
- gint response;
-
- dialog = gtk_message_dialog_new (GTK_WINDOW (ce->app),
- (GtkDialogFlags) 0,
- GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_NONE,
- _("You are moving the contact from one "
- "address book to another, but it cannot "
- "be removed from the source. Do you want "
- "to save a copy instead?"));
- gtk_dialog_add_buttons (GTK_DIALOG (dialog),
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_SAVE, GTK_RESPONSE_YES,
- NULL);
-
- gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CANCEL);
- response = gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
-
- if (response == GTK_RESPONSE_CANCEL)
+ if (e_error_run (GTK_WINDOW (ce->app), "addressbook:prompt-move", NULL) == GTK_RESPONSE_NO)
return;
}
@@ -2601,9 +2576,8 @@ static gboolean
e_contact_editor_is_valid (EABEditor *editor)
{
EContactEditor *ce = E_CONTACT_EDITOR (editor);
- GtkWidget *dialog,*widget;
+ GtkWidget *widget;
gboolean validation_error = FALSE;
- gint result;
GString *errmsg = g_string_new (_("The contact data is invalid:\n\n"));
widget = glade_xml_get_widget (ce->gui, "dateedit-birthday");
@@ -2631,14 +2605,8 @@ e_contact_editor_is_valid (EABEditor *editor)
if (validation_error) {
g_string_append (errmsg, ".");
-
- dialog = gtk_message_dialog_new (GTK_WINDOW (ce->app),
- 0,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- errmsg->str);
- result = gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
+ e_error_run (GTK_WINDOW (ce->app), "addressbook:generic-error",
+ _("Invalid contact."), errmsg->str, NULL);
g_string_free (errmsg, TRUE);
return FALSE;
}