balsa r8068 - in trunk: . libbalsa libbalsa/imap libinit_balsa src



Author: pawels
Date: Sat Feb  7 22:20:25 2009
New Revision: 8068
URL: http://svn.gnome.org/viewvc/balsa?rev=8068&view=rev

Log:
* INSTALL: minimum gtk version upgraded, link cleanup (Incomplete!).
* configure.in: Check min versions, new option for Mac OS X desktop,
  check for *time_r funcs, remove unnecessary check for iconv
* src/filter-edit.h, src/balsa-index.c, src/balsa-mblist.c
* src/mailbox-conf.c, src/filter-edit-dialog.c, src/pref-manager.c
* src/address-book-config.c, libbalsa/misc.[hc]
* libbalsa/libbalsa-conf.[hc], libbalsa/address.c, libbalsa/identity.c
* src/filter-edit-callbacks.c: Assume we have Gtk+/glib >= 2.6.0
* libbalsa/imap/imap_search.c:
  use GDate instead of localtime_r (avoid dependency to libbalsa)
* libbalsa/rfc3156.c: use glib random func
* libbalsa/Makefile.am, libbalsa/missing{_time.c,.h}:
  add system-dependent time_r funcs
* src/main-window.c:
  Add basic Mac OS X menu integration, assume we have Gtk+/glib >= 2.6.0
* src/sendmsg-window.c: Add basic Mac OS X menu integration, use g_strdup.
* src/save-restore.[hc], libinit_balsa/assistant_page_defclient.[hc],
* libinit_balsa/assistant_init.c: No Gnome default client without Gnome
* src/toolbar-factory.c, src/main.c, src/Makefile.am:
  Build without Gnome support
* src/print-gtk.c: Mac OS X doesn't define _NL_MEASUREMENT_MEASUREMENT
* src/balsa-icons.c:  Remove unnecessary include.
* src/balsa-bonobo.[hc]: Only compiled if building with Gnome support
* src/balsa-app.c:
  Gdk on Mac OS X cannot create a new colour map, fall back to system
* src/ab-main.c:
  Build Gnome stuff only when available, assume we have Gtk+/glib >=
  2.6.0, add basic Mac OS X menu integration.


Added:
   trunk/libbalsa/missing.h
   trunk/libbalsa/missing_time.c
Modified:
   trunk/ChangeLog
   trunk/INSTALL
   trunk/configure.in
   trunk/libbalsa/Makefile.am
   trunk/libbalsa/address.c
   trunk/libbalsa/filter-funcs.c
   trunk/libbalsa/identity.c
   trunk/libbalsa/imap/imap_search.c
   trunk/libbalsa/libbalsa-conf.c
   trunk/libbalsa/libbalsa-conf.h
   trunk/libbalsa/libbalsa.c
   trunk/libbalsa/mailbox_mbox.c
   trunk/libbalsa/misc.c
   trunk/libbalsa/misc.h
   trunk/libbalsa/send.c
   trunk/libinit_balsa/assistant_init.c
   trunk/libinit_balsa/assistant_page_defclient.c
   trunk/libinit_balsa/assistant_page_defclient.h
   trunk/src/Makefile.am
   trunk/src/ab-main.c
   trunk/src/address-book-config.c
   trunk/src/balsa-app.c
   trunk/src/balsa-bonobo.c
   trunk/src/balsa-bonobo.h
   trunk/src/balsa-icons.c
   trunk/src/balsa-index.c
   trunk/src/balsa-mblist.c
   trunk/src/filter-edit-callbacks.c
   trunk/src/filter-edit-dialog.c
   trunk/src/filter-edit.h
   trunk/src/mailbox-conf.c
   trunk/src/main-window.c
   trunk/src/main.c
   trunk/src/pref-manager.c
   trunk/src/print-gtk.c
   trunk/src/save-restore.c
   trunk/src/save-restore.h
   trunk/src/sendmsg-window.c
   trunk/src/toolbar-factory.c

Modified: trunk/INSTALL
==============================================================================
--- trunk/INSTALL	(original)
+++ trunk/INSTALL	Sat Feb  7 22:20:25 2009
@@ -9,8 +9,8 @@
 
 Please make sure you have the following things:
 
-	Glib        >= 2.0.0
-	GTK         >= 2.0.0
+	Glib        >= 2.6.0
+	GTK         >= 2.6.0
 	gnome-libs  >= 2.0.0  (see notes below)
 	gnome-print >= 0.25
 	libpspell   >= 0.11.2 (and at least one spell check module)
@@ -48,7 +48,7 @@
 	signed and encrypted MIME messages according to RFC 3156.
 	Further information is available at
 
-	http://home.arcor.de/dralbrecht.dress/balsa/balsa2-gpg.html
+	http://www.mynetcologne.de/~nc-dreszal/balsa/balsa23-secure-mail.html
 
 Build Instructions:
 

Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in	(original)
+++ trunk/configure.in	Sat Feb  7 22:20:25 2009
@@ -114,6 +114,14 @@
 	use_webkit=no
 ])
 
+AC_ARG_WITH([macosx-desktop],
+              AC_HELP_STRING([--with-macosx-desktop],
+                [Use Mac OS X Desktop Integration (default=no, extremely experimental)]),[
+	use_igemacint=$withval
+],[
+	use_igemacint=no
+])
+
 AC_ARG_WITH([gtkhtml],
               AC_HELP_STRING([--with-gtkhtml],
                              [Preferred GtkHTML version, 2 or 3 (default=3)]),[
@@ -298,7 +306,7 @@
 dnl GNOME libs
 dnl #####################################################################
 if test x$with_gnome != xno; then
-   gnome_extras="libgnome-2.0 libgnomeui-2.0 libbonobo-2.0"
+   gnome_extras="libgnome-2.0 libgnomeui-2.0 libbonobo-2.0 gconf-2.0"
    if test x$with_gio != xyes ; then
       gnome_extras="$gnome_extras gnome-vfs-2.0 >= 2.4.0 gnome-vfs-module-2.0"
       AC_DEFINE(HAVE_GNOME_VFS,1,
@@ -369,20 +377,19 @@
 dnl #####################################################################
 
 PKG_CHECK_MODULES(BALSA, [
-glib-2.0
-gtk+-2.0 >= 2.4
+glib-2.0 >= 2.6.0
+gtk+-2.0 >= 2.6.0
 gmime-2.0 >= 2.1.9
-gconf-2.0
 $gio_extra
 $gnome_extras
 $gnome_print_extras
 ])
 
 PKG_CHECK_MODULES(BALSA_AB, [
-   libgnome-2.0 libgnomeui-2.0 
-   glib-2.0
-   gtk+-2.0 >= 2.4
+   glib-2.0 >= 2.6.0
+   gtk+-2.0 >= 2.6.0
    gmime-2.0 >= 2.1.9
+   $gnome_extras
 ])
 
 dnl ##########################################################################
@@ -796,16 +803,29 @@
 fi
 AM_CONDITIONAL([BUILD_WITH_GTKSOURCEVIEW2], [test x$with_gtksourceview = x2 ])
 
+# ige-mac-integration (Mac OS X desktop only)
+AC_MSG_CHECKING([whether to include Mac OS X Desktop Integration])
+if test x$use_igemacint != xno; then
+    AC_MSG_CHECKING([for ige-mac-integration >= 0.8])
+    if $PKG_CONFIG --atleast-version=0.8 ige-mac-integration ; then
+	AC_MSG_RESULT([yes])
+	AC_DEFINE(HAVE_MACOSX_DESKTOP,1,[Defined when menus can be integrated into the Mac OS X desktop])
+	BALSA_CFLAGS="$BALSA_CFLAGS `$PKG_CONFIG --cflags ige-mac-integration`"
+	BALSA_LIBS="$BALSA_LIBS `$PKG_CONFIG --libs ige-mac-integration`"
+	BALSA_AB_LIBS="$BALSA_AB_LIBS `$PKG_CONFIG --libs ige-mac-integration`"
+    else
+	AC_MSG_ERROR([no])
+    fi
+else
+    AC_MSG_RESULT([no])
+fi
+
 dnl #####################################################################
 dnl 5. Headers.
 dnl #####################################################################
 
 # Spell check detection.
 #
-AC_TRY_LINK( [#include <iconv.h>], 
-             [iconv_open("UTF-8", "ISO-8859-2");],,
-             [AC_MSG_ERROR([*** You need iconv for balsa.])])
-
 if test x$with_gtkspell != xno; then
     PKG_CHECK_MODULES(SPELL, [ gtkspell-2.0 ])
     AC_DEFINE(HAVE_GTKSPELL,1,[Defined when GtkSpell can be used.])
@@ -827,6 +847,7 @@
 dnl #####################################################################
 AC_C_CONST
 AC_STDC_HEADERS
+AC_CHECK_FUNCS([localtime_r gmtime_r ctime_r])
 
 
 # more warnings.

Modified: trunk/libbalsa/Makefile.am
==============================================================================
--- trunk/libbalsa/Makefile.am	(original)
+++ trunk/libbalsa/Makefile.am	Sat Feb  7 22:20:25 2009
@@ -90,6 +90,8 @@
 	libbalsa-conf.h		\
 	libbalsa-marshal.c	\
 	libbalsa-marshal.h	\
+	missing.h		\
+	missing_time.c		\
 	libbalsa.c		\
 	libbalsa.h		\
 	libbalsa_private.h	\

Modified: trunk/libbalsa/address.c
==============================================================================
--- trunk/libbalsa/address.c	(original)
+++ trunk/libbalsa/address.c	Sat Feb  7 22:20:25 2009
@@ -253,7 +253,7 @@
 
     convstr = g_convert(str, -1, "utf-8", charset, NULL, &bytes_written, NULL);
     g_free(str);
-    return convstr ? convstr : strdup("");
+    return convstr ? convstr : g_strdup("");
 }
 
 
@@ -827,12 +827,7 @@
     GtkListStore *store = GTK_LIST_STORE(gtk_tree_view_get_model(tv));
     GtkTreeIter iter;
     GtkTreePath *path;
-#if GTK_CHECK_VERSION(2, 6, 0)
     gtk_list_store_insert_with_values(store, &iter, 99999, 0, "", -1);
-#else                           /* GTK_CHECK_VERSION(2, 6, 0) */
-    gtk_list_store_append(store, &iter);
-    gtk_list_store_set(store, &iter, 0, "", -1);
-#endif                          /* GTK_CHECK_VERSION(2, 6, 0) */
     gtk_widget_grab_focus(GTK_WIDGET(tv));
     path = gtk_tree_model_get_path(GTK_TREE_MODEL(store), &iter);
     gtk_tree_view_set_cursor(tv, path, NULL, TRUE);
@@ -863,18 +858,11 @@
             addr = *(LibBalsaAddress**)selection_data->data;
             if(addr && addr->address_list) {
                 g_print ("string: %s\n", (gchar*)addr->address_list->data);
-#if GTK_CHECK_VERSION(2, 6, 0)
                 gtk_list_store_insert_with_values(GTK_LIST_STORE(model),
                                                   &iter, 99999,
                                                   0,
                                                   addr->address_list->data,
                                                   -1);
-#else                           /* GTK_CHECK_VERSION(2, 6, 0) */
-                gtk_list_store_append(GTK_LIST_STORE(model), &iter);
-                gtk_list_store_set(GTK_LIST_STORE(model), &iter,
-                                   0, addr->address_list->data,
-                                   -1);
-#endif                          /* GTK_CHECK_VERSION(2, 6, 0) */
                 dnd_success = TRUE;
             }
             break;

Modified: trunk/libbalsa/filter-funcs.c
==============================================================================
--- trunk/libbalsa/filter-funcs.c	(original)
+++ trunk/libbalsa/filter-funcs.c	Sat Feb  7 22:20:25 2009
@@ -30,6 +30,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <time.h>
+#include "missing.h"
 
 #include "filter-funcs.h"
 #include "filter-private.h"

Modified: trunk/libbalsa/identity.c
==============================================================================
--- trunk/libbalsa/identity.c	(original)
+++ trunk/libbalsa/identity.c	Sat Feb  7 22:20:25 2009
@@ -1184,11 +1184,7 @@
     gtk_widget_set_sensitive(chooser,
                              gtk_toggle_button_get_active(button));
     /* Force validation of current path, if any. */
-#if GTK_CHECK_VERSION(2, 6, 0)
     g_signal_emit_by_name(chooser, "selection-changed");
-#else                           /* GTK_CHECK_VERSION(2, 6, 0) */
-    g_signal_emit_by_name(chooser, "changed");
-#endif                          /* GTK_CHECK_VERSION(2, 6, 0) */
 }
 
 static void
@@ -1211,11 +1207,9 @@
                                             filename, &size, &err);
 
     if (err) {
-#if GTK_CHECK_VERSION(2, 6, 0)
         libbalsa_information(LIBBALSA_INFORMATION_WARNING,
                              _("Error reading file %s: %s"), filename,
                              err->message);
-#endif                          /* GTK_CHECK_VERSION(2, 6, 0) */
         g_error_free(err);
         gtk_widget_hide(face_box);
         return;
@@ -1307,11 +1301,7 @@
     GtkToggleButton *check;
     gboolean active;
 
-#if GTK_CHECK_VERSION(2, 6, 0)
     filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(chooser));
-#else                           /* GTK_CHECK_VERSION(2, 6, 0) */
-    filename = gtk_editable_get_chars(GTK_EDITABLE(chooser), 0, -1);
-#endif                          /* GTK_CHECK_VERSION(2, 6, 0) */
     if (!filename || !*filename) {
         g_free(filename);
         return;
@@ -1338,9 +1328,7 @@
 {
     GtkWidget *check;
     gchar *filename;
-#if GTK_CHECK_VERSION(2, 6, 0)
     gchar *title;
-#endif                          /* GTK_CHECK_VERSION(2, 6, 0) */
     GtkWidget *button;
 
     check =
@@ -1350,17 +1338,12 @@
 
     filename =
         g_build_filename(g_get_home_dir(), path_info[type].basename, NULL);
-#if GTK_CHECK_VERSION(2, 6, 0)
     title = g_strdup_printf("Choose %s file", _(path_info[type].info));
     button = gtk_file_chooser_button_new(title,
                                          GTK_FILE_CHOOSER_ACTION_OPEN);
     g_free(title);
     gtk_file_chooser_set_show_hidden(GTK_FILE_CHOOSER(button), TRUE);
     gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(button), filename);
-#else                           /* GTK_CHECK_VERSION(2, 6, 0) */
-    button = gtk_entry_new();
-    gtk_entry_set_text(GTK_ENTRY(button), filename);
-#endif                          /* GTK_CHECK_VERSION(2, 6, 0) */
     g_free(filename);
 
     gtk_table_attach(GTK_TABLE(table), button, 1, 2, row, row + 1,
@@ -1372,13 +1355,8 @@
                       GUINT_TO_POINTER(type));
     g_signal_connect(check, "toggled",
                      G_CALLBACK(file_chooser_check_cb), button);
-#if GTK_CHECK_VERSION(2, 6, 0)
     g_signal_connect(button, "selection-changed",
                      G_CALLBACK(file_chooser_cb), dialog);
-#else                           /* GTK_CHECK_VERSION(2, 6, 0) */
-    g_signal_connect(button, "changed",
-                     G_CALLBACK(file_chooser_cb), dialog);
-#endif                          /* GTK_CHECK_VERSION(2, 6, 0) */
 }
 
 static void
@@ -1573,11 +1551,7 @@
     if (!GTK_WIDGET_SENSITIVE(chooser))
         return NULL;
 
-#if GTK_CHECK_VERSION(2, 6, 0)
     return gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(chooser));
