f-spot r3570 - in trunk: . src src/Utils src/Widgets



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

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

	* src/Util.cs:
	* src/Utils/GtkUtil.cs: move GtkUtil from Util.cs. Removed unused bits.

	* src/Widgets/Rating.cs:
	* src/PixbufUtils.cs:
	* src/Db.cs:
	* src/TagCommands.cs:
	* src/GroupSelector.cs:
	* src/Makefile.am:
	* src/TagQueryWidget.cs:
	* src/ImportCommand.cs:
	* src/Tag.cs:
	* src/main.cs:
	* src/MainWindow.cs:
	* src/SingleView.cs:
	* src/PhotoView.cs:
	* src/TagPopup.cs:
	* src/TagMenu.cs: using FSpot.Utils.


Added:
   trunk/src/Utils/GtkUtil.cs
Modified:
   trunk/ChangeLog
   trunk/src/Db.cs
   trunk/src/GroupSelector.cs
   trunk/src/ImportCommand.cs
   trunk/src/MainWindow.cs
   trunk/src/Makefile.am
   trunk/src/PhotoView.cs
   trunk/src/PixbufUtils.cs
   trunk/src/SingleView.cs
   trunk/src/Tag.cs
   trunk/src/TagCommands.cs
   trunk/src/TagMenu.cs
   trunk/src/TagPopup.cs
   trunk/src/TagQueryWidget.cs
   trunk/src/Util.cs
   trunk/src/Widgets/Rating.cs
   trunk/src/main.cs

Modified: trunk/src/Db.cs
==============================================================================
--- trunk/src/Db.cs	(original)
+++ trunk/src/Db.cs	Fri Jan 18 13:35:48 2008
@@ -5,20 +5,6 @@
 using Banshee.Database;
 
 
