f-spot r3606 - in trunk: . src src/Utils



Author: sdelcroix
Date: Tue Jan 29 16:24:44 2008
New Revision: 3606
URL: http://svn.gnome.org/viewvc/f-spot?rev=3606&view=rev

Log:
2008-01-29  Stephane Delcroix  <sdelcroix novell com>

	* src/MainWindow.cs:
	* src/SingleView.cs:
	* src/Preferences.cs:
	* src/Utils/GnomeUtil.cs: move SetBackgroundImage in GnomeUtil

	* configure.in: cleaning job

	* src/Makefile.am:
	* src/GConfPreferenceBackend.cs: #if out the parts required by 
	gconf-sharp


Modified:
   trunk/ChangeLog
   trunk/configure.in
   trunk/src/GConfPreferenceBackend.cs
   trunk/src/MainWindow.cs
   trunk/src/Makefile.am
   trunk/src/Preferences.cs
   trunk/src/SingleView.cs
   trunk/src/Utils/GnomeUtil.cs

Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in	(original)
+++ trunk/configure.in	Tue Jan 29 16:24:44 2008
@@ -82,23 +82,19 @@
 fi
 
 dnl - Choose PreferenceBackend (default to gconf)
-AC_ARG_ENABLE([gconf],
-        [AC_HELP_STRING([--disable-gconf],
-                        [build without gconf preference backend])],,
-        enable_gconf=yes)
-AM_CONDITIONAL(ENABLE_GCONF, test "x$enable_gconf" = "xyes")
+AC_ARG_ENABLE([gconf],[AC_HELP_STRING([--disable-gconf], [build without gconf preference backend])],,)
 
-if test "x$enable_gconf" = "xyes"; then
+AM_CONDITIONAL(NOGCONF, test "x$enable_gconf" = "xno")
+
+if test "x$enable_gconf" = "xno"; then
+  CSC_DEFINES="$CSC_DEFINES -d:NOGCONF"
+else
   PKG_CHECK_MODULES(GCONF_SHARP, gconf-sharp-2.0 >= $GTKSHARP_REQUIRED)
   if pkg-config --atleast-version=2.18 gconf-sharp-2.0; then
     CSC_DEFINES="$CSC_DEFINES -d:GCONF_SHARP_2_18"
   fi
-else
-  CSC_DEFINES="$CSC_DEFINES -d:NULLPREFERENCEBACKEND"
 fi
 
-
-
 AC_SUBST(CSC_DEFINES)
 
 PKG_CHECK_MODULES(BEAGLE, beagle-0.0 >= $BEAGLE_REQUIRED,

Modified: trunk/src/GConfPreferenceBackend.cs
==============================================================================
--- trunk/src/GConfPreferenceBackend.cs	(original)
+++ trunk/src/GConfPreferenceBackend.cs	Tue Jan 29 16:24:44 2008
@@ -7,6 +7,7 @@
  * This is free software. See COPYING for details.
  */
 
+#if !NOGCONF
 namespace FSpot
 {
 	public class GConfPreferenceBackend : IPreferenceBackend
@@ -44,3 +45,4 @@
 		}
 	}
 }
+#endif

