diff options
author | Sivaiah Nallagatla <siva@src.gnome.org> | 2004-11-22 07:55:45 +0800 |
---|---|---|
committer | Sivaiah Nallagatla <siva@src.gnome.org> | 2004-11-22 07:55:45 +0800 |
commit | 3c80fbd004c256274bf6856c19cb119226415a89 (patch) | |
tree | e009875c0c1d8c715849b2b4b0a1388ba25e65f1 /addressbook | |
parent | 17df6f69a2a9521ffa3ed41ad93d951909df8f0b (diff) | |
download | gsoc2013-evolution-3c80fbd004c256274bf6856c19cb119226415a89.tar gsoc2013-evolution-3c80fbd004c256274bf6856c19cb119226415a89.tar.gz gsoc2013-evolution-3c80fbd004c256274bf6856c19cb119226415a89.tar.bz2 gsoc2013-evolution-3c80fbd004c256274bf6856c19cb119226415a89.tar.lz gsoc2013-evolution-3c80fbd004c256274bf6856c19cb119226415a89.tar.xz gsoc2013-evolution-3c80fbd004c256274bf6856c19cb119226415a89.tar.zst gsoc2013-evolution-3c80fbd004c256274bf6856c19cb119226415a89.zip |
reverting commit
svn path=/trunk/; revision=27954
Diffstat (limited to 'addressbook')
-rw-r--r-- | addressbook/gui/component/addressbook-config.c | 39 | ||||
-rw-r--r-- | addressbook/gui/component/addressbook.c | 36 | ||||
-rw-r--r-- | addressbook/gui/widgets/eab-gui-util.c | 9 |
3 files changed, 12 insertions, 72 deletions
diff --git a/addressbook/gui/component/addressbook-config.c b/addressbook/gui/component/addressbook-config.c index c675d9a272..ddf44281fb 100644 --- a/addressbook/gui/component/addressbook-config.c +++ b/addressbook/gui/component/addressbook-config.c @@ -29,7 +29,6 @@ #include <gtk/gtkspinbutton.h> #include <gtk/gtkcelllayout.h> #include <gtk/gtklabel.h> -#include <gtk/gtk.h> #include <libgnome/gnome-i18n.h> #include <bonobo/bonobo-generic-factory.h> @@ -542,16 +541,6 @@ name_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog) e_source_set_name (sdialog->source, gtk_entry_get_text (GTK_ENTRY (sdialog->display_name))); } -static void -offline_status_changed_cb (GtkWidget *widget, AddressbookSourceDialog *sdialog) -{ - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) - e_source_set_property (sdialog->source, "offline_sync", "1"); - else - e_source_set_property (sdialog->source, "offline_sync", NULL); - -} - static GtkWidget * eabc_general_name(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, void *data) { @@ -559,7 +548,6 @@ eabc_general_name(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, str const char *uri; GtkWidget *w; GladeXML *gui; - if (old) return old; @@ -579,35 +567,12 @@ eabc_general_name(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, str gtk_widget_set_sensitive (GTK_WIDGET(sdialog->display_name), FALSE); } } - + g_object_unref(gui); return w; } - -static GtkWidget * -eabc_general_offline(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, void *data) -{ - AddressbookSourceDialog *sdialog = data; - GtkCheckButton *offline_setting; - int row; - if (old) - return; - else { - row = ((GtkTable*)parent)->nrows; - offline_setting = gtk_check_button_new_with_label (N_("Sync conents locally for offline usage")); - gtk_widget_show (offline_setting); - gtk_container_add (parent, offline_setting); - g_signal_connect (offline_setting, "toggled", G_CALLBACK (offline_status_changed_cb), sdialog); - - } - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (offline_setting), e_source_get_property (sdialog->source, "offline_sync") ? TRUE : FALSE); - gtk_widget_show (offline_setting); - return offline_setting; - -} - #ifdef HAVE_LDAP static void url_changed(AddressbookSourceDialog *sdialog) @@ -652,7 +617,6 @@ ssl_optionmenu_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog) e_source_set_property (sdialog->source, "ssl", ldap_unparse_ssl (sdialog->ssl)); } - static GtkWidget * eabc_general_host(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, void *data) { @@ -893,7 +857,6 @@ static EConfigItem eabc_items[] = { { E_CONFIG_PAGE, "00.general", N_("General") }, { E_CONFIG_SECTION, "00.general/10.display", N_("Addressbook") }, { E_CONFIG_ITEM, "00.general/10.display/10.name", "hbox122", eabc_general_name }, - { E_CONFIG_ITEM, "00.general/10.display/20.offline", NULL, eabc_general_offline }, #ifdef HAVE_LDAP { E_CONFIG_SECTION, "00.general/20.server", N_("Server Information") }, { E_CONFIG_ITEM, "00.general/20.server/00.host", "table31", eabc_general_host }, diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c index dbeccd75fc..cbf908c17f 100644 --- a/addressbook/gui/component/addressbook.c +++ b/addressbook/gui/component/addressbook.c @@ -120,8 +120,7 @@ load_source_auth_cb (EBook *book, EBookStatus status, gpointer closure) } } - if (data->cb) - data->cb (book, status, data->closure); + data->cb (book, status, data->closure); free_load_source_data (data); } @@ -210,28 +209,12 @@ 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) { @@ -246,16 +229,17 @@ 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")) { - 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; - } + 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); } diff --git a/addressbook/gui/widgets/eab-gui-util.c b/addressbook/gui/widgets/eab-gui-util.c index 90c103be16..a88bd4cf82 100644 --- a/addressbook/gui/widgets/eab-gui-util.c +++ b/addressbook/gui/widgets/eab-gui-util.c @@ -86,14 +86,7 @@ eab_load_error_dialog (GtkWidget *parent, ESource *source, EBookStatus status) uri = e_source_get_uri (source); - if (status == E_BOOK_ERROR_OFFLINE_UNAVAILABLE) { - label_string = _("We were unable to open this addressbook. This either means " - "this book is not marked for offline usage or not yet downloaded " - "for offline usage. Please load the addressbook once in online mode " - "to download its conents"); - } - - else if (!strncmp (uri, "file:", 5)) { + if (!strncmp (uri, "file:", 5)) { label_string = _("We were unable to open this addressbook. Please check that the " "path exists and that you have permission to access it."); |