-#else                           /* GTK_CHECK_VERSION(2, 6, 0) */
-    return gtk_editable_get_chars(GTK_EDITABLE(chooser), 0, -1);
-#endif                          /* GTK_CHECK_VERSION(2, 6, 0) */
 }
 
 

Modified: trunk/libbalsa/imap/imap_search.c
==============================================================================
--- trunk/libbalsa/imap/imap_search.c	(original)
+++ trunk/libbalsa/imap/imap_search.c	Sat Feb  7 22:20:25 2009
@@ -21,6 +21,7 @@
 #define _XOPEN_SOURCE 500
 
 #include <string.h>
+#include <glib.h>
 #include <time.h>
 
 #include "siobuf.h"
@@ -353,7 +354,11 @@
   static const char *month[] = 
     { "Jan", "Feb", "Mar", "Apr", "May",
       "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
+#if GLIB_CHECK_VERSION(2,10,0)
+  GDate date;
+#else
   struct tm date;
+#endif
   if(!internal) sio_write(handle->sio, "SENT", 4);
   switch(range) {
   case IMSE_D_BEFORE : sio_write(handle->sio, "BEFORE ", 7); break;
@@ -361,9 +366,15 @@
   default: /* which is -2, the only remaining option */
   case IMSE_D_SINCE  : sio_write(handle->sio, "SINCE " , 6); break;
   }
+#if GLIB_CHECK_VERSION(2,10,0)
+  g_date_set_time_t(&date, tm);
+  sio_printf(handle->sio, "%02d-%s-%04d",
+	     date.day, month[date.month - 1], date.year);
+#else
   localtime_r(&tm, &date);
   sio_printf(handle->sio, "%02d-%s-%04d",
              date.tm_mday, month[date.tm_mon], date.tm_year + 1900);
+#endif
 }
 
 static void

Modified: trunk/libbalsa/libbalsa-conf.c
==============================================================================
--- trunk/libbalsa/libbalsa-conf.c	(original)
+++ trunk/libbalsa/libbalsa-conf.c	Sat Feb  7 22:20:25 2009
@@ -23,67 +23,6 @@
 #include <string.h>
 #include "libbalsa-conf.h"
 
-#if !GLIB_CHECK_VERSION(2, 6, 0)
-
-#define BALSA_CONFIG_PREFIX "balsa/"
-
-/* 
- * Call @func for each section name that begins with @prefix.
- * @func is called with arguments:
- *   const gchar * @key		the section;
- *   const gchar * @value	the trailing part of the section name,
- *   				following the @prefix;
- *   gpointer @data		the @data passed in.
- * Iteration terminates when @func returns TRUE.
- */
-void
-libbalsa_conf_foreach_group(const gchar * prefix,
-                            LibBalsaConfForeachFunc func, gpointer data)
-{
-    gsize pref_len;
-    void *iterator;
-    gchar *key;
-
-    pref_len = strlen(prefix);
-    iterator = gnome_config_init_iterator_sections(BALSA_CONFIG_PREFIX);
-    while ((iterator = gnome_config_iterator_next(iterator, &key, NULL))) {
-        if (strncmp(key, prefix, pref_len) == 0
-            && func(key, key + pref_len, data)) {
-            g_free(key);
-            g_free(iterator);
-            break;
-        }
-        g_free(key);
-    }
-}
-
-void
-libbalsa_conf_push_group(const char *group)
-{
-    gchar *prefix = g_strconcat(BALSA_CONFIG_PREFIX, group, "/", NULL);
-    gnome_config_push_prefix(prefix);
-    g_free(prefix);
-}
-
-void
-libbalsa_conf_remove_group_(const char *group, gboolean priv)
-{
-    gchar *prefix = g_strconcat(BALSA_CONFIG_PREFIX, group, "/", NULL);
-    gnome_config_clean_section_(prefix, priv);
-    g_free(prefix);
-}
-
-gboolean
-libbalsa_conf_has_group(const char *group)
-{
-    gchar *prefix = g_strconcat(BALSA_CONFIG_PREFIX, group, "/", NULL);
-    gboolean retval = gnome_config_has_section(prefix);
-    g_free(prefix);
-    return retval;
-}
-
-#else                           /* !GLIB_CHECK_VERSION(2, 6, 0) */
-
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
@@ -663,5 +602,3 @@
     lbc_sync(&lbc_conf_priv);
     lbc_unlock();
 }
-
-#endif                          /* !GLIB_CHECK_VERSION(2, 6, 0) */

Modified: trunk/libbalsa/libbalsa-conf.h
==============================================================================
--- trunk/libbalsa/libbalsa-conf.h	(original)
+++ trunk/libbalsa/libbalsa-conf.h	Sat Feb  7 22:20:25 2009
@@ -44,33 +44,6 @@
                                  LibBalsaConfForeachFunc func,
                                  gpointer data);
 