-// All kinds of database items subclass from this.
-public class DbItem {
-	uint id;
-	public uint Id {
-		get {
-			return id;
-		}
-	}
-
-	protected DbItem (uint id) {
-		this.id = id;
-	}
-}
-
 public class DbItemEventArgs {
 	private DbItem [] items;
 	

Modified: trunk/src/GroupSelector.cs
==============================================================================
--- trunk/src/GroupSelector.cs	(original)
+++ trunk/src/GroupSelector.cs	Fri Jan 18 13:35:48 2008
@@ -3,7 +3,7 @@
 using Gtk;
 using Gdk;
 using GLib;
-
+using FSpot.Utils;
 
 namespace FSpot {
 	public class GroupSelector : Fixed {

Modified: trunk/src/ImportCommand.cs
==============================================================================
--- trunk/src/ImportCommand.cs	(original)
+++ trunk/src/ImportCommand.cs	Fri Jan 18 13:35:48 2008
@@ -20,8 +20,10 @@
 using System.IO;
 using System;
 using Mono.Unix;
+
 using FSpot.Widgets;
 using FSpot;
+using FSpot.Utils;
 
 public class ImportCommand : FSpot.GladeDialog
 {

Modified: trunk/src/MainWindow.cs
==============================================================================
--- trunk/src/MainWindow.cs	(original)
+++ trunk/src/MainWindow.cs	Fri Jan 18 13:35:48 2008
@@ -2,7 +2,6 @@
 using Gtk;
 using GtkSharp;
 using Glade;
-using Gnome;
 using Mono.Unix;
 using System;
 using System.Text;
@@ -18,6 +17,7 @@
 using FSpot;
 using FSpot.Query;
 using FSpot.Widgets;
+using FSpot.Utils;
 using LibGPhoto2;
 
 public class MainWindow {
@@ -1611,10 +1611,6 @@
 	public static void HandleHelp (object sender, EventArgs args)
 	{
 		GnomeUtil.ShowHelp ("f-spot.xml", null, Toplevel.Window.Screen, null);
-//		Gnome.Vfs.Url.Show("ghelp:" + 
-//				FSpot.Global.HelpDirectory +
-//				System.IO.Path.DirectorySeparatorChar +
-//				"f-spot.xml");
 	}
 
 	public static void HandleAbout (object sender, EventArgs args)

Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am	(original)
+++ trunk/src/Makefile.am	Fri Jan 18 13:35:48 2008
@@ -62,6 +62,7 @@
 	$(srcdir)/Core.cs			\
 	$(srcdir)/DateCommands.cs		\
 	$(srcdir)/Db.cs				\
+	$(srcdir)/DbItem.cs			\
 	$(srcdir)/DBusProxy.cs			\
 	$(srcdir)/Delay.cs			\
 	$(srcdir)/DependentListStore.cs			\
@@ -213,6 +214,7 @@
 	$(srcdir)/Unix.cs			\
 	$(srcdir)/Updater.cs			\
 	$(srcdir)/UriCollection.cs		\
+	$(srcdir)/Utils/GtkUtil.cs		\
 	$(srcdir)/Utils/ScreenSaver.cs		\
 	$(srcdir)/Util.cs			\
 	$(srcdir)/Vector.cs			\

Modified: trunk/src/PhotoView.cs
==============================================================================
--- trunk/src/PhotoView.cs	(original)
+++ trunk/src/PhotoView.cs	Fri Jan 18 13:35:48 2008
@@ -4,7 +4,9 @@
 using GtkSharp;
 using System;
 using Mono.Unix;
+
 using FSpot.Xmp;
+using FSpot.Utils;
 
 namespace FSpot {
 public class PhotoView : EventBox {

Modified: trunk/src/PixbufUtils.cs
==============================================================================
--- trunk/src/PixbufUtils.cs	(original)
+++ trunk/src/PixbufUtils.cs	Fri Jan 18 13:35:48 2008
@@ -4,6 +4,7 @@
 using System;
 using System.IO;
 using FSpot;
+using FSpot.Utils;
 
 /**
   1        2       3      4         5            6           7          8

Modified: trunk/src/SingleView.cs
==============================================================================
--- trunk/src/SingleView.cs	(original)
+++ trunk/src/SingleView.cs	Fri Jan 18 13:35:48 2008
@@ -3,6 +3,8 @@
 using System;
 using Mono.Unix;
 
+using FSpot.Utils;
+
 namespace FSpot {
 	public class SingleView {
 		[Glade.Widget] Gtk.HBox toolbar_hbox;

Modified: trunk/src/Tag.cs
==============================================================================
--- trunk/src/Tag.cs	(original)
+++ trunk/src/Tag.cs	Fri Jan 18 13:35:48 2008
@@ -9,8 +9,8 @@
  */
 
 using System;
-
 using Gdk;
+using FSpot.Utils;
 
 namespace FSpot
 {

Modified: trunk/src/TagCommands.cs
==============================================================================
--- trunk/src/TagCommands.cs	(original)
+++ trunk/src/TagCommands.cs	Fri Jan 18 13:35:48 2008
@@ -16,6 +16,7 @@
 
 using Mono.Unix;
 using FSpot;
+using FSpot.Utils;
 
 public class TagCommands {
 

Modified: trunk/src/TagMenu.cs
==============================================================================
--- trunk/src/TagMenu.cs	(original)
+++ trunk/src/TagMenu.cs	Fri Jan 18 13:35:48 2008
@@ -1,6 +1,7 @@
 using Gtk;
 using System;
 using FSpot;
+using FSpot.Utils;
 
 public class TagMenu : Menu {
 	private TagStore tag_store;

Modified: trunk/src/TagPopup.cs
==============================================================================
--- trunk/src/TagPopup.cs	(original)
+++ trunk/src/TagPopup.cs	Fri Jan 18 13:35:48 2008
@@ -6,12 +6,13 @@
  *
  * Copyright (c) 2004 Novell, Inc.
  *
- *
+ * This is free software. See COPYING for details.
  */
 
 using System;
 using Mono.Unix;
 using FSpot;
+using FSpot.Utils;
 
 public class TagPopup {
 	public void Activate (Gdk.EventButton eb, Tag tag, Tag [] tags)

Modified: trunk/src/TagQueryWidget.cs
==============================================================================
--- trunk/src/TagQueryWidget.cs	(original)
+++ trunk/src/TagQueryWidget.cs	Fri Jan 18 13:35:48 2008
@@ -5,6 +5,7 @@
 using Gtk;
 using Gdk;
 
+using FSpot.Utils;
 namespace FSpot
 {
 	public class LiteralPopup

Modified: trunk/src/Util.cs
==============================================================================
--- trunk/src/Util.cs	(original)
+++ trunk/src/Util.cs	Fri Jan 18 13:35:48 2008
@@ -279,106 +279,6 @@
 	}
 }
 
-class GtkUtil {
-	public static Gtk.MenuItem MakeMenuItem (Gtk.Menu menu, string l, EventHandler e)
-	{
-		return MakeMenuItem (menu, l, e, true);
-	}
-	
-	public static Gtk.MenuItem MakeMenuItem (Gtk.Menu menu, string l, EventHandler e, bool enabled)
-	{
-		Gtk.MenuItem i;
-		Gtk.StockItem item = Gtk.StockItem.Zero;
-
-		if (Gtk.StockManager.Lookup (l, ref item)) {
-			i = new Gtk.ImageMenuItem (l, new Gtk.AccelGroup ());
-		} else {
-			i = new Gtk.MenuItem (l);
-		}
-
-		if (e != null)
-			i.Activated += e;
-
-                i.Sensitive = enabled;
-		
-		menu.Append (i);
-		i.Show ();
-
-        return i;
-	}
-	
-	public static Gtk.MenuItem MakeMenuItem (Gtk.Menu menu, string label, string image_name, EventHandler e, bool enabled)
-	{
-		Gtk.ImageMenuItem i = new Gtk.ImageMenuItem (label);
-		i.Activated += e;
-                i.Sensitive = enabled;
-		i.Image = Gtk.Image.NewFromIconName (image_name, Gtk.IconSize.Menu);
-		
-		menu.Append (i);
-		i.Show ();
-
-	        return i;
-	}
-
-	public static Gtk.MenuItem MakeCheckMenuItem (Gtk.Menu menu, string label, EventHandler e, bool enabled, bool active, bool as_radio)
-	{
-		Gtk.CheckMenuItem i = new Gtk.CheckMenuItem (label);
-		i.Activated += e;
-		i.Sensitive = enabled;
-		i.DrawAsRadio = as_radio;
-		i.Active = active;
-
-		menu.Append(i);
-		i.Show ();
-
-        return i;
-	}
-
-	public static void MakeMenuSeparator (Gtk.Menu menu)
-	{
-		Gtk.SeparatorMenuItem i = new Gtk.SeparatorMenuItem ();
-		menu.Append (i);
-		i.Show ();
-	}
-	
-	private class SignalFuncHelper {
-		public SignalFuncHelper (System.EventHandler e)
-		{
-			this.e = e;
-		}
-		
-		public void Func ()
-		{
-			this.e (Sender, System.EventArgs.Empty);
-		}
-
-		System.EventHandler e;
-		public object Sender;
-	}
-
-	public static Gtk.ToolButton ToolButtonFromTheme (string theme_id, string label, bool important)
-	{
-		Gtk.ToolButton button = new Gtk.ToolButton (null, null);
-		button.Label = label;
-		button.IconName = theme_id;
-		button.IsImportant = important;
-		button.UseUnderline = true;
-		return button;
-	}
-
-	public static Gdk.Pixbuf TryLoadIcon (Gtk.IconTheme theme, string icon_name, int size, Gtk.IconLookupFlags flags)
-	{
-		try {
-			return theme.LoadIcon (icon_name, size, flags);
-		} catch {
-			try {
-				return theme.LoadIcon ("gtk-missing-image", size, flags);
-			} catch {
-				return null;
-			}
-		}	
-	}
-}
 
 public class SizeUtil {
 	public static string ToHumanReadable (long size)

Added: trunk/src/Utils/GtkUtil.cs
==============================================================================
--- (empty file)
+++ trunk/src/Utils/GtkUtil.cs	Fri Jan 18 13:35:48 2008
@@ -0,0 +1,100 @@
+/*
+ * FSpot.Util.GtkUtil.cs
+ * 
+ * Author(s):
+ *	Miguel de Icaza  <miguel ximian com>
+ *	Stephane Delcroix  <stephane delcroix org>
+ *
+ * This is free software. See COPYING for details.
+ */
+
+using System;
+
+namespace FSpot.Utils
+{
+	class GtkUtil {
+		public static Gtk.MenuItem MakeMenuItem (Gtk.Menu menu, string l, EventHandler e)
+		{
+			return MakeMenuItem (menu, l, e, true);
+		}
+		
+		public static Gtk.MenuItem MakeMenuItem (Gtk.Menu menu, string l, EventHandler e, bool enabled)
+		{
+			Gtk.MenuItem i;
+			Gtk.StockItem item = Gtk.StockItem.Zero;
+	
+			if (Gtk.StockManager.Lookup (l, ref item)) {
+				i = new Gtk.ImageMenuItem (l, new Gtk.AccelGroup ());
+			} else {
+				i = new Gtk.MenuItem (l);
+			}
+	
+			if (e != null)
+				i.Activated += e;
+	
+	                i.Sensitive = enabled;
+			
+			menu.Append (i);
+			i.Show ();
+	
+	        return i;
+		}
+		
+		public static Gtk.MenuItem MakeMenuItem (Gtk.Menu menu, string label, string image_name, EventHandler e, bool enabled)
+		{
+			Gtk.ImageMenuItem i = new Gtk.ImageMenuItem (label);
+			i.Activated += e;
+	                i.Sensitive = enabled;
+			i.Image = Gtk.Image.NewFromIconName (image_name, Gtk.IconSize.Menu);
+			
+			menu.Append (i);
+			i.Show ();
+	
+		        return i;
+		}
+	
+		public static Gtk.MenuItem MakeCheckMenuItem (Gtk.Menu menu, string label, EventHandler e, bool enabled, bool active, bool as_radio)
+		{
+			Gtk.CheckMenuItem i = new Gtk.CheckMenuItem (label);
+			i.Activated += e;
+			i.Sensitive = enabled;
+			i.DrawAsRadio = as_radio;
+			i.Active = active;
+	
+			menu.Append(i);
+			i.Show ();
+	
+	        return i;
+		}
+	
+		public static void MakeMenuSeparator (Gtk.Menu menu)
+		{
+			Gtk.SeparatorMenuItem i = new Gtk.SeparatorMenuItem ();
+			menu.Append (i);
+			i.Show ();
+		}
+		
+		public static Gtk.ToolButton ToolButtonFromTheme (string theme_id, string label, bool important)
+		{
+			Gtk.ToolButton button = new Gtk.ToolButton (null, null);
+			button.Label = label;
+			button.IconName = theme_id;
+			button.IsImportant = important;
+			button.UseUnderline = true;
+			return button;
+		}
+	
+		public static Gdk.Pixbuf TryLoadIcon (Gtk.IconTheme theme, string icon_name, int size, Gtk.IconLookupFlags flags)
+		{
+			try {
+				return theme.LoadIcon (icon_name, size, flags);
+			} catch {
+				try {
+					return theme.LoadIcon ("gtk-missing-image", size, flags);
+				} catch {
+					return null;
+				}
+			}	
+		}
+	}
+}	

Modified: trunk/src/Widgets/Rating.cs
==============================================================================
--- trunk/src/Widgets/Rating.cs	(original)
+++ trunk/src/Widgets/Rating.cs	Fri Jan 18 13:35:48 2008
@@ -15,6 +15,7 @@
 using Gtk;
 using Gdk;
 using System;
+using FSpot.Utils;
 
 namespace FSpot.Widgets
 {

Modified: trunk/src/main.cs
==============================================================================
--- trunk/src/main.cs	(original)
+++ trunk/src/main.cs	Fri Jan 18 13:35:48 2008
@@ -9,6 +9,7 @@
 using Mono.Unix;
 using Mono.Addins;
 using Mono.Addins.Setup;
+using FSpot.Utils;
 
 namespace FSpot 
 {



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