diff options
author | Sivaiah Nallagatla <snallagatla@novell.com> | 2004-11-22 07:30:57 +0800 |
---|---|---|
committer | Sivaiah Nallagatla <siva@src.gnome.org> | 2004-11-22 07:30:57 +0800 |
commit | e57530cbab1283f8d8fc98d88569da08ad9c41b1 (patch) | |
tree | 5b4a8e728f0fa9961a98ffc1e33ae6b3bc3850ed /addressbook/gui/component/addressbook.c | |
parent | b4122c4ebc4c0acedb70e663f6221bd8a3818807 (diff) | |
download | gsoc2013-evolution-e57530cbab1283f8d8fc98d88569da08ad9c41b1.tar gsoc2013-evolution-e57530cbab1283f8d8fc98d88569da08ad9c41b1.tar.gz gsoc2013-evolution-e57530cbab1283f8d8fc98d88569da08ad9c41b1.tar.bz2 gsoc2013-evolution-e57530cbab1283f8d8fc98d88569da08ad9c41b1.tar.lz gsoc2013-evolution-e57530cbab1283f8d8fc98d88569da08ad9c41b1.tar.xz gsoc2013-evolution-e57530cbab1283f8d8fc98d88569da08ad9c41b1.tar.zst gsoc2013-evolution-e57530cbab1283f8d8fc98d88569da08ad9c41b1.zip |
added message which gets prompted when user tries to access a book which
2004-11-21 Sivaiah Nallagatla <snallagatla@novell.com>
* gui/widgets/eab-gui-util.c (eab_load_error_dialog) :
added message which gets prompted when user tries
to access a book which is not available in offline mode
* gui/component/addressbook-config.c (eabc_general_offline)
(offline_status_changed_cb) : added a new check box
to properties page to mark a book for offline usage
* gui/component/addressbook.c (load_source_cb) : do no try to
authenticate in case of offline mode.
(auth_required_cb) : new call back which gets called
when backend sends notification for password to client
svn path=/trunk/; revision=27952
Diffstat (limited to 'addressbook/gui/component/addressbook.c')
-rw-r--r-- | addressbook/gui/component/addressbook.c | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c index cbf908c17f..dbeccd75fc 100644 --- a/addressbook/gui/component/addressbook.c +++ b/addressbook/gui/component/addressbook.c @@ -120,7 +120,8 @@ load_source_auth_cb (EBook *book, EBookStatus status, gpointer closure) } } - data->cb (book, status, data->closure); + if (data->cb) + data->cb (book, status, data->closure); free_load_source_data (data); } @@ -209,12 +210,28 @@ addressbook_authenticate (EBook *book, gboolean previous_failure, ESource *sourc } else { /* they hit cancel */ - cb (book, E_BOOK_ERROR_CANCELLED, closure); + + cb (book, E_BOOK_ERROR_CANCELLED, closure); } g_free (uri); } + + +static void +auth_required_cb (EBook *book, gpointer data) +{ + LoadSourceData *load_source_data = g_new0(LoadSourceData, 1); + + load_source_data->source = g_object_ref (g_object_ref (e_book_get_source (book))); + load_source_data->cancelled = FALSE; + addressbook_authenticate (book, FALSE, load_source_data->source, + load_source_auth_cb, load_source_data); + + + +} static void load_source_cb (EBook *book, EBookStatus status, gpointer closure) { @@ -229,17 +246,16 @@ load_source_cb (EBook *book, EBookStatus status, gpointer closure) const gchar *auth; auth = e_source_get_property (load_source_data->source, "auth"); - - /* check if the addressbook needs authentication */ - if (auth && strcmp (auth, "none")) { - addressbook_authenticate (book, FALSE, load_source_data->source, - load_source_auth_cb, closure); - - return; + g_signal_connect (book, "auth_required", auth_required_cb, NULL); + + if (e_book_is_online (book)) { + addressbook_authenticate (book, FALSE, load_source_data->source, + load_source_auth_cb, closure); + return; + } } } - load_source_data->cb (book, status, load_source_data->closure); free_load_source_data (load_source_data); } |