[tomboy] Make GNOME panel dependency optional



commit 2aa928732b2835c64f04d2e605ca5a31591c7e5b
Author: Javier Jardón <jjardon gnome org>
Date:   Fri Jun 18 06:42:28 2010 +0200

    Make GNOME panel dependency optional
    
    Fixes https://bugzilla.gnome.org/show_bug.cgi?id=603423

 Tomboy/Makefile.am |   15 +++++++++++++--
 Tomboy/Tomboy.cs   |   21 +++++++++++++--------
 configure.in       |   45 ++++++++++++++++++++++++++++++---------------
 data/Makefile.am   |    2 ++
 4 files changed, 58 insertions(+), 25 deletions(-)
---
diff --git a/Tomboy/Makefile.am b/Tomboy/Makefile.am
index faa4249..34d7bdd 100644
--- a/Tomboy/Makefile.am
+++ b/Tomboy/Makefile.am
@@ -40,8 +40,10 @@ WIN_LIBS =					\
 	-r:System.Windows.Forms.dll
 endif
 
+PANELAPPLET_CSFILES =					\
+	$(srcdir)/Applet.cs
+
 GNOME_CSFILES =					\
-	$(srcdir)/Applet.cs 			\
 	$(srcdir)/GConfPreferencesClient.cs	\
 	$(srcdir)/GnomeApplication.cs		\
 	$(srcdir)/GnomeFactory.cs		\
