[evolution-kolab] CamelKolabSession: implemented alert_user() virtual function



commit 9788a65d189355a64f06a5971d7e69437c123903
Author: Christian Hilberg <hilberg kernelconcepts de>
Date:   Fri Oct 26 14:47:40 2012 +0200

    CamelKolabSession: implemented alert_user() virtual function
    
    * implemented this one since the CamelSession does
      not (and cannot) implement a template for it
    * in Evo context, this function will pop up a dialog,
      present a prompt string and (possibly) ask for a
      user input
    * we cannot open a dialog from within our backend
      context, since it runs in E-D-S, which itself does
      not link against an UI toolkit
    * so we just print the prompt message as a warning
      to the console and move on
    * in case this function is called when a server SSL
      certificate is to be accepted/denied, a dialog for
      the same will be opened in Evo and the answer given
      there by the user will be picked up by our backends
      on next E-D-S restart

 src/libekolab/camel-kolab-session.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/src/libekolab/camel-kolab-session.c b/src/libekolab/camel-kolab-session.c
index e588142..82db489 100644
--- a/src/libekolab/camel-kolab-session.c
+++ b/src/libekolab/camel-kolab-session.c
@@ -312,6 +312,25 @@ kolab_session_authenticate_sync (CamelSession *session,
 	return authenticated;
 }
 
+static gint
+kolab_session_alert_user (CamelSession *session,
+                          CamelSessionAlertType type,
+                          const gchar *prompt,
+                          GSList *button_captions)
+{
+	g_return_val_if_fail (CAMEL_IS_SESSION (session), -1);
+	/* prompt may be NULL */
+	(void) button_captions;
+
+	/* should we even pop up a dialog from within E-D-S? */
+	if (prompt != NULL) {
+		g_warning ("%s()[%u] (%u) Error: %s",
+		           __func__, __LINE__, type, prompt);
+	}
+
+	return -1;
+}
+
 /*----------------------------------------------------------------------------*/
 /* class init */
 
@@ -330,6 +349,7 @@ camel_kolab_session_class_init (CamelKolabSessionClass *klass)
 	object_class->finalize = camel_kolab_session_finalize;
 
 	session_class->add_service = parent_class->add_service;
+	session_class->alert_user = kolab_session_alert_user;
 	session_class->authenticate_sync = kolab_session_authenticate_sync;
 
 	g_object_class_install_property (



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]