-#if !GLIB_CHECK_VERSION(2, 6, 0)
-
-#define libbalsa_conf_pop_group               gnome_config_pop_prefix
-#define libbalsa_conf_set_string              gnome_config_set_string
-#define libbalsa_conf_get_string              gnome_config_get_string
-#define libbalsa_conf_private_set_string      gnome_config_private_set_string
-#define libbalsa_conf_private_get_string      gnome_config_private_get_string
-#define libbalsa_conf_get_string_with_default gnome_config_get_string_with_default
-#define libbalsa_conf_set_bool                gnome_config_set_bool
-#define libbalsa_conf_get_bool                gnome_config_get_bool
-#define libbalsa_conf_get_bool_with_default   gnome_config_get_bool_with_default
-#define libbalsa_conf_set_int                 gnome_config_set_int
-#define libbalsa_conf_get_int                 gnome_config_get_int
-#define libbalsa_conf_get_int_with_default    gnome_config_get_int_with_default
-
-#define libbalsa_conf_set_vector              gnome_config_set_vector
-#define libbalsa_conf_get_vector_with_default gnome_config_get_vector_with_default
-
-#define libbalsa_conf_push_prefix             gnome_config_push_prefix
-#define libbalsa_conf_pop_prefix              gnome_config_pop_prefix
-#define libbalsa_conf_clean_key               gnome_config_clean_key
-#define libbalsa_conf_drop_all                gnome_config_drop_all
-#define libbalsa_conf_sync                    gnome_config_sync
-#include <libgnome/gnome-config.h>
-
-#else                           /* !GLIB_CHECK_VERSION(2, 6, 0) */
-
 void libbalsa_conf_foreach_keys              (const gchar * group,
 					      LibBalsaConfForeachFunc func,
 					      gpointer data);
@@ -150,6 +123,4 @@
 void libbalsa_conf_drop_all                  (void);
 void libbalsa_conf_sync                      (void);
 
-#endif                          /* !GLIB_CHECK_VERSION(2, 6, 0) */
-
 #endif                          /* __LIBCONFIG_H__ */

Modified: trunk/libbalsa/libbalsa.c
==============================================================================
--- trunk/libbalsa/libbalsa.c	(original)
+++ trunk/libbalsa/libbalsa.c	Sat Feb  7 22:20:25 2009
@@ -62,6 +62,7 @@
 
 #include "libbalsa.h"
 #include "misc.h"
+#include "missing.h"
 #include <glib/gi18n.h>
 
 #ifdef BALSA_USE_THREADS

Modified: trunk/libbalsa/mailbox_mbox.c
==============================================================================
--- trunk/libbalsa/mailbox_mbox.c	(original)
+++ trunk/libbalsa/mailbox_mbox.c	Sat Feb  7 22:20:25 2009
@@ -44,6 +44,8 @@
 /* for mx_lock_file and mx_unlock_file */
 #include "mailbackend.h"
 #include "mime-stream-shared.h"
+#include "missing.h"
+
 #include <glib/gi18n.h>
 
 /* #define DEBUG_SEEK TRUE */

Modified: trunk/libbalsa/misc.c
==============================================================================
--- trunk/libbalsa/misc.c	(original)
+++ trunk/libbalsa/misc.c	Sat Feb  7 22:20:25 2009
@@ -1036,22 +1036,6 @@
     return 0;
 }
 
-#if !GLIB_CHECK_VERSION(2, 2, 0)
-gboolean
-libbalsa_str_has_prefix(const gchar * str, const gchar * prefix)
-{
-    g_return_val_if_fail(str != NULL, FALSE);
-    g_return_val_if_fail(prefix != NULL, FALSE);
-
-    while (*prefix == *str && *prefix) {
-	++prefix;
-	++str;
-    }
-
-    return *prefix == '\0';
-}
-#endif				/* !GLIB_CHECK_VERSION(2, 2, 0) */
-
 
 /* libbalsa_ia_rfc2821_equal
    compares two addresses according to rfc2821: local-part domain is equal,

Modified: trunk/libbalsa/misc.h
==============================================================================
--- trunk/libbalsa/misc.h	(original)
+++ trunk/libbalsa/misc.h	Sat Feb  7 22:20:25 2009
@@ -154,11 +154,7 @@
 int libbalsa_lock_file (const char *path, int fd, int excl, int dot, int timeout);
 int libbalsa_unlock_file (const char *path, int fd, int dot);
 int libbalsa_safe_rename (const char *src, const char *target);
-#if GLIB_CHECK_VERSION(2, 2, 0)
 #define libbalsa_str_has_prefix(str, prefix) g_str_has_prefix((str), (prefix))
-#else				/* GLIB_CHECK_VERSION(2, 2, 0) */
-gboolean libbalsa_str_has_prefix(const gchar * str, const gchar * prefix);
-#endif				/* GLIB_CHECK_VERSION(2, 2, 0) */
 
 gboolean libbalsa_ia_rfc2821_equal(const InternetAddress * a,
 				   const InternetAddress * b);

Added: trunk/libbalsa/missing.h
==============================================================================
--- (empty file)
+++ trunk/libbalsa/missing.h	Sat Feb  7 22:20:25 2009
@@ -0,0 +1,41 @@
+/* -*-mode:c; c-style:k&r; c-basic-offset:4; -*- */
+#ifndef __MISSING_H__
+#define __MISSING_H__ 1
+/* Balsa E-Mail Client
+ *
+ * Copyright (C) 1997-2002 Stuart Parmenter and others,
+ *                         See the file AUTHORS for a list.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option) 
+ * any later version.
+ *  
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of 
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
+ * GNU General Public License for more details.
+ *  
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  
+ * 02111-1307, USA.
+ */
+
+
+#include <time.h>
+
+#ifndef HAVE_CTIME_R
+char * libbalsa_ctime_r(const time_t *clock, char *buf);
+#endif
+
+#ifndef HAVE_LOCALTIME_R
+struct tm * libbalsa_localtime_r(const time_t *clock, struct tm *result);
+#endif
+
+#ifndef HAVE_GMTIME_R
+struct tm * libbalsa_gmtime_r(const time_t *clock, struct tm *result);
+#endif
+
+#endif
+

Added: trunk/libbalsa/missing_time.c
==============================================================================
--- (empty file)
+++ trunk/libbalsa/missing_time.c	Sat Feb  7 22:20:25 2009
@@ -0,0 +1,73 @@
+/* -*-mode:c; c-style:k&r; c-basic-offset:4; -*- */
+/* Balsa E-Mail Client
+ *
+ * Copyright (C) 1997-2002 Stuart Parmenter and others,
+ *                         See the file AUTHORS for a list.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option) 
+ * any later version.
+ *  
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of 
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
+ * GNU General Public License for more details.
+ *  
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  
+ * 02111-1307, USA.
+ */
+
+#include "config.h"
+
+#include <string.h>
+
+#if HAVE_THREADS
+#include <pthread.h>
+static pthread_mutex_t time_lock = PTHREAD_MUTEX_INITIALIZER;
+#define LOCK(mutex)   pthread_mutex_lock(&mutex)
+#define UNLOCK(mutex) pthread_mutex_unlock(&mutex)
+#else
+#define LOCK(mutex)
+#define UNLOCK(mutex)
+#endif /* HAVE_THREADS */
+
+#include "missing.h"
+
+
+#ifndef HAVE_CTIME_R
+char *
+ctime_r(const time_t *clock, char *buf)
+{
+    LOCK(time_lock);
+    strcpy(buf, ctime(clock));
+    UNLOCK(time_lock);
+    return buf;
+}
+#endif
+
+
+#ifndef HAVE_LOCALTIME_R 
+struct tm *
+localtime_r(const time_t *clock, struct tm *result)
+{
+    LOCK(time_lock);
+    memcpy(result, localtime(clock), sizeof(struct tm));
+    UNLOCK(time_lock);
+    return result;
+}
+#endif
+
+
+#ifndef HAVE_GMTIME_R
+struct tm *
+gmtime_r(const time_t *clock, struct tm *result)
+{
+    LOCK(time_lock);
+    memcpy(result, gmtime(clock), sizeof(struct tm));
+    UNLOCK(time_lock);
+    return result;
+}
+#endif

Modified: trunk/libbalsa/send.c
==============================================================================
--- trunk/libbalsa/send.c	(original)
+++ trunk/libbalsa/send.c	Sat Feb  7 22:20:25 2009
@@ -42,6 +42,7 @@
 #include "server.h"
 #include "send.h"
 #include "misc.h"
+#include "missing.h"
 #include "information.h"
 
 #if ENABLE_ESMTP

Modified: trunk/libinit_balsa/assistant_init.c
==============================================================================
--- trunk/libinit_balsa/assistant_init.c	(original)
+++ trunk/libinit_balsa/assistant_init.c	Sat Feb  7 22:20:25 2009
@@ -120,8 +120,10 @@
     balsa_druid_page_user(assistant, default_logo);
 #if !defined(ENABLE_TOUCH_UI)
     balsa_druid_page_directory(assistant, default_logo);
+#if HAVE_GNOME
     balsa_druid_page_defclient(assistant, default_logo);
 #endif
+#endif
     balsa_druid_page_finish(assistant, default_logo);
 }
 

Modified: trunk/libinit_balsa/assistant_page_defclient.c
==============================================================================
--- trunk/libinit_balsa/assistant_page_defclient.c	(original)
+++ trunk/libinit_balsa/assistant_page_defclient.c	Sat Feb  7 22:20:25 2009
@@ -21,6 +21,10 @@
 
 #include "assistant_page_defclient.h"
 
+#if HAVE_GNOME
+/* setting the default Gnome mail client doesn't make sense if we don't build
+ for Gnome */
+
 #include <string.h>
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -106,3 +110,4 @@
     defclient->default_client = ! (defclient->default_client);
 }
 
+#endif /* HAVE_GNOME */

Modified: trunk/libinit_balsa/assistant_page_defclient.h
==============================================================================
--- trunk/libinit_balsa/assistant_page_defclient.h	(original)
+++ trunk/libinit_balsa/assistant_page_defclient.h	Sat Feb  7 22:20:25 2009
@@ -31,6 +31,11 @@
 
 
 #include "config.h"
+
+#if HAVE_GNOME
+/* setting the default Gnome mail client doesn't make sense if we don't build
+ for Gnome */
+
 #include "assistant_helper.h"
 #include "assistant_init.h"
 
@@ -53,6 +58,8 @@
                                     GdkPixbuf * default_logo);
     void balsa_druid_page_defclient_save(BalsaDruidPageDefclient * defclient);
 
+#endif /* HAVE_GNOME */
+
 #ifdef __cplusplus
 }
 #endif                          /* __cplusplus */

Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am	(original)
+++ trunk/src/Makefile.am	Sat Feb  7 22:20:25 2009
@@ -116,16 +116,27 @@
 		spell-check.h
 endif
 
+if BUILD_WITH_GNOME
 balsa_IDL_SRCLIST = Balsa-common.c Balsa-skels.c Balsa-stubs.c Balsa.h
 balsa_IDL_OBJS    = Balsa-common.o Balsa-skels.o Balsa-stubs.o
