* restore gnome building (check for easysetup)
authorDirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Fri, 6 Apr 2007 13:43:18 +0000 (13:43 +0000)
committerDirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Fri, 6 Apr 2007 13:43:18 +0000 (13:43 +0000)
* use the MODEST_PLATFORM_(GNOME|MAEMO) instead of ugly MODEST_PLATFORM_ID

pmo-trunk-r1525

configure.ac
src/Makefile.am
src/modest-runtime.c
src/modest-ui-actions.c
src/widgets/modest-window.c
src/widgets/modest-window.h

index dc335c4..cf87c59 100644 (file)
@@ -129,7 +129,6 @@ if test "x$with_platform" = "xmaemo"; then
   AC_SUBST(pluginlibdir)
   AC_SUBST(plugindesktopentrydir)
 
   AC_SUBST(pluginlibdir)
   AC_SUBST(plugindesktopentrydir)
 
-  MODEST_PLATFORM_ID=2
   # warnings are errors, but don't check format errors, because
   # it breaks with logical id's
   CFLAGS="$CFLAGS -Wno-format-extra-args -Werror"
   # warnings are errors, but don't check format errors, because
   # it breaks with logical id's
   CFLAGS="$CFLAGS -Wno-format-extra-args -Werror"
@@ -137,16 +136,15 @@ else
    # gnome frontend 
    PKG_CHECK_MODULES(MODEST_LIBTINYMAIL_GNOME_DESKTOP,libtinymail-gnome-desktop-1.0 libnm_glib glib-2.0 >= 2.8 gtk+-2.0 >= 2.10)
    AC_SUBST(MODEST_LIBTINYMAIL_GNOME_DESKTOP_CFLAGS)
    # gnome frontend 
    PKG_CHECK_MODULES(MODEST_LIBTINYMAIL_GNOME_DESKTOP,libtinymail-gnome-desktop-1.0 libnm_glib glib-2.0 >= 2.8 gtk+-2.0 >= 2.10)
    AC_SUBST(MODEST_LIBTINYMAIL_GNOME_DESKTOP_CFLAGS)
-   AC_SUBST(MODEST_LIBTINYMAIL_GNOME_DESKTOP_LIBS)
-   MODEST_PLATFORM_ID=1
-   
+   AC_SUBST(MODEST_LIBTINYMAIL_GNOME_DESKTOP_LIBS)  
    AC_DEFINE_UNQUOTED(MODEST_PLATFORM_GNOME, 1, ["Whether modest is being built for the GNOME platform."])
 fi
 
    AC_DEFINE_UNQUOTED(MODEST_PLATFORM_GNOME, 1, ["Whether modest is being built for the GNOME platform."])
 fi
 
-dnl 1==>gnome, 2==>maemo
-AC_SUBST(MODEST_PLATFORM_ID)
-
-
+dnl do we have the easy setup stuff?
+if test -d src/${with_platform}/easysetup; then        
+      AC_DEFINE_UNQUOTED(MODEST_HAVE_EASYSETUP, 1, ["Whether the easysetup feature is available."])
+fi
+AM_CONDITIONAL(MODEST_HAVE_EASYSETUP,test -d src/${with_platform}/easysetup) 
 
 
 dnl ## setup the testing framework (ie., make check)
 
 
 dnl ## setup the testing framework (ie., make check)
index 9c45d4c..01684f7 100644 (file)
@@ -1,6 +1,6 @@
 #
 # Makefile.am
 #
 # Makefile.am
-# Time-stamp: <2007-03-03 17:20:20 (djcb)>
+# Time-stamp: <2007-04-06 16:29:33 (djcb)>
 SUBDIRS=$(MODEST_PLATFORM) widgets
 DIST_SUBDIRS = widgets gnome maemo
 
 SUBDIRS=$(MODEST_PLATFORM) widgets
 DIST_SUBDIRS = widgets gnome maemo
 
@@ -24,6 +24,12 @@ modest-marshal.c: modest-marshal.list
 modest-marshal.h: modest-marshal.list
        glib-genmarshal --header --prefix=modest_marshal < modest-marshal.list > modest-marshal.h
 
 modest-marshal.h: modest-marshal.list
        glib-genmarshal --header --prefix=modest_marshal < modest-marshal.list > modest-marshal.h
 
