diff options
author | Tor Lillqvist <tml@novell.com> | 2005-11-26 04:32:35 +0800 |
---|---|---|
committer | Tor Lillqvist <tml@src.gnome.org> | 2005-11-26 04:32:35 +0800 |
commit | c815b41a7c9c0aaba193ef0b5d422cc15672909c (patch) | |
tree | 384a332c91d3c7234ce457886b0fa91ce663dc26 /addressbook/gui | |
parent | 5415c6877c944a418d06a754b087b03f089245b0 (diff) | |
download | gsoc2013-evolution-c815b41a7c9c0aaba193ef0b5d422cc15672909c.tar gsoc2013-evolution-c815b41a7c9c0aaba193ef0b5d422cc15672909c.tar.gz gsoc2013-evolution-c815b41a7c9c0aaba193ef0b5d422cc15672909c.tar.bz2 gsoc2013-evolution-c815b41a7c9c0aaba193ef0b5d422cc15672909c.tar.lz gsoc2013-evolution-c815b41a7c9c0aaba193ef0b5d422cc15672909c.tar.xz gsoc2013-evolution-c815b41a7c9c0aaba193ef0b5d422cc15672909c.tar.zst gsoc2013-evolution-c815b41a7c9c0aaba193ef0b5d422cc15672909c.zip |
Include openldap-extract.h on Windows. Include e-util-private.h to get
2005-11-25 Tor Lillqvist <tml@novell.com>
* 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
Diffstat (limited to 'addressbook/gui')
-rw-r--r-- | addressbook/gui/component/addressbook-config.c | 73 |
1 files changed, 63 insertions, 10 deletions
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 <bonobo/bonobo-generic-factory.h> +#ifdef G_OS_WIN32 +/* Include <windows.h> early and work around DATADIR lossage */ +#define DATADIR crap_DATADIR +#include <windows.h> +#undef DATADIR +#endif + #include <glade/glade.h> #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 <ldap.h> +#include <ldap_schema.h> +#else +#include <winldap.h> +#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; |