+# see http://sources.redhat.com/automake/dependencies.html
+BUILT_SOURCES     = Balsa.h
+
+#auto* *SHOULD* figure this out *grr*
+$(srcdir)/balsa-bonobo.c: Balsa.h
+
+
+else
+balsa_IDL_SRCLIST = 
+balsa_IDL_OBJS    = 
+BUILT_SOURCES = 
+endif
 
 balsa_SOURCES =			\
 	$(balsa_BASE_SRCLIST)	\
 	$(balsa_gtkspell_extra) \
 	$(balsa_print_source)
 
-# see http://sources.redhat.com/automake/dependencies.html
-BUILT_SOURCES = Balsa.h
 
 DISTCLEANFILES = $(balsa_IDL_SRCLIST)
 
@@ -167,10 +178,6 @@
 	mkdir $(distdir)/pixmaps
 	cp $(srcdir)/pixmaps/*.{xpm,png} $(distdir)/pixmaps
 
-
-#auto* *SHOULD* figure this out *grr*
-$(srcdir)/balsa-bonobo.c: Balsa.h
-
 $(balsa_IDL_SRCLIST): $(srcdir)/$(idl_DATA) 
 	$(ORBIT_IDL) -I $(LIBBONOBO_IDL) -I $(BONOBO_ACTIVATION_IDL) \
 	$(srcdir)/$(idl_DATA)

Modified: trunk/src/ab-main.c
==============================================================================
--- trunk/src/ab-main.c	(original)
+++ trunk/src/ab-main.c	Sat Feb  7 22:20:25 2009
@@ -22,6 +22,7 @@
 #include "config.h"
 
 #include <string.h>
+#include <gdk/gdkkeysyms.h>
 #include <gtk/gtk.h>
 #if HAVE_GNOME
 #include <gnome.h>
@@ -34,6 +35,10 @@
 #include <locale.h>
 #endif
 
+#if HAVE_MACOSX_DESKTOP
+#include <ige-mac-integration.h>
+#endif
+
 #include "address-book.h"
 #include "address-book-vcard.h"
 #include "address-book-extern.h"
@@ -73,11 +78,13 @@
 
 static void bab_cleanup(void);
 
+#if HAVE_GNOME
 static gint bab_save_session(GnomeClient * client, gint phase,
                              GnomeSaveStyle save_style, gint is_shutdown,
                              GnomeInteractStyle interact_style, gint is_fast,
                              gpointer client_data);
 static gint bab_kill_session(GnomeClient * client, gpointer client_data);
+#endif
 
 static void ab_set_edit_widget(LibBalsaAddress * address,
                                gboolean can_remove);
@@ -571,13 +578,7 @@
      N_("Add new entry"), G_CALLBACK(edit_new_entry_cb)},
     {"DeleteEntry", GTK_STOCK_NEW, N_("_Delete Entry"), NULL,
      N_("Delete entry"), G_CALLBACK(edit_delete_entry_cb)},
-    {"About",
-#if GTK_CHECK_VERSION(2, 6, 0)
-     GTK_STOCK_ABOUT,
-#else
-     GNOME_STOCK_ABOUT,
-#endif                          /* GTK_CHECK_VERSION(2, 6, 0) */
-     N_("_About"), NULL, NULL, NULL}
+    {"About", GTK_STOCK_ABOUT, N_("_About"), NULL, NULL, NULL}
 };
 
 static const char *ui_description =
@@ -623,6 +624,9 @@
     GtkAccelGroup *accel_group;
     GError *error;
     GList *ab;
+#if HAVE_MACOSX_DESKTOP
+    IgeMacMenuGroup *group;
+#endif
 
     contacts_app.action_group = action_group =
         gtk_action_group_new("MenuActions");
@@ -646,6 +650,16 @@
 
     for (ab = address_books; ab; ab = ab->next)
         add_address_book(LIBBALSA_ADDRESS_BOOK(ab->data));
+    
+#if HAVE_MACOSX_DESKTOP
+    ige_mac_menu_set_menu_bar(GTK_MENU_SHELL(gtk_ui_manager_get_widget(ui_manager, "/MainMenu")));
+    ige_mac_menu_set_quit_menu_item(GTK_MENU_ITEM(gtk_ui_manager_get_widget(ui_manager, "/MainMenu/FileMenu/Quit")));
+
+    group = ige_mac_menu_add_app_menu_group();
+    ige_mac_menu_add_app_menu_item(group,
+				   GTK_MENU_ITEM(gtk_ui_manager_get_widget(ui_manager, "/MainMenu/HelpMenu/About")), 
+                                   NULL);
+#endif
 
     if (menubar)
         /* Finally, return the actual menu bar created by the UIManager. */
@@ -986,9 +1000,11 @@
     gtk_container_add(GTK_CONTAINER(wnd), main_vbox);
 
     get_main_menu(GTK_WIDGET(wnd), &menubar, contacts_app.address_book_list);
+#ifndef HAVE_MACOSX_DESKTOP
     if (menubar)
         gtk_box_pack_start(GTK_BOX(main_vbox),
                            menubar, FALSE, FALSE, 1);
+#endif
 
     contacts_app.notebook = gtk_notebook_new();
     gtk_box_pack_start(GTK_BOX(main_vbox),
@@ -1089,7 +1105,9 @@
 int
 main(int argc, char *argv[])
 {
+#if HAVE_GNOME
     GnomeClient *client;
+#endif
 #ifdef GTKHTML_HAVE_GCONF
     GError *gconf_error;
 #endif
@@ -1104,6 +1122,7 @@
 
     /* FIXME: do we need to allow a non-GUI mode? */
     gtk_init_check(&argc, &argv);
+#if HAVE_GNOME
     gnome_program_init(PACKAGE, VERSION, LIBGNOMEUI_MODULE, argc, argv,
 #ifndef GNOME_PARAM_GOPTION_CONTEXT
                        GNOME_PARAM_POPT_TABLE, NULL,
@@ -1114,6 +1133,7 @@
                        GNOME_PARAM_GOPTION_CONTEXT, NULL,
                        GNOME_PARAM_NONE);
 #endif
+#endif
 
 #ifdef GTKHTML_HAVE_GCONF
     if (!gconf_init(argc, argv, &gconf_error))
@@ -1153,11 +1173,13 @@
                      G_CALLBACK(bab_delete_ok), NULL);
 
     /* session management */
+#if HAVE_GNOME
     client = gnome_master_client();
     g_signal_connect(G_OBJECT(client), "save_yourself",
 		     G_CALLBACK(bab_save_session), argv[0]);
     g_signal_connect(G_OBJECT(client), "die",
 		     G_CALLBACK(bab_kill_session), NULL);
+#endif
 
     gtk_widget_show_all(ab_window);
     gtk_widget_hide(contacts_app.edit_widget);
@@ -1186,6 +1208,7 @@
     gtk_main_quit();
 }
 
+#if HAVE_GNOME
 static gint
 bab_kill_session(GnomeClient * client, gpointer client_data)
 {
@@ -1215,3 +1238,4 @@
 
     return TRUE;
 }
+#endif /* HAVE_GNOME */

Modified: trunk/src/address-book-config.c
==============================================================================
--- trunk/src/address-book-config.c	(original)
+++ trunk/src/address-book-config.c	Sat Feb  7 22:20:25 2009
@@ -370,16 +370,10 @@
     gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
     gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2,
 		     GTK_FILL, GTK_FILL, 0, 0);
-#if GTK_CHECK_VERSION(2, 6, 0)
     abc->ab_specific.externq.load =
         gtk_file_chooser_button_new
         (_("Select load program for address book"),
          GTK_FILE_CHOOSER_ACTION_OPEN);
-#else /* GTK_CHECK_VERSION(2, 6, 0) */
-    abc->ab_specific.externq.load =
-	gnome_file_entry_new("ExternAddressBookLoadPath",
-			     _("Select load program for address book"));
-#endif /* GTK_CHECK_VERSION(2, 6, 0) */
     gtk_table_attach(GTK_TABLE(table), abc->ab_specific.externq.load, 1, 2,
 		     1, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
     gtk_label_set_mnemonic_widget(GTK_LABEL(label), 
@@ -389,16 +383,10 @@
     gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
     gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3,
 		     GTK_FILL, GTK_FILL, 0, 0);
-#if GTK_CHECK_VERSION(2, 6, 0)
     abc->ab_specific.externq.save =
         gtk_file_chooser_button_new
         (_("Select save program for address book"),
          GTK_FILE_CHOOSER_ACTION_OPEN);
-#else /* GTK_CHECK_VERSION(2, 6, 0) */
-    abc->ab_specific.externq.save =
-	gnome_file_entry_new("ExternAddressBookSavePath",
-			     _("Select save program for address book"));
-#endif /* GTK_CHECK_VERSION(2, 6, 0) */
     gtk_table_attach(GTK_TABLE(table), abc->ab_specific.externq.save, 1, 2,
 		     2, 3, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
     gtk_label_set_mnemonic_widget(GTK_LABEL(label), 
@@ -407,23 +395,12 @@
     add_radio_buttons(table, 3, abc);
 
     if (ab) {
-#if GTK_CHECK_VERSION(2, 6, 0)
         gtk_file_chooser_set_filename(GTK_FILE_CHOOSER
                                       (abc->ab_specific.externq.load),
                                       ab->load);
         gtk_file_chooser_set_filename(GTK_FILE_CHOOSER
                                       (abc->ab_specific.externq.save),
                                       ab->save);
-#else /* GTK_CHECK_VERSION(2, 6, 0) */
-	GtkWidget *entry;
-	entry = GTK_WIDGET(gnome_file_entry_gtk_entry
-			   (GNOME_FILE_ENTRY(abc->ab_specific.externq.load)));
-	gtk_entry_set_text(GTK_ENTRY(entry), ab->load);
-
-	entry = GTK_WIDGET(gnome_file_entry_gtk_entry
-			   (GNOME_FILE_ENTRY(abc->ab_specific.externq.save)));
-	gtk_entry_set_text(GTK_ENTRY(entry), ab->save);
-#endif /* GTK_CHECK_VERSION(2, 6, 0) */
     }
 
     dialog = create_generic_dialog(abc);
@@ -577,15 +554,6 @@
     return bad_path(gtk_file_chooser_get_filename(chooser), window, type);
 }
 
-#if !GTK_CHECK_VERSION(2, 6, 0)
-static gboolean
-entry_bad_path(GnomeFileEntry * entry, GtkWindow * window, gint type)
-{
-    return bad_path(gnome_file_entry_get_full_path(entry, TRUE), window,
-                    type);
-}
-#endif                          /* GTK_CHECK_VERSION(2, 6, 0) */
-
 static gboolean
 handle_close(AddressBookConfig * abc)
 {
@@ -600,7 +568,6 @@
                      ADDRESS_BOOK_CONFIG_PATH_FILE))
             return FALSE;
     } else if (abc->type == LIBBALSA_TYPE_ADDRESS_BOOK_EXTERN) {
-#if GTK_CHECK_VERSION(2, 6, 0)
         if (chooser_bad_path(GTK_FILE_CHOOSER(abc->ab_specific.externq.load),
                      GTK_WINDOW(abc->window),
                      ADDRESS_BOOK_CONFIG_PATH_LOAD))
@@ -609,16 +576,6 @@
                      GTK_WINDOW(abc->window),
                      ADDRESS_BOOK_CONFIG_PATH_SAVE))
             return FALSE;
