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



Author: sdelcroix
Date: Fri Jan 18 15:35:56 2008
New Revision: 3575
URL: http://svn.gnome.org/viewvc/f-spot?rev=3575&view=rev

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

	* src/Makefile.am: compiling Cms.dll FSpot.Utils as separate
	assemblies.

	* src/Global.cs: moving some bits elsewhere, ModifyColors in GtkUtil,

	* PreferenceDialog.cs:
	* Global.cs:
	* ImportCommand.cs:
	* main.cs:
	* SingleView.cs:
	* PhotoView.cs:
	* Utils/GtkUtil.cs: minor changes related to the previous ones.


Added:
   trunk/src/Cms.dll.config
Modified:
   trunk/ChangeLog
   trunk/src/Global.cs
   trunk/src/ImportCommand.cs
   trunk/src/Makefile.am
   trunk/src/PhotoView.cs
   trunk/src/PreferenceDialog.cs
   trunk/src/SingleView.cs
   trunk/src/Utils/GtkUtil.cs
   trunk/src/main.cs

Added: trunk/src/Cms.dll.config
==============================================================================
--- (empty file)
+++ trunk/src/Cms.dll.config	Fri Jan 18 15:35:56 2008
@@ -0,0 +1,4 @@
+<configuration>
+  <dllmap dll="liblcms-1.0.0.dll" target="liblcms.so.1"/>
+</configuration>
+

Modified: trunk/src/Global.cs
==============================================================================
--- trunk/src/Global.cs	(original)
+++ trunk/src/Global.cs	Fri Jan 18 15:35:56 2008
@@ -19,36 +19,10 @@
 			set { base_dir = value; }
 		}
 
