From c815b41a7c9c0aaba193ef0b5d422cc15672909c Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Fri, 25 Nov 2005 20:32:35 +0000 Subject: Include openldap-extract.h on Windows. Include e-util-private.h to get 2005-11-25 Tor Lillqvist * gui/component/addressbook-config.c: Include openldap-extract.h on Windows. Include e-util-private.h to get redefinition of EVOLUTION_GLADEDIR (as a call to a function) on Windows. (query_for_supported_bases, eabc_general_name, eabc_general_host, eabc_general_auth, eabc_details_search, eabc_details_limit, addressbook_config_edit_source): Construct the path of the glade file at run-time to enable install-anywhere on Windows. svn path=/trunk/; revision=30675 --- addressbook/gui/component/addressbook-config.c | 73 ++++++++++++++++++++++---- 1 file changed, 63 insertions(+), 10 deletions(-) (limited to 'addressbook/gui') diff --git a/addressbook/gui/component/addressbook-config.c b/addressbook/gui/component/addressbook-config.c index e4c10032ae..310d433694 100644 --- a/addressbook/gui/component/addressbook-config.c +++ b/addressbook/gui/component/addressbook-config.c @@ -34,6 +34,13 @@ #include +#ifdef G_OS_WIN32 +/* Include early and work around DATADIR lossage */ +#define DATADIR crap_DATADIR +#include +#undef DATADIR +#endif + #include #include "addressbook.h" @@ -41,14 +48,20 @@ #include "addressbook-config.h" #include "e-util/e-error.h" +#include "e-util/e-util-private.h" #include "addressbook/gui/widgets/eab-config.h" #define d(x) #ifdef HAVE_LDAP -#include "ldap.h" -#include "ldap_schema.h" +#ifndef G_OS_WIN32 +#include +#include +#else +#include +#include "openldap-extract.h" +#endif #endif #define LDAP_PORT_STRING "389" @@ -389,8 +402,14 @@ query_for_supported_bases (GtkWidget *button, AddressbookSourceDialog *sdialog) GtkWidget *supported_bases_table; GladeXML *gui; GtkTreeIter iter; + char *gladefile; + + gladefile = g_build_filename (EVOLUTION_GLADEDIR, + GLADE_FILE_NAME, + NULL); + gui = glade_xml_new (gladefile, "supported-bases-dialog", NULL); + g_free (gladefile); - gui = glade_xml_new (EVOLUTION_GLADEDIR "/" GLADE_FILE_NAME, "supported-bases-dialog", NULL); dialog = glade_xml_get_widget (gui, "supported-bases-dialog"); gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (sdialog->window)); @@ -565,12 +584,17 @@ eabc_general_name(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, str const char *uri; GtkWidget *w; GladeXML *gui; - + char *gladefile; if (old) return old; - gui = glade_xml_new (EVOLUTION_GLADEDIR "/" GLADE_FILE_NAME, item->label, NULL); + gladefile = g_build_filename (EVOLUTION_GLADEDIR, + GLADE_FILE_NAME, + NULL); + gui = glade_xml_new (gladefile, item->label, NULL); + g_free (gladefile); + w = glade_xml_get_widget(gui, item->label); gtk_box_pack_start((GtkBox *)parent, w, FALSE, FALSE, 0); @@ -692,11 +716,17 @@ eabc_general_host(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, str char *uri, port[16]; LDAPURLDesc *lud; GladeXML *gui; + char *gladefile; if (!source_group_is_remote(sdialog->source_group)) return NULL; - gui = glade_xml_new (EVOLUTION_GLADEDIR "/" GLADE_FILE_NAME, item->label, NULL); + gladefile = g_build_filename (EVOLUTION_GLADEDIR, + GLADE_FILE_NAME, + NULL); + gui = glade_xml_new (gladefile, item->label, NULL); + g_free (gladefile); + w = glade_xml_get_widget(gui, item->label); gtk_box_pack_start((GtkBox *)parent, w, FALSE, FALSE, 0); @@ -768,11 +798,17 @@ eabc_general_auth(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, str GtkWidget *w; const char *tmp; GladeXML *gui; + char *gladefile; if (!source_group_is_remote(sdialog->source_group)) return NULL; - gui = glade_xml_new (EVOLUTION_GLADEDIR "/" GLADE_FILE_NAME, item->label, NULL); + gladefile = g_build_filename (EVOLUTION_GLADEDIR, + GLADE_FILE_NAME, + NULL); + gui = glade_xml_new (gladefile, item->label, NULL); + g_free (gladefile); + w = glade_xml_get_widget(gui, item->label); gtk_box_pack_start((GtkBox *)parent, w, FALSE, FALSE, 0); @@ -830,11 +866,17 @@ eabc_details_search(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, s LDAPURLDesc *lud; char *uri; GladeXML *gui; + char *gladefile; if (!source_group_is_remote(sdialog->source_group)) return NULL; - gui = glade_xml_new (EVOLUTION_GLADEDIR "/" GLADE_FILE_NAME, item->label, NULL); + gladefile = g_build_filename (EVOLUTION_GLADEDIR, + GLADE_FILE_NAME, + NULL); + gui = glade_xml_new (gladefile, item->label, NULL); + g_free (gladefile); + w = glade_xml_get_widget(gui, item->label); gtk_box_pack_start((GtkBox *)parent, w, FALSE, FALSE, 0); @@ -904,11 +946,17 @@ eabc_details_limit(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, st GtkWidget *w; const char *tmp; GladeXML *gui; + char *gladefile; if (!source_group_is_remote(sdialog->source_group)) return NULL; - gui = glade_xml_new (EVOLUTION_GLADEDIR "/" GLADE_FILE_NAME, item->label, NULL); + gladefile = g_build_filename (EVOLUTION_GLADEDIR, + GLADE_FILE_NAME, + NULL); + gui = glade_xml_new (gladefile, item->label, NULL); + g_free (gladefile); + w = glade_xml_get_widget(gui, item->label); gtk_box_pack_start((GtkBox *)parent, w, FALSE, FALSE, 0); @@ -1086,8 +1134,13 @@ addressbook_config_edit_source (GtkWidget *parent, ESource *source) GSList *items = NULL; EABConfigTargetSource *target; char *xml; + char *gladefile; - sdialog->gui = glade_xml_new (EVOLUTION_GLADEDIR "/" GLADE_FILE_NAME, "account-editor-notebook", NULL); + gladefile = g_build_filename (EVOLUTION_GLADEDIR, + GLADE_FILE_NAME, + NULL); + sdialog->gui = glade_xml_new (gladefile, "account-editor-notebook", NULL); + g_free (gladefile); if (source) { sdialog->original_source = source; -- cgit v1.2.3