-#else /* GTK_CHECK_VERSION(2, 6, 0) */
-        if (entry_bad_path(GNOME_FILE_ENTRY(abc->ab_specific.externq.load),
-                     GTK_WINDOW(abc->window),
-                     ADDRESS_BOOK_CONFIG_PATH_LOAD))
-            return FALSE;
-        if (entry_bad_path(GNOME_FILE_ENTRY(abc->ab_specific.externq.save),
-                     GTK_WINDOW(abc->window),
-                     ADDRESS_BOOK_CONFIG_PATH_SAVE))
-            return FALSE;
-#endif /* GTK_CHECK_VERSION(2, 6, 0) */
     }
 
     if (abc->address_book == NULL)
@@ -636,9 +593,6 @@
 static gboolean
 bad_path(gchar * path, GtkWindow * window, gint type)
 {
-#if !GTK_CHECK_VERSION(2, 6, 0)
-    gchar *message, *question;
-#endif /* GTK_CHECK_VERSION(2, 6, 0) */
     GtkWidget *ask;
     gint clicked_button;
 
@@ -646,38 +600,12 @@
         g_free(path);
         return FALSE;
     }
-#if GTK_CHECK_VERSION(2, 6, 0)
     ask = gtk_message_dialog_new(window,
 				 GTK_DIALOG_MODAL|
 				 GTK_DIALOG_DESTROY_WITH_PARENT,
                                  GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
                                  _("No path found.  "
 				   "Do you want to give one?"));
-#else /* GTK_CHECK_VERSION(2, 6, 0) */
-    switch (type) {
-        case ADDRESS_BOOK_CONFIG_PATH_FILE:
-            message =
-                _("The address book file path \"%s\" is not correct. %s");
-            break;
-        case ADDRESS_BOOK_CONFIG_PATH_LOAD:
-            message = _("The load program path \"%s\" is not correct. %s");
-            break;
-        case ADDRESS_BOOK_CONFIG_PATH_SAVE:
-            message = _("The save program path \"%s\" is not correct. %s");
-            break;
-        default:
-            message = _("The path \"%s\" is not correct. %s");
-            break;
-    }
-    question = _("Do you want to correct the path?");
-    ask = gtk_message_dialog_new(window,
-				 GTK_DIALOG_MODAL|
-				 GTK_DIALOG_DESTROY_WITH_PARENT,
-                                 GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
-                                 message, path, question);
-    g_free(path);
-#endif /* GTK_CHECK_VERSION(2, 6, 0) */
-
     gtk_dialog_set_default_response(GTK_DIALOG(ask), GTK_RESPONSE_YES);
     clicked_button = gtk_dialog_run(GTK_DIALOG(ask));
     gtk_widget_destroy(ask);
@@ -697,13 +625,8 @@
             address_book = libbalsa_address_book_vcard_new(name, path);
         g_free(path);
     } else if (abc->type == LIBBALSA_TYPE_ADDRESS_BOOK_EXTERN) {
-#if GTK_CHECK_VERSION(2, 6, 0)
 #define GET_FILENAME(chooser) \
   gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(chooser))
-#else /* GTK_CHECK_VERSION(2, 6, 0) */
-#define GET_FILENAME(entry) \
-  gnome_file_entry_get_full_path(GNOME_FILE_ENTRY(entry), FALSE)
-#endif /* GTK_CHECK_VERSION(2, 6, 0) */
         gchar *load = GET_FILENAME(abc->ab_specific.externq.load);
         gchar *save = GET_FILENAME(abc->ab_specific.externq.save);
         if (load != NULL && save != NULL)
@@ -788,23 +711,12 @@
         }
     } else if (abc->type == LIBBALSA_TYPE_ADDRESS_BOOK_EXTERN) {
         LibBalsaAddressBookExtern *externq;
-#if GTK_CHECK_VERSION(2, 6, 0)
         gchar *load =
             gtk_file_chooser_get_filename(GTK_FILE_CHOOSER
                                            (abc->ab_specific.externq.load));
         gchar *save =
             gtk_file_chooser_get_filename(GTK_FILE_CHOOSER
                                            (abc->ab_specific.externq.save));
-#else /* GTK_CHECK_VERSION(2, 6, 0) */
-        gchar *load =
-            gnome_file_entry_get_full_path(GNOME_FILE_ENTRY
-                                           (abc->ab_specific.externq.load),
-                                           FALSE);
-        gchar *save =
-            gnome_file_entry_get_full_path(GNOME_FILE_ENTRY
-                                           (abc->ab_specific.externq.save),
-                                           FALSE);
-#endif /* GTK_CHECK_VERSION(2, 6, 0) */
 
         externq = LIBBALSA_ADDRESS_BOOK_EXTERN(address_book);
         if (load) {

Modified: trunk/src/balsa-app.c
==============================================================================
--- trunk/src/balsa-app.c	(original)
+++ trunk/src/balsa-app.c	Sat Feb  7 22:20:25 2009
@@ -351,10 +351,13 @@
     balsa_app.mblist_totalmsg_width = TOTALMSGCOUNT_DEFAULT_WIDTH;
 
     /* Allocate the best colormap we can get */
-    gtk_widget_set_default_colormap(gdk_rgb_get_colormap());
     balsa_app.visual = gdk_visual_get_best();
-    balsa_app.colormap = gdk_colormap_new(balsa_app.visual, TRUE);
-
+    if (!(balsa_app.colormap = gdk_colormap_new(balsa_app.visual, TRUE))) {
+	balsa_app.visual = gdk_visual_get_system();
+	balsa_app.colormap = gdk_colormap_get_system();
+    }
+    g_assert(balsa_app.colormap);
+    
     /* arp */
     balsa_app.quote_str = NULL;
 

Modified: trunk/src/balsa-bonobo.c
==============================================================================
--- trunk/src/balsa-bonobo.c	(original)
+++ trunk/src/balsa-bonobo.c	Sat Feb  7 22:20:25 2009
@@ -20,9 +20,9 @@
  */
 
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "config.h"
+
+#if HAVE_GNOME
 
 #include <string.h>
 
@@ -276,3 +276,5 @@
 			GNOME_Balsa_Application,
 			BONOBO_TYPE_OBJECT,
 			balsa_application );
+
+#endif /* HAVE_GNOME */ 

Modified: trunk/src/balsa-bonobo.h
==============================================================================
--- trunk/src/balsa-bonobo.h	(original)
+++ trunk/src/balsa-bonobo.h	Sat Feb  7 22:20:25 2009
@@ -24,6 +24,10 @@
 #ifndef __BALSA_BONOBO_H
 #define __BALSA_BONOBO_H
 
+#include "config.h"
+
+#if HAVE_GNOME
+
 #include "Balsa.h" 
 #include <bonobo/bonobo-control.h>
 #include <bonobo/bonobo-object.h>
@@ -87,6 +91,7 @@
  
 GType          balsa_application_get_type (void);
 BonoboObject  *balsa_application_new      (void);
- 
+
+#endif /* HAVE_GNOME */ 
  
 #endif /* __BALSA_BONOBO_H */

Modified: trunk/src/balsa-icons.c
==============================================================================
--- trunk/src/balsa-icons.c	(original)
+++ trunk/src/balsa-icons.c	Sat Feb  7 22:20:25 2009
@@ -20,7 +20,6 @@
  */
 
 #include <string.h>
-#include <gdk/gdkx.h>
 
 #include "config.h"
 

Modified: trunk/src/balsa-index.c
==============================================================================
--- trunk/src/balsa-index.c	(original)
+++ trunk/src/balsa-index.c	Sat Feb  7 22:20:25 2009
@@ -51,13 +51,8 @@
 #include <glib/gi18n.h>
 
 /* TREE_VIEW_FIXED_HEIGHT enables hight-performance mode of GtkTreeView
- * very useful for large mailboxes (#msg >5000) but: a. is available only
- * in gtk2>=2.3.5 b. may expose some bugs in gtk.
- * gtk-2.4.9 has been tested with a positive result.
- */
-#if GTK_CHECK_VERSION(2,4,9)
+ * very useful for large mailboxes (#msg >5000)  */
 #define TREE_VIEW_FIXED_HEIGHT 1
-#endif
 
 
 /* gtk widget */
@@ -415,9 +410,7 @@
     g_signal_connect_after(tree_view, "size-allocate",
                            G_CALLBACK(bndx_column_resize),
                            NULL);
-#if GTK_CHECK_VERSION(2,4,9)
     gtk_tree_view_set_enable_search(tree_view, FALSE);
-#endif
 
     gtk_drag_source_set(GTK_WIDGET (index), 
                         GDK_BUTTON1_MASK | GDK_SHIFT_MASK | GDK_CONTROL_MASK,
@@ -2585,14 +2578,8 @@
         gchar *pipe_cmd;
         GList *active_cmd;
 
-#if GTK_CHECK_VERSION(2, 6, 0)
         pipe_cmd =
             gtk_combo_box_get_active_text(GTK_COMBO_BOX(info->entry));
-#else                           /* GTK_CHECK_VERSION(2, 6, 0) */
-        pipe_cmd =
-            gtk_editable_get_chars(GTK_EDITABLE
-                                   (GTK_BIN(info->entry)->child), 0, -1);
-#endif                          /* GTK_CHECK_VERSION(2, 6, 0) */
         active_cmd =
             g_list_find_custom(balsa_app.pipe_cmds, pipe_cmd,
                                (GCompareFunc) strcmp);

Modified: trunk/src/balsa-mblist.c
==============================================================================
--- trunk/src/balsa-mblist.c	(original)
+++ trunk/src/balsa-mblist.c	Sat Feb  7 22:20:25 2009
@@ -2089,21 +2089,12 @@
     BalsaMBListMRUOption *mro =
         g_object_get_data(G_OBJECT(combo_box), "mro");
     GList *list;
-#if GTK_CHECK_VERSION(2, 6, 0)
     GtkListStore *store;
     GtkTreeIter iter;
-#else                           /* GTK_CHECK_VERSION(2, 6, 0) */
-    gint i;
-#endif                          /* GTK_CHECK_VERSION(2, 6, 0) */
 
     gtk_combo_box_set_active(combo_box, -1);
-#if GTK_CHECK_VERSION(2, 6, 0)
     store = GTK_LIST_STORE(gtk_combo_box_get_model(combo_box));
     gtk_list_store_clear(store);
-#else                           /* GTK_CHECK_VERSION(2, 6, 0) */
-    for (i = g_slist_length(mro->real_urls) + 1; --i >= 0;)
-        gtk_combo_box_remove_text(combo_box, i);
-#endif                          /* GTK_CHECK_VERSION(2, 6, 0) */
     g_slist_foreach(mro->real_urls, (GFunc) g_free, NULL);
     g_slist_free(mro->real_urls);
     mro->real_urls = NULL;
@@ -2113,20 +2104,14 @@
         LibBalsaMailbox *mailbox;
 
         if ((mailbox = balsa_find_mailbox_by_url(url)) || !*url) {
-#if GTK_CHECK_VERSION(2, 6, 0)
 	    gtk_list_store_append(store, &iter);
 	    gtk_list_store_set(store, &iter,
                                0, mailbox ? mailbox->name : "",
                                1, FALSE, -1);
-#else                           /* GTK_CHECK_VERSION(2, 6, 0) */
-            gtk_combo_box_append_text(GTK_COMBO_BOX(combo_box),
-                                      mailbox ? mailbox->name : "");
-#endif                          /* GTK_CHECK_VERSION(2, 6, 0) */
             mro->real_urls = g_slist_append(mro->real_urls, g_strdup(url));
         }
     }
 
-#if GTK_CHECK_VERSION(2, 6, 0)
     /* Separator: */
     gtk_list_store_append(store, &iter);
     gtk_list_store_set(store, &iter, 1, TRUE, -1);
@@ -2134,9 +2119,6 @@
     gtk_list_store_set(store, &iter,
                        0, _("Other..."),
 		       1, FALSE, -1);
-#else                           /* GTK_CHECK_VERSION(2, 6, 0) */
-    gtk_combo_box_append_text(GTK_COMBO_BOX(combo_box), _("Other..."));
-#endif                          /* GTK_CHECK_VERSION(2, 6, 0) */
     gtk_combo_box_set_active(combo_box, 0);
 }
 
@@ -2191,7 +2173,6 @@
  * Adds a last entry that pops up the whole mailbox tree. When an item
  * is clicked, the url_list is updated.
  */
-#if GTK_CHECK_VERSION(2, 6, 0)
 static gboolean
 bmbl_mru_separator_func(GtkTreeModel *model, GtkTreeIter *iter, gpointer data)
 {
@@ -2201,21 +2182,17 @@
 
     return is_sep;
 }
-#endif                          /* GTK_CHECK_VERSION(2, 6, 0) */
 
 GtkWidget *
 balsa_mblist_mru_option_menu(GtkWindow * window, GList ** url_list)
 {
     GtkWidget *combo_box;
     BalsaMBListMRUOption *mro;
-#if GTK_CHECK_VERSION(2, 6, 0)
     GtkListStore *store;
     GtkCellRenderer *renderer;
-#endif                          /* GTK_CHECK_VERSION(2, 6, 0) */
 
     g_return_val_if_fail(url_list != NULL, NULL);
 
-#if GTK_CHECK_VERSION(2, 6, 0)
     store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_BOOLEAN);
     combo_box = gtk_combo_box_new_with_model(GTK_TREE_MODEL(store));
     renderer = gtk_cell_renderer_text_new();
@@ -2225,9 +2202,6 @@
     gtk_combo_box_set_row_separator_func(GTK_COMBO_BOX(combo_box),
                                          bmbl_mru_separator_func, NULL,
                                          NULL);
-#else                           /* GTK_CHECK_VERSION(2, 6, 0) */
-    combo_box = gtk_combo_box_new_text();
-#endif                          /* GTK_CHECK_VERSION(2, 6, 0) */
     mro = g_new(BalsaMBListMRUOption, 1);
 
     mro->window = window;

Modified: trunk/src/filter-edit-callbacks.c
==============================================================================
--- trunk/src/filter-edit-callbacks.c	(original)
+++ trunk/src/filter-edit-callbacks.c	Sat Feb  7 22:20:25 2009
@@ -42,6 +42,7 @@
 #include "mailbox-filter.h"
 #include <glib/gi18n.h>
 #include "libbalsa-conf.h"
+#include "missing.h"
 
 #if !GTK_CHECK_VERSION(2, 14, 0)
 #ifdef HAVE_GNOME
@@ -1780,9 +1781,6 @@
         gtk_entry_set_text(GTK_ENTRY(fe_name_entry),"");
         gtk_entry_set_text(GTK_ENTRY(fe_popup_entry),"");
         /*gtk_option_menu_set_history(GTK_OPTION_MENU(fe_mailboxes), 0); */
-#if !GTK_CHECK_VERSION(2, 6, 0)
-        gtk_entry_set_text(GTK_ENTRY(gnome_file_entry_gtk_entry(GNOME_FILE_ENTRY(fe_sound_entry))),"");
-#endif /* GTK_CHECK_VERSION(2, 6, 0) */
         gtk_list_store_clear(GTK_LIST_STORE
                              (gtk_tree_view_get_model
                               (fe_conditions_list)));
@@ -1912,13 +1910,8 @@
     if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(fe_sound_button))) {
         gchar *tmpstr;
         
-#if GTK_CHECK_VERSION(2, 6, 0)
         tmpstr = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER
                                                (fe_sound_entry));
