diff options
author | Hao Sheng <hao.sheng@sun.com> | 2004-09-24 12:50:00 +0800 |
---|---|---|
committer | Harry Lu <haip@src.gnome.org> | 2004-09-24 12:50:00 +0800 |
commit | 809fa4df4490bcad9663458df09d4928f865ef55 (patch) | |
tree | 3064e4d2aaa7351bad937d584459469ab58482f4 /addressbook/gui | |
parent | d362be429cf05a0e7aaa0582d55dbd97c4616256 (diff) | |
download | gsoc2013-evolution-809fa4df4490bcad9663458df09d4928f865ef55.tar.gz gsoc2013-evolution-809fa4df4490bcad9663458df09d4928f865ef55.tar.zst gsoc2013-evolution-809fa4df4490bcad9663458df09d4928f865ef55.zip |
Fix for #66523
2004-09-24 Hao Sheng <hao.sheng@sun.com>
Fix for #66523
* gui/contact-list-editor/e-contact-list-model.c:
(e_contact_list_model_add_email): estimate the same mail address
and popup a warning dialog.
* addressbook-errors.xml: add the question message for the warning
dialog.
svn path=/trunk/; revision=27360
Diffstat (limited to 'addressbook/gui')
-rw-r--r-- | addressbook/gui/contact-list-editor/e-contact-list-model.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-model.c b/addressbook/gui/contact-list-editor/e-contact-list-model.c index ee9b3a3601..4560413c19 100644 --- a/addressbook/gui/contact-list-editor/e-contact-list-model.c +++ b/addressbook/gui/contact-list-editor/e-contact-list-model.c @@ -3,7 +3,9 @@ #include <config.h> #include <string.h> #include "e-contact-list-model.h" +#include "widgets/misc/e-error.h" +#include <gtk/gtkmessagedialog.h> #define PARENT_TYPE e_table_model_get_type() static ETableModelClass *parent_class; @@ -195,10 +197,26 @@ e_contact_list_model_add_email (EContactListModel *model, const char *email) { EDestination *new_dest; + char *list_email; + int row; + int row_count; g_return_if_fail (E_IS_CONTACT_LIST_MODEL (model)); g_return_if_fail (email != NULL); + row_count = e_table_model_row_count (E_TABLE_MODEL (model)); + + for (row = 0; row < row_count; row++) { + list_email = (char *) e_table_model_value_at (E_TABLE_MODEL (model), 1, row); + + if (strcmp (list_email, email) == 0) { + if (e_error_run (NULL, "addressbook:ask-list-add-exists", + email) != GTK_RESPONSE_YES) + return; + break; + } + } + new_dest = e_destination_new (); e_destination_set_email (new_dest, email); |