aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/contact-list-editor/e-contact-list-editor.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2013-09-30 21:52:45 +0800
committerMilan Crha <mcrha@redhat.com>2013-09-30 21:52:45 +0800
commit10032e2479eb6fc9f5684346364ec52c246a5969 (patch)
tree89dce2c39e699887edee6bc603b5e3fcbb5fa394 /addressbook/gui/contact-list-editor/e-contact-list-editor.c
parent6a65912679f4287dd7d45e11f5c5a7c893c43112 (diff)
downloadgsoc2013-evolution-10032e2479eb6fc9f5684346364ec52c246a5969.tar
gsoc2013-evolution-10032e2479eb6fc9f5684346364ec52c246a5969.tar.gz
gsoc2013-evolution-10032e2479eb6fc9f5684346364ec52c246a5969.tar.bz2
gsoc2013-evolution-10032e2479eb6fc9f5684346364ec52c246a5969.tar.lz
gsoc2013-evolution-10032e2479eb6fc9f5684346364ec52c246a5969.tar.xz
gsoc2013-evolution-10032e2479eb6fc9f5684346364ec52c246a5969.tar.zst
gsoc2013-evolution-10032e2479eb6fc9f5684346364ec52c246a5969.zip
Bug #705685 - Contact(-list)-editor - reject save when book is still opening
Diffstat (limited to 'addressbook/gui/contact-list-editor/e-contact-list-editor.c')
-rw-r--r--addressbook/gui/contact-list-editor/e-contact-list-editor.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.c b/addressbook/gui/contact-list-editor/e-contact-list-editor.c
index 4f5e397f88..4bcaa9bbfb 100644
--- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c
+++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c
@@ -352,7 +352,7 @@ contact_list_editor_get_client_cb (GObject *source_object,
e_source_combo_box_set_active (
E_SOURCE_COMBO_BOX (combo_box),
- closure->source);
+ e_client_get_source (E_CLIENT (editor->priv->book_client)));
g_error_free (error);
goto exit;
@@ -1524,6 +1524,8 @@ contact_list_editor_save_contact (EABEditor *eab_editor,
EditorCloseStruct *ecs;
EContact *contact;
EShell *shell;
+ GtkWidget *client_combo_box;
+ ESource *active_source;
shell = eab_editor_get_shell (eab_editor);
registry = e_shell_get_registry (shell);
@@ -1533,6 +1535,22 @@ contact_list_editor_save_contact (EABEditor *eab_editor,
if (priv->book_client == NULL)
return;
+ client_combo_box = WIDGET (CLIENT_COMBO_BOX);
+ active_source = e_source_combo_box_ref_active (E_SOURCE_COMBO_BOX (client_combo_box));
+ g_return_if_fail (active_source != NULL);
+
+ if (!e_source_equal (e_client_get_source (E_CLIENT (priv->book_client)), active_source)) {
+ e_alert_run_dialog_for_args (
+ GTK_WINDOW (WIDGET (DIALOG)),
+ "addressbook:error-still-opening",
+ e_source_get_display_name (active_source),
+ NULL);
+ g_object_unref (active_source);
+ return;
+ }
+
+ g_object_unref (active_source);
+
ecs = g_new (EditorCloseStruct, 1);
ecs->editor = g_object_ref (editor);
ecs->should_close = should_close;