-#else /* GTK_CHECK_VERSION(2, 6, 0) */
-        tmpstr =
-            gtk_editable_get_chars(GTK_EDITABLE(fe_sound_entry), 0, -1);
-#endif /* GTK_CHECK_VERSION(2, 6, 0) */
         if ((!tmpstr) || (tmpstr[0] == '\0')) {
             g_free(tmpstr);
             libbalsa_filter_free(fil, GINT_TO_POINTER(TRUE));
@@ -2020,14 +2013,9 @@
                        ? fil->popup_text : "");
     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(fe_sound_button),
                                  fil->sound!=NULL);
-#if GTK_CHECK_VERSION(2, 6, 0)
     if (fil->sound)
         gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(fe_sound_entry),
                                       fil->sound);
-#else /* GTK_CHECK_VERSION(2, 6, 0) */
-    gtk_entry_set_text(GTK_ENTRY(gnome_file_entry_gtk_entry(GNOME_FILE_ENTRY(fe_sound_entry))),
-                       fil->sound!=NULL ? fil->sound : "");
-#endif /* GTK_CHECK_VERSION(2, 6, 0) */
     
     gtk_combo_box_set_active(GTK_COMBO_BOX(fe_action_option_menu),
                              fil->action - 1);
@@ -2090,7 +2078,6 @@
     return label;
 }                               /* end fe_date_sample */
 
-#if GTK_CHECK_VERSION(2, 6, 0)
 /* Callback for the sound file-chooser-button's dialog. */
 void
 fe_sound_response(GtkDialog * dialog, gint response)
@@ -2098,4 +2085,3 @@
     if (response == GTK_RESPONSE_ACCEPT)
         set_button_sensitivities(TRUE);
 }
-#endif /* GTK_CHECK_VERSION(2, 6, 0) */

Modified: trunk/src/filter-edit-dialog.c
==============================================================================
--- trunk/src/filter-edit-dialog.c	(original)
+++ trunk/src/filter-edit-dialog.c	Sat Feb  7 22:20:25 2009
@@ -338,9 +338,7 @@
 {
     GtkWidget *page, *frame, *table;
     GtkWidget *box;
-#if GTK_CHECK_VERSION(2, 6, 0)
     GtkWidget *dialog;
-#endif /* GTK_CHECK_VERSION(2, 6, 0) */
 
     page = gtk_vbox_new(TRUE, 5);
 
@@ -361,7 +359,6 @@
 		     0, 1, 0, 1,
 		     GTK_FILL | GTK_SHRINK | GTK_EXPAND, GTK_SHRINK, 5, 5);
 
-#if GTK_CHECK_VERSION(2, 6, 0)
     dialog =
         gtk_file_chooser_dialog_new(_("Use Sound..."), NULL,
                                     GTK_FILE_CHOOSER_ACTION_OPEN,
@@ -374,10 +371,6 @@
                                             GTK_RESPONSE_ACCEPT,
                                             GTK_RESPONSE_CANCEL, -1);
     fe_sound_entry = gtk_file_chooser_button_new_with_dialog(dialog);
