banshee r3423 - in trunk/banshee: . build build/m4/banshee src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea



Author: abock
Date: Tue Mar 11 22:13:05 2008
New Revision: 3423
URL: http://svn.gnome.org/viewvc/banshee?rev=3423&view=rev

Log:
2008-03-11  Aaron Bockover  <abock gnome org>

    * build/build.rules.mk:
    * build/m4/banshee/gtk-sharp.m4:
    * configure.ac: Check for Gtk# 2.10 or better and define HAVE_GTK_2_10
    on all the assemblies; this will allow the build to succeed on Gtk# 2.8

    * src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/GtkNotificationAreaBox.cs:
    Do not build if we don't HAVE_GTK_2_10, since GtkStatusIcon was introduced
    in that version; we only use GtkStatusIcon as a fallback if we are not
    running on X11/Unix anyway (i.e. it's mainly used for Windows)

    * src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/NotificationAreaService.cs:
    Do not try to instantiate GtkNotificationAreaBox if we don't HAVE_GTK_2_10;
    and since now we are not guaranteed to have some sort of
    INotificationAreaBox, properly dispose the notification area service
    if we never get a reference to one (i.e. running on not X11/Unix and
    not Gtk# 2.10+)



Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/build/build.rules.mk
   trunk/banshee/build/m4/banshee/gtk-sharp.m4
   trunk/banshee/configure.ac
   trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/GtkNotificationAreaBox.cs
   trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/NotificationAreaService.cs

Modified: trunk/banshee/build/build.rules.mk
==============================================================================
--- trunk/banshee/build/build.rules.mk	(original)
+++ trunk/banshee/build/build.rules.mk	Tue Mar 11 22:13:05 2008
@@ -33,7 +33,7 @@
 	test "x$$colors" = "xyes" && \
 		echo -e "\033[1mCompiling $(notdir $@)...\033[0m" || \
 		echo "Compiling $(notdir $@)...";
-	@test "x$(HAVE_MONO_1_2_6)" = "xyes" && warn="-warnaserror"; $(BUILD) -target:$(TARGET) -out:$@ $$warn $(LINK) $(RESOURCES_BUILD) $(SOURCES_BUILD)
+	@test "x$(HAVE_MONO_1_2_4)" = "xyes" && warn="-warnaserror"; test "x$(HAVE_GTK_2_10)" = "xyes" && gtk_210="-define:HAVE_GTK_2_10"; $(BUILD) -target:$(TARGET) -out:$@ $$warn $$gtk_210 $(LINK) $(RESOURCES_BUILD) $(SOURCES_BUILD)
 	@if [ -e $(notdir $  config) ]; then \
 		cp $(notdir $  config) $(top_builddir)/bin; \
 	fi;

Modified: trunk/banshee/build/m4/banshee/gtk-sharp.m4
==============================================================================
--- trunk/banshee/build/m4/banshee/gtk-sharp.m4	(original)
+++ trunk/banshee/build/m4/banshee/gtk-sharp.m4	Tue Mar 11 22:13:05 2008
@@ -11,6 +11,10 @@
 		glib-sharp-2.0 >= $GTKSHARP_REQUIRED)
 	AC_SUBST(GLIBSHARP_LIBS)
 
+	PKG_CHECK_MODULES(GTKSHARP_VERSION, gtk-sharp-2.0 >= 2.10, 
+        HAVE_GTK_2_10=yes, HAVE_GTK_2_10=no)
+	AC_SUBST(HAVE_GTK_2_10)
+
 	PKG_CHECK_MODULES(GCONFSHARP,
 		gconf-sharp-2.0 >= $GTKSHARP_REQUIRED)
 	AC_SUBST(GCONFSHARP_LIBS)

Modified: trunk/banshee/configure.ac
==============================================================================
--- trunk/banshee/configure.ac	(original)
+++ trunk/banshee/configure.ac	Tue Mar 11 22:13:05 2008
@@ -51,8 +51,8 @@
 	ICSharpCode.SharpZipLib
 ])
 
-HAVE_MONO_1_2_6=$HAVE_MONO_MODULE
-AC_SUBST(HAVE_MONO_1_2_6)
+HAVE_MONO_1_2_4=$HAVE_MONO_MODULE
+AC_SUBST(HAVE_MONO_1_2_4)
 
 dnl NDesk DBus libraries
 BANSHEE_CHECK_NDESK_DBUS
@@ -168,7 +168,8 @@
     C Compiler:        ${CC}
     Mono C# Compiler:  ${MCS}
     Mono Runtime:      ${MONO}
-    Mono >= 1.2.6:     ${HAVE_MONO_1_2_6}
+    Mono >= 1.2.4:     ${HAVE_MONO_1_2_4}
+    Gtk# >= 2.10:      ${HAVE_GTK_2_10}
 "
 #    Digital Audio Players (DAP):
 #      iPod:            ${enable_ipodsharp}

Modified: trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/GtkNotificationAreaBox.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/GtkNotificationAreaBox.cs	(original)
+++ trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/GtkNotificationAreaBox.cs	Tue Mar 11 22:13:05 2008
@@ -26,6 +26,8 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
+#if HAVE_GTK_2_10
+
 using System;
 using Mono.Unix;
 using Gtk;
@@ -72,3 +74,6 @@
         }
     }
 }
+
+#endif
+

Modified: trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/NotificationAreaService.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/NotificationAreaService.cs	(original)
+++ trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/NotificationAreaService.cs	Tue Mar 11 22:13:05 2008
@@ -52,9 +52,10 @@
         private GtkElementsService elements_service;
         private InterfaceActionService interface_action_service;
         private ArtworkManager artwork_manager_service;
-    
+        private bool disposed;
+        
         private Menu menu;
-		private RatingMenuItem rating_menu_item;
+        private RatingMenuItem rating_menu_item;
         private BansheeActionGroup actions;
         private uint ui_manager_id;
         
@@ -98,7 +99,11 @@
             Initialize ();
             
             ServiceManager.ServiceStarted -= OnServiceStarted;
-            BuildNotificationArea ();
+            if (!BuildNotificationArea ()) {
+                Hyena.Log.Warning ("No available notification area drivers could be found.", false);
+                Dispose ();
+                return false;
+            }
             
             return true;
         }
@@ -142,6 +147,10 @@
         
         public void Dispose ()
         {
+            if (disposed) {
+                return;
+            }
+            
             if (current_nf != null) {
                 current_nf.Close ();
             }
@@ -160,9 +169,11 @@
             
             elements_service = null;
             interface_action_service = null;
+            
+            disposed = true;
         }
         
-        private void BuildNotificationArea () 
+        private bool BuildNotificationArea () 
         {
             if (Environment.OSVersion.Platform == PlatformID.Unix) {
                 try {
@@ -172,7 +183,13 @@
             }
             
             if (notif_area == null) {
+                #if HAVE_GTK_2_10
                 notif_area = new GtkNotificationAreaBox (elements_service.PrimaryWindow);
+                #endif
+            }
+            
+            if (notif_area == null) {
+                return false;
             }
             
             notif_area.Disconnected += OnNotificationAreaDisconnected;
@@ -182,6 +199,8 @@
             if (!QuitOnCloseSchema.Get ()) {
                 RegisterCloseHandler ();
             }
+            
+            return true;
         }
         
         private void RegisterCloseHandler ()



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