f-spot r4544 - in trunk: . src src/Platform/Gnome src/Platform/Null src/Utils



Author: sdelcroix
Date: Tue Oct 28 13:56:44 2008
New Revision: 4544
URL: http://svn.gnome.org/viewvc/f-spot?rev=4544&view=rev

Log:
2008-10-22  Stephane Delcroix  <sdelcroix novell com>

	* src/Makefile.am
	* src/Platform/Gnome/ScreenSaver.cs:
	* src/Platform/Null/ScreenSaver.cs: move the Screensaver code from
	Utils/ to Platform/, stub an empty NullScreensaver

	* src/FullScreenView.cs: namespace changes for the moved ScreenSaver

Added:
   trunk/src/Platform/Gnome/ScreenSaver.cs
      - copied, changed from r4543, /trunk/src/Utils/ScreenSaver.cs
   trunk/src/Platform/Null/ScreenSaver.cs
Removed:
   trunk/src/Utils/ScreenSaver.cs
Modified:
   trunk/ChangeLog
   trunk/src/FullScreenView.cs
   trunk/src/Makefile.am

Modified: trunk/src/FullScreenView.cs
==============================================================================
--- trunk/src/FullScreenView.cs	(original)
+++ trunk/src/FullScreenView.cs	Tue Oct 28 13:56:44 2008
@@ -310,12 +310,12 @@
 		public bool PlayPause ()
 		{
 			if (notebook.CurrentPage == 0) {
-				FSpot.Utils.ScreenSaver.Inhibit ("Running slideshow mode");
+				FSpot.Platform.ScreenSaver.Inhibit ("Running slideshow mode");
 				notebook.CurrentPage = 1;
 				play_pause_button.IconName = "media-playback-pause";
 				display.Start ();
 			} else {
-				FSpot.Utils.ScreenSaver.UnInhibit ();
+				FSpot.Platform.ScreenSaver.UnInhibit ();
 				notebook.CurrentPage = 0;
 				play_pause_button.IconName = "media-playback-start";
 				display.Stop ();
@@ -326,7 +326,7 @@
 		public void Quit ()
 		{
 			hide_cursor_delay.Stop ();
-			FSpot.Utils.ScreenSaver.UnInhibit ();
+			FSpot.Platform.ScreenSaver.UnInhibit ();
 
 			this.Destroy ();
 		}

Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am	(original)
+++ trunk/src/Makefile.am	Tue Oct 28 13:56:44 2008
@@ -54,8 +54,7 @@
 	$(srcdir)/Utils/GtkUtil.cs		\
 	$(srcdir)/Utils/Log.cs			\
 	$(srcdir)/Utils/Unix.cs			\
-	$(srcdir)/Utils/UriUtils.cs		\
-	$(srcdir)/Utils/ScreenSaver.cs
+	$(srcdir)/Utils/UriUtils.cs
 
 JOBSCHEDULER_CSDISTFILES =				\
 	$(srcdir)/JobScheduler/FSpotCompat.cs		\
@@ -77,10 +76,12 @@
 
 GNOME_PLATFORM_CSDISTFILES =				\
 	$(srcdir)/Platform/Gnome/PreferenceBackend.cs	\
+	$(srcdir)/Platform/Gnome/ScreenSaver.cs		\
 	$(srcdir)/Platform/Gnome/ThumbnailFactory.cs
 
 NULL_PLATFORM_CSDISTFILES =				\
-	$(srcdir)/Platform/Null/PreferenceBackend.cs
+	$(srcdir)/Platform/Null/PreferenceBackend.cs	\
+	$(srcdir)/Platform/Null/ScreenSaver.cs
 
 F_SPOT_CSDISTFILES =				\
 	$(srcdir)/AsyncPixbufLoader.cs		\
@@ -319,6 +320,10 @@
 	-pkg:gnome-sharp-2.0			\
 	-pkg:gtk-sharp-2.0			\
 	-pkg:gconf-sharp-2.0			\
+	$(LINK_DBUS)				\
+	-r:FSpot.Utils.dll
+
+NULL_PLATFORM_ASSEMBLIES =			\
 	-r:FSpot.Utils.dll
 
 F_SPOT_ASSEMBLIES = 				\

Copied: trunk/src/Platform/Gnome/ScreenSaver.cs (from r4543, /trunk/src/Utils/ScreenSaver.cs)
==============================================================================
--- /trunk/src/Utils/ScreenSaver.cs	(original)
+++ trunk/src/Platform/Gnome/ScreenSaver.cs	Tue Oct 28 13:56:44 2008
@@ -1,5 +1,5 @@
 /*
- * FSpot.Utils.ScreenSaver.cs
+ * FSpot.Platform.Gnome.ScreenSaver.cs
  *
  * Author(s)
  * 	Stephane Delcroix  <stephane delcroix org>
@@ -13,7 +13,9 @@
 
 using NDesk.DBus;
 
-namespace FSpot.Utils
+using FSpot.Utils;
+
+namespace FSpot.Platform
 {
 	[Interface ("org.gnome.ScreenSaver")]
 	public interface IScreenSaver
@@ -41,13 +43,13 @@
 			if (inhibited)
 				return cookie;
 
-			Log.Information ("Inhibit screensaver for slideshow");
+			Log.Information ("Inhibit screensaver for {0}", reason);
 			try {
 				cookie = GnomeScreenSaver.Inhibit ("f-spot", reason);
 				inhibited = true;
 			} catch (Exception ex) {
 				Log.Exception ("Error Inhibiting the screenserver", ex);
-			}	
+			}
 			return cookie;
 		}
 

Added: trunk/src/Platform/Null/ScreenSaver.cs
==============================================================================
--- (empty file)
+++ trunk/src/Platform/Null/ScreenSaver.cs	Tue Oct 28 13:56:44 2008
@@ -0,0 +1,27 @@
+/*
+ * FSpot.Platform.Null.ScreenSaver.cs
+ *
+ * Author(s)
+ * 	Stephane Delcroix  <stephane delcroix org>
+ *
+ * This is free software. See COPYING for details.
+ */
+
+using System;
+
+using FSpot.Utils;
+
+namespace FSpot.Platform
+{
+	public static class ScreenSaver
+	{
+		public static uint Inhibit (string reason ) {
+			Log.Debug ("No way to inhibit screensaver on this platform (Null Platform)");
+			return 1;
+		}
+
+		public static void UnInhibit () {
+			Log.Debug ("No way to uninhibit screensaver on this platform (Null Platform)");
+		}
+	}
+}



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