-#else /* GTK_CHECK_VERSION(2, 6, 0) */
-    fe_sound_entry =
-	gnome_file_entry_new("filter_sounds", _("Use Sound..."));
-#endif /* GTK_CHECK_VERSION(2, 6, 0) */
     gtk_table_attach(GTK_TABLE(table), fe_sound_entry, 1, 2, 0, 1,
 		     GTK_FILL | GTK_SHRINK | GTK_EXPAND, GTK_SHRINK, 5, 5);
     /* fe_sound_entry is initially sensitive, so to be consistent 
@@ -385,15 +378,8 @@
     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(fe_sound_button), TRUE);
     g_signal_connect(G_OBJECT(fe_sound_button), "toggled",
                      G_CALLBACK(fe_button_toggled), fe_sound_entry);
-#if GTK_CHECK_VERSION(2, 6, 0)
     g_signal_connect(G_OBJECT(dialog), "response",
                      G_CALLBACK(fe_sound_response), NULL);
-#else /* GTK_CHECK_VERSION(2, 6, 0) */
-    g_signal_connect(G_OBJECT
-                     (gnome_file_entry_gtk_entry
-                      (GNOME_FILE_ENTRY(fe_sound_entry))), "changed",
-                     G_CALLBACK(fe_action_changed), NULL);
-#endif /* GTK_CHECK_VERSION(2, 6, 0) */
 
     fe_popup_button = gtk_check_button_new_with_label(_("Popup text:"));
     gtk_table_attach(GTK_TABLE(table),

Modified: trunk/src/filter-edit.h
==============================================================================
--- trunk/src/filter-edit.h	(original)
+++ trunk/src/filter-edit.h	Sat Feb  7 22:20:25 2009
@@ -94,10 +94,8 @@
 void fe_action_changed(GtkWidget * widget, gpointer data);
 void fe_enable_right_page(gboolean enabled);
 
-#if GTK_CHECK_VERSION(2, 6, 0)
 /* Callback for the sound file-chooser-button's dialog. */
 void fe_sound_response(GtkDialog * dialog, gint response);
-#endif /* GTK_CHECK_VERSION(2, 6, 0) */
 
 void fe_add_new_user_header(const gchar *);
 #endif /*__FILTER_EDIT_H__ */

Modified: trunk/src/mailbox-conf.c
==============================================================================
--- trunk/src/mailbox-conf.c	(original)
+++ trunk/src/mailbox-conf.c	Sat Feb  7 22:20:25 2009
@@ -42,9 +42,6 @@
 #include "config.h"
 
 #include <gtk/gtk.h>
-#if !GTK_CHECK_VERSION(2, 6, 0) && HAVE_GNOME
-#include <gnome.h>  /* needed by GnomeFileEntry */
-#endif
 #include <string.h>
 
 #include "balsa-app.h"
@@ -83,12 +80,6 @@
     gboolean ok_sensitive;
 
     union {
-#if !GTK_CHECK_VERSION(2, 6, 0) && HAVE_GNOME
-	/* for local mailboxes */
-	struct local { 
-	    GnomeFileEntry *path;
-	} local;
-#endif /* GTK_CHECK_VERSION(2, 6, 0) */
 	/* for imap mailboxes & directories */
 	struct {
 	    GtkWidget *port;

Modified: trunk/src/main-window.c
==============================================================================
--- trunk/src/main-window.c	(original)
+++ trunk/src/main-window.c	Sat Feb  7 22:20:25 2009
@@ -40,6 +40,10 @@
 #include "misc.h"
 #include "html.h"
 #include <glib/gi18n.h>
+ 
+#if HAVE_MACOSX_DESKTOP
+#include <ige-mac-integration.h>
+#endif
 
 #include "ab-window.h"
 #include "balsa-app.h"
@@ -1545,6 +1549,9 @@
     static const gchar *const threading_options[] =
         { "FlatIndex", "SimpleThreading", "JWZThreading" };
     guint i;
+#if HAVE_MACOSX_DESKTOP
+    IgeMacMenuGroup *group;
+#endif
 
     /* Call to register custom balsa pixmaps with GNOME_STOCK_PIXMAPS
      * - allows for grey out */
@@ -1576,7 +1583,22 @@
     }
 
     menubar = gtk_ui_manager_get_widget(ui_manager, "/MainMenu");
+#if HAVE_MACOSX_DESKTOP
+    ige_mac_menu_set_menu_bar(GTK_MENU_SHELL(menubar));
+    ige_mac_menu_set_quit_menu_item(GTK_MENU_ITEM(gtk_ui_manager_get_widget(ui_manager, "/MainMenu/FileMenu/Quit")));
+ 
+    group = ige_mac_menu_add_app_menu_group();
+    ige_mac_menu_add_app_menu_item(group,
+                                  GTK_MENU_ITEM(gtk_ui_manager_get_widget(ui_manager, "/MainMenu/HelpMenu/About")), 
+                                   NULL);
+				   
+    group = ige_mac_menu_add_app_menu_group();
+    ige_mac_menu_add_app_menu_item(group,
+                                  GTK_MENU_ITEM(gtk_ui_manager_get_widget(ui_manager, "/MainMenu/EditMenu/Preferences")), 
+                                   NULL);
+#else
     gtk_box_pack_start(GTK_BOX(window->vbox), menubar, FALSE, FALSE, 0);
+#endif
 
     toolbar = balsa_toolbar_new(model, ui_manager);
     gtk_box_pack_start(GTK_BOX(window->vbox), toolbar, FALSE, FALSE, 0);
@@ -2558,7 +2580,6 @@
 /*
  * show the about box for Balsa
  */
-#if GTK_CHECK_VERSION(2, 6, 0)
 static void
 bw_show_about_box_url_hook(GtkAboutDialog * about, const gchar * link,
                            gpointer data)
@@ -2577,7 +2598,6 @@
         g_error_free(err);
     }
 }
-#endif /* GTK_CHECK_VERSION(2, 6, 0) */
 
 static void
 bw_show_about_box(GtkAction * action, gpointer user_data)
@@ -2602,7 +2622,6 @@
         gdk_pixbuf_new_from_file(BALSA_DATA_PREFIX
                                  "/pixmaps/balsa_logo.png", NULL);
 
-#if GTK_CHECK_VERSION(2, 6, 0)
     gtk_about_dialog_set_url_hook(bw_show_about_box_url_hook, NULL, NULL);
     gtk_show_about_dialog(GTK_WINDOW(user_data),
                           "version", BALSA_VERSION,
@@ -2623,35 +2642,6 @@
                           "wrap-license", TRUE,
                           NULL);
     g_object_unref(balsa_logo);
-#else /* GTK_CHECK_VERSION(2, 6, 0) */
-    static GtkWidget *about = NULL;
-
-    /* only show one about box at a time */
-    if (about) {
-        gdk_window_raise(about->window);
-        return;
-    }
-
-    about = gnome_about_new("Balsa",
-                            BALSA_VERSION,
-                            "Copyright \xc2\xa9 1997-2003 The Balsa Developers",
-                            _("The Balsa email client is part of "
-                              "the GNOME desktop environment.  "
-                              "Information on Balsa can be found at "
-                              "http://balsa.gnome.org/\n\n";
-                              "If you need to report bugs, "
-                              "please do so at: "
-                              "http://bugzilla.gnome.org/";),
-                            authors,
-                            documenters,
-                            strcmp(translator_credits, "translator-credits") != 0 ? translator_credits : NULL,
-                            balsa_logo
-                            );
-
-    g_object_add_weak_pointer(G_OBJECT(about), (gpointer) &about);
-
-    gtk_widget_show(about);
-#endif /* GTK_CHECK_VERSION(2, 6, 0) */
 }
 
 /* Check all mailboxes in a list

Modified: trunk/src/main.c
==============================================================================
--- trunk/src/main.c	(original)
+++ trunk/src/main.c	Sat Feb  7 22:20:25 2009
@@ -22,8 +22,10 @@
 #define _XOPEN_SOURCE 500
 #include "config.h"
 
+#if HAVE_GNOME
 #include <gnome.h>
 #include <libgnomeui/gnome-window-icon.h>
+#endif
 
 #ifdef GTKHTML_HAVE_GCONF
 # include <gconf/gconf.h>
@@ -59,10 +61,12 @@
 
 #include "libinit_balsa/init_balsa.h"
 
+#if HAVE_GNOME
 #include "Balsa.h"
 #include "balsa-bonobo.h"
 #include <bonobo-activation/bonobo-activation.h>
 #include <bonobo/bonobo-exception.h>
+#endif
 
 #ifdef HAVE_GPGME
 #include <string.h>
@@ -92,11 +96,13 @@
 static void config_init(gboolean check_only);
 static void mailboxes_init(gboolean check_only);
 static void balsa_cleanup(void);
+#if HAVE_GNOME
 static gint balsa_kill_session(GnomeClient * client, gpointer client_data);
 static gint balsa_save_session(GnomeClient * client, gint phase,
 			       GnomeSaveStyle save_style, gint is_shutdown,
 			       GnomeInteractStyle interact_style,
 			       gint is_fast, gpointer client_data);
+#endif
 gboolean initial_open_unread_mailboxes(void); 
 /* yes void is there cause gcc is tha suck */
 gboolean initial_open_inbox(void);
@@ -132,6 +138,7 @@
     g_free(accel_map_filename);
 }
 
+#if HAVE_GNOME
 static void
 balsa_handle_automation_options() {
    CORBA_Object factory;
@@ -216,6 +223,7 @@
    }
    
 }
+#endif /* HAVE_GNOME */
 
 /* balsa_init:
    FIXME - check for memory leaks.
@@ -223,7 +231,7 @@
 static void
 balsa_init(int argc, char **argv)
 {
-#ifndef GNOME_PARAM_GOPTION_CONTEXT
+#if (HAVE_GNOME && !defined(GNOME_PARAM_GOPTION_CONTEXT))
     static char *attachment = NULL;
     int opt;
     poptContext context;
@@ -307,6 +315,7 @@
           "Special option that collects any remaining arguments for us" },
         { NULL }
     };
+#if HAVE_GNOME
     GOptionContext *option_context = g_option_context_new("balsa");
     GnomeProgram *my_app;
     g_option_context_add_main_entries(option_context, option_entries, NULL);
@@ -317,6 +326,9 @@
                                 GNOME_PARAM_APP_DATADIR,
                                 BALSA_STD_PREFIX "/share",
                                 GNOME_PARAM_NONE);
+#else /* HAVE_GNOME */
+    gtk_init_with_args(&argc, &argv, PACKAGE, option_entries, NULL, NULL);
+#endif  /* HAVE_GNOME */
 
     if (remaining_args != NULL) {
         gint i, num_args;
@@ -340,8 +352,10 @@
         attach_vect = NULL;
     }
 #endif /* OPTION HANDLING */
-    balsa_handle_automation_options();  
-    
+
+#if HAVE_GNOME
+    balsa_handle_automation_options();
+#endif
 }
 
 /* check_special_mailboxes: 
@@ -389,7 +403,9 @@
 {
     while(!config_load() && !check_only) {
 	balsa_init_begin();
+#if HAVE_GNOME
         config_defclient_save();
+#endif
     }
 }
 
@@ -400,7 +416,9 @@
     if (!balsa_app.inbox && !check_only) {
 	g_warning("*** error loading mailboxes\n");
 	balsa_init_begin();
+#if HAVE_GNOME
         config_defclient_save();
+#endif
 	return;
     }
 }
@@ -721,7 +739,9 @@
 main(int argc, char *argv[])
 {
     GtkWidget *window;
+#if HAVE_GNOME
     GnomeClient *client;
+#endif
     gchar *default_icon;
 #ifdef GTKHTML_HAVE_GCONF
     GError *gconf_error;
@@ -806,7 +826,9 @@
     }
 
     signal( SIGPIPE, SIG_IGN );
+#if HAVE_GNOME
     gnome_triggers_do("", "program", "balsa", "startup", NULL);
+#endif
 
     window = balsa_window_new();
     balsa_app.main_window = BALSA_WINDOW(window);
@@ -825,11 +847,13 @@
     }
 
     /* session management */
+#if HAVE_GNOME
     client = gnome_master_client();
     g_signal_connect(G_OBJECT(client), "save_yourself",
 		     G_CALLBACK(balsa_save_session), argv[0]);
     g_signal_connect(G_OBJECT(client), "die",
 		     G_CALLBACK(balsa_kill_session), NULL);