+if MODEST_HAVE_EASYSETUP
+       easysetupmaybe=$(MODEST_PLATFORM)/easysetup/libmodest-easysetup.la
+else
+       easysetupmaybe=$(MODEST_PLATFORM)/easysetup/libmodest-easysetup.la      
+endif
+
 
 bin_PROGRAMS=\
        modest
 
 bin_PROGRAMS=\
        modest
@@ -89,7 +95,7 @@ modest_LDADD =                                                \
        $(MODEST_GSTUFF_LIBS)                           \
        $(MODEST_LIBTINYMAIL_GNOME_DESKTOP_LIBS)        \
        $(MODEST_LIBTINYMAIL_MAEMO_LIBS)                \
        $(MODEST_GSTUFF_LIBS)                           \
        $(MODEST_LIBTINYMAIL_GNOME_DESKTOP_LIBS)        \
        $(MODEST_LIBTINYMAIL_MAEMO_LIBS)                \
-       $(MODEST_PLATFORM)/easysetup/libmodest-easysetup.la             \
+       ${easysetupmaybe}                               \
        $(MODEST_PLATFORM)/libmodest-ui.la              \
        widgets/libmodest-widgets.la                    
 
        $(MODEST_PLATFORM)/libmodest-ui.la              \
        widgets/libmodest-widgets.la                    
 
