From: Milan Crha Date: Thu, 25 Feb 2010 12:30:34 +0000 (+0100) Subject: Bug #529331 - Be able to disallow selection of a certain ESource X-Git-Tag: upstream/3.7.4~3345 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c1f0d8ca12fe6c5d0e1ab3d9155c6ea5d7e4b8a2;p=platform%2Fupstream%2Fevolution-data-server.git Bug #529331 - Be able to disallow selection of a certain ESource --- diff --git a/libedataserverui/e-source-selector-dialog.c b/libedataserverui/e-source-selector-dialog.c index 29abf90..e301169 100644 --- a/libedataserverui/e-source-selector-dialog.c +++ b/libedataserverui/e-source-selector-dialog.c @@ -129,6 +129,22 @@ primary_selection_changed_cb (ESourceSelector *selector, gpointer user_data) if (priv->selected_source) g_object_unref (priv->selected_source); priv->selected_source = e_source_selector_peek_primary_selection (selector); + + /* FIXME: add an API to "except-source" or to get the ESourceSelector from outside */ + if (priv->selected_source) { + ESource *except_source = g_object_get_data (G_OBJECT (dialog), "except-source"); + + if (except_source) { + const gchar *except_uid, *selected_uid; + + except_uid = e_source_peek_uid (except_source); + selected_uid = e_source_peek_uid (priv->selected_source); + + if (except_uid && selected_uid && g_str_equal (except_uid, selected_uid)) + priv->selected_source = NULL; + } + } + if (priv->selected_source) { g_object_ref (priv->selected_source); gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_OK, TRUE);