+#endif
 
 #ifdef HAVE_GPGME
     balsa_app.has_openpgp = 
@@ -924,9 +948,12 @@
     g_hash_table_destroy(libbalsa_mailbox_view_table);
     libbalsa_mailbox_view_table = NULL;
 
+#if HAVE_GNOME
     gnome_sound_shutdown();
+#endif
 }
 
+#if HAVE_GNOME
 static gint
 balsa_kill_session(GnomeClient * client, gpointer client_data)
 {
@@ -988,3 +1015,4 @@
 
     return TRUE;
 }
+#endif /* HAVE_GNOME */

Modified: trunk/src/pref-manager.c
==============================================================================
--- trunk/src/pref-manager.c	(original)
+++ trunk/src/pref-manager.c	Sat Feb  7 22:20:25 2009
@@ -420,7 +420,6 @@
 };
 
     /* and now the important stuff: */
-#if GTK_CHECK_VERSION(2, 6, 0)
 static gboolean
 open_preferences_manager_idle(void)
 {
@@ -449,7 +448,6 @@
     gdk_threads_leave();
     return FALSE;
 }                               /* open_preferences_manager_idle */
-#endif                          /* GTK_CHECK_VERSION(2, 6, 0) */
 
 enum {
     PM_TEXT_COL,
@@ -618,16 +616,11 @@
                      G_CALLBACK(properties_modified_cb), property_box);
 #endif                          /* HAVE_GTKSPELL */
 
-#if GTK_CHECK_VERSION(2, 6, 0)
     /* Connect signal in an idle handler, after the file chooser has
      * been initialized. */
     g_idle_add_full(G_PRIORITY_LOW,
                     (GSourceFunc) open_preferences_manager_idle,
                     NULL, NULL);
-#else                           /* GTK_CHECK_VERSION(2, 6, 0) */
-    g_signal_connect(G_OBJECT(pui->mail_directory), "changed",
-                     G_CALLBACK(properties_modified_cb), property_box);
-#endif                          /* GTK_CHECK_VERSION(2, 6, 0) */
     g_signal_connect(G_OBJECT(pui->check_mail_auto), "toggled",
                      G_CALLBACK(timer_modified_cb), property_box);
 
@@ -830,14 +823,9 @@
                          (GHFunc) update_view_defaults, NULL);
 
     g_free(balsa_app.local_mail_directory);
-#if GTK_CHECK_VERSION(2, 6, 0)
     balsa_app.local_mail_directory =
         gtk_file_chooser_get_filename(GTK_FILE_CHOOSER
                                       (pui->mail_directory));
-#else                           /* GTK_CHECK_VERSION(2, 6, 0) */
-    balsa_app.local_mail_directory =
-        g_strdup(gtk_entry_get_text(GTK_ENTRY(pui->mail_directory)));
-#endif                          /* GTK_CHECK_VERSION(2, 6, 0) */
 
     /* 
      * display page 
@@ -1082,14 +1070,9 @@
             break;
         }
 
-#if GTK_CHECK_VERSION(2, 6, 0)
     gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER
                                         (pui->mail_directory),
                                   balsa_app.local_mail_directory);
-#else                           /* GTK_CHECK_VERSION(2, 6, 0) */
-    gtk_entry_set_text(GTK_ENTRY(pui->mail_directory),
-                       balsa_app.local_mail_directory);
-#endif                          /* GTK_CHECK_VERSION(2, 6, 0) */
 
     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(pui->previewpane),
                                  balsa_app.previewpane);
@@ -1665,26 +1648,10 @@
 local_mail_group(GtkWidget * page)
 {
     GtkWidget *group = pm_group_new(_("Local mail directory"));
-#if GTK_CHECK_VERSION(2, 6, 0)
     pui->mail_directory =
         gtk_file_chooser_button_new(_("Select your local mail directory"),
                                     GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);
     pm_group_add(group, pui->mail_directory, FALSE);
-#else                           /* GTK_CHECK_VERSION(2, 6, 0) */
-    GtkWidget *fileentry;
-
-    fileentry = gnome_file_entry_new("MAIL-DIR",
-                                     _
-                                     ("Select your local mail directory"));
-    pm_group_add(group, fileentry, FALSE);
-
-    gnome_file_entry_set_directory_entry(GNOME_FILE_ENTRY(fileentry),
-                                         TRUE);
-    gnome_file_entry_set_modal(GNOME_FILE_ENTRY(fileentry), TRUE);
-
-    pui->mail_directory =
-        gnome_file_entry_gtk_entry(GNOME_FILE_ENTRY(fileentry));
-#endif                          /* GTK_CHECK_VERSION(2, 6, 0) */
 
     return group;
 }

Modified: trunk/src/print-gtk.c
==============================================================================
--- trunk/src/print-gtk.c	(original)
+++ trunk/src/print-gtk.c	Sat Feb  7 22:20:25 2009
@@ -377,7 +377,7 @@
      */
     gchar *e = _("default:mm");
   
-#ifdef HAVE_LANGINFO
+#if (HAVE_LANGINFO && defined(_NL_MEASUREMENT_MEASUREMENT))
     gchar *imperial = NULL;
   
     imperial = nl_langinfo(_NL_MEASUREMENT_MEASUREMENT);

Modified: trunk/src/save-restore.c
==============================================================================
--- trunk/src/save-restore.c	(original)
+++ trunk/src/save-restore.c	Sat Feb  7 22:20:25 2009
@@ -24,7 +24,9 @@
 
 #include <stdlib.h>
 #include <string.h>
+#if HAVE_GNOME
 #include <gconf/gconf-client.h>
+#endif
 #include <glib/gi18n.h>
 #include "balsa-app.h"
 #include "save-restore.h"
@@ -2173,6 +2175,7 @@
     }
 }
 
+#if HAVE_GNOME
 void
 config_defclient_save(void)
 {
@@ -2222,3 +2225,4 @@
         }
     }
 }
+#endif /* HAVE_GNOME */

Modified: trunk/src/save-restore.h
==============================================================================
--- trunk/src/save-restore.h	(original)
+++ trunk/src/save-restore.h	Sat Feb  7 22:20:25 2009
@@ -22,6 +22,7 @@
 #ifndef __SAVE_RESTORE_H__
 #define __SAVE_RESTORE_H__
 
+#include "config.h"
 #include "libbalsa.h"
 #include "mailbox-node.h"
 
@@ -39,7 +40,9 @@
 gint config_load(void);
 void config_load_sections(void);
 gint config_save(void);
+#if HAVE_GNOME
 void config_defclient_save(void);
+#endif
 
 gchar *mailbox_get_pkey(const LibBalsaMailbox * mbox);
 gint config_mailbox_add(LibBalsaMailbox * mailbox, const char *key_arg);

Modified: trunk/src/sendmsg-window.c
==============================================================================
--- trunk/src/sendmsg-window.c	(original)
+++ trunk/src/sendmsg-window.c	Sat Feb  7 22:20:25 2009
@@ -58,6 +58,10 @@
 #include <unistd.h>
 #endif
 #include <errno.h>
+ 
+#if HAVE_MACOSX_DESKTOP
+#include <ige-mac-integration.h>
+#endif
 
 #include "libbalsa.h"
 #include "misc.h"
@@ -74,6 +78,7 @@
 #include "threads.h"
 #endif
 
+#include "missing.h"
 #include "sendmsg-window.h"
 #include "ab-window.h"
 #include "address-view.h"
@@ -4593,7 +4598,12 @@
     }
 
     menubar = gtk_ui_manager_get_widget(ui_manager, "/MainMenu");
+#if 0 && HAVE_MACOSX_DESKTOP
+    /* FIXME - this call destroys the main balsa menu after closing the composer... */
+    ige_mac_menu_set_menu_bar(GTK_MENU_SHELL(menubar));
+#else
     gtk_box_pack_start(GTK_BOX(main_box), menubar, FALSE, FALSE, 0);
+#endif
 
     toolbar = balsa_toolbar_new(model, ui_manager);
     gtk_box_pack_start(GTK_BOX(main_box), toolbar, FALSE, FALSE, 0);
@@ -5594,7 +5604,7 @@
     else
         message->gpg_mode = 0;
     if (ident->force_key_id && *ident->force_key_id)
-        message->force_key_id = strdup(ident->force_key_id);
+        message->force_key_id = g_strdup(ident->force_key_id);
 #endif
 
     /* remember the parent window */

Modified: trunk/src/toolbar-factory.c
==============================================================================
--- trunk/src/toolbar-factory.c	(original)
+++ trunk/src/toolbar-factory.c	Sat Feb  7 22:20:25 2009
@@ -22,7 +22,9 @@
 #include "config.h"
 
 #include <string.h>
+#if HAVE_GNOME
 #include <gconf/gconf-client.h>
+#endif
 
 #include <glib/gi18n.h>
 
@@ -263,6 +265,7 @@
     libbalsa_conf_pop_group();
 }
 
+#if HAVE_GNOME
 /* GConfClientNotifyFunc
  */
 static void
@@ -272,6 +275,7 @@
     if (model->style == (GtkToolbarStyle) (-1))
         balsa_toolbar_model_changed(model);
 }
+#endif /* HAVE_GNOME */
 
 /* Create a BalsaToolbarModel structure.
  */
@@ -280,13 +284,16 @@
 {
     BalsaToolbarModel *model =
         g_object_new(BALSA_TYPE_TOOLBAR_MODEL, NULL);
+#if HAVE_GNOME
     GConfClient *conf;
     guint notify_id;
+#endif
 
     model->type = type;
     model->standard = standard;
     tm_load_model(model);
 
+#if HAVE_GNOME
     conf = gconf_client_get_default();
     /* We never destroy a model, so we do nothing with the notify-id: */
     notify_id =
@@ -294,6 +301,7 @@
                                 "/desktop/gnome/interface/toolbar_style",
                                 (GConfClientNotifyFunc) tm_gconf_notify,
                                 model, NULL, NULL);
+#endif /* HAVE_GNOME */
 
     return model;
 }
@@ -526,9 +534,10 @@
 static GtkToolbarStyle
 tm_default_style(void)
 {
+    GtkToolbarStyle default_style = GTK_TOOLBAR_BOTH;
+#if HAVE_GNOME
     GConfClient *conf;
     gchar *str;
-    GtkToolbarStyle default_style = GTK_TOOLBAR_BOTH;
 
     /* Get global setting */
     conf = gconf_client_get_default();
@@ -545,6 +554,7 @@
             }
         g_free(str);
     }
+#endif /* HAVE_GNOME */
 
     return default_style;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]