Modified: trunk/src/MainWindow.cs
==============================================================================
--- trunk/src/MainWindow.cs	(original)
+++ trunk/src/MainWindow.cs	Tue Jan 29 16:24:44 2008
@@ -2507,12 +2507,14 @@
 
 	void HandleSetAsBackgroundCommand (object sender, EventArgs args)
 	{
+#if !NOGCONF
 		Photo current = CurrentPhoto;
 
 		if (current == null)
 			return;
 
-		Preferences.SetAsBackground (current.DefaultVersionUri.LocalPath);
+		GnomeUtil.SetBackgroundImage (current.DefaultVersionUri.LocalPath);
+#endif
 	}
 
 	void HandleSetDateRange (object sender, EventArgs args) {

Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am	(original)
+++ trunk/src/Makefile.am	Tue Jan 29 16:24:44 2008
@@ -263,10 +263,15 @@
 	$(srcdir)/XmpTagsImporter.cs		\
 	$(srcdir)/main.cs
 
+if !NOGCONF
+GCONF_PKG = -pkg:gconf-sharp-2.0
+endif
+
 UTILS_ASSEMBLIES =				\
 	-pkg:gtk-sharp-2.0			\
 	-pkg:gnome-sharp-2.0			\
 	-r:Mono.Posix				\
+	$(GCONF_PKG)				\
 	$(LINK_DBUS)
 
 CMS_ASSEMBLIES = 				\
@@ -300,14 +305,13 @@
 	-r:FSpot.Core.dll			\
 	-r:Cms.dll				\
 	$(NUNIT_PKG)				\
+	$(GCONF_PKG)				\
 	-pkg:gtkhtml-sharp-2.0			\
 	-pkg:glade-sharp-2.0			\
-	-pkg:gnome-vfs-sharp-2.0		\
-	-pkg:gconf-sharp-2.0
-
+	-pkg:gnome-vfs-sharp-2.0
 
 RESOURCES =										\
--resource:$(top_srcdir)/icons/f-spot-simple-white.css,f-spot-simple-white.css	\
+	-resource:$(top_srcdir)/icons/f-spot-simple-white.css,f-spot-simple-white.css	\
 	-resource:$(top_srcdir)/icons/f-spot-simple.css,f-spot-simple.css		\
 	-resource:$(top_srcdir)/icons/f-spot.js,f-spot.js				\
 	-resource:$(top_srcdir)/icons/f-spot-not.png,f-spot-not.png			\

Modified: trunk/src/Preferences.cs
==============================================================================
--- trunk/src/Preferences.cs	(original)
+++ trunk/src/Preferences.cs	Tue Jan 29 16:24:44 2008
@@ -115,7 +115,7 @@
 		private static IPreferenceBackend Backend {
 			get {
 				if (backend == null) {
-#if !NULLPREFERENCEBACKEND
+#if !NOGCONF
 					backend = new GConfPreferenceBackend ();
 #else
 					backend = new NullPreferenceBackend ();
@@ -258,16 +258,6 @@
 			}
 		}
 
-		public static void SetAsBackground (string path)
-		{
-			Set ("/desktop/gnome/background/color_shading_type", "solid");
-			Set ("/desktop/gnome/background/primary_color", "#000000");
-			Set ("/desktop/gnome/background/picture_options", "stretched");
-			Set ("/desktop/gnome/background/picture_opacity", 100);
-			Set ("/desktop/gnome/background/picture_filename", path);
-			Set ("/desktop/gnome/background/draw_background", true);
-		}
-
 		public static event NotifyChangedHandler SettingChanged;
 
 		static void OnSettingChanged (object sender, NotifyEventArgs args)

Modified: trunk/src/SingleView.cs
==============================================================================
--- trunk/src/SingleView.cs	(original)
+++ trunk/src/SingleView.cs	Tue Jan 29 16:24:44 2008
@@ -242,12 +242,14 @@
 
 		void HandleSetAsBackgroundCommand (object sender, EventArgs args)
 		{
+#if !NOGCONF
 			IBrowsableItem current = image_view.Item.Current;
 
 			if (current == null)
 				return;
 
-			Preferences.SetAsBackground (current.DefaultVersionUri.LocalPath);
+			GnomeUtil.SetBackgroundImage (current.DefaultVersionUri.LocalPath);
+#endif
 		}
 
 		private void HandleViewToolbar (object sender, System.EventArgs args)

Modified: trunk/src/Utils/GnomeUtil.cs
==============================================================================
--- trunk/src/Utils/GnomeUtil.cs	(original)
+++ trunk/src/Utils/GnomeUtil.cs	Tue Jan 29 16:24:44 2008
@@ -52,6 +52,18 @@
 						"completed successfully.");
 			}
 		}
-	
+
+#if !NOGCONF
+		public static void SetBackgroundImage (string path)
+		{
+			GConf.Client client = new GConf.Client (); 
+			client.Set ("/desktop/gnome/background/color_shading_type", "solid");
+			client.Set ("/desktop/gnome/background/primary_color", "#000000");
+			client.Set ("/desktop/gnome/background/picture_options", "stretched");
+			client.Set ("/desktop/gnome/background/picture_opacity", 100);
+			client.Set ("/desktop/gnome/background/picture_filename", path);
+			client.Set ("/desktop/gnome/background/draw_background", true);
+		}
+#endif	
 	}
 }



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