index 3f3b107..de3fa1f 100644 (file)
@@ -557,11 +557,11 @@ init_stock_icons (void)
                gint i;
 
                static GtkStockItem items[] = {
                gint i;
 
                static GtkStockItem items[] = {
-#if MODEST_PLATFORM_ID==2
+#ifdef MODEST_PLATFORM_MAEMO
                        { MODEST_STOCK_SPLIT_VIEW, "split view", 0, 0, NULL },
                        { MODEST_STOCK_SORT, "sort mail", 0, 0, NULL },
                        { MODEST_STOCK_REFRESH, "refresh mail", 0, 0, NULL },
                        { MODEST_STOCK_SPLIT_VIEW, "split view", 0, 0, NULL },
                        { MODEST_STOCK_SORT, "sort mail", 0, 0, NULL },
                        { MODEST_STOCK_REFRESH, "refresh mail", 0, 0, NULL },
-#endif
+#endif /*MODEST_PLATFORM_MAEMO*/
                        { MODEST_STOCK_MAIL_SEND, "send mail", 0, 0, NULL },
                        { MODEST_STOCK_NEW_MAIL, "new mail", 0, 0, NULL },
 /*                     { MODEST_STOCK_SEND_RECEIVE, "send receive", 0, 0, NULL },  */
                        { MODEST_STOCK_MAIL_SEND, "send mail", 0, 0, NULL },
                        { MODEST_STOCK_NEW_MAIL, "new mail", 0, 0, NULL },
 /*                     { MODEST_STOCK_SEND_RECEIVE, "send receive", 0, 0, NULL },  */
@@ -575,11 +575,11 @@ init_stock_icons (void)
                };
       
                static gchar *items_names [] = {
                };
       
                static gchar *items_names [] = {
-#if MODEST_PLATFORM_ID==2
+#ifdef MODEST_PLATFORM_MAEMO
                        MODEST_TOOLBAR_ICON_SPLIT_VIEW,
                        MODEST_TOOLBAR_ICON_SORT,
                        MODEST_TOOLBAR_ICON_REFRESH,
                        MODEST_TOOLBAR_ICON_SPLIT_VIEW,
                        MODEST_TOOLBAR_ICON_SORT,
                        MODEST_TOOLBAR_ICON_REFRESH,
-#endif
+#endif /*MODEST_PLATFORM_MAEMO*/
                        MODEST_TOOLBAR_ICON_MAIL_SEND,
                        MODEST_TOOLBAR_ICON_NEW_MAIL,
 /*                     MODEST_TOOLBAR_ICON_SEND_RECEIVE,  */
                        MODEST_TOOLBAR_ICON_MAIL_SEND,
                        MODEST_TOOLBAR_ICON_NEW_MAIL,
 /*                     MODEST_TOOLBAR_ICON_SEND_RECEIVE,  */
@@ -607,15 +607,16 @@ init_stock_icons (void)
                /* Register icons to accompany stock items */
                for (i = 0; i < G_N_ELEMENTS (items); i++) {
 
                /* Register icons to accompany stock items */
                for (i = 0; i < G_N_ELEMENTS (items); i++) {
 
-#if MODEST_PLATFORM_ID==1  /* MODES_PLATFORM_ID: 1 ==> gnome, 2==> maemo */ 
-                       pixbuf = gdk_pixbuf_new_from_file (items_names[i], NULL);
-#else
+#ifdef MODEST_PLATFORM_MAEMO  /* MODES_PLATFORM_ID: 1 ==> gnome, 2==> maemo */ 
                        pixbuf = gtk_icon_theme_load_icon (current_theme,
                                                           items_names[i],
                                                           26,
                                                           GTK_ICON_LOOKUP_NO_SVG,
                                                           NULL);
                        pixbuf = gtk_icon_theme_load_icon (current_theme,
                                                           items_names[i],
                                                           26,
                                                           GTK_ICON_LOOKUP_NO_SVG,
                                                           NULL);
+#else
+                       pixbuf = gdk_pixbuf_new_from_file (items_names[i], NULL);
 #endif
 #endif
+
                        if (pixbuf != NULL) {
                                GtkIconSet *icon_set;
                                GdkPixbuf *transparent;
                        if (pixbuf != NULL) {
                                GtkIconSet *icon_set;
                                GdkPixbuf *transparent;
index 2bd91be..e44c0c6 100644 (file)
 
 #include "modest-account-mgr-helpers.h"
 #include "modest-mail-operation.h"
 
 #include "modest-account-mgr-helpers.h"
 #include "modest-mail-operation.h"
+
+#ifdef MODEST_HAVE_EASYSETUP
 #include "easysetup/modest-easysetup-wizard.h"
 #include "easysetup/modest-easysetup-wizard.h"
+#endif /*MODEST_HAVE_EASYSETUP*/
+
 #include <modest-widget-memory.h>
 #include <tny-error.h>
 #include <tny-simple-list.h>
 #include <modest-widget-memory.h>
 #include <tny-error.h>
 #include <tny-simple-list.h>
index e3b30be..a5a667d 100644 (file)
@@ -64,11 +64,11 @@ modest_window_get_type (void)
                        (GInstanceInitFunc) modest_window_init,
                        NULL
                };
                        (GInstanceInitFunc) modest_window_init,
                        NULL
                };
-#if MODEST_PLATFORM_ID==1   /* gtk */
-               parent_type = GTK_TYPE_WINDOW;
-#elif MODEST_PLATFORM_ID==2   /* hildon (maemo) */
+#ifdef MODEST_PLATFORM_MAEMO
                parent_type = HILDON_TYPE_WINDOW;
                parent_type = HILDON_TYPE_WINDOW;
-#endif
+#else
+               parent_type = GTK_TYPE_WINDOW;
+#endif 
                my_type = g_type_register_static (parent_type,
                                                  "ModestWindow",
                                                  &my_info, 
                my_type = g_type_register_static (parent_type,
                                                  "ModestWindow",
                                                  &my_info, 
index cc55fa9..8902355 100644 (file)
@@ -43,15 +43,17 @@ G_BEGIN_DECLS
  * admittedly, the ifdefs for gtk and maemo are rather ugly; still
  * this way is probably the easiest to maintain
  */
  * admittedly, the ifdefs for gtk and maemo are rather ugly; still
  * this way is probably the easiest to maintain
  */
-#if MODEST_PLATFORM_ID==1   /* gtk */
+#ifdef MODEST_PLATFORM_GNOME
 #include <gtk/gtkwindow.h>
 typedef GtkWindow      ModestWindowParent;
 typedef GtkWindowClass ModestWindowParentClass;
 #include <gtk/gtkwindow.h>
 typedef GtkWindow      ModestWindowParent;
 typedef GtkWindowClass ModestWindowParentClass;
-#elif MODEST_PLATFORM_ID==2   /* hildon (maemo) */
+#endif /* MODEST_PLATFORM_GNOME */
+
+#ifdef MODEST_PLATFORM_MAEMO
 #include <hildon-widgets/hildon-window.h>
 typedef HildonWindow      ModestWindowParent;
 typedef HildonWindowClass ModestWindowParentClass;
 #include <hildon-widgets/hildon-window.h>
 typedef HildonWindow      ModestWindowParent;
 typedef HildonWindowClass ModestWindowParentClass;
-#endif /*MODEST_PLATFORM_ID*/
+#endif /*MODEST_PLATFORM_MAEMO */
 
 /* convenience macros */
 #define MODEST_TYPE_WINDOW             (modest_window_get_type())
 
 /* convenience macros */
 #define MODEST_TYPE_WINDOW             (modest_window_get_type())