diff options
author | Not Zed <NotZed@Ximian.com> | 2004-08-30 12:31:52 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2004-08-30 12:31:52 +0800 |
commit | 5c9634578c184e4981b2d0d91aad695492e16bcc (patch) | |
tree | 800353bb95d41641a918fbd68eb1cf5f87bea5a3 /e-util/e-passwords.c | |
parent | b7b81ffedd5dddd0ae0cade43f13722379c29d6c (diff) | |
download | gsoc2013-evolution-5c9634578c184e4981b2d0d91aad695492e16bcc.tar.gz gsoc2013-evolution-5c9634578c184e4981b2d0d91aad695492e16bcc.tar.zst gsoc2013-evolution-5c9634578c184e4981b2d0d91aad695492e16bcc.zip |
return cancelled if we're in an offline state.
2004-08-27 Not Zed <NotZed@Ximian.com>
* e-passwords.c (e_passwords_ask_password): return cancelled if
we're in an offline state.
svn path=/trunk/; revision=27074
Diffstat (limited to 'e-util/e-passwords.c')
-rw-r--r-- | e-util/e-passwords.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/e-util/e-passwords.c b/e-util/e-passwords.c index 3798819f22..d64f7a33dc 100644 --- a/e-util/e-passwords.c +++ b/e-util/e-passwords.c @@ -102,6 +102,7 @@ static GHashTable *passwords = NULL; static GtkDialog *password_dialog; static EDList request_list = E_DLIST_INITIALISER(request_list); static int idle_id; +static int ep_online_state = TRUE; static char *decode_base64 (char *base64); static int base64_encode_close(unsigned char *in, int inlen, gboolean break_lines, unsigned char *out, int *state, int *save); @@ -538,6 +539,23 @@ e_passwords_shutdown (void) } /** + * e_passwords_set_online: + * @state: + * + * Set the offline-state of the application. This is a work-around + * for having the backends fully offline aware, and returns a + * cancellation response instead of prompting for passwords. + * + * FIXME: This is not a permanent api, review post 2.0. + **/ +void +e_passwords_set_online(int state) +{ + ep_online_state = state; + /* TODO: we could check that a request is open and close it, or maybe who cares */ +} + +/** * e_passwords_forget_passwords: * * Forgets all cached passwords, in memory and on disk. @@ -698,6 +716,9 @@ e_passwords_ask_password (const char *title, const char *component_name, char *passwd; EPassMsg *msg = ep_msg_new(ep_ask_password); + if ((type & E_PASSWORDS_ONLINE) && !ep_online_state) + return NULL; + msg->title = title; msg->component = component_name; msg->key = key; |