-		private static string photo_directory = (string) Preferences.Get(Preferences.STORAGE_PATH);
+		private static string photo_directory;
 		public static string PhotoDirectory {
-			get {
-				return photo_directory;
-			}
-			set {
-				photo_directory = value;
-			}
-		}
-
-		public static bool CustomPhotoDirectory {
-			get {
-				return photo_directory != (string)Preferences.Get(Preferences.STORAGE_PATH);
-			}
-		}
-
-		public static void ModifyColors (Gtk.Widget widget)
-		{
-			try {
-				widget.ModifyFg (Gtk.StateType.Normal, widget.Style.TextColors [(int)Gtk.StateType.Normal]);
-				widget.ModifyFg (Gtk.StateType.Active, widget.Style.TextColors [(int)Gtk.StateType.Active]);
-				widget.ModifyFg (Gtk.StateType.Selected, widget.Style.TextColors [(int)Gtk.StateType.Selected]);
-				widget.ModifyBg (Gtk.StateType.Normal, widget.Style.BaseColors [(int)Gtk.StateType.Normal]);
-				widget.ModifyBg (Gtk.StateType.Active, widget.Style.BaseColors [(int)Gtk.StateType.Active]);
-				widget.ModifyBg (Gtk.StateType.Selected, widget.Style.BaseColors [(int)Gtk.StateType.Selected]);
-				
-			} catch {
-				widget.ModifyFg (Gtk.StateType.Normal, widget.Style.Black);
-				widget.ModifyBg (Gtk.StateType.Normal, widget.Style.Black);
-			}
+			get { return photo_directory; }
+			set { photo_directory = value; }
 		}
 
 		public static string HelpDirectory {

Modified: trunk/src/ImportCommand.cs
==============================================================================
--- trunk/src/ImportCommand.cs	(original)
+++ trunk/src/ImportCommand.cs	Fri Jan 18 15:35:56 2008
@@ -619,9 +619,9 @@
 		photo_scrolled.SetSizeRequest (200, 200);
 		photo_view.Show ();
 
-		//FSpot.Global.ModifyColors (frame_eventbox);
-		FSpot.Global.ModifyColors (photo_scrolled);
-		FSpot.Global.ModifyColors (photo_view);
+		//GtkUtil.ModifyColors (frame_eventbox);
+		GtkUtil.ModifyColors (photo_scrolled);
+		GtkUtil.ModifyColors (photo_view);
 
 		photo_view.Pixbuf = FSpot.Global.IconTheme.LoadIcon ("f-spot", 48, (Gtk.IconLookupFlags)0);
 		photo_view.Fit = true;

Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am	(original)
+++ trunk/src/Makefile.am	Fri Jan 18 15:35:56 2008
@@ -1,6 +1,14 @@
 include $(top_srcdir)/Makefile.include
 EXTRAFLAGS = -unsafe -nowarn:0169 -nowarn:0612 -nowarn:0414 -d:TEST_METADATA -d:BROKEN_RSVG $(NUNIT_DEFINES) $(BEAGLE_DEFINES) $(CSC_DEFINES)
 
+UTILS_CSDISTFILES =				\
+	$(srcdir)/Utils/GtkUtil.cs		\
+	$(srcdir)/Utils/ScreenSaver.cs
+
+CMS_CSDISTFILES =				\
+	$(srcdir)/Cms/Cms.cs			\
+	$(srcdir)/Cms/CctTable.cs
+
 F_SPOT_CSDISTFILES =				\
 	$(srcdir)/Cairo/Antialias.cs		\
 	$(srcdir)/Cairo/Cairo.cs		\
@@ -46,8 +54,6 @@
 	$(srcdir)/Cairo/Win32Surface.cs		\
 	$(srcdir)/Cairo/XcbSurface.cs		\
 	$(srcdir)/Cairo/XlibSurface.cs		\
-	$(srcdir)/Cms/Cms.cs			\
-	$(srcdir)/Cms/CctTable.cs		\
 	$(srcdir)/AsyncPixbufLoader.cs		\
 	$(srcdir)/BeagleNotifier.cs		\
 	$(srcdir)/BlockProcessor.cs		\
@@ -214,8 +220,6 @@
 	$(srcdir)/Unix.cs			\
 	$(srcdir)/Updater.cs			\
 	$(srcdir)/UriCollection.cs		\
-	$(srcdir)/Utils/GtkUtil.cs		\
-	$(srcdir)/Utils/ScreenSaver.cs		\
 	$(srcdir)/Util.cs			\
 	$(srcdir)/Vector.cs			\
 	$(srcdir)/ThumbnailCommand.cs		\
@@ -252,7 +256,15 @@
 	$(srcdir)/XmpTagsImporter.cs		\
 	$(srcdir)/main.cs
 
-ASSEMBLIES = \
+UTILS_ASSEMBLIES =				\
+	-pkg:gtk-sharp-2.0			\
+	$(LINK_DBUS)
+
+CMS_ASSEMBLIES = 				\
+	$(NUNIT_PKG)				\
+	-pkg:gtk-sharp-2.0
+
+F_SPOT_ASSEMBLIES = 				\
 	$(LINK_DBUS)				\
 	$(LINK_GPHOTO2)				\
 	$(LINK_MONO_ADDINS)			\
@@ -270,6 +282,8 @@
 	-r:Mono.Posix				\
 	-r:Mono.Security			\
 	-r:ICSharpCode.SharpZipLib		\
+	-r:FSpot.Utils.dll			\
+	-r:Cms.dll				\
 	$(NUNIT_PKG)				\
 	-pkg:gtkhtml-sharp-2.0			\
 	-pkg:glade-sharp-2.0			\
@@ -289,25 +303,39 @@
 
 fspotlibdir = $(libdir)/f-spot
 fspotlib_DATA = f-spot.exe.config	\
-		f-spot.exe		
+		f-spot.exe		\
+		Cms.dll.config		\
+		Cms.dll			\
+		FSpot.Utils.dll
 
 bin_SCRIPTS = f-spot
 
+UTILS_CSFILES = $(UTILS_CSDISTFILES)
+CMS_CSFILES = $(CMS_CSDISTFILES)
+
 F_SPOT_CSFILES = $(F_SPOT_CSDISTFILES)	\
 	Defines.cs			\
 	AssemblyInfo.cs
 
-f-spot.exe: $(F_SPOT_CSFILES) f-spot.glade dces.rdf FSpot.addin.xml
-	$(CSC) -target:winexe -out:$@ $(EXTRAFLAGS) $(F_SPOT_CSFILES) $(ASSEMBLIES) $(RESOURCES)
+Cms.dll: $(CMS_CSFILES)
+	$(CSC) -target:library -out:$@ $(EXTRAFLAGS) $(CMS_CSFILES) $(CMS_ASSEMBLIES)
+
+FSpot.Utils.dll: $(UTILS_CSFILES)
+	$(CSC) -target:library -out:$@ $(EXTRAFLAGS) $(UTILS_CSFILES) $(UTILS_ASSEMBLIES)
+
+f-spot.exe: $(F_SPOT_CSFILES) f-spot.glade dces.rdf FSpot.addin.xml FSpot.Utils.dll Cms.dll
+	$(CSC) -target:winexe -out:$@ $(EXTRAFLAGS) $(F_SPOT_CSFILES) $(F_SPOT_ASSEMBLIES) $(RESOURCES)
 
 all: f-spot.exe
 
 EXTRA_DIST =					\
+	$(UTILS_CSDISTFILES)			\
 	$(F_SPOT_CSDISTFILES)			\
 	dces.rdf				\
 	f-spot.exe.config.in			\
 	f-spot.glade				\
 	f-spot.in				\
+	Cms.dll.config				\
 	FSpot.addin.xml
 
 

Modified: trunk/src/PhotoView.cs
==============================================================================
--- trunk/src/PhotoView.cs	(original)
+++ trunk/src/PhotoView.cs	Fri Jan 18 15:35:56 2008
@@ -593,10 +593,10 @@
 
 	private void SetColors ()
 	{
-		FSpot.Global.ModifyColors (tag_view);
-		FSpot.Global.ModifyColors (photo_view);
-		FSpot.Global.ModifyColors (background);
-		FSpot.Global.ModifyColors (photo_view_scrolled);
+		GtkUtil.ModifyColors (tag_view);
+		GtkUtil.ModifyColors (photo_view);
+		GtkUtil.ModifyColors (background);
+		GtkUtil.ModifyColors (photo_view_scrolled);
 	}
 
 	protected override void OnStyleSet (Style previous)

Modified: trunk/src/PreferenceDialog.cs
==============================================================================
--- trunk/src/PreferenceDialog.cs	(original)
+++ trunk/src/PreferenceDialog.cs	Fri Jan 18 15:35:56 2008
@@ -43,7 +43,7 @@
 			LoadPreference (Preferences.METADATA_EMBED_IN_IMAGE);
 			LoadPreference (Preferences.SCREENSAVER_TAG);
 			LoadPreference (Preferences.GNOME_SCREENSAVER_THEME);
-			if (!Global.CustomPhotoDirectory) {
+			if (Global.PhotoDirectory == (string)Preferences.Get(Preferences.STORAGE_PATH)) {
 				photosdir_chooser.CurrentFolderChanged += HandlePhotosdirChanged;
 				photosdir_chooser.SetCurrentFolder (Global.PhotoDirectory);
 			} else {

Modified: trunk/src/SingleView.cs
==============================================================================
--- trunk/src/SingleView.cs	(original)
+++ trunk/src/SingleView.cs	Fri Jan 18 15:35:56 2008
@@ -112,8 +112,8 @@
 			ThumbnailGenerator.Default.OnPixbufLoaded += delegate { directory_view.QueueDraw (); };
 
 			image_view = new PhotoImageView (collection);
-			FSpot.Global.ModifyColors (image_view);
-			FSpot.Global.ModifyColors (image_scrolled);
+			GtkUtil.ModifyColors (image_view);
+			GtkUtil.ModifyColors (image_scrolled);
 			image_view.ZoomChanged += HandleZoomChanged;
 			image_view.Item.Changed += HandleItemChanged;
 			image_view.ButtonPressEvent += HandleImageViewButtonPressEvent;

Modified: trunk/src/Utils/GtkUtil.cs
==============================================================================
--- trunk/src/Utils/GtkUtil.cs	(original)
+++ trunk/src/Utils/GtkUtil.cs	Fri Jan 18 15:35:56 2008
@@ -12,7 +12,7 @@
 
 namespace FSpot.Utils
 {
-	class GtkUtil {
+	public class GtkUtil {
 		public static Gtk.MenuItem MakeMenuItem (Gtk.Menu menu, string l, EventHandler e)
 		{
 			return MakeMenuItem (menu, l, e, true);
@@ -96,5 +96,22 @@
 				}
 			}	
 		}
+
+		public static void ModifyColors (Gtk.Widget widget)
+		{
+			try {
+				widget.ModifyFg (Gtk.StateType.Normal, widget.Style.TextColors [(int)Gtk.StateType.Normal]);
+				widget.ModifyFg (Gtk.StateType.Active, widget.Style.TextColors [(int)Gtk.StateType.Active]);
+				widget.ModifyFg (Gtk.StateType.Selected, widget.Style.TextColors [(int)Gtk.StateType.Selected]);
+				widget.ModifyBg (Gtk.StateType.Normal, widget.Style.BaseColors [(int)Gtk.StateType.Normal]);
+				widget.ModifyBg (Gtk.StateType.Active, widget.Style.BaseColors [(int)Gtk.StateType.Active]);
+				widget.ModifyBg (Gtk.StateType.Selected, widget.Style.BaseColors [(int)Gtk.StateType.Selected]);
+				
+			} catch {
+				widget.ModifyFg (Gtk.StateType.Normal, widget.Style.Black);
+				widget.ModifyBg (Gtk.StateType.Normal, widget.Style.Black);
+			}
+		}
+
 	}
 }	

Modified: trunk/src/main.cs
==============================================================================
--- trunk/src/main.cs	(original)
+++ trunk/src/main.cs	Fri Jan 18 15:35:56 2008
@@ -43,6 +43,8 @@
 		bool view = false;
 		bool slideshow = false;
 		string import_uri = null;
+		
+		FSpot.Global.PhotoDirectory = (string) Preferences.Get(Preferences.STORAGE_PATH);
 
 		for (int i = 0; i < args.Length && !shutdown; i++) {
 			switch (args [i]) {



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