@@ -49,6 +51,11 @@ GNOME_CSFILES =					\
 	$(srcdir)/XKeybinder.cs			\
 	$(srcdir)/gtk-sharp-beans/*.cs
 
+if ENABLE_PANEL_APPLET
+PANEL_APPLET_CSFLAGS = -define:PANEL_APPLET
+PANELAPPLET_USED_CSFILES = $(PANELAPPLET_CSFILES)
+endif
+
 if ENABLE_GNOME
 DBUS_CSFLAGS = -define:ENABLE_DBUS
 DBUS_USED_CSFILES = $(DBUS_CSFILES)
@@ -72,6 +79,7 @@ CSFLAGS = 				\
 	$(DBUS_CSFLAGS) 		\
 	$(OSX_CSFLAGS) 		\
 	$(WIN_CSFLAGS) 		\
+	$(PANEL_APPLET_CSFLAGS)		\
 	$(FIXED_GTKSPELL_CSFLAGS) \
 	$(HAS_GTK_2_16_FLAGS) \
 	$(CSC_DEFINES)
@@ -166,7 +174,10 @@ tomboylibdir = $(pkglibdir)
 tomboylib_DATA = $(TARGET) $(TARGET).config $(TARGET).mdb
 
 
-bin_SCRIPTS = $(WRAPPER) $(PANEL_WRAPPER)
+bin_SCRIPTS = $(WRAPPER)
+if ENABLE_PANEL_APPLET
+bin_SCRIPTS += $(PANEL_WRAPPER)
+endif
 
 $(WRAPPER): $(srcdir)/$(WRAPPER).in Makefile
 	sed -e "s|\ prefix\@|$(prefix)|g" 		\
diff --git a/Tomboy/Tomboy.cs b/Tomboy/Tomboy.cs
index 3028011..678bd17 100644
--- a/Tomboy/Tomboy.cs
+++ b/Tomboy/Tomboy.cs
@@ -4,9 +4,7 @@ using System.IO;
 using System.Xml;
 using Mono.Unix;
 
-#if !WIN32 && !MAC
 using Gnome;
-#endif
 
 using Tomboy.Sync;
 
@@ -72,7 +70,11 @@ namespace Tomboy
 			}
 
 			Logger.LogLevel = debugging ? Level.DEBUG : Level.INFO;
+#if PANEL_APPLET
 			is_panel_applet = cmd_line.UsePanelApplet;
+#else
+			is_panel_applet = false;
+#endif
 
 			// NOTE: It is important not to use the Preferences
 			//       class before this call.
@@ -132,6 +134,7 @@ namespace Tomboy
 				return false;
 			});
 
+#if PANEL_APPLET
 			if (is_panel_applet) {
 				tray_icon_showing = true;
 
@@ -142,13 +145,13 @@ namespace Tomboy
 				RegisterPanelAppletFactory ();
 				Logger.Log ("All done.  Ciao!");
 				Exit (0);
-			} else {
-				RegisterSessionManagerRestart (
-				        Environment.GetEnvironmentVariable ("TOMBOY_WRAPPER_PATH"),
-				        args,
-				        new string [] { "TOMBOY_PATH=" + note_path  }); // TODO: Pass along XDG_*?
-				StartTrayIcon ();
 			}
+#endif
+			RegisterSessionManagerRestart (
+			        Environment.GetEnvironmentVariable ("TOMBOY_WRAPPER_PATH"),
+			        args,
+			        new string [] { "TOMBOY_PATH=" + note_path  }); // TODO: Pass along XDG_*?
+			StartTrayIcon ();
 
 			Logger.Log ("All done.  Ciao!");
 		}
@@ -175,8 +178,10 @@ namespace Tomboy
 		{
 			// This will block if there is no existing instance running
 #if !WIN32 && !MAC
+#if PANEL_APPLET
 			PanelAppletFactory.Register (typeof (TomboyApplet));
 #endif
+#endif
 		}
 
 		static void StartTrayIcon ()
diff --git a/configure.in b/configure.in
index 54b5c14..be3bba7 100644
--- a/configure.in
+++ b/configure.in
@@ -147,14 +147,20 @@ else
 	ENABLE_GNOME="no"
 fi
 AM_CONDITIONAL(ENABLE_GNOME, test "x$ENABLE_GNOME" != "xno")
-	
 
+#
+# Check for GNOME Panel Support
+#
+AC_ARG_ENABLE(panel-applet,
+	      [  --enable-panel-applet[[=no/yes]]    compile with GNOME Panel support [[default: no]]],
+	      ENABLE_PANEL_APPLET="$enableval", ENABLE_PANEL_APPLET="no")
+AM_CONDITIONAL(ENABLE_PANEL_APPLET, test "x$ENABLE_PANEL_APPLET" = "xyes")
 
 #
 # Use DBus to export our remote control if available.
 #
 
-AC_ARG_WITH(dbus_service_dir, [  --with-dbus-service-dir=DIR            Where to install Tomboy's DBus service file.])
+AC_ARG_WITH(dbus_service_dir, [  --with-dbus-service-dir=DIR            Where to install Tomboys DBus service file.])
 AM_CONDITIONAL(WITH_DBUS_SERVICE_DIR, test "x$with_dbus_service_dir" != "x")
 if test "x$with_dbus_service_dir" != "x"; then
 	DBUS_SERVICE_DIR=$with_dbus_service_dir
@@ -182,11 +188,18 @@ PKG_CHECK_MODULES(MONO_ADDINS, mono-addins >= 0.3 \
 GTKSHARP2_MINIMUM_VERSION=2.10.1
 GNOMESHARP_MINIMUM_VERSION=2.24
 if test "x$ENABLE_GNOME" != "xno"; then
-	PKG_CHECK_MODULES(GNOME,
-		          gnome-sharp-2.0 >= $GNOMESHARP_MINIMUM_VERSION
-		          gconf-sharp-2.0
-		          gconf-sharp-peditors-2.0
-		          gnome-panel-sharp-2.24)
+	if test "x$ENABLE_PANEL_APPLET" != "xno"; then
+		PKG_CHECK_MODULES(GNOME,
+				  gnome-sharp-2.0 >= $GNOMESHARP_MINIMUM_VERSION
+				  gconf-sharp-2.0
+				  gconf-sharp-peditors-2.0
+				  gnome-panel-sharp-2.24)
+	else
+		PKG_CHECK_MODULES(GNOME,
+				  gnome-sharp-2.0 >= $GNOMESHARP_MINIMUM_VERSION
+				  gconf-sharp-2.0
+				  gconf-sharp-peditors-2.0)
+	fi
 fi
 AC_SUBST(GNOME_LIBS)
 
@@ -353,17 +366,19 @@ po/Makefile.in
 echo "
 ${PACKAGE}-${VERSION}
 
-    Install Prefix:    ${prefix}
+    Install Prefix:             ${prefix}
+
+    GNOME Support:              ${ENABLE_GNOME}
+    Mac OS X Support:           ${ENABLE_OSX}
+    Windows Support:            ${ENABLE_WIN}
 
-    GNOME Support:     ${ENABLE_GNOME}
-    Mac OS X Support:  ${ENABLE_OSX}
-    Windows Support:   ${ENABLE_WIN}
+    D-Bus Support:              ${ENABLE_DBUS}
 
-    D-Bus Support:     ${ENABLE_DBUS}
+    GNOME Panel Applet Support: ${ENABLE_PANEL_APPLET}
 
-    Evolution Add-in:  ${ENABLE_EVOLUTION}
-    Galago Add-in:     ${ENABLE_GALAGO}
-    Sketching Add-in:  ${ENABLE_SKETCHING}
+    Evolution Add-in:           ${ENABLE_EVOLUTION}
+    Galago Add-in:              ${ENABLE_GALAGO}
+    Sketching Add-in:           ${ENABLE_SKETCHING}
 "
 
 
diff --git a/data/Makefile.am b/data/Makefile.am
index 45ae0b6..86c1628 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -38,6 +38,7 @@ $(dbusservice_DATA): $(dbusservice_in_files) Makefile
 	    < $< > $@
 
 
+if ENABLE_PANEL_APPLET
 serverdir       = $(PANELAPPLET_SERVER_DIR)
 server_in_files = GNOME_TomboyApplet.server.in
 server_DATA     = $(server_in_files:.server.in=.server)
@@ -46,6 +47,7 @@ $(server_in_files): $(server_in_files:.server.in=.server.in.in) Makefile
 	sed -e "s|\ bindir\@|$(bindir)|g"	\
 	    -e "s|\ wrapper\@|tomboy-panel|g"		\
 	    < $< > $@
+endif
 
 @INTLTOOL_SERVER_RULE@
 



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